/* =========================================================
   VARIABLES DE MARCA - CAPSI / UA
   ========================================================= */
:root {
    --ua-red:       #c32424;
    --ua-red-hover: #cc0000;
    /* Rojo legible como TEXTO sobre superficie oscura; el --ua-red
       original se sigue usando para fondos y bordes. */
    --ua-red-text:  #ef6b6b;
    /* Neutro calido, no gris puro: es el fondo de todas las superficies
       oscuras del panel (body, cabeceras de tabla, badges) y asi quedan en la
       misma familia que el sidebar y la sala de teleconsulta. Misma
       luminancia que el #1a1a1a anterior, solo cambia el matiz. */
    --ua-black:     #1c1917;
    --ua-white:     #ffffff;   /* solo como TEXTO sobre rojo/oscuro */

    /* -----------------------------------------------------
       Superficies del panel.

       Son exactamente las de consulta.css: el panel y la
       teleconsulta tienen que verse del mismo producto, y la
       barra lateral queda sobre el mismo tipo de fondo en las
       dos (que era justo lo que las hacia ver distintas).
       ----------------------------------------------------- */
    --page-bg:      #1a1715;   /* fondo de pagina */
    --surface:      #231f1c;   /* tarjetas, tablas, paneles */
    --surface-2:    #2f2b26;   /* inputs, cabeceras, rellenos suaves */
    --border:       #3d3935;
    --text:         #f3f1ee;
    --text-muted:   #a09a92;

    /* Alias heredados: habia reglas que usaban estos nombres para
       superficie y otras para texto, asi que no se podian voltear
       de golpe. Se conservan apuntando al valor nuevo. */
    --ua-gray:      var(--surface-2);
    --ua-gray-text: var(--text);
    --ua-border:    var(--border);
    /* --sidebar-w / --sidebar-w-min: ver css/sidebar.css */

}

/* =========================================================
   BASE
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Segoe UI', sans-serif;
    background-color: var(--page-bg);
    color: var(--ua-gray-text);
    min-height: 100vh;
}

/* =========================================================
   LOGIN
   ========================================================= */
body.page-login {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px;
}

.logo-ua {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 120px;
}

.login-box {
    background: var(--surface);
    width: 100%;
    max-width: 420px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.login-header {
    background-color: var(--ua-red);
    padding: 30px;
    text-align: center;
}

.login-header img {
    max-width: 280px;
    height: auto;
    /* Mismo caso que en la barra lateral: el logo es texto gris oscuro sobre
       transparente y aca va sobre el rojo de marca, donde apenas se leia.
       En blanco solido contrasta y ademas queda igual que en el sidebar. */
    filter: brightness(0) invert(1);
}

.login-body {
    padding: 40px;
}

.login-body label {
    display: block;
    font-weight: 700;
    margin-bottom: 6px;
    margin-top: 16px;
    color: var(--ua-gray-text);
    font-size: .9rem;
}

.login-body label:first-of-type { margin-top: 0; }

.login-body input[type="email"],
.login-body input[type="password"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--ua-border);
    border-radius: 4px;
    font-size: .95rem;
    background: var(--ua-gray);
    color: var(--text);
    transition: border-color .2s;
}

.login-body input:focus {
    outline: none;
    border-color: var(--ua-red);
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    font-size: .88rem;
    cursor: pointer;
    color: var(--ua-gray-text);
}

.checkbox-row input { width: auto; cursor: pointer; }

.btn-autonoma {
    display: block;
    width: 100%;
    margin-top: 24px;
    padding: 14px;
    background-color: var(--ua-red);
    color: var(--ua-white);
    border: none;
    border-radius: 4px;
    font-weight: 700;
    font-size: .95rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color .2s, transform .15s;
}

.btn-autonoma:hover:not(:disabled) {
    background-color: var(--ua-red-hover);
    transform: translateY(-2px);
}

.btn-autonoma:disabled { opacity: .6; cursor: default; transform: none; }

.error-msg {
    margin-top: 14px;
    color: var(--ua-red-text);
    font-size: .85rem;
    text-align: center;
    min-height: 1.2em;
}

/* =========================================================
   DASHBOARD
   ========================================================= */
body.page-dashboard {
    display: flex;
    background-color: var(--page-bg);
}

.main-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    padding: 2rem 2.5rem;
}

.page-header {
    margin-bottom: 1.5rem;
    border-bottom: 3px solid var(--ua-red);
    padding-bottom: .8rem;
}

.page-header h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text);
}

.header-user {
    font-size: .85rem;
    color: var(--text-muted);
    margin-top: .2rem;
}

.context-block {
    background: var(--surface);
    border-left: 4px solid var(--ua-red);
    border-radius: 0 6px 6px 0;
    padding: 1.2rem 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 1px 4px rgba(0,0,0,.07);
}

.context-block h2 {
    font-size: .95rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: .5rem;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.context-block p {
    font-size: .88rem;
    line-height: 1.6;
    color: var(--text-muted);
    margin-bottom: .4rem;
}

.context-block p:last-child { margin-bottom: 0; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.2rem;
}

.stat-card {
    background: var(--surface);
    border-radius: 6px;
    box-shadow: 0 1px 6px rgba(0,0,0,.08);
    padding: 1.4rem 1.2rem;
    display: flex;
    align-items: flex-start;
    gap: .9rem;
    border-top: 4px solid var(--ua-red);
    transition: transform .15s, box-shadow .15s;
}

.stat-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.12); }
.stat-card.wide  { grid-column: 1 / -1; }

.stat-icon  { font-size: 1.7rem; line-height: 1; }
.stat-value { font-size: 1.9rem; font-weight: 700; color: var(--ua-red-text); line-height: 1; }
.stat-label { font-size: .9rem; font-weight: 700; color: var(--text); margin-top: .2rem; }
.stat-desc  { font-size: .78rem; color: #777; margin-top: .1rem; }
.stat-loading { color: #888; font-size: .9rem; }

.last-updated {
    margin-top: 1.2rem;
    font-size: .78rem;
    color: #999;
    text-align: right;
}

/* ---------------------------------------------------------
   Pagina Estadisticas (dashboard.html): KPIs, grafico de
   sesiones por dia y desglose por estado. Las .stat-card de
   arriba las sigue usando security.html.
   --------------------------------------------------------- */

.dash-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.dash-refresh { display: flex; align-items: center; gap: .8rem; }
.dash .last-updated { margin: 0; color: var(--text-muted); }
.dash .error-msg { text-align: left; margin: 0 0 1rem; min-height: 0; }

.kpi-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.kpi {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.1rem 1.2rem 1rem;
    display: flex;
    flex-direction: column;
    gap: .35rem;
    min-height: 118px;
}

.kpi.is-loading { opacity: .55; }

.kpi-label {
    display: flex;
    align-items: center;
    gap: .45rem;
    font-size: .8rem;
    font-weight: 600;
    color: var(--text-muted);
}

.kpi-value {
    font-size: 2.3rem;
    font-weight: 700;
    line-height: 1.05;
    color: var(--text);
}

.kpi-foot { font-size: .78rem; color: var(--text-muted); margin-top: auto; }
.kpi-foot.is-up   { color: #86d79b; }
.kpi-foot.is-down { color: #f0a0a0; }

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #86d79b;
    box-shadow: 0 0 0 0 rgba(134, 215, 155, .6);
    animation: live-pulse 2s infinite;
}

@keyframes live-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(134, 215, 155, .55); }
    70%  { box-shadow: 0 0 0 7px rgba(134, 215, 155, 0); }
    100% { box-shadow: 0 0 0 0 rgba(134, 215, 155, 0); }
}

@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }

.dash-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
    gap: 1rem;
}

.dash-card {
    position: relative;   /* ancla del tooltip del grafico */
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.1rem 1.2rem 1.2rem;
    min-width: 0;
}

.dash-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.dash-card h2 { font-size: 1rem; font-weight: 700; color: var(--text); }
.dash-card-sub { font-size: .78rem; color: var(--text-muted); margin-top: .15rem; }

.chart-summary {
    font-size: .8rem;
    color: var(--text-muted);
    white-space: nowrap;
    padding-top: .15rem;
}

.chart-days { width: 100%; min-height: 220px; }
.chart-svg { display: block; overflow: visible; }

.chart-svg .grid      { stroke: var(--surface-2); stroke-width: 1; }
.chart-svg .axis-base { stroke: var(--border); stroke-width: 1; }
.chart-svg .tick      { fill: var(--text-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart-svg .tick.is-today { fill: var(--text); font-weight: 700; }
.chart-svg .bar       { fill: var(--ua-red-text); transition: opacity .12s; }
.chart-svg .bar-value { fill: var(--text); font-size: 12px; font-weight: 700; }
.chart-svg .hit       { fill: transparent; cursor: default; }
.chart-svg:hover .col:not(.is-hover) .bar { opacity: .45; }

.chart-days.is-empty { min-height: 0; }

.chart-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    border: 1px dashed var(--border);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: .88rem;
}

.chart-tooltip {
    position: absolute;
    transform: translate(-50%, -100%);
    pointer-events: none;
    background: var(--page-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: .4rem .6rem;
    font-size: .8rem;
    color: var(--text);
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .35);
    z-index: 2;
}

.chart-tooltip span { display: block; color: var(--text-muted); font-size: .74rem; margin-top: .1rem; }
.chart-tooltip[hidden] { display: none; }

.chart-table { margin-top: .8rem; font-size: .8rem; }
.chart-table summary { cursor: pointer; color: var(--text-muted); width: max-content; }
.chart-table summary:hover { color: var(--text); }

.mini-table { width: 100%; border-collapse: collapse; margin-top: .6rem; }
.mini-table th,
.mini-table td {
    text-align: left;
    padding: .35rem .5rem;
    border-bottom: 1px solid var(--surface-2);
    color: var(--text);
}
.mini-table th { color: var(--text-muted); font-weight: 600; }
.mini-table td:last-child,
.mini-table th:last-child { text-align: right; font-variant-numeric: tabular-nums; }

.status-bar {
    display: flex;
    gap: 2px;
    height: 12px;
    border-radius: 6px;
    overflow: hidden;
    background: var(--surface-2);
    margin-bottom: 1rem;
}

.status-seg { flex-basis: 0; min-width: 4px; }

.status-list { list-style: none; display: flex; flex-direction: column; gap: .55rem; }

.status-list li {
    display: grid;
    grid-template-columns: 10px 1fr auto 3.2em;
    align-items: center;
    gap: .6rem;
    font-size: .86rem;
    color: var(--text);
}

.status-key { width: 10px; height: 10px; border-radius: 3px; }
.status-key[data-status="ended"]     { background: #86d79b; }
.status-key[data-status="active"]    { background: #e8b765; }
.status-key[data-status="abandoned"] { background: #f0a0a0; }

.status-list li.status-missing { display: block; color: var(--text-muted); font-size: .82rem; }
.status-bar[hidden] { display: none; }

.status-count { font-weight: 700; font-variant-numeric: tabular-nums; }
.status-pct   { color: var(--text-muted); text-align: right; font-variant-numeric: tabular-nums; }

.dash-facts {
    margin-top: 1.2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--surface-2);
    display: grid;
    gap: .8rem;
}

.dash-facts dt { font-size: .76rem; color: var(--text-muted); }
.dash-facts dd { font-size: 1.05rem; font-weight: 700; color: var(--text); margin-top: .1rem; }

.dash-note {
    margin-top: 1.4rem;
    font-size: .78rem;
    line-height: 1.5;
    color: var(--text-muted);
}

@media (max-width: 1024px) {
    .kpi-row  { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dash-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 520px) {
    .kpi-row { grid-template-columns: minmax(0, 1fr); }
    .kpi { min-height: 0; }
    .dash-card-head { flex-direction: column; gap: .3rem; }
}

/* =========================================================
   COMPONENTES — TABLA, BOTONES, BADGES, MODAL
   ========================================================= */

/* Toolbar superior con search + acción */
.toolbar {
    display: flex;
    gap: 1rem;
    align-items: center;
    background: var(--surface);
    padding: 1rem 1.25rem;
    border-radius: 6px;
    border: 1px solid #eee;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
    margin-bottom: 1.2rem;
}

.toolbar .spacer { flex: 1; }
.toolbar-subtitle {
    font-size: .82rem;
    color: #777;
    margin-top: .15rem;
}

.search-box { position: relative; flex: 1; max-width: 360px; }

.search-box input {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--ua-border);
    border-radius: 5px;
    font-size: .9rem;
    background: var(--ua-gray);
    color: var(--text);
}

.search-box input:focus { outline: none; border-color: var(--ua-red); }

/* Card que envuelve tablas */
.dashboard-card {
    background: var(--surface);
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.card-topbar {
    background: var(--surface-2);
    color: var(--ua-white);
    padding: .9rem 1.4rem;
    border-bottom: 3px solid var(--ua-red);
}

.card-topbar h2 {
    margin: 0;
    font-size: .95rem;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.card-topbar small { color: rgba(255,255,255,.7); font-size: .8rem; }

/* Tabla moderna */
.table-modern {
    width: 100%;
    border-collapse: collapse;
}

.table-modern thead th {
    background: var(--ua-gray);
    text-align: left;
    padding: .8rem 1.2rem;
    font-size: .75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
    border-bottom: 2px solid var(--ua-red);
}

.table-modern tbody td {
    padding: .9rem 1.2rem;
    border-bottom: 1px solid #eee;
    font-size: .9rem;
    color: var(--ua-gray-text);
    vertical-align: middle;
}

.table-modern tbody tr { transition: background .15s; }
.table-modern tbody tr:hover { background: #2a2622; }
.table-modern tbody tr.deleted { opacity: .55; background: #2a2622; }

.table-modern .td-actions { text-align: right; white-space: nowrap; }

/* Avatar circle (iniciales) */
.user-cell { display: flex; align-items: center; gap: .7rem; }

.avatar-circle {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: var(--surface-2);
    color: var(--ua-white);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .82rem;
    text-transform: uppercase;
}

.user-email { font-weight: 700; color: var(--text); }
.user-meta  { font-size: .78rem; color: #777; }

/* Pills/badges */
.pill {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 700;
    background: var(--ua-gray);
    color: var(--text-muted);
    border: 1px solid var(--border);
    text-transform: uppercase;
    letter-spacing: .3px;
}

.pill.role-student { background: #15263a; color: #8fc1f2; border-color: #27415f; }
.pill.role-teacher { background: #3a2c12; color: #e8b765; border-color: #5c4720; }
.pill.role-admin   { background: #3a1a1a; color: #f0a0a0; border-color: #5c2a2a; }

.pill.status-active     { background: #16301c; color: #86d79b; border-color: #27512f; }
.pill.status-ended      { background: #2b2824; color: #a09a92; border-color: #3d3935; }
.pill.status-abandoned  { background: #3a1a1a; color: #f0a0a0; border-color: #5c2a2a; }
.pill.deleted-pill      { background: #3a1a1a; color: #f0a0a0; border-color: #5c2a2a; }

/* Botones de acción */
.btn-action {
    display: inline-block;
    padding: 7px 14px;
    border-radius: 4px;
    font-weight: 700;
    font-size: .8rem;
    cursor: pointer;
    border: 1px solid var(--ua-black);
    background: var(--surface-2);
    color: var(--ua-white);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: .4px;
    transition: background .15s, transform .15s;
    margin-left: 6px;
}

.btn-action:hover:not(:disabled) {
    background: var(--ua-red);
    border-color: var(--ua-red);
    color: var(--ua-white);
    transform: translateY(-1px);
}

.btn-action.btn-secondary {
    background: var(--surface);
    color: var(--text);
}

.btn-action.btn-danger {
    border-color: var(--ua-red);
    color: var(--ua-red-text);
    background: var(--surface);
}

.btn-action.btn-danger:hover {
    background: var(--ua-red);
    color: var(--ua-white);
}

.btn-action:disabled { opacity: .5; cursor: default; transform: none; }

/* Empty state */
.empty-state {
    padding: 3rem 1rem;
    text-align: center;
    color: #888;
}

.empty-state-icon {
    font-size: 2.5rem;
    margin-bottom: .5rem;
    opacity: .4;
}

/* Cards de detalle de sesión (estilo test-card) */
.session-card {
    background: var(--surface);
    border-radius: 6px;
    box-shadow: 0 1px 6px rgba(0,0,0,.07);
    border-left: 4px solid var(--ua-red);
    padding: 1.2rem 1.5rem;
    margin-bottom: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1.2rem;
    align-items: center;
}

.session-card .session-main { flex: 1; min-width: 220px; }

.session-card h3 {
    margin: 0 0 .3rem;
    font-size: 1rem;
    color: var(--text);
}

.session-card .session-meta {
    font-size: .82rem;
    color: #777;
}

.session-stats { display: flex; gap: 1.5rem; flex-wrap: wrap; }

.session-stat {
    text-align: center;
    min-width: 80px;
}

.session-stat .v {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--ua-red-text);
    line-height: 1;
}

.session-stat .l {
    font-size: .7rem;
    text-transform: uppercase;
    color: #888;
    margin-top: .2rem;
    letter-spacing: .4px;
}

.coverage-summary {
    padding: 1rem 1.25rem 1.1rem;
    border-bottom: 1px solid #eee;
}

.coverage-stats {
    margin-bottom: 1rem;
}

.coverage-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.coverage-chip {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 700;
    border: 1px solid #ddd;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.coverage-chip.covered {
    background: #16301c;
    color: #86d79b;
    border-color: #b8e6b8;
}

.coverage-chip.uncovered {
    background: #2b2824;
    color: var(--text-muted);
    border-color: #ddd;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-overlay[hidden] { display: none; }

.modal-box {
    background: var(--surface);
    width: 100%;
    max-width: 460px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,.4);
}

.modal-header {
    background: var(--ua-red);
    color: var(--ua-white);
    padding: .9rem 1.4rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.modal-body { padding: 1.4rem; }

.modal-body label {
    display: block;
    font-weight: 700;
    color: var(--ua-gray-text);
    margin-top: 12px;
    margin-bottom: 4px;
    font-size: .85rem;
}

.modal-body label:first-child { margin-top: 0; }

.modal-body input,
.modal-body select {
    width: 100%;
    padding: 9px 10px;
    border: 1px solid var(--ua-border);
    border-radius: 4px;
    font-size: .9rem;
    background: var(--ua-gray);
    color: var(--text);
}

.modal-body input:focus,
.modal-body select:focus { outline: none; border-color: var(--ua-red); }

.modal-footer {
    padding: 1rem 1.4rem;
    background: var(--ua-gray);
    text-align: right;
    border-top: 1px solid var(--border);
}

/* Display de código generado */
.code-display {
    background: var(--page-bg);
    color: #6f6;
    padding: 14px;
    font-family: 'Consolas', monospace;
    font-size: 1.1rem;
    border-radius: 4px;
    text-align: center;
    letter-spacing: 1px;
    margin: 12px 0;
    word-break: break-all;
}

.code-warning {
    background: #332a12;
    border-left: 3px solid #f0a500;
    padding: 10px 12px;
    font-size: .82rem;
    color: #e8b765;
    margin-bottom: 8px;
    border-radius: 0 4px 4px 0;
    text-transform: none;
    letter-spacing: 0;
}

.stat-icon { display: none; }
.empty-state-icon { display: none; }

.toolbar-actions {
    display: flex;
    gap: .55rem;
    align-items: center;
}

.list-pagination {
    display: flex;
    justify-content: flex-end;
    padding: 1rem 1.2rem 1.15rem;
    border-top: 1px solid #eee;
    background: var(--surface);
}

.pagination-shell {
    display: flex;
    align-items: center;
    gap: .9rem;
    flex-wrap: wrap;
}

.pagination-info {
    color: var(--text-muted);
    font-size: .82rem;
}

.pagination-list {
    display: flex;
    align-items: center;
    gap: .32rem;
    flex-wrap: wrap;
}

.page-btn {
    border: 1px solid #d7d7d7;
    background: var(--surface);
    color: var(--text);
    border-radius: 4px;
    padding: 7px 11px;
    font-size: .8rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
}

.page-btn:hover:not(:disabled),
.page-btn.is-active {
    background: var(--ua-red);
    border-color: var(--ua-black);
    color: var(--ua-white);
}

.page-btn:disabled {
    opacity: .48;
    cursor: default;
}

.page-ellipsis {
    color: #777;
    font-weight: 700;
    padding: 0 .2rem;
}

.modal-box-wide {
    max-width: 1120px;
}

.import-toolbar {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(280px, 1.25fr) auto;
    gap: .9rem;
    align-items: end;
    margin-bottom: 1rem;
}

.import-field {
    display: flex;
    flex-direction: column;
    gap: .35rem;
}

.import-field label {
    margin: 0;
}

.import-field input,
.import-field select {
    background: var(--surface);
}

.import-help {
    margin: .8rem 0 1rem;
    font-size: .82rem;
    color: var(--text-muted);
}

.import-summary {
    display: grid;
    gap: .2rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--ua-red);
    border-radius: 5px;
    padding: .9rem 1rem;
    margin-bottom: .8rem;
    color: var(--text);
}

.import-summary strong {
    color: var(--ua-red-text);
}

.import-summary-meta {
    font-size: .78rem;
    color: #777;
}

.table-scroll {
    border: 1px solid #eee;
    border-radius: 6px;
    overflow: auto;
    max-height: 360px;
    background: var(--surface);
}

.table-modern.table-compact thead th,
.table-modern.table-compact tbody td {
    padding: .65rem .85rem;
    font-size: .82rem;
}

.import-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 78px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .3px;
}

.import-status-valid {
    background: #16301c;
    color: #86d79b;
    border: 1px solid #cfe7cf;
}

.import-status-invalid {
    background: #3a1a1a;
    color: #f0a0a0;
    border: 1px solid #5c2a2a;
}

.import-preview-note {
    padding: .8rem 1rem 1rem;
    color: #777;
    font-size: .78rem;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 768px) {
    .logo-ua { position: relative; top: 0; left: 0; margin-bottom: 16px; width: 100px; }
    body.page-login { justify-content: flex-start; padding-top: 24px; }
    .login-body { padding: 24px; }

    .toolbar { flex-wrap: wrap; }
    .search-box { max-width: none; width: 100%; }
    .toolbar-actions { width: 100%; justify-content: flex-end; }
    .import-toolbar { grid-template-columns: 1fr; }
    .list-pagination { justify-content: flex-start; }
    .pagination-shell { width: 100%; flex-direction: column; align-items: flex-start; }
}

@media (max-width: 640px) {
    .toolbar-actions .btn-action {
        flex: 1;
        text-align: center;
        margin-left: 0;
    }
}
