/* AutrixWeb — widgets.css: Galería de widgets, modales de widget, ESPN, toggles y tema.
 * Rango contiguo 5909-8771 del antiguo styles.css: el orden relativo
 * se conserva para no alterar la cascada. */
/* ========================================
   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;
}

/* Fila única de ancho completo (texto rápido): la tarjeta reparte
   sus campos en horizontal con salto de línea */
.widgets-gallery-single {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    margin-top: 20px;
}

.widgets-gallery-single .widget-card-inline-form {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px 16px;
}

.widgets-gallery-single .widget-card-header-inline {
    flex: 1 1 100%;
    margin-bottom: 0;
}

.widgets-gallery-single label.widget-inline-label {
    flex: 2 1 220px;
    margin-top: 0 !important;
    min-width: 0;
}

.widgets-gallery-single .widget-inline-colors,
.widgets-gallery-single .widget-inline-expire,
.widgets-gallery-single label.timer-repeat-label,
.widgets-gallery-single .widget-card-inline-form > label {
    margin-top: 0 !important;
    margin-bottom: 0;
    flex: 0 1 auto;
    min-width: 0;
}

.widgets-gallery-single .widget-inline-hint {
    flex: 1 1 100%;
}

.widgets-gallery-single .widget-inline-send-btn {
    flex: 0 0 auto;
    margin-top: 0;
    align-self: flex-end;
}

.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 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);
}

.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;
}

.alarm-repeat-section {
    background: #f8f9fa;
    padding: 16px;
    border-radius: 8px;
    margin: 16px 0;
}

/* ============================================
   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-info {
    flex: 1;
}

/* 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;
}

/* 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);
    /* Visibilidad via .is-hidden + setHidden() (el display:none rompía el
       mostrar: quitar is-hidden no bastaba para anularlo). */
}

.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;
}


/* ===========================================
   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-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-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;
}

/* ===========================================
   TEXT WIDGET — color pickers + expiration
   =========================================== */

.widget-inline-colors {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.widget-inline-color-label {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 6px 8px;
    border: 1px solid #e0e6ea;
    border-radius: 6px;
    background-color: #f8fafc;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    margin-bottom: 0;
}

.widget-inline-color-label:hover {
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

.widget-inline-color-label span {
    font-size: 0.82em;
    font-weight: 600;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 6px;
}

.widget-inline-color-label span i {
    color: #64748b;
    font-size: 0.95em;
}

.widget-inline-color-input {
    width: 100%;
    height: 30px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    cursor: pointer;
    padding: 2px;
    background-color: #fff;
    margin: 0;
}

.widget-inline-color-input:hover {
    border-color: #3498db;
}

.widget-inline-color-input::-webkit-color-swatch-wrapper {
    padding: 0;
}

.widget-inline-color-input::-webkit-color-swatch {
    border: none;
    border-radius: 3px;
}

.widget-inline-color-input::-moz-color-swatch {
    border: none;
    border-radius: 3px;
}

.widget-inline-expire {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border: 1px solid #e0e6ea;
    border-radius: 6px;
    background-color: #f8fafc;
    flex-wrap: wrap;
}

.widget-inline-expire-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: 600;
    color: #475569;
    margin: 0;
    flex: 1;
    min-width: 0;
}

.widget-inline-expire-toggle input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
    accent-color: #3498db;
}

.widget-inline-expire-toggle span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.widget-inline-expire-toggle span i {
    color: #64748b;
    font-size: 0.95em;
}

.widget-inline-expire-input {
    width: 64px;
    padding: 4px 6px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 0.9em;
    text-align: center;
    background-color: #fff;
    transition: border-color 0.2s, box-shadow 0.2s, opacity 0.2s;
    margin: 0;
}

.widget-inline-expire-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

.widget-inline-expire-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.widget-inline-expire-unit {
    font-size: 0.85em;
    color: #64748b;
    font-weight: 600;
}

/* ===========================================
   FRAGMENT COLOR PICKER 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-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-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;
}

/* ===========================================
   TEXT WIDGET — color pickers + expiration
   =========================================== */

.widget-inline-colors {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.widget-inline-color-label {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 6px 8px;
    border: 1px solid #e0e6ea;
    border-radius: 6px;
    background-color: #f8fafc;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    margin-bottom: 0;
}

.widget-inline-color-label:hover {
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

.widget-inline-color-label span {
    font-size: 0.82em;
    font-weight: 600;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 6px;
}

.widget-inline-color-label span i {
    color: #64748b;
    font-size: 0.95em;
}

.widget-inline-color-input {
    width: 100%;
    height: 30px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    cursor: pointer;
    padding: 2px;
    background-color: #fff;
    margin: 0;
}

.widget-inline-color-input:hover {
    border-color: #3498db;
}

.widget-inline-color-input::-webkit-color-swatch-wrapper {
    padding: 0;
}

.widget-inline-color-input::-webkit-color-swatch {
    border: none;
    border-radius: 3px;
}

.widget-inline-color-input::-moz-color-swatch {
    border: none;
    border-radius: 3px;
}

.widget-inline-expire {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border: 1px solid #e0e6ea;
    border-radius: 6px;
    background-color: #f8fafc;
    flex-wrap: wrap;
}

.widget-inline-expire-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: 600;
    color: #475569;
    margin: 0;
    flex: 1;
    min-width: 0;
}

.widget-inline-expire-toggle input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
    accent-color: #3498db;
}

.widget-inline-expire-toggle span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.widget-inline-expire-toggle span i {
    color: #64748b;
    font-size: 0.95em;
}

.widget-inline-expire-input {
    width: 64px;
    padding: 4px 6px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 0.9em;
    text-align: center;
    background-color: #fff;
    transition: border-color 0.2s, box-shadow 0.2s, opacity 0.2s;
    margin: 0;
}

.widget-inline-expire-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

.widget-inline-expire-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.widget-inline-expire-unit {
    font-size: 0.85em;
    color: #64748b;
    font-weight: 600;
}

/* ===========================================
   FRAGMENT COLOR PICKER STYLING
   =========================================== */

.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-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-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;
}

/* ===========================================
   TEXT WIDGET — color pickers + expiration
   =========================================== */

.widget-inline-colors {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.widget-inline-color-label {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 6px 8px;
    border: 1px solid #e0e6ea;
    border-radius: 6px;
    background-color: #f8fafc;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    margin-bottom: 0;
}

.widget-inline-color-label:hover {
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

.widget-inline-color-label span {
    font-size: 0.82em;
    font-weight: 600;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 6px;
}

.widget-inline-color-label span i {
    color: #64748b;
    font-size: 0.95em;
}

.widget-inline-color-input {
    width: 100%;
    height: 30px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    cursor: pointer;
    padding: 2px;
    background-color: #fff;
    margin: 0;
}

.widget-inline-color-input:hover {
    border-color: #3498db;
}

.widget-inline-color-input::-webkit-color-swatch-wrapper {
    padding: 0;
}

.widget-inline-color-input::-webkit-color-swatch {
    border: none;
    border-radius: 3px;
}

.widget-inline-color-input::-moz-color-swatch {
    border: none;
    border-radius: 3px;
}

.widget-inline-expire {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border: 1px solid #e0e6ea;
    border-radius: 6px;
    background-color: #f8fafc;
    flex-wrap: wrap;
}

.widget-inline-expire-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: 600;
    color: #475569;
    margin: 0;
    flex: 1;
    min-width: 0;
}

.widget-inline-expire-toggle input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
    accent-color: #3498db;
}

.widget-inline-expire-toggle span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.widget-inline-expire-toggle span i {
    color: #64748b;
    font-size: 0.95em;
}

.widget-inline-expire-input {
    width: 64px;
    padding: 4px 6px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 0.9em;
    text-align: center;
    background-color: #fff;
    transition: border-color 0.2s, box-shadow 0.2s, opacity 0.2s;
    margin: 0;
}

.widget-inline-expire-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

.widget-inline-expire-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.widget-inline-expire-unit {
    font-size: 0.85em;
    color: #64748b;
    font-weight: 600;
}

/* ===========================================
   FRAGMENT COLOR PICKER STYLING
   =========================================== */

.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-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-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;
}

/* ===========================================
   TEXT WIDGET — color pickers + expiration
   =========================================== */

.widget-inline-colors {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.widget-inline-color-label {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 6px 8px;
    border: 1px solid #e0e6ea;
    border-radius: 6px;
    background-color: #f8fafc;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    margin-bottom: 0;
}

.widget-inline-color-label:hover {
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

.widget-inline-color-label span {
    font-size: 0.82em;
    font-weight: 600;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 6px;
}

.widget-inline-color-label span i {
    color: #64748b;
    font-size: 0.95em;
}

.widget-inline-color-input {
    width: 100%;
    height: 30px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    cursor: pointer;
    padding: 2px;
    background-color: #fff;
    margin: 0;
}

.widget-inline-color-input:hover {
    border-color: #3498db;
}

.widget-inline-color-input::-webkit-color-swatch-wrapper {
    padding: 0;
}

.widget-inline-color-input::-webkit-color-swatch {
    border: none;
    border-radius: 3px;
}

.widget-inline-color-input::-moz-color-swatch {
    border: none;
    border-radius: 3px;
}

.widget-inline-expire {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border: 1px solid #e0e6ea;
    border-radius: 6px;
    background-color: #f8fafc;
    flex-wrap: wrap;
}

.widget-inline-expire-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: 600;
    color: #475569;
    margin: 0;
    flex: 1;
    min-width: 0;
}

.widget-inline-expire-toggle input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
    accent-color: #3498db;
}

.widget-inline-expire-toggle span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.widget-inline-expire-toggle span i {
    color: #64748b;
    font-size: 0.95em;
}

.widget-inline-expire-input {
    width: 64px;
    padding: 4px 6px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 0.9em;
    text-align: center;
    background-color: #fff;
    transition: border-color 0.2s, box-shadow 0.2s, opacity 0.2s;
    margin: 0;
}

.widget-inline-expire-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

.widget-inline-expire-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.widget-inline-expire-unit {
    font-size: 0.85em;
    color: #64748b;
    font-weight: 600;
}

/* ===========================================
   FRAGMENT COLOR PICKER STYLING
   =========================================== */

/* ===========================================
   MODAL HEADER ACTIONS
   =========================================== */

.widget-card-header-inline h4 {
    flex: 1;
    margin: 0;
    font-size: 1.1em;
    color: #2c3e50;
}

.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-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;
}

/* ===========================================
   TEXT WIDGET — color pickers + expiration
   =========================================== */

.widget-inline-colors {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.widget-inline-color-label {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 6px 8px;
    border: 1px solid #e0e6ea;
    border-radius: 6px;
    background-color: #f8fafc;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    margin-bottom: 0;
}

.widget-inline-color-label:hover {
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

.widget-inline-color-label span {
    font-size: 0.82em;
    font-weight: 600;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 6px;
}

.widget-inline-color-label span i {
    color: #64748b;
    font-size: 0.95em;
}

.widget-inline-color-input {
    width: 100%;
    height: 30px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    cursor: pointer;
    padding: 2px;
    background-color: #fff;
    margin: 0;
}

.widget-inline-color-input:hover {
    border-color: #3498db;
}

.widget-inline-color-input::-webkit-color-swatch-wrapper {
    padding: 0;
}

.widget-inline-color-input::-webkit-color-swatch {
    border: none;
    border-radius: 3px;
}

.widget-inline-color-input::-moz-color-swatch {
    border: none;
    border-radius: 3px;
}

.widget-inline-expire {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border: 1px solid #e0e6ea;
    border-radius: 6px;
    background-color: #f8fafc;
    flex-wrap: wrap;
}

.widget-inline-expire-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: 600;
    color: #475569;
    margin: 0;
    flex: 1;
    min-width: 0;
}

.widget-inline-expire-toggle input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
    accent-color: #3498db;
}

.widget-inline-expire-toggle span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.widget-inline-expire-toggle span i {
    color: #64748b;
    font-size: 0.95em;
}

.widget-inline-expire-input {
    width: 64px;
    padding: 4px 6px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 0.9em;
    text-align: center;
    background-color: #fff;
    transition: border-color 0.2s, box-shadow 0.2s, opacity 0.2s;
    margin: 0;
}

.widget-inline-expire-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

.widget-inline-expire-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.widget-inline-expire-unit {
    font-size: 0.85em;
    color: #64748b;
    font-weight: 600;
}

/* ===========================================
   FRAGMENT COLOR PICKER STYLING
   =========================================== */

/* ===========================================
   MODAL HEADER ACTIONS
   =========================================== */

/* Modern Toggle Switch - Form Context */
/* ============================================
   Modo de conexión LAN / Cloud (sidebar)
   ============================================ */
.mode-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px 0 15px;
}
.mode-badge {
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.mode-badge .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}
.mode-badge.lan {
    background: #e8f5e9;
    color: #2e7d32;
}
.mode-badge.cloud {
    background: #e3f2fd;
    color: #1565c0;
}
.mode-switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 24px;
    flex-shrink: 0;
    margin: 0;
}
.mode-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.mode-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #90caf9;
    border-radius: 24px;
    transition: all 0.2s ease;
}
.mode-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: all 0.2s ease;
}
.mode-switch input:checked + .mode-slider {
    background: #66bb6a;
}
.mode-switch input:checked + .mode-slider:before {
    transform: translateX(22px);
}

/* ============================================
   Puerta de entrada: landing + app bloqueada
   body.locked -> se ve la landing, se oculta la app.
   body.authed -> se ve la app, se oculta la landing.
   ============================================ */
body.locked .sidebar,
body.locked .main-content {
  display: none;
}
body.authed #view_landing {
  display: none;
}

.landing {
  min-height: 100vh;
  width: 100%;
  background: radial-gradient(1200px 600px at 15% -10%, #1d4ed8 0%, transparent 60%),
    radial-gradient(1000px 500px at 110% 10%, #7c3aed 0%, transparent 55%),
    linear-gradient(180deg, #0b1020 0%, #111a33 100%);
  color: #eef2ff;
  display: flex;
  justify-content: center;
  padding: 48px 20px 32px;
  box-sizing: border-box;
}
.landing-inner {
  width: 100%;
  max-width: 1020px;
}
.landing-hero {
  text-align: center;
  margin-bottom: 32px;
}
.landing-badge {
  display: inline-block;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.22);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 16px;
}
.landing-badge i {
  margin-right: 6px;
}
.beta-pill {
  display: inline-block;
  margin-left: 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  background: #f59e0b;
  color: #1c1005;
  border-radius: 999px;
  padding: 2px 9px;
  vertical-align: 1px;
}
.beta-banner {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: rgba(245, 158, 11, 0.14);
  border: 2px solid rgba(245, 158, 11, 0.8);
  color: #fde68a;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.55;
  margin: 14px auto 0;
  max-width: 640px;
  box-shadow: 0 8px 28px rgba(245, 158, 11, 0.25);
}
.beta-banner > i {
  font-size: 18px;
  color: #f59e0b;
  margin-top: 2px;
  flex-shrink: 0;
}
.landing-hero h1 {
  font-size: 44px;
  line-height: 1.1;
  margin: 0 0 12px;
  font-weight: 800;
}
.landing-hero h1 em {
  font-style: normal;
  background: linear-gradient(90deg, #60a5fa, #a78bfa, #f472b6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.landing-sub {
  font-size: 17px;
  color: #c7d2fe;
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.6;
}
.landing-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 28px;
  align-items: start;
}
.landing-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.landing-feature {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 14px;
  backdrop-filter: blur(4px);
}
.landing-feature i {
  font-size: 20px;
  color: #93c5fd;
  margin-top: 2px;
  min-width: 24px;
  text-align: center;
}
.landing-feature strong {
  display: block;
  font-size: 15px;
  margin-bottom: 2px;
}
.landing-feature span {
  font-size: 13px;
  color: #c7d2fe;
  line-height: 1.45;
}
.auth-card {
  background: #ffffff;
  color: #1f2937;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}
.auth-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.auth-tab {
  flex: 1;
  border: 1px solid #e5e7eb;
  background: #f3f4f6;
  border-radius: 8px;
  padding: 9px;
  font-weight: 700;
  cursor: pointer;
  color: #4b5563;
}
.auth-tab.active {
  background: #2c5aa0;
  border-color: #2c5aa0;
  color: #fff;
}
.auth-pane {
  display: none;
}
.auth-pane.active {
  display: block;
}
.auth-card label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 10px;
}
.auth-card input {
  margin-top: 4px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  box-sizing: border-box;
  width: 100%;
  padding: 10px;
}
.auth-submit {
  width: 100%;
  margin-top: 4px;
  padding: 11px;
  font-size: 15px;
}
.auth-links {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
  font-size: 13px;
}
.auth-links a {
  color: #2c5aa0;
  text-decoration: none;
}
.auth-links a:hover {
  text-decoration: underline;
}
.auth-note {
  display: block;
  margin-top: 10px;
  color: #6b7280;
  line-height: 1.5;
}
.auth-msg {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.5;
}
.auth-msg--error {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #b91c1c;
}
.auth-msg--ok {
  background: #f0fdf4;
  border: 1px solid #86efac;
  color: #15803d;
}
.landing-foot {
  text-align: center;
  margin-top: 28px;
  color: #93a0c4;
}
.sidebar-account {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 0;
  padding: 10px 15px;
  border-top: 1px solid #e5e7eb;
  font-size: 12px;
  color: #4b5563;
}
.sidebar-account > i {
  color: #2c5aa0;
  font-size: 16px;
}
.sidebar-account-email {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-logout {
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  padding: 4px;
  font-size: 14px;
}
.sidebar-logout:hover {
  background: none;
  color: #b91c1c;
}
body.locked .sidebar-account {
  display: none;
}
@media (max-width: 860px){
  .landing-grid {
    grid-template-columns: 1fr;
  }
  .landing-hero h1 {
    font-size: 32px;
  }
  .landing-features {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   AutrixWeb — Tema oscuro "landing" para la app
   Tokens compartidos con #view_landing.
   Bloque aditivo: pisa el tema claro anterior.
   ============================================ */
:root {
  --bg0: #0b1020;
  --bg1: #111a33;
  --panel: #0d1428;
  --card: rgba(255, 255, 255, 0.06);
  --card-solid: #151f3a;
  --card-border: rgba(255, 255, 255, 0.12);
  --ink: #eef2ff;
  --muted: #c7d2fe;
  --muted-dim: #93a0c4;
  --primary: #2c5aa0;
  --accent1: #60a5fa;
  --accent2: #a78bfa;
  --accent3: #f472b6;
  --ok: #22c55e;
  --warn: #f59e0b;
  --bad: #ef4444;
}

body.authed {
  background:
    radial-gradient(1200px 600px at 15% -10%, #1d4ed8 0%, transparent 60%),
    radial-gradient(1000px 500px at 110% 10%, #7c3aed 0%, transparent 55%),
    linear-gradient(180deg, var(--bg0) 0%, var(--bg1) 100%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}
