/*
 * RSC SE Admin · mismo estilo que el RSC SE Portal (copiado de su layout
 * resources/views/components/layouts/app.blade.php, sin las insignias de Formación).
 * Tokens --skf-* de skf.css: guía de marca SKF (Brand Hub + Design System).
 * Si cambia el estilo del portal, copiarlo aquí también para que las dos webs sean iguales.
 */
:root {
            /* Nombres de siempre del portal, ahora con los tokens SKF (public/css/skf.css). */
            --bg-main: var(--skf-bg-color-base-secondary);
            --bg-white: var(--skf-bg-color-base-primary);
            --bg-tint: var(--skf-bg-color-base-tertiary);
            --text-dark: var(--skf-text-color-base-primary);
            --text-mid: var(--skf-text-color-base-secondary);
            --text-muted: var(--skf-text-color-base-tertiary);
            --blue: var(--skf-bg-color-brand-primary);
            --blue-dark: var(--skf-bg-color-brand-pressed);
            --blue-light: var(--skf-bg-color-info-primary);
            --navy: var(--skf-bg-color-brand-secondary);
            --navy-2: var(--skf-bg-color-brand-secondary);
            --navy-line: rgba(255,255,255,.2);
            --on-navy: #fff;
            --on-navy-muted: var(--skf-bg-color-info-primary);
            --red: var(--skf-bg-color-error-primary);
            --red-light: var(--skf-bg-color-error-light);
            --amber: var(--skf-text-color-warning-primary);
            --amber-sm: var(--skf-text-color-warning-primary);
            --amber-light: var(--skf-bg-color-warning-primary);
            --green: var(--skf-text-color-success-primary);
            --green-light: var(--skf-bg-color-success-primary);
            --line: var(--skf-border-color-base-subtle);
            --line-strong: var(--skf-border-color-base-secondary);
            --radius: var(--skf-radius-md);
            --font-brand: var(--skf-font-family-sans);
            --font-display: var(--skf-font-family-display);
            --font-ui: var(--skf-font-family-sans);
            /* Barra lateral: tema claro del Design System (fondo blanco, texto negro, activo en azul SKF). */
            --side-bg: var(--skf-bg-color-base-primary);
            --side-fg: var(--skf-text-color-base-primary);
            --side-muted: var(--skf-text-color-base-tertiary);
            --side-line: var(--skf-border-color-base-subtle);
            --side-hover: var(--skf-bg-color-base-hover);
        }

        /* El portal solo tiene tema claro: sin esto, Edge/Chrome con Windows en modo oscuro pintan
           las listas de los <select> en oscuro y las opciones (texto oscuro) no se ven. */
        :root { color-scheme: light; }
        * { box-sizing: border-box; }
        body { margin: 0; background: var(--bg-main); color: var(--text-dark); font-family: var(--font-ui); }
        a { color: inherit; text-decoration: none; }
        button, input, select, textarea { font: inherit; }

        .shell { min-height: 100vh; display: grid; grid-template-columns: 264px 1fr; }
        /* Plegado de la barra lateral para ganar espacio */
        .nav-collapse-btn { position: absolute; top: 20px; right: 14px; width: 28px; height: 28px; border: 0; border-radius: var(--radius); background: transparent; color: var(--side-fg); cursor: pointer; font-size: 16px; line-height: 1; display: grid; place-items: center; }
        .nav-collapse-btn:hover { background: var(--side-hover); }
        .nav-reopen { position: fixed; top: 14px; left: 14px; z-index: 60; display: none; width: 38px; height: 38px; border-radius: var(--radius); border: 1px solid var(--line-strong); background: #fff; color: var(--text-dark); cursor: pointer; font-size: 17px; }
        body.nav-collapsed .shell { grid-template-columns: 1fr; }
        body.nav-collapsed .sidebar { display: none; }
        body.nav-collapsed .nav-reopen { display: grid; place-items: center; }
        body.nav-collapsed .content { padding-left: 62px; }
        @media print { .nav-reopen, .nav-collapse-btn { display: none !important; } }
        .sidebar { background: var(--side-bg); color: var(--side-fg); border-right: 1px solid var(--side-line); padding: 26px 18px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
        .brand { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
        .brand-mark { width: 46px; height: 46px; display: grid; place-items: center; flex: 0 0 auto; }
        .brand-mark img { width: 100%; height: 100%; object-fit: contain; }
        .brand-title { display: block; font: 700 20px/1 var(--font-brand); color: var(--text-dark); }
        .brand-subtitle { display: block; color: var(--text-muted); font-size: 12px; margin-top: 4px; }
        .sidebar .brand-title { color: var(--side-fg); }
        .sidebar .brand-subtitle { color: var(--side-muted); }
        .nav { display: grid; gap: 2px; }
        .nav-section { display: grid; gap: 2px; }
        .nav-section + .nav-section { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--side-line); }
        .nav-label { color: var(--side-muted); font-size: 12px; font-weight: 500; padding: 0 12px 4px; display: flex; align-items: center; gap: 7px; }
        .nav a, .nav button { width: 100%; border: 0; background: transparent; border-radius: var(--radius); color: var(--side-fg); display: flex; align-items: center; gap: 10px; padding: 9px 12px; cursor: pointer; text-align: left; font-size: 14px; font-weight: 400; }
        .nav a:hover, .nav button:hover { background: var(--side-hover); }
        .nav a.active { background: var(--blue); color: #fff; font-weight: 500; }
        .nav a.disabled { color: var(--side-muted); cursor: not-allowed; opacity: .72; }
        .nav a.disabled:hover { background: transparent; color: var(--side-muted); }
        .nav-badge-hot { background: var(--red) !important; color: #fff !important; border-radius: var(--skf-radius-round) !important; font-size: 11px !important; padding: 2px 7px !important; }
        .nav-badge { margin-left: auto; font-size: 11px; font-weight: 500; background: var(--bg-tint); color: var(--text-mid); border-radius: var(--skf-radius-sm); padding: 2px 6px; }
        .nav a.active .nav-badge { background: rgba(255,255,255,.2); color: #fff; }
        .nav-icon { width: 18px; height: 18px; flex: 0 0 auto; }
        .logout-form { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--side-line); }
        .logout-button { color: var(--side-muted) !important; }
        .logout-button:hover { color: var(--skf-text-color-error-primary) !important; background: var(--red-light) !important; }
        .global-language-form { display: grid; gap: 7px; margin: 0 0 22px; }
        .global-language-form label { color: var(--side-muted); font-size: 12px; font-weight: 500; }
        .global-language-form select { width: 100%; border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 9px 11px; background: #fff; color: var(--side-fg); }
        .global-language-form select option { color: var(--text-dark); }
        .content { padding: 36px; }
        .topbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 28px; }
        /* Sentence case y texto negro (Brand Hub); pesos y alturas de línea de los tokens de titular del Design System. */
        .eyebrow { color: var(--text-mid); font-size: 13px; font-weight: 500; margin-bottom: 8px; }
        h1, h2, h3 { font-family: var(--font-brand); margin: 0; letter-spacing: 0; font-weight: 500; }
        h1 { font-size: clamp(30px, 4vw, 40px); line-height: 1.15; }
        h2 { font-size: 26px; line-height: 1.15; }
        h3 { font-size: 20px; line-height: 1.3; }
        /* SKF Display solo para el titular principal de portada (login, inicio). */
        .display-title { font-family: var(--font-display); font-weight: 700; line-height: 1.1; }
        .muted { color: var(--text-muted); }
        .grid { display: grid; gap: 18px; }
        .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
        .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
        .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
        .card { background: var(--bg-white); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
        .stat { display: grid; gap: 8px; }
        /* Cifras destacadas en Display Light (Brand Hub, Typography: "data emphasis"). */
        .stat-value { font: 300 34px/1.1 var(--font-display); color: var(--text-dark); }
        .stat-label { color: var(--text-muted); font-size: 13px; }
        .tag { display: inline-flex; align-items: center; border-radius: var(--skf-radius-sm); padding: 3px 8px; font-size: 13px; font-weight: 500; }
        .tag-blue { background: var(--skf-bg-color-info-primary); color: var(--skf-text-color-info-primary); }
        .tag-green { background: var(--skf-bg-color-success-primary); color: var(--skf-text-color-success-primary); }
        .tag-amber { background: var(--skf-bg-color-warning-primary); color: var(--skf-text-color-warning-primary); }
        .tag-red { background: var(--skf-bg-color-error-light); color: var(--skf-text-color-error-primary); }
        .tag-teal { background: #D9F2F0; color: #276770; }
        .tag-slate { background: var(--bg-tint); color: var(--text-mid); }
        .btn { border: 1px solid transparent; border-radius: var(--radius); padding: 10px 16px; font-weight: 500; cursor: pointer; display: inline-flex; justify-content: center; align-items: center; gap: 8px; }
        .btn-primary { background: var(--blue); color: white; }
        .btn-primary:hover { background: var(--skf-bg-color-brand-hover); }
        .btn-secondary { background: #fff; color: var(--text-dark); border-color: var(--skf-border-color-base-primary); }
        .btn-secondary:hover { background: var(--skf-bg-color-base-hover); }
        .form { display: grid; gap: 14px; }
        .field { display: grid; gap: 7px; }
        .field label { color: var(--text-dark); font-size: 14px; font-weight: 500; }
        .field input, .field select, .field textarea { width: 100%; border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 10px 12px; background: white; color: var(--text-dark); }
        .field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--blue); outline-offset: -1px; border-color: var(--blue); }
        .field select option, .field select optgroup { background: #fff; color: var(--text-dark); }
        .alert { border-radius: var(--radius); padding: 12px 14px; margin-bottom: 18px; font-size: 14px; }
        .alert-ok { background: var(--green-light); color: var(--skf-text-color-success-primary); border: 1px solid var(--skf-text-color-success-primary); }
        .alert-error { background: var(--red-light); color: var(--skf-text-color-error-primary); border: 1px solid var(--skf-text-color-error-primary); }
        .progress { height: 8px; background: var(--bg-tint); border-radius: var(--skf-radius-round); overflow: hidden; }
        .progress span { display: block; height: 100%; background: var(--blue); border-radius: inherit; }
        .module-card { border-top: 4px solid var(--blue); min-height: 190px; display: flex; flex-direction: column; justify-content: space-between; }
        .module-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
        .auth-page { min-height: 100vh; display: grid; grid-template-columns: 1fr 480px; }
        .auth-hero { padding: 54px; display: flex; flex-direction: column; justify-content: space-between; }
        .auth-panel { background: white; border-left: 1px solid var(--line); padding: 54px; display: flex; align-items: center; }
        .auth-panel > div { width: 100%; }
        .language-row { display: flex; gap: 8px; flex-wrap: wrap; }
        .language-row span { border: 1px solid var(--line-strong); background: white; color: var(--text-mid); border-radius: var(--skf-radius-sm); padding: 5px 9px; font-size: 13px; font-weight: 500; }
        .profile-hero { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; }
        .avatar { width: 82px; height: 82px; border-radius: 50%; display: grid; place-items: center; background: var(--blue); color: white; font: 500 24px var(--font-brand); }
        .detail-list { display: grid; gap: 12px; }
        .detail-row { display: grid; grid-template-columns: 150px 1fr; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
        .detail-row:last-child { border-bottom: 0; padding-bottom: 0; }
        .detail-label { color: var(--text-muted); font-size: 13px; font-weight: 500; }
        .toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-main); }
        .actions-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
        .btn-small { padding: 8px 10px; font-size: 12px; }
        .table-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
        .table-wrap { width: 100%; overflow-x: auto; }
        .data-table { width: 100%; border-collapse: collapse; min-width: 720px; }
        .data-table th { color: var(--text-dark); font-size: 13px; font-weight: 500; text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line-strong); }
        .data-table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; color: var(--text-dark); }
        .data-table tr:last-child td { border-bottom: 0; }
        [readonly] { background: var(--bg-main) !important; color: var(--text-muted) !important; }
        @media (max-width: 900px) {
            .shell { grid-template-columns: 1fr; }
            .sidebar { position: static; height: auto; }
            .content { padding: 22px; }
            .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
            .profile-hero, .detail-row { grid-template-columns: 1fr; }
            .auth-page { grid-template-columns: 1fr; }
            .auth-panel { border-left: 0; border-top: 1px solid var(--line); }
        }

/* ---- Solo admin (mismos tokens) ---- */
.content { max-width: 1280px; }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
a.card { display: block; }
a.card:hover { border-color: var(--blue); }
a.card h3 { color: var(--blue); }
.card p { margin: 6px 0 0; }
.card-foot { margin-top: 14px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--text-muted); }
.section-title { margin: 32px 0 14px; }
.data-table td.num, .data-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.checks { display: grid; gap: 0; }
.checks label { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; padding: 10px 0; border-bottom: 1px solid var(--line); }
.checks label small { display: block; color: var(--text-mid); font-size: 13px; }
.hint { color: var(--text-mid); font-size: 13px; }
.empty { color: var(--text-mid); padding: 22px; background: var(--bg-white); border: 1px solid var(--line); border-radius: var(--radius); }
.alert ul { margin: 0; padding-left: 18px; }
input[type=checkbox] { accent-color: var(--blue); }
.auth-languages { display: flex; gap: 8px; flex-wrap: wrap; }
.auth-languages a { border: 1px solid var(--line-strong); background: #fff; color: var(--text-mid); border-radius: var(--skf-radius-sm); padding: 5px 9px; font-size: 13px; font-weight: 500; }
.auth-languages a.active { background: var(--blue); border-color: var(--blue); color: #fff; }
form.inline { display: inline; }
