* {
    box-sizing: border-box;
}

body {
    font-family: sans-serif;
    background: #f5f6fa;
    margin: 0;
    padding: 0;
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background: #273c75;
    color: #fff;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
}

.sidebar-header {
    padding: 20px;
    background: #1e2a4a;
    border-bottom: 1px solid #34495e;
}

.sidebar-header h1 {
    margin: 0;
    font-size: 18px;
    color: #ecf0f1;
}

.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav li {
    border-bottom: 1px solid #34495e;
}

.sidebar-nav a {
    display: block;
    padding: 15px 20px;
    color: #bdc3c7;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: #34495e;
    color: #ecf0f1;
    border-left: 4px solid #2c5aa0;
}

.sidebar-nav a i {
    margin-right: 10px;
    width: 20px;
    display: inline-block;
    text-align: center;
}

/* Main content */
.main-content {
    flex: 1;
    margin-left: 250px;
    padding: 20px;
    overflow-y: auto;
}

.header {
    background: #fff;
    padding: 20px;
    border-radius: 7px;
    box-shadow: 0 1px 4px #ccc;
    margin-bottom: 20px;
}

.status-header {
    text-align: center;
}

.status-header h2 {
    margin: 0;
}

.power-buttons {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    flex-wrap: nowrap;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    flex-shrink: 0;
}

.power-buttons button {
    margin-top: 0;
    width: 42px;
    height: 42px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    border-radius: 8px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.power-buttons button:hover {
    transform: scale(1.05);
}

/* Unified Control Container */
.control-container {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%);
    padding: 5px 12px;
    border-radius: 14px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.control-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.25);
    background: linear-gradient(135deg, #3a5065 0%, #34495e 100%);
}

/* Power Toggle Switch */
.power-toggle-container {
    background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%);
    padding: 5px 12px;
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.1);
    height: 44px;
    display: flex;
    align-items: center;
}

.power-toggle-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    background: linear-gradient(135deg, #3a5065 0%, #34495e 100%);
}

.power-toggle-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
    margin: 0;
}

.power-toggle-text {
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.power-toggle {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
    flex-shrink: 0;
}

.power-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.power-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #bdc3c7 0%, #95a5a6 100%);
    border-radius: 30px;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.power-toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background: linear-gradient(135deg, #fff 0%, #ecf0f1 100%);
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.power-toggle input:checked+.power-toggle-slider {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    box-shadow: 0 0 20px rgba(39, 174, 96, 0.4);
}

.power-toggle input:checked+.power-toggle-slider:before {
    transform: translateX(30px);
    background: linear-gradient(135deg, #fff 0%, #ecf0f1 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.power-toggle:hover .power-toggle-slider {
    transform: scale(1.05);
}

.power-toggle input:checked+.power-toggle-slider:hover {
    box-shadow: 0 0 25px rgba(39, 174, 96, 0.6);
}

/* Sound Toggle Switch */
.sound-toggle-container {
    background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%);
    padding: 5px 12px;
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.1);
    height: 44px;
    display: flex;
    align-items: center;
}

.sound-toggle-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    background: linear-gradient(135deg, #3a5065 0%, #34495e 100%);
}

.sound-toggle-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    margin: 0;
    padding: 0;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.sound-toggle {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 32px;
    flex-shrink: 0;
}

.sound-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.sound-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #bdc3c7 0%, #95a5a6 100%);
    border-radius: 32px;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.sound-toggle-slider::before {
    position: absolute;
    content: "\f026";
    /* fa-volume-off */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    height: 24px;
    width: 24px;
    left: 4px;
    bottom: 4px;
    background: linear-gradient(135deg, #fff 0%, #ecf0f1 100%);
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #666;
    line-height: 1;
}

.sound-toggle input:checked+.sound-toggle-slider {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    box-shadow: 0 0 20px rgba(39, 174, 96, 0.4);
}

.sound-toggle input:checked+.sound-toggle-slider::before {
    transform: translateX(28px);
    content: "\f028";
    /* fa-volume-up */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    color: #2c3e50;
}

.sound-toggle:hover .sound-toggle-slider {
    transform: scale(1.05);
}

.sound-toggle input:checked+.sound-toggle-slider:hover {
    box-shadow: 0 0 25px rgba(39, 174, 96, 0.6);
}

/* Reboot Button */
.reboot-button-container {
    background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%);
    padding: 5px 12px;
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    height: 44px;
    display: flex;
    align-items: center;
}

.reboot-button-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

.reboot-button-container button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    margin: 0;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.reboot-button-container button:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
}

.reboot-button-container button:active {
    transform: scale(0.95);
}

.reboot-button-container button i {
    transition: transform 0.3s ease;
}

.reboot-button-container button:hover i {
    transform: rotate(180deg);
}

.sleep-control {
    display: flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%);
    padding: 5px 12px;
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    height: 44px;
}

.sleep-control:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    background: linear-gradient(135deg, #3a5065 0%, #34495e 100%);
}

.sleep-control input {
    width: 50px;
    margin: 0;
    padding: 6px 8px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    font-size: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-weight: 600;
    transition: all 0.3s ease;
}

.sleep-control input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
}

.sleep-control input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.sleep-control button {
    margin: 0;
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    border-radius: 10px;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    transition: all 0.3s ease;
}

.sleep-control button:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
}

.header h2 {
    margin: 0 0 15px 0;
    color: #273c75;
}

.sidebar input#dev_ip {
    border: none;
    background: #34495e;
    color: #ecf0f1;
    font-size: 14px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    width: auto;
}

.sidebar input#dev_ip:focus {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), 0 0 0 2px #2c5aa0;
    outline: none;
}

.sidebar-canvas-container {
    padding: 10px 15px 15px;
    display: flex;
    justify-content: center;
}

.sidebar-canvas-container canvas {
    background: #181c21;
    border-radius: 5px;
    border: 8px solid #181c21;
    box-shadow:
        0 2px 16px rgba(0, 0, 0, 0.6),
        inset 0 0 0 1px #0a0c0e,
        inset 0 0 10px rgba(0, 0, 0, 0.4);
    image-rendering: pixelated;
    max-width: 100%;
    height: auto;
    display: block;
}

/* Sections */
.section {
    background: transparent;
    padding: 0;
    margin-bottom: 20px;
    display: none;
    width: 100%;
}

.section.active {
    display: block;
}

.section h3 {
    margin-top: 0;
    color: #273c75;
    border-bottom: 2px solid #2c5aa0;
    padding-bottom: 10px;
}

/* Form elements */
label {
    font-weight: bold;
    display: block;
    margin-top: 12px;
    color: #333;
}

input,
select,
textarea {
    margin-top: 4px;
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

button {
    margin-top: 12px;
    background: #2c5aa0;
    color: #fff;
    border: none;
    padding: 12px 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease;
}

button:hover {
    background: #1e4a8a;
}

.result {
    background: #dff9fb;
    margin-top: 15px;
    padding: 12px;
    border-radius: 4px;
    font-size: 12px;
    color: #333;
    border: 1px solid #b2ebf2;
    white-space: pre-wrap;
    overflow-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
    overflow-x: auto;
}

.colorbox {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.colpreview {
    width: 30px;
    height: 30px;
    border-radius: 5px;
    border: 2px solid #ccc;
}

/* Status Container - Centered and width-constrained */
.status-container {
    max-width: 750px;
    margin: 0 auto;
    background: #fff;
    padding: 20px;
    border-radius: 7px;
    box-shadow: 0 1px 4px #ccc;
}

/* Generic Section Container - Centered and width-constrained */
.section-container {
    max-width: 750px;
    margin: 0 auto;
    background: #fff;
    padding: 20px;
    border-radius: 7px;
    box-shadow: 0 1px 4px #ccc;
    width: 100%;
    box-sizing: border-box;
}

.section-container-drawing {
    max-width: 950px;
    padding: 30px;
}

.status-preview {
    background: #fff;
    border-radius: 7px;
    box-shadow: 0 1px 4px #ccc;
    margin-bottom: 10px;
    display: block;
    width: 100%;
    padding: 20px;
}

.status-preview.active {
    display: block;
}

.canvas-with-indicators {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin: 0 auto 24px;
    max-width: 800px;
    width: 100%;
}

.status-preview canvas {
    background: #181c21;
    box-shadow: 0 4px 32px rgba(0, 0, 0, 0.7);
    image-rendering: pixelated;
    border-radius: 7px;
    border: 12px solid #181c21;
    box-shadow:
        0 4px 32px rgba(0, 0, 0, 0.7),
        inset 0 0 0 2px #0a0c0e,
        inset 0 0 20px rgba(0, 0, 0, 0.5);
    max-width: 578px;
    width: 100%;
    height: auto;
}

.canvas-indicators {
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: center;
    height: 120px;
}

.canvas-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px;
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.canvas-indicator:hover {
    border-color: #2c5aa0;
    background: #e9ecef;
    transform: translateX(3px);
    box-shadow: 0 2px 8px rgba(44, 90, 160, 0.2);
}

.canvas-indicator.active {
    background: linear-gradient(135deg, #2c5aa0 0%, #273c75 100%);
    border-color: #1e3a6d;
    box-shadow: 0 4px 12px rgba(44, 90, 160, 0.4);
}

.canvas-indicator-led {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid #ced4da;
    box-shadow:
        0 2px 6px rgba(0, 0, 0, 0.2),
        inset 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    cursor: pointer;
    flex-shrink: 0;
}

.canvas-indicator-led:hover {
    transform: scale(1.1);
    border-color: #495057;
}

.canvas-indicator-led:active {
    transform: scale(0.95);
}

/* Canvas indicator LED colors */
.canvas-indicator-led-red {
    background: #ff4757;
}

.canvas-indicator-led-green {
    background: #2ed573;
}

.canvas-indicator-led-blue {
    background: #3742fa;
}

.canvas-indicator.active .canvas-indicator-led {
    border-color: white;
    box-shadow:
        0 0 16px currentColor,
        0 2px 8px rgba(0, 0, 0, 0.3),
        inset 0 0 10px rgba(255, 255, 255, 0.5);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        box-shadow:
            0 0 16px currentColor,
            0 2px 8px rgba(0, 0, 0, 0.3),
            inset 0 0 10px rgba(255, 255, 255, 0.5);
    }

    50% {
        box-shadow:
            0 0 24px currentColor,
            0 2px 8px rgba(0, 0, 0, 0.3),
            inset 0 0 14px rgba(255, 255, 255, 0.6);
    }
}

.canvas-indicator input[type="color"] {
    width: 28px;
    height: 28px;
    border: 2px solid #dee2e6;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    margin: 0;
    flex-shrink: 0;
}

.canvas-indicator input[type="color"]:hover {
    border-color: #2c5aa0;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(44, 90, 160, 0.3);
}

.canvas-indicator.active input[type="color"] {
    border-color: white;
}

/* Mood Lighting Controls */
.moodlight-controls {
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    margin-top: 20px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.moodlight-header {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    padding: 12px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.moodlight-header h4 {
    margin: 0;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
}

.moodlight-header i {
    margin-right: 8px;
}

.moodlight-toggle-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.4);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.moodlight-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.6);
    transform: scale(1.05);
}

.moodlight-toggle-btn.active {
    background: #27ae60;
    border-color: #229954;
    box-shadow: 0 0 20px rgba(39, 174, 96, 0.6);
}

.moodlight-toggle-btn.active:hover {
    background: #229954;
}

.moodlight-body {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.moodlight-color-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.moodlight-color-row label {
    font-weight: 600;
    color: #495057;
    margin: 0;
}

.moodlight-color-row input[type="color"] {
    width: 60px;
    height: 40px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 2px;
    margin: 0;
}

.moodlight-color-row input[type="color"]:hover {
    border-color: #f39c12;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(243, 156, 18, 0.3);
}

#moodlight_color {
    transition: all 0.3s ease;
}

#moodlight_kelvin {
    transition: all 0.3s ease;
}

.moodlight-slider-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.moodlight-slider-group label {
    font-weight: 600;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.moodlight-slider-group label span {
    color: #f39c12;
    font-weight: 700;
}

.kelvin-label {
    font-size: 12px;
    padding: 2px 8px;
    background: #e67e22;
    color: white;
    border-radius: 12px;
    font-weight: 600;
}

.moodlight-slider-group input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(to right, #ddd 0%, #ddd 100%);
    outline: none;
    -webkit-appearance: none;
    margin: 0;
    padding: 0;
}

.moodlight-slider-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #f39c12;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 3px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.moodlight-slider-group input[type="range"]::-webkit-slider-thumb:hover {
    background: #e67e22;
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.4);
}

.moodlight-slider-group input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #f39c12;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 3px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.moodlight-slider-group input[type="range"]::-moz-range-thumb:hover {
    background: #e67e22;
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.4);
}

#moodlight_brightness::-webkit-slider-runnable-track {
    background: linear-gradient(to right, #34495e 0%, #f39c12 100%);
    height: 8px;
    border-radius: 4px;
}

#moodlight_kelvin::-webkit-slider-runnable-track {
    background: linear-gradient(to right,
            #ff6b35 0%,
            /* 1500K - Cálida/Vela */
            #ffaa5a 20%,
            /* 2700K - Incandescente */
            #ffd89b 45%,
            /* 4000K - Neutra */
            #dfe6e9 70%,
            /* 5500K - Día */
            #a4b0bd 100%
            /* 6500K - Fría */
        );
    height: 8px;
    border-radius: 4px;
}

.kelvin-markers {
    margin-top: 8px;
    padding: 0;
    position: relative;
    width: 100%;
    height: 40px;
}

.kelvin-markers span {
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 6px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    position: absolute;
    transform: translateX(-50%);
}

/* Posicionamiento proporcional basado en el rango 1500-6500K */
.kelvin-markers span[data-kelvin="1500"] {
    left: 0%;
}

.kelvin-markers span[data-kelvin="2700"] {
    left: 24%;
    /* (2700-1500)/(6500-1500) = 0.24 */
}

.kelvin-markers span[data-kelvin="4000"] {
    left: 50%;
    /* (4000-1500)/(6500-1500) = 0.50 */
}

.kelvin-markers span[data-kelvin="5500"] {
    left: 80%;
    /* (5500-1500)/(6500-1500) = 0.80 */
}

.kelvin-markers span[data-kelvin="6500"] {
    left: 100%;
}

.kelvin-markers span:hover {
    transform: translateX(-50%) scale(1.2);
    background: rgba(243, 156, 18, 0.2);
    box-shadow: 0 2px 8px rgba(243, 156, 18, 0.3);
}

.kelvin-markers span:active {
    transform: translateX(-50%) scale(1.1);
    background: rgba(243, 156, 18, 0.4);
}

.kelvin-markers span.active-kelvin {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.5);
    transform: translateX(-50%) scale(1.15);
    animation: kelvinPulse 2s ease-in-out infinite;
}

@keyframes kelvinPulse {

    0%,
    100% {
        box-shadow: 0 4px 12px rgba(243, 156, 18, 0.5);
    }

    50% {
        box-shadow: 0 6px 20px rgba(243, 156, 18, 0.8);
    }
}

/* Loop Apps Controls */
.loop-controls {
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    margin-top: 20px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.loop-header {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    padding: 12px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.loop-header h4 {
    margin: 0;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
}

.loop-header i {
    margin-right: 8px;
}

.loop-body {
    padding: 18px;
}

.loop-header .status-navigation {
    gap: 6px;
}

.loop-header .status-navigation button {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.4);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0;
    box-sizing: border-box;
}

.loop-header .status-navigation button i {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
}

.loop-header .status-navigation button:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.6);
    transform: scale(1.05);
}

.loop-buttons {
    display: grid;
    gap: 12px;
    justify-content: center;
    margin: 0;
}

.loop-buttons__row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.loop-buttons__row--native {
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    padding-bottom: 8px;
}

.loop-buttons__row--custom {
    padding-top: 6px;
}

.loop-buttons__empty {
    font-style: italic;
    color: #666;
    margin: 0;
}

.app-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: #f5f6fa;
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
    min-width: auto;
    justify-content: space-between;
    min-height: 64px;
}

.app-card--native {
    min-width: auto;
}

.app-card--inactive {
    background: #f0f0f0;
    opacity: 0.85;
}

.app-card--custom {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: 2px solid #5a67d8;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.app-button {
    flex: 1;
    min-width: 90px;
    margin-top: 0;
    padding: 8px 12px;
    font-size: 13px;
}

.app-button--icon-native {
    flex: 0 0 auto;
    min-width: 0;
    width: 48px;
    height: 48px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.app-button--icon-native:hover {
    transform: scale(1.08);
}

.app-button--icon-native i {
    pointer-events: none;
}

.app-button--icon-custom {
    flex: 0 0 auto;
    min-width: 0;
    width: 48px;
    height: 48px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.4);
    color: #fff;
    margin: 0;
}

.app-button--icon-custom:hover {
    transform: scale(1.08);
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.6);
}

.app-button--icon-custom i {
    pointer-events: none;
}

.app-card__label {
    flex: 1;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 8px;
}

.app-button--inactive {
    background: #dcdde1;
    color: #555;
}

.app-button--icon {
    flex: 0 0 auto;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    font-size: 12px;
    background: #d64541;
    border-radius: 5px;
}

.app-button--icon i {
    pointer-events: none;
    font-size: 14px;
}

.app-button--icon:hover {
    background: #c23616;
}

.app-button--delete {
    flex: 0 0 auto;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    font-size: 13px;
    background: rgba(214, 69, 65, 0.9);
    border-radius: 6px;
    border: none;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 0;
}

.app-button--delete i {
    pointer-events: none;
    font-size: 14px;
}

.app-button--delete:hover {
    background: #c23616;
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(214, 69, 65, 0.4);
}

.status-top-controls {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 5px;
    width: 100%;
    flex-wrap: nowrap;
}

.status-navigation {
    display: flex;
    justify-content: flex-start;
    gap: 10px;
    margin: 0;
    padding: 0;
    align-items: center;
    flex-shrink: 0;
    flex-wrap: nowrap;
}

.status-navigation button {
    width: 44px;
    height: 44px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.heading-icon {
    margin-right: 8px;
    color: #273c75;
}

.native-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    user-select: none;
}

.native-toggle input {
    display: none;
}

.native-toggle__indicator {
    width: 36px;
    height: 18px;
    border-radius: 999px;
    background: #dcdde1;
    position: relative;
    transition: background 0.2s ease;
}

.native-toggle__indicator::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.native-toggle input:checked+.native-toggle__indicator {
    background: #2c5aa0;
}

.native-toggle input:checked+.native-toggle__indicator::after {
    transform: translateX(18px);
}

/* Custom Tabs System - Diseño con solape */
.custom-tabs-container {
    margin: 20px 0 0 0;
    position: relative;
}

.custom-tabs-row {
    display: flex;
    gap: 0;
    margin-bottom: -2px;
    flex-wrap: nowrap;
    background: transparent;
    position: relative;
    z-index: 1;
    overflow-x: auto;
    overflow-y: visible;
}

.custom-tabs-row::-webkit-scrollbar {
    height: 6px;
}

.custom-tabs-row::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.custom-tabs-row::-webkit-scrollbar-thumb {
    background: #9b59b6;
    border-radius: 3px;
}

.custom-tabs-row::-webkit-scrollbar-thumb:hover {
    background: #8e44ad;
}

.custom-tabs-row+.custom-tabs-row {
    margin-top: -8px;
    padding-left: 10px;
}

.custom-tab-button {
    flex: 0 1 auto;
    min-width: 100px;
    padding: 12px 18px;
    background: linear-gradient(135deg, #e8f4f8 0%, #dfe9f3 100%);
    border: 2px solid #c5d9e8;
    border-bottom: 2px solid #c5d9e8;
    border-radius: 12px 12px 0 0;
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 0;
    margin-left: -10px;
    margin-right: 0;
    position: relative;
    z-index: 1;
    box-shadow:
        0 2px 6px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    clip-path: polygon(10px 0%,
            calc(100% - 10px) 0%,
            100% 100%,
            0% 100%);
}

.custom-tab-button:first-child {
    margin-left: 0;
    clip-path: polygon(0% 0%,
            calc(100% - 10px) 0%,
            100% 100%,
            0% 100%);
}

.custom-tab-button:hover {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-color: #a78bfa;
    color: #6366f1;
    z-index: 10;
    transform: translateY(-3px) scale(1.03);
    box-shadow:
        0 6px 16px rgba(139, 92, 246, 0.15),
        0 2px 8px rgba(139, 92, 246, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.custom-tab-button.active {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    border-color: #7c3aed;
    border-bottom: 2px solid #fff;
    color: #fff;
    z-index: 20;
    transform: translateY(-2px) scale(1.05);
    box-shadow:
        0 8px 24px rgba(139, 92, 246, 0.35),
        0 4px 12px rgba(124, 58, 237, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.25),
        inset 0 -1px 0 rgba(0, 0, 0, 0.15);
}

.custom-tab-button.active:hover {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    transform: translateY(-2px) scale(1.05);
    box-shadow:
        0 10px 28px rgba(139, 92, 246, 0.4),
        0 6px 16px rgba(124, 58, 237, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}

.custom-tab-button i {
    font-size: 14px;
}

.custom-tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
    background: #fff;
    border: 2px solid #adb5bd;
    border-radius: 8px;
    padding: 20px;
    margin-top: -2px;
    position: relative;
    z-index: 5;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.custom-tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Custom styles */
.custom-text-json-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.custom-text-column {
    display: flex;
    flex-direction: column;
}

.custom-text-column label {
    margin-bottom: 8px;
}

.custom-text-column input {
    margin-top: 0;
}

.custom-json-column {
    display: flex;
    flex-direction: column;
}

.custom-json-column label {
    margin-bottom: 8px;
}

#custom_json_preview {
    background: #f8f9fa;
    border: 1px solid #ccc;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #333;
    margin-top: 0;
    resize: vertical;
    min-height: 100px;
}

/* Appearance Card - Card Style like Status */
.appearance-card {
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    margin-top: 20px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.appearance-card-header {
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
    padding: 12px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.appearance-card-header h4 {
    margin: 0;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
}

.appearance-card-header i {
    margin-right: 8px;
}

.appearance-card-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Appearance Mode Section */
.appearance-mode-section {
    margin-bottom: 0;
}

.appearance-mode-section h5 {
    margin: 0 0 15px 0;
    color: #495057;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.appearance-mode-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
}

.appearance-mode-option {
    position: relative;
    cursor: pointer;
    margin: 0;
}

.appearance-mode-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.appearance-mode-card {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 12px 10px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.appearance-mode-card:hover {
    border-color: #9b59b6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(155, 89, 182, 0.15);
}

.appearance-mode-card.active {
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
    border-color: #8e44ad;
    color: white;
    box-shadow: 0 4px 16px rgba(155, 89, 182, 0.3);
    transform: translateY(-2px);
}

.appearance-mode-icon {
    font-size: 22px;
    margin-bottom: 6px;
    transition: all 0.3s ease;
}

.appearance-mode-card.active .appearance-mode-icon {
    transform: scale(1.1);
}

.appearance-mode-title {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 2px;
    transition: all 0.3s ease;
}

.appearance-mode-desc {
    font-size: 10px;
    color: #6c757d;
    line-height: 1.2;
    transition: all 0.3s ease;
}

.appearance-mode-card.active .appearance-mode-desc {
    color: rgba(255, 255, 255, 0.9);
}

/* Color Controls Section */
.color-controls-section,
.gradient-controls-section {
    margin-bottom: 0;
    padding: 12px;
    background: rgba(155, 89, 182, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(155, 89, 182, 0.1);
}

/* Background Color Section (always visible) */
.background-color-section {
    margin-bottom: 0;
    padding: 12px;
    background: rgba(52, 152, 219, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(52, 152, 219, 0.1);
}

/* Gradient Color Items */
.gradient-color-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.gradient-color-label {
    font-size: 11px;
    font-weight: 600;
    color: #495057;
    text-align: center;
    margin-bottom: 0;
}

/* Color Section */
.color-section-margin-top {
    margin-top: 10px;
}

/* Color Label with Margin */
.color-label-margin-top {
    margin-top: 10px;
}

.color-label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-weight: 600;
    color: #495057;
    margin: 0;
}

.color-label span {
    font-size: 14px;
}

.color-picker-compact {
    width: 100%;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    padding: 0;
    margin: 0;
    position: relative;
}

.color-picker-compact input[type="color"] {
    width: 100%;
    height: 100%;
    border: none;
    cursor: pointer;
    padding: 0;
    margin: 0;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.color-picker-compact input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-picker-compact input[type="color"]::-webkit-color-swatch {
    border: none;
}

.color-picker-compact input[type="color"]::-moz-color-swatch {
    border: none;
}

/* Large Color Picker for Gradients */
.color-picker-large {
    width: 100%;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    padding: 0;
    margin: 0;
    position: relative;
}

.color-picker-large input[type="color"] {
    width: 100%;
    height: 100%;
    border: none;
    cursor: pointer;
    padding: 0;
    margin: 0;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.color-picker-large input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-picker-large input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 6px;
}

.color-picker-large input[type="color"]::-moz-color-swatch {
    border: none;
    border-radius: 6px;
}

.color-picker-large:hover {
    border-color: #f39c12;
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(243, 156, 18, 0.3);
}

.color-picker-compact:hover {
    border-color: #9b59b6;
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(155, 89, 182, 0.3);
}

/* Gradient Section */
.gradient-section {
    background: rgba(155, 89, 182, 0.05);
    padding: 10px;
    border-radius: 8px;
    border: 1px solid rgba(155, 89, 182, 0.2);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gradient-colors {
    display: flex;
    gap: 8px;
}

.gradient-colors .color-picker-compact {
    flex: 1;
    height: 42px;
}

.section-custom .sub-section {
    margin-top: 20px;
    border-top: 1px solid #eee;
    padding-top: 15px;
}

.section-custom .sub-section h4 {
    margin: 0 0 15px 0;
    color: #666;
    font-size: 16px;
}

.section-custom .control-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 10px;
}

.section-custom .checkbox-group {
    display: flex;
    gap: 20px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.section-custom .checkbox-group label {
    margin-top: 0;
    font-weight: normal;
    display: flex;
    align-items: center;
    gap: 5px;
}

.progress-display {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 5px;
}

.progress-display span {
    font-weight: normal;
    min-width: 35px;
}

.action-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

/* Custom Modal Dialog */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.modal-overlay.active {
    display: flex;
}

.modal-dialog {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 480px;
    width: 90%;
    overflow: hidden;
    animation: slideIn 0.3s ease;
}

.modal-header {
    background: linear-gradient(135deg, #2c5aa0 0%, #273c75 100%);
    color: #fff;
    padding: 20px 24px;
}

.modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.modal-body {
    padding: 24px;
    color: #333;
    font-size: 15px;
    line-height: 1.6;
}

.modal-body p {
    margin: 0;
}

.modal-footer {
    padding: 16px 24px;
    background: #f8f9fa;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    border-top: 1px solid #e9ecef;
}

.modal-button {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 0;
}

.modal-button--primary {
    background: #2c5aa0;
    color: #fff;
}

.modal-button--primary:hover {
    background: #1e4a8a;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(44, 90, 160, 0.3);
}

.modal-button--secondary {
    background: #e9ecef;
    color: #495057;
}

.modal-button--secondary:hover {
    background: #dee2e6;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Text Fragments */
.text-fragment-item {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 6px;
}

.text-fragment-item .fragment-text {
    flex: 1;
    margin-top: 0;
}

.text-fragment-item .fragment-color {
    width: 50px;
    height: 35px;
    border: 2px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 0;
}

.btn-small {
    width: 32px;
    height: 32px;
    padding: 0;
    font-size: 16px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 0;
}

.btn-small:hover {
    background: #c0392b;
}

/* Drawing Tools */
.tool-button {
    padding: 8px 6px;
    font-size: 11px;
    text-align: center;
    background: #ecf0f1;
    color: #2c3e50;
    border: 2px solid #bdc3c7;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 0;
    font-weight: 600;
}

.tool-button:hover {
    background: #d5dbdb;
    color: #1a252f;
    transform: translateY(-2px);
}

.tool-button.active {
    background: #3498db;
    color: white;
    border-color: #2980b9;
}

.tool-button i {
    font-size: 16px;
    display: block;
    margin-bottom: 3px;
}

.tool-button-icon {
    width: 60px;
    height: 60px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    color: #2c3e50;
    border: 3px solid #dee2e6;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.tool-button-icon:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    color: #1a252f;
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: #3498db;
}

.tool-button-icon.active {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border-color: #2980b9;
    box-shadow: 0 4px 16px rgba(52, 152, 219, 0.4), 0 0 0 3px rgba(52, 152, 219, 0.15);
    transform: translateY(-2px);
}

.tool-button-icon.active:hover {
    background: linear-gradient(135deg, #2980b9 0%, #21618c 100%);
}

.color-picker-button {
    width: 100%;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ecf0f1;
    border: 2px solid #bdc3c7;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    overflow: hidden;
    padding: 4px;
    box-sizing: border-box;
}

.color-picker-button:hover {
    border-color: #3498db;
    transform: scale(1.02);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.color-picker-button-prominent {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 4px solid #2c5aa0;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    padding: 10px;
    box-sizing: border-box;
    box-shadow: 0 4px 16px rgba(44, 90, 160, 0.3);
    position: relative;
}

.color-picker-button-prominent::before {
    content: '🎨';
    position: absolute;
    bottom: 2px;
    right: 2px;
    font-size: 14px;
    opacity: 0.6;
}

.color-picker-button-prominent:hover {
    border-color: #3498db;
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(52, 152, 219, 0.5);
}

.color-picker-button-prominent:active {
    transform: scale(1.05);
}

#draw_canvas {
    display: block;
}

.undo-button {
    width: 60px;
    height: 60px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
    border: 3px solid #d68910;
    border-radius: 12px;
    cursor: pointer;
    font-size: 24px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.clear-button {
    width: 60px;
    height: 60px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    border: 3px solid #a93226;
    border-radius: 12px;
    cursor: pointer;
    font-size: 24px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.clear-button:hover {
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
    transform: translateY(-3px);
    box-shadow: 0 4px 16px rgba(231, 76, 60, 0.5);
}

.pin-button {
    width: 38px;
    min-width: 38px;
    height: auto;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ecf0f1;
    color: #7f8c8d;
    border: 2px solid #bdc3c7;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
}

.pin-button:hover {
    background: #d5dbdb;
    color: #34495e;
}

.pin-button.pinned {
    background: #3498db;
    color: white;
    border-color: #2980b9;
    transform: rotate(45deg);
}

.pin-button.pinned:hover {
    background: #2980b9;
}

.connect-button {
    width: 44px;
    min-width: 44px;
    height: 44px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(39, 174, 96, 0.3);
    flex-shrink: 0;
}

.connect-button:hover {
    background: linear-gradient(135deg, #229954 0%, #1e8449 100%);
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.5);
}

.connect-button:active {
    transform: scale(1.02);
}

.undo-button:hover {
    background: linear-gradient(135deg, #e67e22 0%, #d68910 100%);
    transform: translateY(-3px);
    box-shadow: 0 4px 16px rgba(243, 156, 18, 0.5);
}

.undo-button:active {
    transform: translateY(0);
}

.clear-button:active {
    transform: translateY(0);
}

#draw_commands_list {
    line-height: 1.6;
}

#draw_commands_list div {
    padding: 4px 0;
    border-bottom: 1px solid #e9ecef;
}

#draw_commands_list div:last-child {
    border-bottom: none;
}

/* Control groups improvements */
.control-group>* {
    margin-top: 0;
}

.control-group label {
    margin-top: 0;
}

/* Sound Section */
.preset-sound-btn {
    background: #ecf0f1;
    border: 2px solid #bdc3c7;
    padding: 10px 8px;
    font-size: 13px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 0;
    text-align: center;
}

.preset-sound-btn:hover {
    background: #3498db;
    color: white;
    border-color: #2980b9;
    transform: translateY(-2px);
}

.preset-sound-btn:active {
    transform: translateY(0);
}

/* Global Brightness Controls */
.brightness-controls {
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    margin-top: 20px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.brightness-header {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    padding: 12px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brightness-header h4 {
    margin: 0;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
}

.brightness-header i {
    margin-right: 8px;
}

.auto-brightness-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.4);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.auto-brightness-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.6);
    transform: scale(1.05);
}

.auto-brightness-btn.active {
    background: #f39c12;
    border-color: #e67e22;
    box-shadow: 0 0 20px rgba(243, 156, 18, 0.6);
}

.auto-brightness-btn.active:hover {
    background: #e67e22;
}

.brightness-body {
    padding: 18px;
}

.brightness-slider-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.brightness-slider-group label {
    font-weight: 600;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.brightness-slider-group label span {
    color: #3498db;
    font-weight: 700;
}

.brightness-slider-group input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(to right, #34495e 0%, #3498db 100%);
    outline: none;
    -webkit-appearance: none;
    margin: 0;
    padding: 0;
}

.brightness-slider-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #3498db;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 3px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.brightness-slider-group input[type="range"]::-webkit-slider-thumb:hover {
    background: #2980b9;
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
}

.brightness-slider-group input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #3498db;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 3px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.brightness-slider-group input[type="range"]::-moz-range-thumb:hover {
    background: #2980b9;
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
}

.brightness-presets {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-top: 8px;
}

.brightness-preset-btn {
    flex: 1;
    padding: 10px;
    background: rgba(52, 152, 219, 0.1);
    border: 2px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 18px;
    color: #3498db;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.brightness-preset-btn:hover {
    background: #3498db;
    color: white;
    border-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.brightness-preset-btn:active {
    transform: translateY(0);
}

.brightness-preset-btn.active {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border-color: #2980b9;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.4);
}

.brightness-preset-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    filter: grayscale(50%);
    pointer-events: none;
}

/* Drawing Options Card */
.drawing-options-card {
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    margin-top: 20px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.drawing-options-header {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    padding: 12px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.drawing-options-header h4 {
    margin: 0;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
}

.drawing-options-header i {
    margin-right: 8px;
}

.drawing-options-body {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* Mobile responsive */
@media (max-width: 768px) {

    .status-container,
    .section-container {
        max-width: 100%;
        padding: 15px;
        margin: 0 auto;
    }

    /* Ensure sections are centered on mobile */
    .section {
        display: flex;
        justify-content: center;
    }

    .section .section-container {
        max-width: calc(100vw - 20px);
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }

    .sidebar-canvas-container {
        display: none;
    }

    .main-content {
        margin-left: 0;
    }

    .status-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .power-buttons {
        justify-content: flex-start;
        gap: 10px;
    }

    .control-container,
    .power-toggle-container,
    .sound-toggle-container,
    .sleep-control,
    .reboot-button-container {
        padding: 4px 10px;
    }

    .power-toggle-container {
        padding: 4px 10px;
    }

    .power-toggle-text {
        font-size: 13px;
    }

    .power-toggle {
        width: 55px;
        height: 28px;
    }

    .power-toggle-slider::before {
        height: 20px;
        width: 20px;
        left: 4px;
        bottom: 4px;
    }

    .power-toggle input:checked+.power-toggle-slider::before {
        transform: translateX(27px);
    }

    .sound-toggle-container {
        padding: 4px 10px;
    }

    .sound-toggle {
        width: 55px;
        height: 30px;
    }

    .sound-toggle-slider::before {
        height: 22px;
        width: 22px;
        left: 4px;
        bottom: 4px;
        font-size: 11px;
    }

    .sound-toggle input:checked+.sound-toggle-slider::before {
        transform: translateX(25px);
    }

    .sleep-control {
        padding: 4px 10px;
    }

    .sleep-control input {
        width: 45px;
        padding: 5px 6px;
        font-size: 11px;
    }

    .sleep-control button {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }

    .reboot-button-container {
        padding: 4px 10px;
    }

    .reboot-button-container button {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }

    /* Refactored Inline Styles */

    /* Device IP Input Container - MOVIDO AL FINAL DEL ARCHIVO */

    /* Status Header */
    .status-header-hidden {
        display: none;
    }

    /* Canvas Indicator LEDs */
    .canvas-indicator-led-red {
        background: #FF0000;
    }

    .canvas-indicator-led-green {
        background: #00FF00;
    }

    .canvas-indicator-led-blue {
        background: #0000FF;
    }

    /* Loop Controls */
    .loop-controls-hidden {
        display: none;
    }

    /* Custom JSON Preview */
    .custom-json-preview {
        font-family: monospace;
        font-size: 12px;
    }

    /* Gradient Controls */
    .gradient-controls-hidden {
        display: none;
    }

    .custom-gradient-enable-hidden {
        display: none;
    }

    /* Custom Rainbow */
    .custom-rainbow-hidden {
        display: none;
    }

    /* Control Groups */
    .control-group-margin-top {
        margin-top: 10px;
    }

    /* Section Headers */
    .section-header-small {
        font-size: 14px;
        margin-top: 15px;
        color: #888;
    }

    /* Checkbox Groups */
    .checkbox-group-margin-top {
        margin-top: 10px;
    }

    /* Labels */
    .label-margin-top {
        margin-top: 10px;
    }

    /* Color Sections */
    .color-section-margin-top {
        margin-top: 10px;
    }

    /* Text Fragments */
    .text-fragment-description {
        font-size: 12px;
        color: #666;
        margin: 0 0 10px 0;
    }

    .add-fragment-button {
        margin-top: 10px;
        font-size: 13px;
        padding: 8px 16px;
    }

    .use-fragments-label {
        margin-top: 10px;
    }

    /* Batch Apps */
    .batch-apps-description {
        font-size: 12px;
        color: #666;
        margin: 0 0 10px 0;
    }

    .batch-name-label {
        margin-top: 10px;
    }

    .send-batch-button {
        margin-top: 10px;
    }

    /* Sound Section */
    .sound-description {
        font-size: 12px;
        color: #666;
        margin: 0 0 10px 0;
    }

    .sound-examples-container {
        margin-top: 15px;
    }

    .sound-examples-label {
        font-weight: bold;
        display: block;
        margin-bottom: 8px;
    }

    .sound-examples-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 8px;
    }

    /* Melody Section */
    .melody-description {
        font-size: 12px;
        color: #666;
        margin: 0 0 10px 0;
    }

    .melody-select-margin {
        margin-bottom: 10px;
    }

    /* Drawing Section */
    .draw-result-hidden {
        display: none;
    }

    /* .canvas-with-tools - ESTILOS MOVIDOS AL FINAL DEL ARCHIVO */

    /* .draw-main-area - ESTILOS MOVIDOS AL FINAL DEL ARCHIVO */

    /* Canvas de Drawing - DEBE verse idéntico al de Status */
    .draw-canvas,
    canvas#draw_canvas {
        background: #181c21 !important;
        image-rendering: pixelated !important;
        cursor: crosshair;
        border-radius: 7px !important;
        border: 12px solid #181c21 !important;
        box-shadow:
            0 4px 32px rgba(0, 0, 0, 0.7),
            inset 0 0 0 2px #0a0c0e,
            inset 0 0 20px rgba(0, 0, 0, 0.5) !important;
        max-width: 578px !important;
        width: 100% !important;
        height: auto !important;
        display: block !important;
        flex-shrink: 0;
    }

    .draw-tools-container {
        display: none;
    }

    /* .draw-color-controls - YA NO SE USA, reemplazado por .draw-tools-panel */

    .draw-color-input-hidden {
        display: none;
    }

    .draw-color-preview {
        width: 100%;
        height: 100%;
        border-radius: 10px;
        background: #FFFFFF;
        cursor: pointer;
        box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
    }

    .draw-separator {
        width: 2px;
        height: 60px;
        background: linear-gradient(to bottom, transparent 0%, #bdc3c7 20%, #bdc3c7 80%, transparent 100%);
        margin: 0 8px;
        border-radius: 2px;
    }

    .draw-size-indicator {
        font-size: 10px;
    }

    .draw-text-controls {
        display: flex;
        align-items: center;
        gap: 15px;
        margin-bottom: 15px;
        max-width: 600px;
    }

    .draw-text-label {
        margin: 0;
        font-weight: bold;
        min-width: 120px;
    }

    .draw-text-input {
        flex: 1;
        margin: 0;
    }

    .draw-app-controls {
        display: grid;
        grid-template-columns: 1fr 1fr 1.5fr;
        gap: 15px;
        align-items: start;
        max-width: 800px;
    }

    .draw-app-panel {
        background: #e8ecef;
        padding: 15px;
        border-radius: 8px;
        border: 1px solid #d0d7de;
        display: flex;
        flex-direction: column;
        gap: 10px;
        height: 100%;
    }

    .draw-app-name-label {
        margin: 0;
        font-weight: bold;
    }

    .draw-app-name-input {
        margin: 0;
        height: 38px;
    }

    .draw-send-app-button {
        margin-top: auto;
    }

    .draw-duration-panel {
        background: #e8ecef;
        padding: 15px;
        border-radius: 8px;
        border: 1px solid #d0d7de;
        display: flex;
        flex-direction: column;
        gap: 10px;
        height: 100%;
    }

    .draw-duration-label {
        margin: 0;
        font-weight: bold;
    }

    .draw-duration-controls {
        display: flex;
        gap: 8px;
        align-items: flex-start;
    }

    .draw-duration-input {
        flex: 1;
        margin: 0;
    }

    .draw-pin-duration {
        height: 38px;
        margin: 0;
    }

    .draw-send-notification-button {
        margin-top: auto;
    }

    .draw-commands-panel {
        background: #e8ecef;
        padding: 15px;
        border-radius: 8px;
        border: 1px solid #d0d7de;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .draw-commands-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .draw-commands-title {
        margin: 0;
        font-weight: bold;
    }

    .draw-commands-counter {
        font-weight: bold;
        font-size: 14px;
        color: #666;
    }

    .draw-commands-max-note {
        margin: 0;
        font-size: 10px;
        color: #888;
        margin-top: -5px;
    }

    .draw-commands-list {
        height: 66px;
        overflow-y: auto;
        background: #fff;
        padding: 10px;
        border-radius: 6px;
        font-family: monospace;
        font-size: 11px;
        border: 1px solid #d0d7de;
    }

    .draw-commands-placeholder {
        color: #888;
        margin: 0;
    }

    .draw-json-textarea {
        font-family: monospace;
        font-size: 12px;
    }

    /* Settings Preview */
    .settings-preview-color {
        background: #FF00FF;
    }

    /* Draw Commands Placeholder */
    .draw-commands-placeholder-text {
        color: #888;
        margin: 0;
    }

    .power-toggle-container {
        padding: 6px;
    }

    .power-toggle-text {
        font-size: 13px;
    }

    .power-toggle {
        width: 55px;
        height: 28px;
    }

    .power-toggle-slider:before {
        height: 20px;
        width: 20px;
        left: 4px;
        bottom: 4px;
    }

    .power-toggle input:checked+.power-toggle-slider:before {
        transform: translateX(27px);
    }

    .sound-toggle-container {
        gap: 6px;
    }

    .sound-toggle-label {
        padding: 6px;
    }

    .sound-toggle {
        width: 55px;
        height: 30px;
    }

    .sound-toggle-slider::before {
        height: 22px;
        width: 22px;
        left: 4px;
        bottom: 4px;
        font-size: 13px;
    }

    .sound-toggle input:checked+.sound-toggle-slider::before {
        transform: translateX(25px);
    }

    .reboot-button {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .sidebar-nav {
        display: flex;
        overflow-x: auto;
        padding: 0 10px;
    }


    .sidebar-nav li {
        border-bottom: none;
        border-right: 1px solid #34495e;
        flex-shrink: 0;
    }

    .sidebar-nav a {
        white-space: nowrap;
        padding: 12px 15px;
    }

    /* Drawing canvas responsive */
    #draw_canvas {
        width: 100%;
        height: auto;
    }

    .undo-button {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }

    /* Canvas indicators responsive */
    .canvas-with-indicators {
        flex-direction: column;
        gap: 15px;
    }

    .canvas-indicators {
        flex-direction: row;
        justify-content: center;
        gap: 8px;
        height: auto;
    }

    .canvas-indicator {
        flex-direction: column;
        gap: 6px;
        padding: 6px;
        align-items: center;
    }

    .canvas-indicator:hover {
        transform: translateY(-3px);
    }

    .canvas-indicator input[type="color"] {
        width: 24px;
        height: 24px;
    }

    /* Mood Lighting responsive */
    .moodlight-header {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }

    .moodlight-header h4 {
        text-align: center;
    }

    .moodlight-toggle-btn {
        width: 100%;
        justify-content: center;
    }

    .moodlight-color-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .kelvin-markers {
        gap: 2px;
    }

    .kelvin-markers span {
        font-size: 16px;
        min-width: 32px;
        height: 32px;
        padding: 4px;
    }

    /* Appearance mode responsive */
    .appearance-mode-options {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .appearance-mode-card {
        padding: 14px 10px;
    }

    .appearance-mode-icon {
        font-size: 22px;
    }

    .appearance-mode-title {
        font-size: 12px;
    }

    .appearance-mode-desc {
        font-size: 10px;
    }

    .background-color-section {
        padding: 10px;
    }

    .gradient-color-item {
        gap: 8px;
    }

    .gradient-color-label {
        font-size: 10px;
    }

    .color-picker-large {
        height: 50px;
    }

    /* Brightness controls responsive */
    .brightness-header {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }

    .brightness-header h4 {
        text-align: center;
    }

    .auto-brightness-btn {
        width: 100%;
        justify-content: center;
    }

    .brightness-presets {
        gap: 4px;
    }

    .brightness-preset-btn {
        font-size: 16px;
        padding: 8px;
    }
}

/* ============================================
   FIX: Device IP Input Container
   Estos estilos DEBEN estar al final para
   sobrescribir los selectores generales
   ============================================ */

.device-ip-input-container {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
    align-items: center !important;
    padding: 0 15px !important;
    margin: 15px 0 10px 0 !important;
}

.device-ip-input-container input#dev_ip {
    flex: 1 !important;
    margin: 0 !important;
    margin-top: 0 !important;
    padding: 10px !important;
    font-size: 14px !important;
    height: 40px !important;
    width: auto !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    display: block !important;
}

.device-ip-input-container button.connect-button {
    margin: 0 !important;
    margin-top: 0 !important;
    width: 40px !important;
    min-width: 40px !important;
    height: 40px !important;
    flex-shrink: 0 !important;
    box-sizing: border-box !important;
    display: flex !important;
    padding: 0 !important;
}

/* ============================================
   FIX: Draw Tools Panel - Matriz 3x3
   Estos estilos DEBEN estar al final para
   sobrescribir los selectores generales
   ============================================ */

.canvas-with-tools {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    gap: 20px !important;
    margin: 20px auto !important;
    max-width: 100% !important;
}

.draw-tools-panel {
    display: grid !important;
    grid-template-columns: repeat(3, 50px) !important;
    grid-template-rows: repeat(3, 50px) !important;
    gap: 3px !important;
    padding: 10px !important;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
    border-radius: 12px !important;
    border: 2px solid #dee2e6 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
    align-items: center !important;
    justify-items: start !important;
    height: 170px !important;
    box-sizing: border-box !important;
}

.draw-tools-panel>* {
    margin: 0 !important;
    margin-top: 0 !important;
}

.draw-tools-panel button.tool-button-icon {
    margin: 0 !important;
    margin-top: 0 !important;
    display: flex !important;
    width: 50px !important;
    height: 50px !important;
    font-size: 18px !important;
}

/* Icono del pixel tool - círculo muy pequeño */
.draw-tools-panel button#tool_pixel i.draw-size-indicator {
    font-size: 8px !important;
}

/* ============================================
   FIX: Draw Text Controls debajo de todo
   Alineado con el panel de herramientas
   Sin etiqueta, solo input
   ============================================ */

.section-container-drawing>.draw-text-controls {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 0 !important;
    margin: 12px 0 0 0 !important;
    padding: 0 !important;
    width: 170px !important;
}

.section-container-drawing>.draw-text-controls .draw-text-input {
    width: 170px !important;
    margin: 0 !important;
    padding: 10px 14px !important;
    font-size: 14px !important;
    border: 2px solid #dee2e6 !important;
    border-radius: 6px !important;
    background: #fff !important;
    transition: all 0.3s ease !important;
    color: #333 !important;
    box-sizing: border-box !important;
}

.section-container-drawing>.draw-text-controls .draw-text-input:disabled {
    background: #f5f6fa !important;
    color: #95a5a6 !important;
    cursor: not-allowed !important;
    border-color: #e9ecef !important;
}

.section-container-drawing>.draw-text-controls .draw-text-input:enabled {
    background: #fff !important;
    border-color: #3498db !important;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15) !important;
}

.section-container-drawing>.draw-text-controls .draw-text-input:focus {
    outline: none !important;
    border-color: #2980b9 !important;
    box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.25) !important;
}

/* ============================================
   Drawing Options - 3 Columnas Rediseñadas
   ============================================ */

.draw-options-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr 1.5fr !important;
    gap: 20px !important;
    margin: 0 !important;
    padding: 0 !important;
}

.draw-option-column {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    padding: 20px !important;
    margin: 0 !important;
    background: #f8f9fa !important;
    border-radius: 10px !important;
    border: 2px solid #e9ecef !important;
    transition: all 0.3s ease !important;
}

.draw-option-column:hover {
    border-color: #dee2e6 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) !important;
}

/* Columna 1 - Custom App (azul suave) */
.draw-option-column:nth-child(1) {
    background: linear-gradient(135deg, #f0f4ff 0%, #e8f0fe 100%) !important;
    border-color: #d0e1ff !important;
}

.draw-option-column:nth-child(1):hover {
    border-color: #b8d4ff !important;
    box-shadow: 0 4px 12px rgba(44, 90, 160, 0.1) !important;
}

/* Columna 2 - Notificación (verde suave) */
.draw-option-column:nth-child(2) {
    background: linear-gradient(135deg, #f0fdf4 0%, #e8fef0 100%) !important;
    border-color: #d0f5e0 !important;
}

.draw-option-column:nth-child(2):hover {
    border-color: #b8f0d0 !important;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.1) !important;
}

/* Columna 3 - Comandos de dibujo (naranja suave) */
.draw-option-column:nth-child(3) {
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%) !important;
    border-color: #fed7aa !important;
}

.draw-option-column:nth-child(3):hover {
    border-color: #fdba74 !important;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.1) !important;
}

.draw-option-label {
    margin: 0 !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    color: #495057 !important;
}

.draw-option-input {
    margin: 0 !important;
    padding: 10px 12px !important;
    font-size: 14px !important;
    border: 2px solid #dee2e6 !important;
    border-radius: 6px !important;
    transition: all 0.3s ease !important;
    background: white !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
}

.draw-option-input:focus {
    outline: none !important;
    border-color: #2c5aa0 !important;
    box-shadow: 0 0 0 3px rgba(44, 90, 160, 0.15) !important;
}

/* Input en columna de Custom App (azul) */
.draw-option-column:nth-child(1) .draw-option-input:focus {
    border-color: #2c5aa0 !important;
    box-shadow: 0 0 0 3px rgba(44, 90, 160, 0.15) !important;
}

/* Input en columna de Notificación (verde) */
.draw-option-column:nth-child(2) .draw-option-input:focus {
    border-color: #22c55e !important;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15) !important;
}

/* Elementos en columna de Comandos (naranja) */
.draw-option-column:nth-child(3) .draw-commands-scroll {
    background: white !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
}

.draw-duration-row {
    display: flex !important;
    gap: 8px !important;
    align-items: stretch !important;
}

.draw-duration-number {
    flex: 1 !important;
}

.draw-duration-row .pin-button {
    width: 42px !important;
    min-width: 42px !important;
    height: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #ecf0f1 !important;
    color: #7f8c8d !important;
    border: 2px solid #bdc3c7 !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    font-size: 16px !important;
    transition: all 0.3s ease !important;
}

.draw-duration-row .pin-button:hover {
    background: #d5dbdb !important;
    color: #34495e !important;
    transform: translateY(-3px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.draw-duration-row .pin-button:active {
    transform: translateY(0) !important;
}

.draw-duration-row .pin-button.pinned {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%) !important;
    color: white !important;
    border-color: #2980b9 !important;
    transform: none !important;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3) !important;
}

.draw-duration-row .pin-button.pinned:hover {
    background: linear-gradient(135deg, #2980b9 0%, #21618c 100%) !important;
    transform: translateY(-3px) !important;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4) !important;
}

.draw-duration-row .pin-button.pinned:active {
    transform: translateY(0) !important;
}

.draw-option-button {
    margin: 0 !important;
    padding: 12px 16px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    border: none !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    margin-top: auto !important;
}

.draw-option-button-primary {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%) !important;
    color: white !important;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3) !important;
}

.draw-option-button-primary:hover {
    background: linear-gradient(135deg, #2980b9 0%, #21618c 100%) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4) !important;
}

.draw-option-button-secondary {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%) !important;
    color: white !important;
    box-shadow: 0 2px 8px rgba(243, 156, 18, 0.3) !important;
}

.draw-option-button-secondary:hover {
    background: linear-gradient(135deg, #e67e22 0%, #d68910 100%) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.4) !important;
}

.draw-commands-header-row {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin: 0 !important;
}

.draw-commands-counter {
    font-size: 12px !important;
    font-weight: 600 !important;
    color: #95a5a6 !important;
    background: #ecf0f1 !important;
    padding: 4px 10px !important;
    border-radius: 12px !important;
}

.draw-commands-scroll {
    flex: 1 !important;
    overflow-y: auto !important;
    padding: 12px !important;
    background: white !important;
    border: 2px solid #dee2e6 !important;
    border-radius: 6px !important;
    min-height: 120px !important;
    max-height: 120px !important;
    font-size: 12px !important;
    color: #495057 !important;
    line-height: 1.6 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
}

.draw-commands-scroll::-webkit-scrollbar {
    width: 8px !important;
}

.draw-commands-scroll::-webkit-scrollbar-track {
    background: #ecf0f1 !important;
    border-radius: 4px !important;
}

.draw-commands-scroll::-webkit-scrollbar-thumb {
    background: #bdc3c7 !important;
    border-radius: 4px !important;
}

.draw-commands-scroll::-webkit-scrollbar-thumb:hover {
    background: #95a5a6 !important;
}

.draw-commands-placeholder {
    margin: 0 !important;
    color: #95a5a6 !important;
    font-style: italic !important;
    text-align: center !important;
}

/* Selector de color en la última posición, ocupa 2 celdas */
.draw-tools-panel label.color-picker-button-draw {
    display: flex !important;
    margin: 0 !important;
    margin-top: 0 !important;
    grid-column: 2 / 4 !important;
    grid-row: 3 !important;
    width: 100% !important;
    height: 50px !important;
    align-items: center !important;
    justify-content: center !important;
    background: #fff !important;
    border: 3px solid #2c5aa0 !important;
    border-radius: 10px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    overflow: hidden !important;
    padding: 4px !important;
    box-sizing: border-box !important;
    box-shadow: 0 2px 8px rgba(44, 90, 160, 0.3) !important;
}

.draw-tools-panel label.color-picker-button-draw:hover {
    border-color: #3498db !important;
    transform: scale(1.05) !important;
    box-shadow: 0 4px 16px rgba(52, 152, 219, 0.5) !important;
}

.draw-tools-panel .draw-color-preview {
    width: 100% !important;
    height: 100% !important;
    border-radius: 8px !important;
    background: #FFFFFF !important;
    cursor: pointer !important;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1) !important;
    display: block !important;
}

.draw-tools-panel .draw-color-input-hidden {
    position: absolute !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    pointer-events: none !important;
}

/* Panel de acciones al lateral derecho del canvas, en vertical */
.draw-actions-panel {
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    height: 170px !important;
    box-sizing: border-box !important;
}

.draw-actions-panel>* {
    margin: 0 !important;
}

.draw-actions-panel button.undo-button {
    margin: 0 !important;
    display: flex !important;
    width: 50px !important;
    height: 50px !important;
    font-size: 20px !important;
    align-self: flex-start !important;
}

.draw-actions-panel button.clear-button {
    margin: 0 !important;
    display: flex !important;
    width: 50px !important;
    height: 50px !important;
    font-size: 20px !important;
    align-self: flex-end !important;
}

.draw-main-area {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0 !important;
}

/* ============================================
   FIX: Draw Canvas - Idéntico a Status Canvas
   ============================================ */

canvas#draw_canvas {
    background: #181c21 !important;
    box-shadow: 0 4px 32px rgba(0, 0, 0, 0.7) !important;
    image-rendering: pixelated !important;
    border-radius: 7px !important;
    border: 12px solid #181c21 !important;
    box-shadow:
        0 4px 32px rgba(0, 0, 0, 0.7),
        inset 0 0 0 2px #0a0c0e,
        inset 0 0 20px rgba(0, 0, 0, 0.5) !important;
    max-width: 578px !important;
    width: 100% !important;
    height: auto !important;
    cursor: crosshair !important;
    display: block !important;
}

/* ============================================
   Movement Toggles - Beautiful Switches
   ============================================ */

.movement-toggles {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 20px;
}

.movement-toggle-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.movement-toggle-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e1e4e8;
    transition: all 0.2s ease;
}

.movement-toggle-label:hover {
    background: #e9ecef;
    border-color: #d1d5da;
}

.movement-toggle-text {
    font-size: 14px;
    font-weight: 500;
    color: #24292e;
}

.movement-toggle {
    position: relative;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}

.movement-toggle input[type="checkbox"] {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.movement-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 26px;
}

.movement-toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.movement-toggle input:checked+.movement-toggle-slider {
    background-color: #2c5aa0;
}

.movement-toggle input:focus+.movement-toggle-slider {
    box-shadow: 0 0 1px #2c5aa0;
}

.movement-toggle input:checked+.movement-toggle-slider:before {
    transform: translateX(22px);
}

.movement-toggle-help {
    display: block;
    font-size: 12px;
    color: #6c757d;
    padding-left: 16px;
    line-height: 1.4;
    font-style: italic;
}

/* Responsive adjustment for movement toggles */
@media (max-width: 768px) {
    .movement-toggle-label {
        padding: 10px 12px;
    }

    .movement-toggle-text {
        font-size: 13px;
    }

    .movement-toggle {
        width: 44px;
        height: 24px;
    }

    .movement-toggle-slider:before {
        height: 18px;
        width: 18px;
    }

    .movement-toggle input:checked+.movement-toggle-slider:before {
        transform: translateX(20px);
    }
}

/* ============================================
   Notification Options - Beautiful Toggles
   ============================================ */

.notification-options {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin: 6px 0 0 0;
}

.notification-option-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.notification-option-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
    padding: 6px 10px;
    background: white;
    border-radius: 5px;
    border: 1px solid #e1e4e8;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.notification-option-label:hover {
    background: #ffffff;
    border-color: #22c55e;
    box-shadow: 0 2px 6px rgba(34, 197, 94, 0.15);
}

.notification-option-text {
    font-size: 11px;
    font-weight: 500;
    color: #24292e;
    display: flex;
    align-items: center;
    gap: 5px;
}

.notification-option-text i {
    font-size: 12px;
    color: #6c757d;
}

.notification-toggle {
    position: relative;
    width: 42px;
    height: 22px;
    flex-shrink: 0;
}

.notification-toggle input[type="checkbox"] {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.notification-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 22px;
}

.notification-toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.notification-toggle input:checked+.notification-toggle-slider {
    background-color: #2c5aa0;
}

.notification-toggle input:focus+.notification-toggle-slider {
    box-shadow: 0 0 1px #2c5aa0;
}

.notification-toggle input:checked+.notification-toggle-slider:before {
    transform: translateX(20px);
}

.notification-option-help {
    display: block;
    font-size: 10px;
    color: #6c757d;
    padding-left: 10px;
    line-height: 1.2;
    font-style: italic;
}

/* Responsive adjustment for notification toggles */
@media (max-width: 768px) {
    .notification-option-label {
        padding: 8px 12px;
    }

    .notification-option-text {
        font-size: 12px;
    }

    .notification-toggle {
        width: 38px;
        height: 20px;
    }

    .notification-toggle-slider:before {
        height: 14px;
        width: 14px;
    }

    .notification-toggle input:checked+.notification-toggle-slider:before {
        transform: translateX(18px);
    }
}

/* ============================================
   Lifetime Options - Custom App Settings
   ============================================ */

.lifetime-options {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin: 6px 0 0 0;
}

.lifetime-option-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.lifetime-option-label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 6px 10px;
    background: white;
    border-radius: 5px;
    border: 1px solid #e1e4e8;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.lifetime-option-label:hover {
    background: #ffffff;
    border-color: #2c5aa0;
    box-shadow: 0 2px 6px rgba(44, 90, 160, 0.15);
}

.lifetime-option-text {
    font-size: 11px;
    font-weight: 500;
    color: #24292e;
    display: flex;
    align-items: center;
    gap: 5px;
}

.lifetime-option-text i {
    font-size: 12px;
    color: #6c757d;
}

.lifetime-input,
.lifetime-select {
    width: 100%;
    padding: 5px 7px;
    border: 1px solid #d1d5da;
    border-radius: 4px;
    font-size: 11px;
    background: white;
    transition: all 0.2s ease;
}

.lifetime-input:focus,
.lifetime-select:focus {
    outline: none;
    border-color: #2c5aa0;
    box-shadow: 0 0 0 3px rgba(44, 90, 160, 0.1);
}

.lifetime-input::placeholder {
    color: #6c757d;
    font-size: 11px;
}

.lifetime-option-help {
    display: block;
    font-size: 10px;
    color: #6c757d;
    padding-left: 10px;
    line-height: 1.2;
    font-style: italic;
}

/* Responsive adjustment for lifetime options */
@media (max-width: 768px) {
    .lifetime-option-label {
        padding: 8px 12px;
    }

    .lifetime-option-text {
        font-size: 12px;
    }

    .lifetime-input,
    .lifetime-select {
        font-size: 12px;
        padding: 7px 9px;
    }
}

/* ============================================
   Save Flash Option - Beautiful Toggle
   ============================================ */

.save-flash-option {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 6px;
}

.save-flash-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
    padding: 6px 10px;
    background: white;
    border-radius: 5px;
    border: 1px solid #e1e4e8;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.save-flash-label:hover {
    background: #ffffff;
    border-color: #2c5aa0;
    box-shadow: 0 2px 6px rgba(44, 90, 160, 0.15);
}

.save-flash-text {
    font-size: 11px;
    font-weight: 500;
    color: #24292e;
    display: flex;
    align-items: center;
    gap: 5px;
}

.save-flash-text i {
    font-size: 12px;
    color: #6c757d;
}

.save-flash-toggle {
    position: relative;
    width: 42px;
    height: 22px;
    flex-shrink: 0;
}

.save-flash-toggle input[type="checkbox"] {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.save-flash-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 22px;
}

.save-flash-toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.save-flash-toggle input:checked+.save-flash-toggle-slider {
    background-color: #2c5aa0;
}

.save-flash-toggle input:focus+.save-flash-toggle-slider {
    box-shadow: 0 0 1px #2c5aa0;
}

.save-flash-toggle input:checked+.save-flash-toggle-slider:before {
    transform: translateX(20px);
}

.save-flash-help {
    display: block;
    font-size: 10px;
    color: #6c757d;
    padding-left: 10px;
    line-height: 1.2;
    font-style: italic;
}

/* Responsive adjustment for save flash toggle */
@media (max-width: 768px) {
    .save-flash-label {
        padding: 8px 12px;
    }

    .save-flash-text {
        font-size: 12px;
    }

    .save-flash-toggle {
        width: 38px;
        height: 20px;
    }

    .save-flash-toggle-slider:before {
        height: 14px;
        width: 14px;
    }

    .save-flash-toggle input:checked+.save-flash-toggle-slider:before {
        transform: translateX(18px);
    }
}

/* ============================================
   Use Fragments Toggle - Beautiful Switch
   ============================================ */

.use-fragments-toggle {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 16px;
}

.use-fragments-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
    padding: 10px 14px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e1e4e8;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.use-fragments-label:hover {
    background: #ffffff;
    border-color: #9b59b6;
    box-shadow: 0 2px 6px rgba(155, 89, 182, 0.15);
}

.use-fragments-text {
    font-size: 13px;
    font-weight: 500;
    color: #24292e;
    display: flex;
    align-items: center;
    gap: 8px;
}

.use-fragments-text i {
    font-size: 14px;
    color: #6c757d;
}

.use-fragments-toggle-switch {
    position: relative;
    width: 42px;
    height: 22px;
    flex-shrink: 0;
}

.use-fragments-toggle-switch input[type="checkbox"] {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.use-fragments-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 22px;
}

.use-fragments-toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.use-fragments-toggle-switch input:checked+.use-fragments-toggle-slider {
    background-color: #9b59b6;
}

.use-fragments-toggle-switch input:focus+.use-fragments-toggle-slider {
    box-shadow: 0 0 1px #9b59b6;
}

.use-fragments-toggle-switch input:checked+.use-fragments-toggle-slider:before {
    transform: translateX(20px);
}

.use-fragments-help {
    display: block;
    font-size: 11px;
    color: #6c757d;
    padding-left: 14px;
    line-height: 1.3;
    font-style: italic;
}

/* Responsive adjustment for use fragments toggle */
@media (max-width: 768px) {
    .use-fragments-label {
        padding: 8px 12px;
    }

    .use-fragments-text {
        font-size: 12px;
    }

    .use-fragments-toggle-switch {
        width: 38px;
        height: 20px;
    }

    .use-fragments-toggle-slider:before {
        height: 14px;
        width: 14px;
    }

    .use-fragments-toggle-switch input:checked+.use-fragments-toggle-slider:before {
        transform: translateX(18px);
    }
}

/* Custom Apps Send Card - Diseño de dos columnas como Drawing */
.custom-send-card {
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    margin-top: 20px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.custom-send-header {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    padding: 8px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.custom-send-header h4 {
    margin: 0;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
}

.custom-send-header i {
    margin-right: 8px;
}

.custom-send-body {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.custom-send-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
    margin: 0 !important;
    padding: 0 !important;
}

.custom-send-column {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    padding: 10px !important;
    margin: 0 !important;
    background: #f8f9fa !important;
    border-radius: 8px !important;
    border: 2px solid #e9ecef !important;
    transition: all 0.3s ease !important;
}

.custom-send-column:hover {
    border-color: #dee2e6 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) !important;
}

/* Columna 1 - Custom App (azul suave) */
.custom-send-column:nth-child(1) {
    background: linear-gradient(135deg, #f0f4ff 0%, #e8f0fe 100%) !important;
    border-color: #d0e1ff !important;
}

.custom-send-column:nth-child(1):hover {
    border-color: #b8d4ff !important;
    box-shadow: 0 4px 12px rgba(44, 90, 160, 0.1) !important;
}

/* Columna 2 - Notificación (verde suave) */
.custom-send-column:nth-child(2) {
    background: linear-gradient(135deg, #f0fdf4 0%, #e8fef0 100%) !important;
    border-color: #d0f5e0 !important;
}

.custom-send-column:nth-child(2):hover {
    border-color: #b8f0d0 !important;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.1) !important;
}

.custom-send-label {
    margin: 0 0 2px 0 !important;
    font-weight: 600 !important;
    font-size: 12px !important;
    color: #495057 !important;
}

.custom-send-input {
    margin: 0 !important;
    padding: 6px 8px !important;
    font-size: 12px !important;
    border: 2px solid #dee2e6 !important;
    border-radius: 5px !important;
    transition: all 0.3s ease !important;
    background: white !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
}

.custom-send-input:focus {
    outline: none !important;
    border-color: #2c5aa0 !important;
    box-shadow: 0 0 0 3px rgba(44, 90, 160, 0.15) !important;
}

/* Input en columna de Custom App (azul) */
.custom-send-column:nth-child(1) .custom-send-input:focus {
    border-color: #2c5aa0 !important;
    box-shadow: 0 0 0 3px rgba(44, 90, 160, 0.15) !important;
}

/* Input en columna de Notificación (verde) */
.custom-send-column:nth-child(2) .custom-send-input:focus {
    border-color: #22c55e !important;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15) !important;
}

.custom-duration-row {
    display: flex !important;
    gap: 8px !important;
    align-items: center !important;
}

.custom-duration-number {
    flex: 1 !important;
}

.custom-send-button {
    margin: 4px 0 0 0 !important;
    padding: 8px 12px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    border: none !important;
    border-radius: 5px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;
    margin-top: auto !important;
}

.custom-send-button-primary {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%) !important;
    color: white !important;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3) !important;
}

.custom-send-button-primary:hover {
    background: linear-gradient(135deg, #2980b9 0%, #21618c 100%) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4) !important;
}

.custom-send-button-secondary {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%) !important;
    color: white !important;
    box-shadow: 0 2px 8px rgba(243, 156, 18, 0.3) !important;
}

.custom-send-button-secondary:hover {
    background: linear-gradient(135deg, #e67e22 0%, #d68910 100%) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.4) !important;
}

@media (max-width: 768px) {
    .custom-send-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ============================================
   Schedule Button (Clock Icon)
   ============================================ */
.schedule-button {
    width: 32px;
    height: 32px;
    min-width: 32px;
    padding: 0;
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(243, 156, 18, 0.3);
    margin: 0;
}

.schedule-button:hover {
    background: linear-gradient(135deg, #e67e22 0%, #d68910 100%);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.5);
}

.schedule-button:active {
    transform: scale(1.05);
}

.schedule-button-blue {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    box-shadow: 0 2px 6px rgba(52, 152, 219, 0.3);
}

.schedule-button-blue:hover {
    background: linear-gradient(135deg, #2980b9 0%, #1f6fa8 100%);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.5);
}

/* ============================================
   Schedule Modal
   ============================================ */
.schedule-modal {
    max-width: 580px;
}

.schedule-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.schedule-tab-btn {
    flex: 1;
    padding: 10px 14px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #dee2e6;
    border-radius: 6px;
    color: #495057;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 0;
}

.schedule-tab-btn:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    border-color: #3498db;
    transform: translateY(-1px);
}

.schedule-tab-btn.active {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border-color: #2980b9;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

.schedule-tab-content {
    display: none;
    margin-bottom: 16px;
}

.schedule-tab-content.active {
    display: block;
}

.schedule-tab-content label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    color: #495057;
    margin-bottom: 8px;
}

#schedule_datetime {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
}

#schedule_datetime:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}

.timer-inputs {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto 1fr;
    gap: 10px;
    align-items: center;
    margin-bottom: 12px;
}

.timer-input-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.timer-input-group input {
    width: 100%;
    text-align: center;
    font-size: 24px;
    font-weight: bold;
    padding: 12px 8px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-family: 'Courier New', monospace;
    margin: 0;
}

.timer-input-group input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}

.timer-input-group label {
    font-size: 11px;
    font-weight: 600;
    color: #7f8c8d;
    text-transform: uppercase;
    margin: 0;
}

.timer-separator {
    font-size: 28px;
    font-weight: bold;
    color: #95a5a6;
    align-self: start;
    margin-top: 8px;
}

/* Schedule text section */
.schedule-text-section {
    margin-bottom: 16px;
    padding: 14px;
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 8px;
}

.schedule-text-section label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    color: #495057;
    margin-bottom: 8px;
}

#schedule_text {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
    font-family: inherit;
}

#schedule_text:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}

.schedule-text-help {
    display: block;
    font-size: 11px;
    color: #7f8c8d;
    margin-top: 6px;
    font-style: italic;
}

.schedule-text-help i {
    color: #3498db;
    margin-right: 4px;
}

.schedule-preview {
    padding: 12px 14px;
    background: linear-gradient(135deg, #e8f4f8 0%, #d4ebf2 100%);
    border-left: 4px solid #3498db;
    border-radius: 6px;
    font-size: 13px;
    color: #2c3e50;
    line-height: 1.6;
    margin-bottom: 16px;
}

.schedule-preview i {
    color: #3498db;
    margin-right: 6px;
}

.schedule-preview strong {
    color: #2c5aa0;
}

#schedule_json_preview {
    width: 100%;
    padding: 10px 12px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #333;
    resize: vertical;
    min-height: 120px;
}

/* ============================================
   Schedule Repeat Controls
   ============================================ */
.schedule-repeat-section {
    margin-bottom: 16px;
    padding: 14px;
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 8px;
}

.schedule-repeat-toggle {
    margin-bottom: 12px;
}

.schedule-repeat-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
}

.schedule-repeat-text {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
}

.schedule-repeat-text i {
    color: #8e44ad;
    font-size: 16px;
}

.schedule-repeat-toggle-switch {
    position: relative;
    width: 48px;
    height: 24px;
}

.schedule-repeat-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.schedule-repeat-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 24px;
}

.schedule-repeat-toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.schedule-repeat-toggle-switch input:checked+.schedule-repeat-toggle-slider {
    background: linear-gradient(135deg, #8e44ad 0%, #7d3c98 100%);
}

.schedule-repeat-toggle-switch input:checked+.schedule-repeat-toggle-slider:before {
    transform: translateX(24px);
}

.repeat-controls {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #dee2e6;
}

.repeat-controls label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    color: #495057;
    margin-bottom: 10px;
}

.repeat-inputs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 10px;
}

.repeat-input-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.repeat-input-group input {
    width: 100%;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    padding: 10px 6px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-family: 'Courier New', monospace;
    margin: 0;
}

.repeat-input-group input:focus {
    outline: none;
    border-color: #8e44ad;
    box-shadow: 0 0 0 3px rgba(142, 68, 173, 0.15);
}

.repeat-input-group label {
    font-size: 11px;
    font-weight: 600;
    color: #7f8c8d;
    text-transform: uppercase;
    margin: 0;
}

.repeat-help {
    display: block;
    font-size: 11px;
    color: #7f8c8d;
    font-style: italic;
    margin-top: 6px;
}

/* ============================================
   Scheduled Tasks Card
   ============================================ */
.scheduled-tasks-card {
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    margin-top: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.scheduled-tasks-header {
    background: linear-gradient(135deg, #8e44ad 0%, #7d3c98 100%);
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.scheduled-tasks-header h4 {
    margin: 0;
    color: white;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tasks-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    color: white;
}

.scheduled-tasks-body {
    padding: 12px;
}

#scheduled_tasks_list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.scheduled-task-item {
    display: grid;
    grid-template-columns: auto 1fr auto auto auto;
    gap: 12px;
    padding: 10px 12px;
    background: white;
    border-radius: 8px;
    border: 2px solid #e9ecef;
    align-items: center;
    transition: all 0.3s ease;
}

.scheduled-task-item:hover {
    border-color: #8e44ad;
    box-shadow: 0 2px 12px rgba(142, 68, 173, 0.15);
    transform: translateY(-1px);
}

.task-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.task-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.task-text {
    font-size: 13px;
    font-weight: 600;
    color: #2c3e50;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-time {
    font-size: 11px;
    color: #7f8c8d;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

/* Task repeat badge */
.task-repeat-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, #8e44ad 0%, #7d3c98 100%);
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-left: 4px;
}

.task-repeat-badge i {
    font-size: 9px;
    animation: spin-slow 3s linear infinite;
}

@keyframes spin-slow {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Highlight for repetitive tasks */
.scheduled-task-item.task-repeat {
    border-left: 4px solid #8e44ad;
}

.scheduled-task-item.task-repeat:hover {
    border-left-color: #7d3c98;
    box-shadow: 0 2px 12px rgba(142, 68, 173, 0.25);
}

.task-countdown {
    font-size: 18px;
    font-weight: bold;
    color: #2ecc71;
    font-family: 'Courier New', monospace;
    flex-shrink: 0;
    min-width: 80px;
    text-align: center;
}

.task-countdown.urgent {
    color: #e74c3c;
    animation: pulse-urgent 1s ease-in-out infinite;
}

.task-countdown.warning {
    color: #e67e22;
}

@keyframes pulse-urgent {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.task-edit-btn {
    width: 32px;
    height: 32px;
    min-width: 32px;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
    margin: 0;
    padding: 0;
}

.task-edit-btn:hover {
    background: linear-gradient(135deg, #2980b9 0%, #21618c 100%);
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.4);
}

.task-edit-btn:active {
    transform: scale(1.05);
}

.task-delete-btn {
    width: 32px;
    height: 32px;
    min-width: 32px;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    margin: 0;
    padding: 0;
}

.task-delete-btn:hover {
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.4);
}

.task-delete-btn:active {
    transform: scale(1.05);
}

.no-tasks-message {
    padding: 30px 20px;
    text-align: center;
    color: #95a5a6;
    font-style: italic;
    font-size: 13px;
}

.no-tasks-message i {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

/* Responsive */
@media (max-width: 768px) {
    .scheduled-task-item {
        grid-template-columns: auto 1fr;
        gap: 8px;
    }

    .task-countdown {
        grid-column: 2;
        text-align: right;
        font-size: 16px;
    }

    .task-delete-btn {
        grid-column: 2;
        justify-self: end;
    }

    .timer-inputs {
        gap: 6px;
    }

    .timer-input-group input {
        font-size: 20px;
        padding: 10px 6px;
    }
}

/* ============================================
   SPORTS SECTION STYLES
   ============================================ */

/* Sports main container (for standalone section) */
.sports-main-container {
    background: white;
    padding: 24px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Sports selector */
.sports-selector {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 2px solid #ecf0f1;
}

.sports-selector label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: #2c3e50;
    margin-bottom: 10px;
}

.sport-buttons {
    display: flex;
    gap: 12px;
}

.sport-btn {
    flex: 1;
    padding: 14px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 600;
    color: #495057;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.sport-btn:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    border-color: #2ecc71;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.2);
}

.sport-btn.active {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    color: white;
    border-color: #27ae60;
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.3);
}

.sport-btn i {
    font-size: 18px;
}

/* Search section */
.sports-search-section {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 2px solid #ecf0f1;
}

.sports-search-section label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: #2c3e50;
    margin-bottom: 10px;
}

.search-input-group {
    display: flex;
    gap: 10px;
}

.search-input-group input {
    flex: 1;
    padding: 12px 14px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.search-input-group input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}

.sports-search-btn {
    padding: 12px 20px;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sports-search-btn:hover {
    background: linear-gradient(135deg, #2980b9 0%, #21618c 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

/* Search results */
.search-results-container {
    max-height: 300px;
    overflow-y: auto;
    margin-top: 12px;
}

.search-result-item {
    padding: 12px;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-result-item:hover {
    border-color: #2ecc71;
    box-shadow: 0 2px 8px rgba(46, 204, 113, 0.2);
    transform: translateX(4px);
}

.search-result-name {
    font-weight: 600;
    font-size: 14px;
    color: #2c3e50;
    margin-bottom: 4px;
}

.search-result-info {
    font-size: 12px;
    color: #7f8c8d;
}

/* Live matches section */
.live-matches-section {
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 2px solid #ecf0f1;
}

.live-matches-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.live-matches-header h4 {
    margin: 0;
    font-size: 16px;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 8px;
}

.refresh-matches-btn {
    padding: 8px 16px;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.refresh-matches-btn:hover {
    background: linear-gradient(135deg, #2980b9 0%, #21618c 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.live-matches-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 500px;
    overflow-y: auto;
    padding: 2px;
}

/* Match card */
.match-card {
    padding: 14px;
    background: white;
    border-left: 4px solid #95a5a6;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.match-card:hover {
    border-left-color: #2ecc71;
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.15);
    transform: translateX(4px);
}

.match-card.live {
    border-left-color: #e74c3c;
    background: linear-gradient(135deg, #fff 0%, #fee 100%);
}

.match-card.selected {
    border-left-color: #2ecc71;
    background: linear-gradient(135deg, #fff 0%, #e8f8f0 100%);
    box-shadow: 0 4px 16px rgba(46, 204, 113, 0.25);
}

.match-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.match-league {
    font-size: 11px;
    font-weight: 600;
    color: #7f8c8d;
    text-transform: uppercase;
}

.match-status {
    display: inline-block;
    padding: 4px 10px;
    background: #95a5a6;
    color: white;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.match-status.live {
    background: #e74c3c;
    animation: pulse-live 2s ease-in-out infinite;
}

@keyframes pulse-live {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

.match-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.match-team {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
}

.match-score {
    font-size: 24px;
    font-weight: bold;
    color: #2c3e50;
    font-family: 'Courier New', monospace;
    min-width: 60px;
    text-align: center;
}

.match-sets {
    font-size: 12px;
    color: #7f8c8d;
    text-align: center;
}

.set-score {
    display: inline-block;
    margin: 0 4px;
    padding: 2px 6px;
    background: #ecf0f1;
    border-radius: 4px;
}

.match-time {
    font-size: 12px;
    color: #7f8c8d;
    text-align: center;
    font-weight: 600;
}

/* Selected match section */
.selected-match-section {
    margin-bottom: 24px;
}

.selected-match-section h4 {
    margin: 0 0 12px 0;
    font-size: 16px;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 8px;
}

.match-preview-card {
    padding: 16px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ecf0f1 100%);
    border: 2px solid #dee2e6;
    border-radius: 8px;
    min-height: 120px;
    margin-bottom: 12px;
}

.preview-placeholder {
    text-align: center;
    color: #95a5a6;
    font-size: 14px;
    margin: 40px 0;
}

.preview-match {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.preview-league {
    font-size: 12px;
    font-weight: 600;
    color: #7f8c8d;
    text-transform: uppercase;
    text-align: center;
}

.preview-teams {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.preview-team {
    flex: 1;
    font-size: 16px;
    font-weight: 700;
    color: #2c3e50;
    text-align: center;
}

.preview-score {
    font-size: 32px;
    font-weight: bold;
    color: #2c3e50;
    font-family: 'Courier New', monospace;
    min-width: 80px;
    text-align: center;
}

.preview-sets {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
}

.preview-status {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.badge-live {
    display: inline-block;
    padding: 6px 12px;
    background: #e74c3c;
    color: white;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    animation: pulse-live 2s ease-in-out infinite;
}

.preview-time {
    font-size: 14px;
    font-weight: 600;
    color: #7f8c8d;
}

.selected-match-section label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    color: #495057;
    margin-bottom: 8px;
}

.sports-text-output {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
    font-family: 'Courier New', monospace;
    background: #f8f9fa;
    color: #2c3e50;
    font-weight: 600;
}

/* Sports actions */
.sports-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 2px solid #ecf0f1;
}

.btn-sports-send,
.btn-sports-notify {
    flex: 1;
    min-width: 200px;
    padding: 14px 18px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-sports-send {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
}

.btn-sports-send:hover {
    background: linear-gradient(135deg, #2980b9 0%, #21618c 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(52, 152, 219, 0.3);
}

.btn-sports-notify {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
}

.btn-sports-notify:hover {
    background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(243, 156, 18, 0.3);
}

/* Auto update section */
.sports-auto-update-section {
    margin-bottom: 24px;
}

.sports-auto-update-section h4 {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 8px;
}

.auto-update-description {
    font-size: 13px;
    color: #7f8c8d;
    margin-bottom: 16px;
    line-height: 1.5;
}

.auto-update-controls {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.auto-update-config {
    flex: 1;
    min-width: 200px;
}

.auto-update-config label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    color: #495057;
    margin-bottom: 8px;
}

.interval-select {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.interval-select:focus {
    outline: none;
    border-color: #8e44ad;
    box-shadow: 0 0 0 3px rgba(142, 68, 173, 0.15);
}

.interval-select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #f8f9fa;
}

.auto-update-actions {
    display: flex;
    gap: 10px;
}

.btn-auto-start,
.btn-auto-stop {
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 180px;
}

.btn-auto-start {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    color: white;
}

.btn-auto-start:hover {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(46, 204, 113, 0.3);
}

.btn-auto-stop {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
}

.btn-auto-stop:hover {
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(231, 76, 60, 0.3);
}

.auto-update-status {
    margin-top: 16px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #e8f8f0 0%, #d4f1e3 100%);
    border-left: 4px solid #2ecc71;
    border-radius: 6px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.status-dot {
    width: 12px;
    height: 12px;
    background: #2ecc71;
    border-radius: 50%;
    animation: pulse-status 2s ease-in-out infinite;
}

.status-dot.status-stopped {
    background: #e74c3c;
    animation: none;
}

/* Custom Header */
.custom-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.custom-header h3 {
    margin: 0;
}

.config-button {
    background: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.config-button:hover {
    background: #2980b9;
}

.config-button i {
    margin-right: 5px;
}

/* Advanced Configuration Modal */
.modal-advanced-config {
    max-width: 800px;
    width: 90vw;
    max-height: 80vh;
    overflow-y: auto;
}

.advanced-tabs-container {
    margin-bottom: 20px;
}

.advanced-tabs-row {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 5px;
}

.advanced-tab-button {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
    flex: 1;
    min-width: 120px;
    color: #495057;
    /* Color de texto gris oscuro para estado normal */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.advanced-tab-button:hover {
    background: #e9ecef;
    color: #212529;
    /* Color más oscuro en hover */
}

.advanced-tab-button.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.advanced-tab-button i {
    font-size: 11px;
}

.advanced-tab-content {
    display: none;
}

.advanced-tab-content.active {
    display: block;
}

@keyframes pulse-status {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.6;
        transform: scale(1.2);
    }
}

.status-text {
    font-weight: 600;
    font-size: 14px;
    color: #27ae60;
}

.status-info {
    font-size: 12px;
    color: #7f8c8d;
    padding-left: 22px;
}

/* Info box */
.sports-info-box {
    padding: 14px 16px;
    background: linear-gradient(135deg, #e8f4f8 0%, #d4ebf2 100%);
    border-left: 4px solid #3498db;
    border-radius: 6px;
    font-size: 13px;
    color: #2c3e50;
    line-height: 1.6;
}

.sports-info-box i {
    color: #3498db;
    margin-right: 8px;
}

.sports-info-box strong {
    color: #2c5aa0;
}

/* Loading and error messages */
.loading-message,
.error-message,
.no-results-message,
.no-matches-message {
    padding: 20px;
    text-align: center;
    font-size: 14px;
    color: #7f8c8d;
}

.loading-message i {
    color: #3498db;
    margin-right: 8px;
}

.error-message {
    color: #e74c3c;
}

.error-message i {
    color: #e74c3c;
    margin-right: 8px;
}

.no-results-message i,
.no-matches-message i {
    color: #95a5a6;
    margin-right: 8px;
}

/* Responsive */
@media (max-width: 768px) {
    .sport-buttons {
        flex-direction: column;
    }

    .sports-actions {
        flex-direction: column;
    }

    .btn-sports-send,
    .btn-sports-notify {
        width: 100%;
        min-width: auto;
    }

    .auto-update-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .auto-update-config {
        width: 100%;
    }

    .auto-update-actions {
        flex-direction: column;
    }

    .btn-auto-start,
    .btn-auto-stop {
        width: 100%;
        min-width: auto;
    }

    .match-body {
        flex-direction: column;
        text-align: center;
    }

    .preview-teams {
        flex-direction: column;
    }
}

/* ============================================
   TEMPLATES SYSTEM STYLES
   Sistema de Plantillas para AWTRIX3
   ============================================ */

/* Template Selector Button */
.template-selector-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    margin: 0;
}

.template-selector-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.template-selector-btn i {
    font-size: 16px;
}

/* Custom Header Actions */
.custom-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.custom-header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Templates Modal */
.modal-templates {
    max-width: 900px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    margin: 0;
    margin-left: auto;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.templates-tabs {
    display: flex;
    gap: 0;
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    padding: 0 16px;
    flex-shrink: 0;
}

.templates-tab {
    flex: 1;
    padding: 12px 16px;
    background: transparent;
    border: none;
    color: #64748b;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    margin: 0;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.templates-tab:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.templates-tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: white;
}

.templates-tab i {
    font-size: 14px;
}

.templates-tab-content {
    display: none;
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.templates-tab-content.active {
    display: block;
}

/* Template Create Subtabs */
.template-create-subtabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 2px solid #dee2e6;
}

.template-subtab {
    flex: 1;
    padding: 12px 16px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: #64748b;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.template-subtab:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.template-subtab.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: transparent;
}

.template-subtab i {
    font-size: 16px;
}

.template-subtab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.template-subtab-content.active {
    display: block;
}

#template_format_config_content {
    width: 100%;
    max-width: 100%;
}

#template_format_config_content .advanced-tabs-container {
    margin-bottom: 20px;
}

#template_format_config_content .advanced-tab-content {
    padding: 0;
}

#template_format_config_content .appearance-card {
    margin-bottom: 16px;
}

/* Templates Search */
.templates-search {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    margin-bottom: 20px;
}

.templates-search input {
    flex: 1;
    margin: 0;
}

.templates-search select {
    width: 200px;
    margin: 0;
}

/* Templates Grid */
.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    max-height: 500px;
    overflow-y: auto;
    padding-right: 8px;
}

.templates-grid::-webkit-scrollbar {
    width: 8px;
}

.templates-grid::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.templates-grid::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

.templates-grid::-webkit-scrollbar-thumb:hover {
    background: #5568d3;
}

/* Template Card */
.template-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #dee2e6;
    border-radius: 12px;
    padding: 16px;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 280px;
}

.template-card:hover {
    border-color: #667eea;
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.2);
}

.template-card-icon {
    font-size: 36px;
    text-align: center;
    padding: 8px;
    background: white;
    border-radius: 8px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    flex-shrink: 0;
}

.template-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.template-card-title {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 700;
    color: #2c3e50;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.template-card-desc {
    margin: 0 0 12px 0;
    font-size: 13px;
    color: #6c757d;
    line-height: 1.5;
    text-align: center;
    flex: 1;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.template-card-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 8px;
}

.template-category {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
}

.template-usage {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    background: #e9ecef;
    color: #495057;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.template-card-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
}

.btn-template-load {
    flex: 1;
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    color: white;
    border: none;
    padding: 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-template-load:hover {
    background: linear-gradient(135deg, #229954 0%, #1e8449 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.4);
}

.btn-template-preview {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-template-preview:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

/* Templates Empty State */
.templates-empty {
    text-align: center;
    padding: 80px 20px;
    color: #6c757d;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border: 2px dashed #dee2e6;
}

.templates-empty i {
    font-size: 48px;
    color: #adb5bd;
    margin-bottom: 16px;
    display: block;
}

.templates-empty p {
    margin: 8px 0;
    font-size: 14px;
    line-height: 1.6;
}

.loading-message {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.loading-message i {
    font-size: 18px;
    color: #667eea;
}

/* Template Save Form */
#template_save_form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

#template_save_form label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-weight: 600;
    color: #495057;
    margin: 0;
    font-size: 14px;
}

#template_save_form label i {
    margin-right: 6px;
    color: #667eea;
    font-size: 14px;
}

#template_save_form input,
#template_save_form textarea,
#template_save_form select {
    margin: 0;
    border: 2px solid #dee2e6;
    transition: all 0.3s ease;
}

#template_save_form input:focus,
#template_save_form textarea:focus,
#template_save_form select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    outline: none;
}

#template_save_form small {
    font-size: 12px;
    color: #6c757d;
    font-weight: normal;
    line-height: 1.4;
}

.template-save-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    border: 2px solid #dee2e6;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: normal;
    cursor: pointer;
    margin: 0;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.checkbox-label:hover {
    background: rgba(102, 126, 234, 0.05);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
}

.template-preview {
    margin-top: 16px;
    padding: 18px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    border: 2px solid #dee2e6;
}

.template-preview h5 {
    margin: 0 0 12px 0;
    color: #2c3e50;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.template-preview-json {
    background: #2d3748;
    color: #f7fafc;
    padding: 14px;
    border-radius: 8px;
    max-height: 200px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.7;
    border: 2px solid #1a202c;
}

.template-preview-json::-webkit-scrollbar {
    width: 8px;
}

.template-preview-json::-webkit-scrollbar-track {
    background: #1a202c;
}

.template-preview-json::-webkit-scrollbar-thumb {
    background: #4a5568;
    border-radius: 4px;
}

.template-preview-json::-webkit-scrollbar-thumb:hover {
    background: #5a6678;
}

.btn-save-template {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 16px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 8px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-save-template:hover {
    background: linear-gradient(135deg, #5568d3 0%, #6a3d96 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.btn-save-template:active {
    transform: translateY(0);
}

/* Template Manage List */
.templates-manage-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 600px;
    overflow-y: auto;
    padding-right: 8px;
}

.template-manage-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 16px;
    padding: 16px;
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    align-items: start;
    transition: all 0.2s ease;
}

.template-manage-item:hover {
    border-color: #667eea;
    background: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

.template-manage-icon {
    font-size: 32px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 8px;
    flex-shrink: 0;
}

.template-manage-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.template-manage-info h4 {
    margin: 0 0 6px 0;
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.template-manage-info p {
    margin: 0 0 10px 0;
    font-size: 13px;
    color: #6c757d;
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.template-manage-meta {
    display: flex;
    gap: 8px;
    font-size: 12px;
    color: #6c757d;
    flex-wrap: wrap;
}

.template-manage-meta span {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    background: #e9ecef;
    border-radius: 12px;
    white-space: nowrap;
}

.template-manage-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    align-self: center;
}

.btn-manage-edit,
.btn-manage-duplicate,
.btn-manage-delete {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    font-size: 16px;
}

.btn-manage-edit {
    background: #3498db;
    color: white;
}

.btn-manage-edit:hover {
    background: #2980b9;
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

.btn-manage-duplicate {
    background: #9b59b6;
    color: white;
}

.btn-manage-duplicate:hover {
    background: #8e44ad;
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(155, 89, 182, 0.3);
}

.btn-manage-delete {
    background: #e74c3c;
    color: white;
}

.btn-manage-delete:hover {
    background: #c0392b;
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
}

/* Import/Export Section */
.import-export-section {
    padding: 24px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border: 2px solid #dee2e6;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.import-export-section:hover {
    border-color: #667eea;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.1);
}

.import-export-section h4 {
    margin: 0 0 12px 0;
    color: #2c3e50;
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.import-export-section h4 i {
    color: #667eea;
    font-size: 20px;
}

.import-export-section p {
    margin: 0 0 20px 0;
    color: #6c757d;
    font-size: 14px;
    line-height: 1.6;
}

.btn-export,
.btn-import {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 8px;
    margin-top: 8px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.btn-export:hover,
.btn-import:hover {
    background: linear-gradient(135deg, #5568d3 0%, #6a3d96 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
}

.btn-export:active,
.btn-import:active {
    transform: translateY(0);
}

.import-options {
    margin-top: 20px;
    padding: 16px;
    background: white;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.import-options .checkbox-label {
    font-size: 14px;
    color: #495057;
}

/* Quick Access Templates */
.template-quick-access {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.template-quick-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: white;
    border: 2px solid #dee2e6;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #495057;
    margin: 0;
}

.template-quick-btn:hover {
    border-color: #667eea;
    color: #667eea;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.template-icon {
    font-size: 14px;
}

.template-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

/* Template Preview Modal Content */
.template-preview-modal h4 {
    margin: 0 0 8px 0;
    color: #2c3e50;
    font-size: 20px;
}

.template-preview-modal p {
    margin: 0 0 20px 0;
    color: #6c757d;
    font-size: 14px;
}

.template-preview-details {
    background: #f8f9fa;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.template-preview-details h5 {
    margin: 0 0 12px 0;
    color: #495057;
    font-size: 14px;
    font-weight: 600;
}

.template-config-list {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
}

.template-config-list li {
    padding: 6px 0;
    border-bottom: 1px solid #e9ecef;
    font-size: 13px;
    color: #495057;
}

.template-config-list li:last-child {
    border-bottom: none;
}

.template-config-list strong {
    color: #2c3e50;
    margin-right: 8px;
}

.color-swatch {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    vertical-align: middle;
    margin-right: 4px;
}

.template-json-preview {
    background: #2d3748;
    color: #f7fafc;
    padding: 12px;
    border-radius: 6px;
    max-height: 300px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Loading and Error Messages */
.loading-message {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
    font-size: 14px;
}

.loading-message i {
    font-size: 24px;
    margin-bottom: 12px;
    display: block;
}

.error-message {
    text-align: center;
    padding: 40px 20px;
    color: #e74c3c;
    font-size: 14px;
}

.error-message i {
    font-size: 24px;
    margin-bottom: 12px;
    display: block;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .templates-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .templates-search {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .templates-search select {
        width: 100%;
    }

    .modal-templates {
        max-width: 95vw;
        max-height: 95vh;
    }

    .templates-tabs {
        overflow-x: auto;
        padding: 0 8px;
        -webkit-overflow-scrolling: touch;
    }

    .templates-tab {
        flex: 0 0 auto;
        min-width: 100px;
        font-size: 11px;
        padding: 10px 12px;
    }

    .templates-tab i {
        font-size: 12px;
    }

    .templates-tab-content {
        padding: 16px;
    }

    .template-create-subtabs {
        flex-direction: column;
        gap: 4px;
        margin-bottom: 16px;
    }

    .template-subtab {
        font-size: 13px;
        padding: 10px 12px;
        border-bottom: none;
        border-left: 3px solid transparent;
        justify-content: flex-start;
    }

    .template-subtab.active {
        border-bottom-color: transparent;
        border-left-color: #667eea;
        background: rgba(102, 126, 234, 0.1);
    }

    .template-subtab i {
        font-size: 14px;
    }

    .template-card {
        min-height: auto;
    }

    .template-manage-item {
        grid-template-columns: auto 1fr;
        gap: 12px;
        padding: 12px;
    }

    .template-manage-icon {
        font-size: 24px;
        width: 40px;
        height: 40px;
    }

    .template-manage-info h4 {
        font-size: 14px;
    }

    .template-manage-info p {
        font-size: 12px;
    }

    .template-manage-actions {
        grid-column: 1 / -1;
        width: 100%;
        justify-content: center;
        margin-top: 8px;
    }

    .btn-manage-edit,
    .btn-manage-duplicate,
    .btn-manage-delete {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .template-list-item {
        gap: 10px 12px;
        padding: 12px;
    }

    .template-list-icon {
        font-size: 28px;
        width: 45px;
        height: 45px;
    }

    .template-list-info h4 {
        font-size: 14px;
    }

    .template-list-info p {
        font-size: 12px;
    }

    .template-list-meta {
        gap: 6px;
    }

    .template-list-meta span {
        font-size: 11px;
        padding: 2px 6px;
    }

    .template-list-actions {
        gap: 6px;
        flex-wrap: nowrap;
        overflow-x: auto;
    }

    .btn-template-load {
        padding: 0 12px;
        font-size: 12px;
    }

    .btn-template-preview,
    .btn-template-edit,
    .btn-template-duplicate,
    .btn-template-delete {
        width: 34px;
        height: 34px;
        min-width: 34px;
        min-height: 34px;
    }

    .import-export-section {
        padding: 16px;
    }

    .import-export-section h4 {
        font-size: 16px;
    }

    .btn-export,
    .btn-import {
        width: 100%;
        justify-content: center;
        margin-right: 0;
    }
}

/* Asegurar que el modal de confirmación aparezca encima del modal de plantillas */
#custom_modal {
    z-index: 10001;
}

/* Estilos para lista de plantillas unificada */
.templates-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 500px;
    overflow-y: auto;
    padding: 4px;
}

.template-list-item {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    gap: 12px 16px;
    padding: 16px;
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.template-list-item:hover {
    border-color: #667eea;
    background: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

.template-list-icon {
    grid-row: 1 / 2;
    grid-column: 1 / 2;
    font-size: 32px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 8px;
    flex-shrink: 0;
}

.template-list-info {
    grid-row: 1 / 2;
    grid-column: 2 / 3;
    min-width: 0;
    overflow: hidden;
}

.template-list-info h4 {
    margin: 0 0 6px 0;
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.template-list-info p {
    margin: 0 0 8px 0;
    font-size: 13px;
    color: #6c757d;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.template-list-meta {
    display: flex;
    gap: 8px;
    font-size: 12px;
    color: #6c757d;
    flex-wrap: wrap;
}

.template-list-meta span {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    background: #e9ecef;
    border-radius: 12px;
    white-space: nowrap;
    font-weight: 500;
}

.template-list-actions {
    grid-row: 2 / 3;
    grid-column: 1 / -1;
    display: flex;
    gap: 8px;
    justify-content: flex-start;
    align-items: center;
}

.btn-template-load,
.btn-template-preview,
.btn-template-edit,
.btn-template-duplicate,
.btn-template-delete {
    height: 36px;
    min-height: 36px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    margin: 0;
}

.btn-template-load {
    background: #27ae60;
    color: white;
    padding: 0 16px;
}

.btn-template-load:hover {
    background: #229954;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(39, 174, 96, 0.3);
}

.btn-template-preview {
    background: #6c757d;
    color: white;
    width: 36px;
    min-width: 36px;
    padding: 0;
}

.btn-template-preview:hover {
    background: #5a6268;
    transform: scale(1.05);
}

.btn-template-edit {
    background: #3498db;
    color: white;
    width: 36px;
    min-width: 36px;
    padding: 0;
}

.btn-template-edit:hover {
    background: #2980b9;
    transform: scale(1.05);
}

.btn-template-duplicate {
    background: #9b59b6;
    color: white;
    width: 36px;
    min-width: 36px;
    padding: 0;
}

.btn-template-duplicate:hover {
    background: #8e44ad;
    transform: scale(1.05);
}

.btn-template-delete {
    background: #e74c3c;
    color: white;
    width: 36px;
    min-width: 36px;
    padding: 0;
}

.btn-template-delete:hover {
    background: #c0392b;
    transform: scale(1.05);
}

/* Estilos para vista previa de plantilla */
.template-preview-modal {
    max-height: 60vh;
    overflow-y: auto;
}

.template-preview-details {
    margin-top: 20px;
}

.template-config-list {
    list-style: none;
    padding: 0;
    margin: 10px 0;
}

.template-config-list li {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 8px;
}

.template-config-list li:last-child {
    border-bottom: none;
}

.color-swatch {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 1px solid #ddd;
    vertical-align: middle;
}

.template-json-preview {
    background: #f5f5f5;
    padding: 12px;
    border-radius: 6px;
    font-size: 12px;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #ddd;
    color: #000;
    font-family: 'Courier New', Courier, monospace;
}

/* ========================================
   WIDGETS SECTION STYLES
   ======================================== */

/* Widgets Header */
.widgets-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 30px 0 20px 0;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.widgets-header h3 {
    margin: 0;
    color: #273c75;
    font-size: 22px;
}

.widgets-header h3 i {
    margin-right: 10px;
    color: #2c5aa0;
}

/* Widgets Gallery (Matriz 3 columnas) */
.widgets-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 20px;
}

.widget-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 28px 24px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 220px;
}

.widget-card:hover:not(.widget-card-placeholder) {
    border-color: #2c5aa0;
    box-shadow: 0 6px 16px rgba(44, 90, 160, 0.25);
    transform: translateY(-4px);
}

.widget-card-icon {
    font-size: 56px;
    margin-bottom: 16px;
    line-height: 1;
}

.widget-card h4 {
    margin: 0 0 10px 0;
    color: #273c75;
    font-size: 20px;
    font-weight: 600;
}

.widget-card p {
    margin: 0 0 20px 0;
    color: #666;
    font-size: 14px;
    line-height: 1.5;
    flex: 1;
}

.widget-card-btn {
    background: linear-gradient(135deg, #2c5aa0 0%, #1e3a70 100%);
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
    font-weight: 600;
    width: 100%;
    box-shadow: 0 2px 8px rgba(44, 90, 160, 0.3);
}

.widget-card-btn:hover:not(.widget-card-btn-disabled) {
    background: linear-gradient(135deg, #1e3a70 0%, #0f1f3d 100%);
    box-shadow: 0 4px 12px rgba(44, 90, 160, 0.4);
    transform: translateY(-2px);
}

.widget-card-btn i {
    margin-right: 6px;
}

.widget-card-placeholder {
    opacity: 0.6;
    cursor: not-allowed;
    background: #f8f9fa;
}

.widget-card-placeholder:hover {
    transform: none;
    border-color: #e0e0e0;
    box-shadow: none;
}

.widget-card-btn-disabled {
    background: #ccc;
    cursor: not-allowed;
    box-shadow: none;
}

.widget-card-btn-disabled:hover {
    background: #ccc;
    transform: none;
    box-shadow: none;
}

/* Active Widgets Area */
.active-widgets-area {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #dee2e6;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.active-widgets-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #dee2e6;
}

.active-widgets-header h3 {
    margin: 0;
    color: #273c75;
    font-size: 20px;
    font-weight: 600;
}

.active-widgets-header h3 i {
    margin-right: 10px;
    color: #2c5aa0;
}

.active-widgets-count {
    background: linear-gradient(135deg, #2c5aa0 0%, #1e3a70 100%);
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 6px rgba(44, 90, 160, 0.3);
}

.active-widgets-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.active-widget-item {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    padding: 18px;
    display: grid;
    grid-template-columns: 60px 1fr auto;
    gap: 18px;
    align-items: center;
    transition: all 0.3s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.active-widget-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.active-widget-icon {
    font-size: 40px;
    text-align: center;
    line-height: 1;
}

.active-widget-info {
    flex: 1;
}

.active-widget-info h5 {
    margin: 0 0 6px 0;
    color: #273c75;
    font-size: 17px;
    font-weight: 600;
}

.active-widget-info p {
    margin: 3px 0;
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

.active-widget-type {
    color: #2c5aa0;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.active-widget-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-running {
    background: #28a745;
    animation: pulse-widget 2s infinite;
    box-shadow: 0 0 6px rgba(40, 167, 69, 0.6);
}

.status-paused {
    background: #ffc107;
    box-shadow: 0 0 6px rgba(255, 193, 7, 0.6);
}

@keyframes pulse-widget {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.6;
        transform: scale(0.9);
    }
}

.active-widget-next {
    font-size: 12px;
    color: #999;
    font-style: italic;
}

.active-widget-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.widget-action-btn {
    background: #f0f0f0;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #666;
}

.widget-action-btn:hover {
    background: #2c5aa0;
    color: white;
    transform: scale(1.1);
}

.widget-action-delete:hover {
    background: #dc3545;
    color: white;
}

.no-active-widgets {
    text-align: center;
    padding: 50px 20px;
    color: #999;
}

.no-active-widgets i {
    font-size: 60px;
    color: #ddd;
    margin-bottom: 16px;
    display: block;
}

.no-active-widgets p {
    margin: 8px 0;
    font-size: 16px;
    color: #666;
}

.no-active-widgets small {
    font-size: 13px;
    color: #999;
    font-style: italic;
}

/* Responsive: 2 columnas en tablets */
@media (max-width: 1024px) {
    .widgets-gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .active-widget-item {
        grid-template-columns: 50px 1fr auto;
        gap: 14px;
    }

    .active-widget-icon {
        font-size: 36px;
    }
}

/* Responsive: 1 columna en móviles */
@media (max-width: 768px) {
    .widgets-gallery {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .widgets-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .active-widget-item {
        grid-template-columns: 1fr;
        gap: 12px;
        text-align: center;
    }

    .active-widget-icon {
        font-size: 48px;
        grid-column: 1;
        grid-row: 1;
    }

    .active-widget-info {
        grid-column: 1;
        grid-row: 2;
    }

    .active-widget-actions {
        grid-column: 1;
        grid-row: 3;
        justify-content: center;
    }
}

/* Widget Modals specific styles */
.modal-dialog.modal-widget {
    max-width: 700px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-dialog.modal-widget .modal-body {
    overflow-y: auto;
    max-height: calc(90vh - 180px);
}

.modal-dialog.modal-widget .modal-footer {
    position: sticky;
    bottom: 0;
    background: white;
    border-top: 1px solid #e0e0e0;
    z-index: 10;
}

.weekday-selector {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin: 12px 0;
}

.weekday-btn {
    position: relative;
    cursor: pointer;
}

.weekday-btn input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.weekday-btn span {
    display: inline-block;
    width: 42px;
    height: 42px;
    line-height: 42px;
    text-align: center;
    border: 2px solid #ddd;
    border-radius: 50%;
    background: white;
    color: #666;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s;
    cursor: pointer;
}

.weekday-btn input[type="checkbox"]:checked+span {
    background: #2c5aa0;
    border-color: #2c5aa0;
    color: white;
    transform: scale(1.1);
}

.weekday-btn:hover span {
    border-color: #2c5aa0;
    transform: scale(1.05);
}

.time-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 20px;
    font-weight: 600;
    color: #273c75;
    justify-content: center;
    margin: 12px 0;
}

.time-input-group input {
    width: 70px;
    text-align: center;
    font-size: 20px;
    font-weight: 600;
    padding: 8px;
    border: 2px solid #ddd;
    border-radius: 8px;
}

.time-input-group input:focus {
    border-color: #2c5aa0;
    outline: none;
}

.timer-duration-inputs {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 12px;
    margin: 20px 0;
}

.timer-input-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.timer-input-group input {
    width: 80px;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    padding: 12px 8px;
    border: 2px solid #ddd;
    border-radius: 8px;
    color: #273c75;
}

.timer-input-group input:focus {
    border-color: #2c5aa0;
    outline: none;
    box-shadow: 0 0 0 3px rgba(44, 90, 160, 0.1);
}

.timer-input-group label {
    font-size: 12px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.timer-separator {
    font-size: 28px;
    font-weight: 700;
    color: #2c5aa0;
    margin-top: 15px;
}

.timer-repeat-label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 20px 0;
    cursor: pointer;
}

.timer-repeat-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin: 0;
    cursor: pointer;
}

.form-control-color {
    width: 100%;
    height: 40px;
    padding: 4px;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
}

.alarm-repeat-section {
    background: #f8f9fa;
    padding: 16px;
    border-radius: 8px;
    margin: 16px 0;
}

.advanced-options {
    background: #f8f9fa;
    padding: 16px;
    border-radius: 8px;
    margin: 16px 0;
    border: 1px solid #e0e0e0;
}

.advanced-options summary {
    cursor: pointer;
    font-weight: 600;
    color: #273c75;
    padding: 4px;
    user-select: none;
}

.advanced-options summary:hover {
    color: #2c5aa0;
}

.advanced-options[open] summary {
    margin-bottom: 12px;
}

/* ============================================
   ESPN SPORTS WIDGET STYLES
   ============================================ */

/* ESPN Tabs */
.espn-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 0;
}

.espn-tab {
    flex: 1;
    padding: 12px 16px;
    background: #f8f9fa;
    border: none;
    border-bottom: 3px solid transparent;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    font-weight: 600;
    color: #666;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.espn-tab:hover {
    background: #e9ecef;
    color: #273c75;
}

.espn-tab.active {
    background: #fff;
    color: #273c75;
    border-bottom-color: #2c5aa0;
}

.espn-tab i {
    font-size: 16px;
}

/* ESPN Tab Content */
.espn-tab-content {
    display: none;
}

.espn-tab-content.active {
    display: block;
}

/* ESPN Results Container */
.espn-results {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 12px;
    background: #f8f9fa;
    margin: 12px 0;
}

.espn-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.espn-empty-state i {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.espn-empty-state p {
    margin: 0;
    font-size: 14px;
}

/* ESPN Result Item */
.espn-result-item {
    background: #fff;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.espn-result-item:hover {
    border-color: #2c5aa0;
    background: #f0f4ff;
    transform: translateX(4px);
}

.espn-result-item:last-child {
    margin-bottom: 0;
}

.espn-result-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: #e9ecef;
}

.espn-result-info {
    flex: 1;
}

.espn-result-name {
    font-weight: 600;
    color: #273c75;
    margin: 0 0 4px 0;
}

.espn-result-details {
    font-size: 12px;
    color: #666;
    margin: 0;
}

/* ESPN Selected Item */
.espn-selected {
    background: #e7f3ff;
    border: 2px solid #2c5aa0;
    border-radius: 8px;
    padding: 16px;
    margin: 16px 0;
}

.espn-selected h4 {
    margin: 0 0 12px 0;
    color: #273c75;
    display: flex;
    align-items: center;
    gap: 8px;
}

.espn-selected h4 i {
    color: #27ae60;
}

/* ESPN Preview */
.espn-preview {
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 16px;
    margin: 16px 0;
}

.espn-preview h4 {
    margin: 0 0 12px 0;
    color: #273c75;
    display: flex;
    align-items: center;
    gap: 8px;
}

.espn-preview-text {
    font-family: monospace;
    background: #fff;
    padding: 12px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    font-size: 14px;
}

/* Modal Large Variant */
.modal-large {
    max-width: 700px;
}

/* Loading Spinner */
.espn-loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

.espn-loading i {
    font-size: 24px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Weather City Search */
.weather-city-search-container {
    position: relative;
    width: 100%;
}

.weather-city-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 0 0 8px 8px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: none;
}

.weather-city-result-item {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    transition: background 0.2s;
}

.weather-city-result-item:last-child {
    border-bottom: none;
}

.weather-city-result-item:hover {
    background-color: #f0f7ff;
}

.weather-city-result-item .city-name {
    font-weight: 600;
    color: #333;
}

.weather-city-result-item .city-details {
    font-size: 0.85em;
    color: #666;
}

.weather-selected-city {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    background: #e3f2fd;
    border: 1px solid #90caf9;
    border-radius: 6px;
    margin-top: 5px;
}

.selected-city-info {
    display: flex;
    flex-direction: column;
}

.selected-city-info #selected_city_name {
    font-weight: bold;
    color: #1565c0;
}

.selected-city-info #selected_city_details {
    font-size: 0.85em;
    color: #555;
}

.clear-selection-btn {
    background: none;
    border: none;
    color: #d32f2f;
    cursor: pointer;
    font-size: 1.1em;
    padding: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.clear-selection-btn:hover {
    background-color: rgba(211, 47, 47, 0.1);
}

.weather-search-loading,
.weather-search-empty,
.weather-search-error {
    padding: 12px;
    text-align: center;
    color: #666;
    font-size: 0.9em;
}

/* Advanced Config Button in Widgets */
.advanced-config-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
    float: right;
    font-size: 1.1em;
}

.advanced-config-btn:hover {
    background-color: #e9ecef;
    color: #2c3e50;
    transform: scale(1.1);
}


.advanced-options summary {
    display: list-item;
    cursor: pointer;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 12px;
    outline: none;
    list-style: none;
    padding: 4px 0;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.advanced-options summary:hover {
    color: #1a252f;
}

.advanced-options summary::-webkit-details-marker {
    display: none;
}

.advanced-options summary span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.advanced-options summary::before {
    content: '►';
    font-size: 0.8em;
    margin-right: 8px;
    display: inline-block;
    transition: transform 0.2s;
    color: #7f8c8d;
}

.advanced-options[open] summary::before {
    transform: rotate(90deg);
}

.advanced-options[open] summary {
    border-bottom: 1px solid #eee;
    margin-bottom: 16px;
}

/* Advanced Config Modal - Higher z-index to appear above widget modals */
#advanced_config_modal {
    z-index: 11000;
}

/* ===========================================
   INLINE TEXT WIDGET STYLING
   =========================================== */

.widget-card-inline-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px !important;
    position: relative;
}

.widget-card-header-inline {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
}

.widget-card-icon-inline {
    font-size: 2em;
    min-width: 40px;
    text-align: center;
}

.widget-card-header-inline h4 {
    flex: 1;
    margin: 0;
    font-size: 1.1em;
    color: #2c3e50;
}

.widget-inline-config-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 4px;
    transition: all 0.2s;
    font-size: 1.1em;
    z-index: 10;
}

.widget-inline-config-btn:hover {
    background-color: #e9ecef;
    color: #2c3e50;
    transform: scale(1.1);
}

.widget-inline-label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.9em;
    color: #555;
    font-weight: 500;
    margin-bottom: 0;
}

.widget-inline-label i {
    margin-right: 6px;
    color: #7f8c8d;
}

.widget-inline-select,
.widget-inline-input {
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95em;
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 100%;
    margin-top: 0;
}

.widget-inline-select:focus,
.widget-inline-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.widget-inline-radio-group {
    display: flex;
    gap: 12px;
    padding: 4px 0;
    margin-top: 0;
}

.widget-inline-radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border: 2px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    flex: 1;
    justify-content: center;
    font-weight: 500;
    color: #555;
}

.widget-inline-radio-label:hover {
    border-color: #3498db;
    background-color: #f8f9fa;
}

.widget-inline-radio-label input[type="radio"] {
    margin: 0;
    cursor: pointer;
}

.widget-inline-radio-label input[type="radio"]:checked+span {
    color: #3498db;
    font-weight: 600;
}

.widget-inline-radio-label:has(input[type="radio"]:checked) {
    border-color: #3498db;
    background-color: #e3f2fd;
}

.widget-inline-send-btn {
    padding: 10px 18px;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 4px;
}

.widget-inline-send-btn:hover {
    background: linear-gradient(135deg, #2980b9 0%, #21618c 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}


.widget-inline-send-btn:active {
    transform: translateY(0);
}

.widget-inline-send-btn i {
    font-size: 1.1em;
}

/* ===========================================
   FRAGMENT COLOR PICKER STYLING
   =========================================== */

.text-fragment-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.fragment-text {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95em;
}

.fragment-color {
    width: 60px;
    height: 38px;
    border: 2px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
}

.fragment-color:hover {
    border-color: #3498db;
    transform: scale(1.05);
}

.fragment-color::-webkit-color-swatch-wrapper {
    padding: 0;
}


.widget-card-inline-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px !important;
    position: relative;
}

.widget-card-header-inline {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
}

.widget-card-icon-inline {
    font-size: 2em;
    min-width: 40px;
    text-align: center;
}

.widget-card-header-inline h4 {
    flex: 1;
    margin: 0;
    font-size: 1.1em;
    color: #2c3e50;
}

.widget-inline-config-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 4px;
    transition: all 0.2s;
    font-size: 1.1em;
    z-index: 10;
}

.widget-inline-config-btn:hover {
    background-color: #e9ecef;
    color: #2c3e50;
    transform: scale(1.1);
}

.widget-inline-label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.9em;
    color: #555;
    font-weight: 500;
    margin-bottom: 0;
}

.widget-inline-label i {
    margin-right: 6px;
    color: #7f8c8d;
}

.widget-inline-select,
.widget-inline-input {
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95em;
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 100%;
    margin-top: 0;
}

.widget-inline-select:focus,
.widget-inline-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.widget-inline-radio-group {
    display: flex;
    gap: 12px;
    padding: 4px 0;
    margin-top: 0;
}

.widget-inline-radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border: 2px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    flex: 1;
    justify-content: center;
    font-weight: 500;
    color: #555;
}

.widget-inline-radio-label:hover {
    border-color: #3498db;
    background-color: #f8f9fa;
}

.widget-inline-radio-label input[type="radio"] {
    margin: 0;
    cursor: pointer;
}

.widget-inline-radio-label input[type="radio"]:checked+span {
    color: #3498db;
    font-weight: 600;
}

.widget-inline-radio-label:has(input[type="radio"]:checked) {
    border-color: #3498db;
    background-color: #e3f2fd;
}

.widget-inline-send-btn {
    padding: 10px 18px;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 4px;
}

.widget-inline-send-btn:hover {
    background: linear-gradient(135deg, #2980b9 0%, #21618c 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}


.widget-inline-send-btn:active {
    transform: translateY(0);
}

.widget-inline-send-btn i {
    font-size: 1.1em;
}

/* ===========================================
   FRAGMENT COLOR PICKER STYLING
   =========================================== */

.text-fragment-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.fragment-text {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95em;
}

.fragment-color {
    width: 60px;
    height: 38px;
    border: 2px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
}

.fragment-color:hover {
    border-color: #3498db;
    transform: scale(1.05);
}

.fragment-color::-webkit-color-swatch-wrapper {
    padding: 0;
}

.fragment-color::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}

.fragment-color::-moz-color-swatch {
    border: none;
    border-radius: 4px;
}

.widget-card-header-inline {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
}

.widget-card-icon-inline {
    font-size: 2em;
    min-width: 40px;
    text-align: center;
}

.widget-card-header-inline h4 {
    flex: 1;
    margin: 0;
    font-size: 1.1em;
    color: #2c3e50;
}

.widget-inline-config-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 4px;
    transition: all 0.2s;
    font-size: 1.1em;
    z-index: 10;
}

.widget-inline-config-btn:hover {
    background-color: #e9ecef;
    color: #2c3e50;
    transform: scale(1.1);
}

.widget-inline-label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.9em;
    color: #555;
    font-weight: 500;
    margin-bottom: 0;
}

.widget-inline-label i {
    margin-right: 6px;
    color: #7f8c8d;
}

.widget-inline-select,
.widget-inline-input {
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95em;
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 100%;
    margin-top: 0;
}

.widget-inline-select:focus,
.widget-inline-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.widget-inline-radio-group {
    display: flex;
    gap: 12px;
    padding: 4px 0;
    margin-top: 0;
}

.widget-inline-radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border: 2px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    flex: 1;
    justify-content: center;
    font-weight: 500;
    color: #555;
}

.widget-inline-radio-label:hover {
    border-color: #3498db;
    background-color: #f8f9fa;
}

.widget-inline-radio-label input[type="radio"] {
    margin: 0;
    cursor: pointer;
}

.widget-inline-radio-label input[type="radio"]:checked+span {
    color: #3498db;
    font-weight: 600;
}

.widget-inline-radio-label:has(input[type="radio"]:checked) {
    border-color: #3498db;
    background-color: #e3f2fd;
}

.widget-inline-send-btn {
    padding: 10px 18px;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 4px;
}

.widget-inline-send-btn:hover {
    background: linear-gradient(135deg, #2980b9 0%, #21618c 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}


.widget-inline-send-btn:active {
    transform: translateY(0);
}

.widget-inline-send-btn i {
    font-size: 1.1em;
}

/* ===========================================
   FRAGMENT COLOR PICKER STYLING
   =========================================== */

.text-fragment-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.fragment-text {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95em;
}

.fragment-color {
    width: 60px;
    height: 38px;
    border: 2px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
}

.fragment-color:hover {
    border-color: #3498db;
    transform: scale(1.05);
}

.fragment-color::-webkit-color-swatch-wrapper {
    padding: 0;
}

.fragment-color::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}

border: none;
border-radius: 4px;
}

.widget-card-header-inline {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
}

.widget-card-icon-inline {
    font-size: 2em;
    min-width: 40px;
    text-align: center;
}

.widget-card-header-inline h4 {
    flex: 1;
    margin: 0;
    font-size: 1.1em;
    color: #2c3e50;
}

.widget-inline-config-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 4px;
    transition: all 0.2s;
    font-size: 1.1em;
    z-index: 10;
}

.widget-inline-config-btn:hover {
    background-color: #e9ecef;
    color: #2c3e50;
    transform: scale(1.1);
}

.widget-inline-label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.9em;
    color: #555;
    font-weight: 500;
    margin-bottom: 0;
}

.widget-inline-label i {
    margin-right: 6px;
    color: #7f8c8d;
}

.widget-inline-select,
.widget-inline-input {
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95em;
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 100%;
    margin-top: 0;
}

.widget-inline-select:focus,
.widget-inline-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.widget-inline-radio-group {
    display: flex;
    gap: 12px;
    padding: 4px 0;
    margin-top: 0;
}

.widget-inline-radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border: 2px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    flex: 1;
    justify-content: center;
    font-weight: 500;
    color: #555;
}

.widget-inline-radio-label:hover {
    border-color: #3498db;
    background-color: #f8f9fa;
}

.widget-inline-radio-label input[type="radio"] {
    margin: 0;
    cursor: pointer;
}

.widget-inline-radio-label input[type="radio"]:checked+span {
    color: #3498db;
    font-weight: 600;
}

.widget-inline-radio-label:has(input[type="radio"]:checked) {
    border-color: #3498db;
    background-color: #e3f2fd;
}

.widget-inline-send-btn {
    padding: 10px 18px;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 4px;
}

.widget-inline-send-btn:hover {
    background: linear-gradient(135deg, #2980b9 0%, #21618c 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}


.widget-inline-send-btn:active {
    transform: translateY(0);
}

.widget-inline-send-btn i {
    font-size: 1.1em;
}

/* ===========================================
   FRAGMENT COLOR PICKER STYLING
   =========================================== */

.text-fragment-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.fragment-text {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95em;
}

.fragment-color {
    width: 60px;
    height: 38px;
    border: 2px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
}

.fragment-color:hover {
    border-color: #3498db;
    transform: scale(1.05);
}

.fragment-color::-webkit-color-swatch-wrapper {
    padding: 0;
}

.fragment-color::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}

.fragment-color::-moz-color-swatch {
    border: none;
    border-radius: 4px;
}

/* ===========================================
   MODAL HEADER ACTIONS
   =========================================== */

.modal-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
    text-align: center;
}

.widget-card-header-inline h4 {
    flex: 1;
    margin: 0;
    font-size: 1.1em;
    color: #2c3e50;
}

.widget-inline-config-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 4px;
    transition: all 0.2s;
    font-size: 1.1em;
    z-index: 10;
}

.widget-inline-config-btn:hover {
    background-color: #e9ecef;
    color: #2c3e50;
    transform: scale(1.1);
}

.widget-inline-label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.9em;
    color: #555;
    font-weight: 500;
    margin-bottom: 0;
}

.widget-inline-label i {
    margin-right: 6px;
    color: #7f8c8d;
}

.widget-inline-select,
.widget-inline-input {
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95em;
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 100%;
    margin-top: 0;
}

.widget-inline-select:focus,
.widget-inline-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.widget-inline-radio-group {
    display: flex;
    gap: 12px;
    padding: 4px 0;
    margin-top: 0;
}

.widget-inline-radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border: 2px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    flex: 1;
    justify-content: center;
    font-weight: 500;
    color: #555;
}

.widget-inline-radio-label:hover {
    border-color: #3498db;
    background-color: #f8f9fa;
}

.widget-inline-radio-label input[type="radio"] {
    margin: 0;
    cursor: pointer;
}

.widget-inline-radio-label input[type="radio"]:checked+span {
    color: #3498db;
    font-weight: 600;
}

.widget-inline-radio-label:has(input[type="radio"]:checked) {
    border-color: #3498db;
    background-color: #e3f2fd;
}

.widget-inline-send-btn {
    padding: 10px 18px;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 4px;
}

.widget-inline-send-btn:hover {
    background: linear-gradient(135deg, #2980b9 0%, #21618c 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}


.widget-inline-send-btn:active {
    transform: translateY(0);
}

.widget-inline-send-btn i {
    font-size: 1.1em;
}

/* ===========================================
   FRAGMENT COLOR PICKER STYLING
   =========================================== */

.text-fragment-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.fragment-text {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95em;
}

.fragment-color {
    width: 60px;
    height: 38px;
    border: 2px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
}

.fragment-color:hover {
    border-color: #3498db;
    transform: scale(1.05);
}

.fragment-color::-webkit-color-swatch-wrapper {
    padding: 0;
}

.fragment-color::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}

.fragment-color::-moz-color-swatch {
    border: none;
    border-radius: 4px;
}

/* ===========================================
   MODAL HEADER ACTIONS
   =========================================== */

.modal-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Fix for Templates Modal Z-Index - Ensure it appears above Advanced Config Modal */
#templates_modal {
    z-index: 1100 !important;
}
/* Templates Modal Z-Index Fix */
#templates_modal.modal-overlay { z-index: 1100 !important; }

/* Modern Toggle Switch - Form Context */
.toggle-switch-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 12px 0;
    padding: 10px 14px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.toggle-switch-container:hover {
    background: #fff;
    border-color: #ced4da;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    transform: translateY(-1px);
}

.toggle-switch {
    position: relative;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e0;
    transition: .3s cubic-bezier(0.4, 0.0, 0.2, 1);
    border-radius: 34px;
}

.toggle-switch-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s cubic-bezier(0.4, 0.0, 0.2, 1);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.toggle-switch input:checked + .toggle-switch-slider {
    background: linear-gradient(135deg, #2c5aa0 0%, #273c75 100%);
}

.toggle-switch input:checked + .toggle-switch-slider:before {
    transform: translateX(22px);
}

.toggle-switch-label {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.toggle-switch-text {
    font-weight: 600;
    color: #495057;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toggle-switch-subtext {
    font-size: 11px;
    color: #868e96;
    margin-top: 3px;
    line-height: 1.3;
}
