@import '_content/Microsoft.FluentUI.AspNetCore.Components/css/reboot.css';
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

/* ============================================================
   TOKENS GLOBALES — ÓpticaPro Design System
   ============================================================ */
:root {
    --op-font: 'Plus Jakarta Sans', 'Segoe UI Variable', 'Segoe UI', sans-serif;
    /* Colores primarios */
    --op-teal: #c77ad3;
    --op-blue: #090979;
    --op-gradient: linear-gradient(135deg, #c77ad3, #090979);
    /* Fondo general */
    --op-bg: linear-gradient(135deg, #e8d6f5 0%, #d4d8f8 50%, #c8d9ff 100%);
    /* Superficies glass */
    --op-surface: rgba(255, 255, 255, 0.55);
    --op-surface-card: rgba(255, 255, 255, 0.62);
    --op-surface-input: rgba(255, 255, 255, 0.70);
    --op-border: rgba(255, 255, 255, 0.85);
    /* Tipografía */
    --op-ink-1: #090979;
    --op-ink-2: #5a5a9a;
    --op-ink-3: #8a8fbf;
    --op-ink-4: #b0b8d8;
    /* Radios */
    --op-radius-lg: 16px;
    --op-radius-md: 14px;
    --op-radius-sm: 10px;
    --op-radius-xs: 8px;
    /* Sombra */
    --op-shadow: 0 8px 32px rgba(9, 9, 121, 0.08);
}

/* ============================================================
   RESET BASE
   ============================================================ */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    --body-font: var(--op-font);
    font-family: var(--op-font);
    font-size: var(--type-ramp-base-font-size);
    line-height: var(--type-ramp-base-line-height);
    margin: 0;
    background: var(--op-bg);
    min-height: 100dvh;
    color: var(--op-ink-1);
}

/* ============================================================
   LAYOUT PRINCIPAL
   ============================================================ */
.navmenu-icon {
    display: none;
}

.main {
    min-height: calc(100dvh - 86px);
    color: var(--neutral-foreground-rest);
    align-items: stretch !important;
}

.body-content {
    align-self: stretch;
    height: 100dvh !important;
    display: flex;
}

.content {
    padding: 1rem 1.5rem;
    align-self: stretch !important;
    width: 100%;
}

.manage {
    width: 100dvw;
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
    background: var(--op-surface);
    backdrop-filter: blur(8px);
    border-top: 1px solid var(--op-border);
    color: var(--op-ink-2);
    align-items: center;
    padding: 10px;
    font-family: var(--op-font);
    font-size: 11px;
}

    footer a {
        color: var(--op-ink-2);
        text-decoration: none;
        transition: color 0.15s;
    }

        footer a:focus {
            outline: 1px dashed;
            outline-offset: 3px;
        }

        footer a:hover {
            color: var(--op-teal);
            text-decoration: underline;
        }

/* ============================================================
   TOPBAR DE PÁGINA
   ============================================================ */
.op-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--op-surface);
    border: 1px solid var(--op-border);
    border-radius: var(--op-radius-lg);
    padding: 14px 20px;
    margin-bottom: 14px;
    backdrop-filter: blur(8px);
    box-shadow: var(--op-shadow);
    animation: op-fade-up 0.25s ease both;
}

.op-topbar-left .op-greet {
    font-size: 10px;
    color: var(--op-teal);
    font-weight: 500;
    margin-bottom: 2px;
}

.op-topbar-left .op-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--op-ink-1);
    letter-spacing: -0.03em;
}

.op-topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ============================================================
   STAT CHIP
   ============================================================ */
.op-stat-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid var(--op-border);
    border-radius: var(--op-radius-sm);
    padding: 6px 12px;
    font-size: 11px;
    color: var(--op-ink-2);
}

    .op-stat-chip strong {
        color: var(--op-ink-1);
        font-weight: 700;
    }

/* ============================================================
   BUSCADOR
   ============================================================ */
.op-search {
    display: flex;
    align-items: center;
    gap: 7px;
    background: var(--op-surface-input);
    border: 1px solid var(--op-border);
    border-radius: var(--op-radius-sm);
    padding: 7px 12px;
    font-size: 11px;
    color: var(--op-ink-3);
    min-width: 260px;
    transition: border-color 0.15s;
}

    .op-search:focus-within {
        border-color: var(--op-teal);
    }

    .op-search input {
        border: none;
        background: transparent;
        outline: none;
        font-family: var(--op-font);
        font-size: 11px;
        color: var(--op-ink-1);
        width: 100%;
    }

        .op-search input::placeholder {
            color: var(--op-ink-4);
        }

/* ============================================================
   BOTONES
   ============================================================ */
.op-btn {
    font-family: var(--op-font);
    font-size: 11px;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: var(--op-radius-sm);
    background: var(--op-gradient);
    color: #fff;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    transition: opacity 0.15s;
    text-decoration: none;
}

    .op-btn:hover:not(:disabled) {
        opacity: 0.88;
    }

    .op-btn:disabled {
        opacity: 0.4;
        cursor: not-allowed;
    }

.op-btn-ghost {
    background: var(--op-surface);
    border: 1px solid rgba(9, 9, 121, 0.12);
    color: var(--op-ink-2);
}

    .op-btn-ghost:disabled {
        opacity: 0.35;
        cursor: not-allowed;
    }

.op-btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

/* ============================================================
   CARDS
   ============================================================ */
.op-card {
    background: var(--op-surface-card);
    border: 1px solid var(--op-border);
    border-radius: var(--op-radius-md);
    padding: 15px 17px;
    backdrop-filter: blur(8px);
    box-shadow: var(--op-shadow);
    animation: op-fade-up 0.3s ease both 0.05s;
}

.op-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.op-card-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--op-ink-1);
}

.op-card-count,
.op-card-sub {
    font-size: 11px;
    color: var(--op-ink-3);
    font-weight: 500;
}

.op-card-link {
    font-size: 11px;
    color: var(--op-teal);
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
}

    .op-card-link:hover {
        text-decoration: underline;
    }

/* ============================================================
   TABLA
   ============================================================ */
.op-table {
    width: 100%;
    border-collapse: collapse;
}

    .op-table th {
        font-size: 9px;
        color: var(--op-ink-4);
        font-weight: 600;
        text-align: left;
        padding: 0 8px 10px 8px;
        border-bottom: 1px solid rgba(9, 9, 121, 0.07);
        letter-spacing: 0.06em;
        text-transform: uppercase;
        white-space: nowrap;
    }

    .op-table td {
        font-size: 11px;
        color: var(--op-ink-1);
        padding: 10px 8px;
        border-bottom: 1px solid rgba(9, 9, 121, 0.05);
        vertical-align: middle;
    }

    .op-table tbody tr:last-child td {
        border-bottom: none;
    }

    .op-table tbody tr {
        cursor: pointer;
        transition: background 0.12s;
    }

        .op-table tbody tr:hover td {
            background: rgba(199, 122, 211, 0.04);
        }

/* Modificadores de celda */
.td-muted {
    font-size: 10px;
    color: var(--op-ink-3);
}

.td-code {
    font-size: 10px;
    color: var(--op-ink-3);
    font-weight: 500;
    font-family: monospace;
}

.td-name {
    font-weight: 600;
    color: var(--op-ink-1);
}

.td-price {
    font-weight: 700;
    color: var(--op-teal);
    font-size: 12px;
}

.td-right {
    text-align: right;
}

.td-center {
    text-align: center;
}

/* ============================================================
   PILLS / BADGES
   ============================================================ */
.op-pill {
    font-size: 9px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 20px;
    white-space: nowrap;
    display: inline-block;
    background: rgba(9, 9, 121, 0.06);
    color: #5a5a9a;
}

.op-pill--green {
    background: #d1fae5;
    color: #065f46;
}

.op-pill--yellow {
    background: #fef3c7;
    color: #92400e;
}

.op-pill--blue {
    background: #dbeafe;
    color: #1e40af;
}

.op-pill--red {
    background: #fee2e2;
    color: #991b1b;
}

.op-pill--gray {
    background: rgba(9, 9, 121, 0.06);
    color: #5a5a9a;
}

/* ============================================================
   PAGINACIÓN
   ============================================================ */
.op-pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    padding-top: 12px;
    border-top: 1px solid rgba(9, 9, 121, 0.06);
    margin-top: 4px;
}

.op-page-info {
    font-size: 10px;
    color: var(--op-ink-3);
    font-weight: 500;
    margin-right: auto;
}

.op-page-btn {
    width: 28px;
    height: 28px;
    border-radius: var(--op-radius-xs);
    border: 1px solid rgba(9, 9, 121, 0.10);
    background: var(--op-surface);
    color: var(--op-ink-2);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--op-font);
    transition: all 0.12s;
}

    .op-page-btn:hover:not(:disabled) {
        background: var(--op-gradient);
        color: #fff;
        border-color: transparent;
    }

    .op-page-btn.active {
        background: var(--op-gradient);
        color: #fff;
        border-color: transparent;
    }

    .op-page-btn:disabled {
        opacity: 0.35;
        cursor: not-allowed;
    }

/* ============================================================
   ESTADO VACÍO
   ============================================================ */
.op-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--op-ink-4);
    font-size: 12px;
}

.op-empty-icon {
    font-size: 32px;
    margin-bottom: 10px;
    display: block;
}

/* ============================================================
   PROGRESS BARS
   ============================================================ */
.op-progress {
    margin-bottom: 10px;
}

    .op-progress:last-child {
        margin-bottom: 0;
    }

.op-progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.op-progress-label {
    font-size: 11px;
    color: var(--op-ink-1);
    font-weight: 500;
}

.op-progress-pct {
    font-size: 10px;
    font-weight: 700;
}

.op-progress-track {
    height: 6px;
    border-radius: 10px;
    background: rgba(9, 9, 121, 0.07);
    overflow: hidden;
}

.op-progress-fill {
    height: 100%;
    border-radius: 10px;
    background: var(--op-gradient);
}

/* ============================================================
   AGENDA ROWS
   ============================================================ */
.op-agenda-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(9, 9, 121, 0.05);
}

    .op-agenda-row:last-child {
        border-bottom: none;
    }

.op-agenda-time {
    font-size: 10px;
    color: var(--op-ink-3);
    min-width: 38px;
    font-weight: 500;
}

.op-agenda-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.op-agenda-name {
    font-size: 12px;
    font-weight: 500;
    color: var(--op-ink-1);
    flex: 1;
}

/* ============================================================
   AVATARES
   ============================================================ */
.op-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
    background: var(--op-gradient);
    color: #fff;
}

/* ============================================================
   BANNER CTA
   ============================================================ */
.op-banner {
    border-radius: var(--op-radius-md);
    padding: 16px 18px;
    background: linear-gradient(135deg, #8a1fa0 0%, #090979 100%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.op-banner-label {
    font-size: 9px;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.op-banner-title {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.op-banner-btn {
    font-family: var(--op-font);
    font-size: 10px;
    font-weight: 700;
    padding: 8px 14px;
    border-radius: var(--op-radius-sm);
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
}

    .op-banner-btn:hover {
        background: rgba(255, 255, 255, 0.28);
    }

/* ============================================================
   STAT CARD (KPI)
   ============================================================ */
.op-stat-card {
    background: var(--op-surface-card);
    border-radius: var(--op-radius-md);
    border: 1px solid var(--op-border);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--op-shadow);
}

.op-stat-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.op-stat-label {
    font-size: 9px;
    font-weight: 600;
    color: var(--op-ink-3);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 3px;
}

.op-stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--op-ink-1);
    letter-spacing: -0.02em;
    line-height: 1;
}

.op-stat-delta {
    font-size: 10px;
    font-weight: 500;
    margin-top: 3px;
}

/* ============================================================
   GRIDS DE LAYOUT
   ============================================================ */
.op-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.op-grid-3 {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 12px;
}

.op-grid-3c {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.op-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

/* ============================================================
   FORMULARIO / INPUTS
   ============================================================ */
.op-field {
    margin-bottom: 14px;
}

.op-label {
    font-size: 9px;
    font-weight: 600;
    color: var(--op-ink-3);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 5px;
    display: block;
}

.op-input {
    width: 100%;
    padding: 9px 12px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(166, 196, 255, 0.50);
    border-radius: var(--op-radius-sm);
    font-family: var(--op-font);
    font-size: 12px;
    color: var(--op-ink-1);
    outline: none;
    transition: border-color 0.15s;
}

    .op-input:focus {
        border-color: var(--op-teal);
    }

/* ============================================================
   NUEVA FILA (compatibilidad código existente)
   ============================================================ */
.nueva-fila {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

/* ============================================================
   DATA GRID TABLA (compatibilidad FluentDataGrid)
   ============================================================ */
.data-grid-table {
    border-radius: var(--op-radius-md) !important;
    border: 1px solid var(--op-border) !important;
    background: var(--op-surface-card) !important;
    backdrop-filter: blur(8px);
    box-shadow: var(--op-shadow);
}

/* ============================================================
   ANIMACIONES
   ============================================================ */
@keyframes op-fade-up {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================
   BLAZOR — ERRORES Y CARGA
   ============================================================ */
.alert {
    border: 1px dashed var(--accent-fill-rest);
    padding: 5px;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    margin: 20px 0;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbmsiPjwvc3ZnPg==) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::before {
        content: "An error has occurred. "
    }

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: var(--op-teal);
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

code {
    color: #c02d76;
}

/* ============================================================
   BOTONES FLUENT — OVERRIDES
   ============================================================ */
.btn-delete-grid::part(control) {
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.btn-delete-grid:hover::part(control) {
    background-color: #d13438 !important;
    border-radius: 4px;
}

.btn-delete-grid:hover {
    --error: white;
}

.btn-danger {
    --neutral-fill-rest: #d13438;
    --neutral-fill-hover: #b1232f;
    --neutral-fill-active: #a21d29;
    --neutral-foreground-rest: white;
    --neutral-foreground-hover: white;
    --neutral-foreground-active: white;
}

.btn-motor-refractivo {
    --neutral-fill-rest: #A21BDE;
    --neutral-fill-hover: #8D06C9;
    --neutral-fill-active: #690699;
    --neutral-foreground-rest: white;
    --neutral-foreground-hover: white;
    --neutral-foreground-active: white;
}

.btn-lente-contacto {
    --neutral-fill-rest: #2cb20a;
    --neutral-fill-hover: #209403;
    --neutral-fill-active: #1d7e05;
    --neutral-foreground-rest: white;
    --neutral-foreground-hover: white;
    --neutral-foreground-active: white;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 600px) {
    .header-gutters {
        margin: 0.5rem 3rem 0.5rem 1.5rem !important;
    }

    [dir="rtl"] .header-gutters {
        margin: 0.5rem 1.5rem 0.5rem 3rem !important;
    }

    .main {
        flex-direction: column !important;
        row-gap: 0 !important;
    }

    nav.sitenav {
        width: 100%;
        height: 100%;
    }

    #main-menu {
        width: 100% !important;
    }

        #main-menu > div:first-child:is(.expander) {
            display: none;
        }

    .navmenu {
        width: 100%;
    }

    #navmenu-toggle {
        appearance: none;
    }

        #navmenu-toggle ~ nav {
            display: none;
        }

        #navmenu-toggle:checked ~ nav {
            display: block;
        }

    .navmenu-icon {
        cursor: pointer;
        z-index: 10;
        display: block;
        position: absolute;
        top: 15px;
        left: unset;
        right: 20px;
        width: 20px;
        height: 20px;
        border: none;
    }

    [dir="rtl"] .navmenu-icon {
        left: 20px;
        right: unset;
    }

    .op-topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .op-topbar-right {
        flex-wrap: wrap;
        width: 100%;
    }

    .op-search {
        min-width: 0;
        flex: 1;
    }

    .op-grid-2,
    .op-grid-3,
    .op-grid-3c,
    .op-grid-4 {
        grid-template-columns: 1fr;
    }
}
