/* ============================================================
   HNI ERP — Estilos principales con soporte dark/light mode
   ============================================================ */

/* --- Variables tema claro (blanco institucional HNI) --- */
:root {
    /* ---- Font scale system ---- */
    --fz:      14px;                          /* base — cambia con el controlador */
    --fz-xs:   calc(var(--fz) * 0.857);       /* ≈12px — solo elementos decorativos */
    --fz-sm:   calc(var(--fz) * 0.929);       /* ≈13px — mínimo para texto legible   */
    --fz-base: var(--fz);                     /* 14px base */
    --fz-md:   calc(var(--fz) * 1.071);       /* ≈15px */
    --fz-lg:   calc(var(--fz) * 1.143);       /* ≈16px */
    --fz-xl:   calc(var(--fz) * 1.286);       /* ≈18px */
    --fz-2xl:  calc(var(--fz) * 1.571);       /* ≈22px */
    --fz-hero: calc(var(--fz) * 1.857);       /* ≈26px */

    --brand-blue:    #1B4FA0;
    --brand-red:     #C93329;
    --brand-gray:    #8A8F99;

    --bg-app:        #F0F2F5;
    --bg-header:     #FFFFFF;
    --bg-navbar:     #FFFFFF;
    --bg-card:       #FFFFFF;
    --bg-column:     #E8EAED;
    --bg-column-hdr: #DDDFE4;
    --bg-input:      #FFFFFF;
    --bg-modal:      #FFFFFF;
    --bg-overlay:    rgba(0,0,0,0.5);

    --text-primary:   #1A1F2E;
    --text-secondary: #555C6E;
    --text-muted:     #8892A4;
    --text-header:    #1A1F2E;
    --text-nav:       #555C6E;
    --text-nav-active: var(--brand-blue);

    --border:         #D1D5DC;
    --border-card:    #E0E3E8;

    --shadow-card:    0 1px 3px rgba(0,0,0,0.10), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-modal:   0 20px 60px rgba(0,0,0,0.15);
    --shadow-header:  0 1px 0 var(--border);

    --accent:         var(--brand-blue);
    --accent-hover:   #163C7A;
    --success:        #28a745;
    --danger:         #dc3545;
    --warning:        #ffc107;
    --info:           #17a2b8;
    --orange:         #fd7e14;
    --purple:         #6f42c1;

    --header-h:       58px;
    --navbar-h:       44px;
    --radius:         8px;
    --radius-card:    10px;
    --radius-pill:    50px;
    --transition:     0.2s ease;
}

/* ---- Font-scale controller levels ---- */
html[data-font="lg"] { --fz: 16px; }
html[data-font="xl"] { --fz: 18px; }

/* --- Variables tema oscuro --- */
[data-theme="dark"] {
    --bg-app:         #0f1117;
    --bg-header:      #111827;
    --bg-navbar:      #111827;
    --bg-card:        #1e2433;
    --bg-column:      #161d2e;
    --bg-column-hdr:  #1a2236;
    --bg-input:       #252d3e;
    --bg-modal:       #1e2433;

    --text-primary:   #e8eaf6;
    --text-secondary: #9aa3b5;
    --text-muted:     #5a6478;
    --text-header:    #e8eaf0;
    --text-nav:       #9aa3b5;
    --text-nav-active: #74b9ff;

    --border:         #2a3348;
    --border-card:    #2a3348;

    --shadow-card:    0 2px 8px rgba(0,0,0,0.4);
    --shadow-modal:   0 20px 60px rgba(0,0,0,0.6);
    --shadow-header:  0 1px 0 rgba(255,255,255,0.05);
}

/* --- Reset & base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: var(--fz-base);
    background: var(--bg-app);
    color: var(--text-primary);
    line-height: 1.5;
    transition: background var(--transition), color var(--transition);
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

/* ============================================================
   LAYOUT
   ============================================================ */

/* ---- Barra superior ---- */
.app-header {
    position: fixed; top: 0; left: 0; right: 0;
    height: var(--header-h);
    background: var(--bg-header);
    display: flex; align-items: center; gap: 12px;
    padding: 0 20px;
    z-index: 1000;
    box-shadow: var(--shadow-header);
    transition: background var(--transition);
}

.header-left  { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.header-right { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-shrink: 0; }
.header-stats { display: flex; align-items: center; gap: 8px; flex: 1; overflow-x: auto; scrollbar-width: none; padding: 0 8px; }
.header-stats::-webkit-scrollbar { display: none; }

/* Botón "Tablero" en el header — siempre visible en todas las páginas */
.header-tablero-btn {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 13px; font-weight: 700;
    color: var(--brand-blue);
    text-decoration: none;
    padding: 5px 14px;
    border-radius: var(--radius-pill);
    background: rgba(27,79,160,0.08);
    border: 1.5px solid rgba(27,79,160,0.2);
    transition: all var(--transition);
    white-space: nowrap;
}
.header-tablero-btn:hover { background: rgba(27,79,160,0.15); border-color: var(--brand-blue); color: var(--brand-blue); text-decoration: none; }
[data-theme="dark"] .header-tablero-btn { color: #74b9ff; background: rgba(116,185,255,0.08); border-color: rgba(116,185,255,0.2); }
[data-theme="dark"] .header-tablero-btn:hover { background: rgba(116,185,255,0.15); border-color: #74b9ff; color: #74b9ff; }

/* Logo imagen */
.app-logo { display: flex; align-items: center; }
.logo-img  { height: 40px; width: auto; object-fit: contain; display: block; }

/* Stats chips en el header */
.stat-chip {
    display: flex; align-items: center; gap: 5px;
    background: rgba(27,79,160,0.06);
    border: 1px solid rgba(27,79,160,0.15);
    border-radius: var(--radius-pill);
    padding: 4px 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    font-size: var(--fz-sm);
}
[data-theme="dark"] .stat-chip {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.10);
    color: var(--text-header);
}
.stat-chip i { opacity: 0.65; color: var(--brand-blue); }
[data-theme="dark"] .stat-chip i { color: #74b9ff; }
.stat-chip strong { color: var(--brand-blue); }
[data-theme="dark"] .stat-chip strong { color: #ffffff; }
.stat-chip .stat-label { opacity: 0.6; font-size: var(--fz-xs); }
.stat-chip .stat-used  { color: var(--brand-red); font-size: var(--fz-xs); }
[data-theme="dark"] .stat-chip .stat-used { color: #ff7675; }
.stat-chip--personnel strong { color: var(--brand-blue); }
.stat-chip--machines  strong { color: #00b894; }
[data-theme="dark"] .stat-chip--personnel strong { color: #74b9ff; }
[data-theme="dark"] .stat-chip--machines  strong { color: #55efc4; }

/* ---- Navbar horizontal ---- */
.app-navbar {
    position: fixed;
    top: var(--header-h);
    left: 0; right: 0;
    height: var(--navbar-h);
    background: var(--bg-navbar);
    border-bottom: 3px solid var(--brand-red);
    display: flex; align-items: center;
    padding: 0 16px;
    z-index: 999;
    overflow: visible; /* visible para que el dropdown no quede recortado */
    transition: background var(--transition);
}
/* Inner scrollable wrapper — los ítems hacen scroll en mobile,
   pero el dropdown queda fuera del contexto de overflow */
.navbar-inner {
    display: flex; align-items: center;
    height: var(--navbar-h);
    gap: 0;
    overflow-x: auto;
    overflow-y: visible;
    scrollbar-width: none;
    flex: 1;
}
.navbar-inner::-webkit-scrollbar { display: none; }

.nav-item {
    display: flex; align-items: center; gap: 6px;
    padding: 0 13px;
    height: var(--navbar-h);
    font-size: 13px; font-weight: 500;
    color: var(--text-nav);
    white-space: nowrap;
    transition: all var(--transition);
    text-decoration: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -3px;
    flex-shrink: 0;
}
.nav-item:hover {
    color: var(--brand-blue);
    background: rgba(27,79,160,0.06);
    text-decoration: none;
}
.nav-item.active {
    color: var(--brand-blue);
    border-bottom-color: var(--brand-blue);
    font-weight: 600;
}
.nav-item i { font-size: 14px; opacity: 0.8; }

/* Tablero — ítem destacado */
.nav-item--board { font-weight: 700; color: var(--brand-blue); gap: 7px; }
.nav-item--board i { opacity: 1; font-size: 16px; }
.nav-item--board:hover { background: rgba(27,79,160,0.1); }
[data-theme="dark"] .nav-item--board { color: #74b9ff; }

[data-theme="dark"] .nav-item { color: var(--text-nav); }
[data-theme="dark"] .nav-item:hover,
[data-theme="dark"] .nav-item.active { color: #74b9ff; }
[data-theme="dark"] .nav-item.active { border-bottom-color: #74b9ff; }

.nav-divider {
    width: 1px; height: 20px;
    background: var(--border);
    margin: 0 4px;
    flex-shrink: 0;
    align-self: center;
}

/* Admin dropdown in navbar */
.nav-dropdown {
    position: relative;
    display: flex;
    align-items: center;
    height: var(--navbar-h);
    flex-shrink: 0;
}
.nav-dropdown-toggle {
    display: flex; align-items: center; gap: 6px;
    padding: 0 13px;
    height: var(--navbar-h);
    font-size: 13px; font-weight: 500;
    color: var(--text-nav);
    white-space: nowrap;
    border: none; background: transparent; cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -3px;
    transition: all var(--transition);
    font-family: inherit;
}
.nav-dropdown-toggle:hover { color: var(--brand-blue); background: rgba(27,79,160,0.06); }
.nav-dropdown-toggle.active { color: var(--brand-blue); border-bottom-color: var(--brand-blue); font-weight: 600; }
.nav-dropdown-toggle i.chevron { font-size: 10px; opacity: 0.6; transition: transform var(--transition); }
.nav-dropdown:hover .chevron { transform: rotate(180deg); }
[data-theme="dark"] .nav-dropdown-toggle { color: var(--text-nav); }
[data-theme="dark"] .nav-dropdown-toggle:hover,
[data-theme="dark"] .nav-dropdown-toggle.active { color: #74b9ff; }
[data-theme="dark"] .nav-dropdown-toggle.active { border-bottom-color: #74b9ff; }

.nav-dropdown-menu {
    position: absolute; top: 100%; right: 0;
    min-width: 180px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    z-index: 2000;
    display: none;
    overflow: hidden;
    animation: slideDown 0.15s ease;
}
.nav-dropdown:hover .nav-dropdown-menu { display: block; }
.nav-dropdown.open .nav-dropdown-menu  { display: block; }
.nav-dropdown.open .chevron            { transform: rotate(180deg); }
.nav-dropdown-menu a {
    display: flex; align-items: center; gap: 8px;
    padding: 9px 16px;
    font-size: 13px; color: var(--text-secondary);
    transition: background var(--transition);
    border-left: 3px solid transparent;
}
.nav-dropdown-menu a:hover { background: rgba(27,79,160,0.07); color: var(--brand-blue); text-decoration: none; }
.nav-dropdown-menu a.active { color: var(--brand-blue); font-weight: 600; border-left-color: var(--brand-blue); background: rgba(27,79,160,0.05); }
.nav-dropdown-menu a i { font-size: 14px; opacity: 0.75; }

/* ---- Cuerpo de la aplicación ---- */
.app-body {
    display: flex;
    padding-top: calc(var(--header-h) + var(--navbar-h));
    height: 100vh;
    overflow: hidden;
}

/* Sidebar — oculto (reemplazado por navbar horizontal) */
.app-sidebar { display: none; }

/* ---- Contenido principal ---- */
.app-main {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* ============================================================
   BOTONES
   ============================================================ */
.btn { border-radius: var(--radius); font-size: 13px; font-weight: 500; cursor: pointer; border: none; padding: 7px 16px; transition: all var(--transition); display: inline-flex; align-items: center; gap: 6px; }
.btn-primary { background: var(--brand-blue); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-success { background: var(--success); color: #fff; }
.btn-danger  { background: var(--danger);  color: #fff; }
.btn-ghost   { background: transparent; color: var(--text-secondary); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--border); }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-icon {
    background: transparent; border: none; cursor: pointer;
    color: var(--text-header);
    width: 34px; height: 34px;
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    font-size: 17px;
    transition: all var(--transition);
}
.btn-icon:hover { background: rgba(27,79,160,0.08); }
[data-theme="dark"] .btn-icon:hover { background: rgba(255,255,255,0.10); }

/* ============================================================
   KANBAN BOARD
   ============================================================ */
.board-container {
    display: flex;
    gap: 10px;
    padding: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    flex: 1;
    align-items: flex-start;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}
.board-container::-webkit-scrollbar { height: 6px; }
.board-container::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* Columna */
.kanban-col {
    min-width: 260px;
    max-width: 260px;
    background: var(--bg-column);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - var(--header-h) - var(--navbar-h) - 24px);
    transition: background var(--transition);
}

.col-header {
    padding: 10px 12px 8px;
    border-radius: var(--radius) var(--radius) 0 0;
    background: var(--bg-column-hdr);
    flex-shrink: 0;
    transition: background var(--transition);
}
.col-header-top {
    display: flex; align-items: center; gap: 6px; margin-bottom: 4px;
}
.col-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.col-name { font-weight: 700; font-size: 13px; flex: 1; color: var(--text-primary); }
.col-count {
    background: var(--bg-card);
    color: var(--text-muted);
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 600;
    padding: 1px 7px;
}
.col-total-usd {
    font-size: 12px; font-weight: 600;
    color: var(--text-secondary);
}
.col-add-btn {
    background: transparent; border: none; cursor: pointer;
    color: var(--brand-blue); font-size: 26px; font-weight: 700; line-height: 1;
    border-radius: 6px; padding: 0 6px;
    transition: all var(--transition);
    flex-shrink: 0;
}
/* El color base viene inline desde Admin → Configuración; el hover solo resalta */
.col-add-btn:hover { background: rgba(27,79,160,0.10); transform: scale(1.12); }

/* Cards container */
.col-cards {
    overflow-y: auto;
    padding: 6px 8px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
    min-height: 60px;
}
.col-cards::-webkit-scrollbar { width: 4px; }
.col-cards::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* Tarjeta */
.kanban-card {
    background: var(--bg-card);
    border-radius: var(--radius-card);
    padding: 10px 11px 8px;
    text-align: center;
    box-shadow: var(--shadow-card);
    cursor: pointer;
    border: 1px solid var(--border-card);
    transition: box-shadow var(--transition), transform var(--transition), background var(--transition);
    position: relative;
}
.kanban-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.14);
    transform: translateY(-1px);
}
.kanban-card.sortable-ghost { opacity: 0.4; }
.kanban-card.sortable-chosen { box-shadow: 0 8px 24px rgba(0,0,0,0.2); }

/* Card header */
.card-top {
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 5px;
}
.card-num {
    font-size: 11px; font-weight: 700; color: var(--text-muted);
    display: flex; align-items: center; gap: 4px;
}
.card-num a { color: var(--text-muted); }
.card-num a:hover { color: var(--brand-blue); }
.card-actions { display: flex; align-items: center; gap: 2px; }
.card-actions button {
    background: transparent; border: none; cursor: pointer;
    color: var(--text-muted); font-size: 13px; padding: 1px 3px;
    border-radius: 3px; transition: all var(--transition);
    line-height: 1;
}
.card-actions button:hover { color: var(--brand-blue); background: rgba(27,79,160,0.10); }

/* Nombre del cliente en la tarjeta */
.card-client {
    font-size: 13px; font-weight: 700; color: var(--text-primary);
    line-height: 1.3; margin-bottom: 2px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* Subtítulo en tarjeta */
.card-subtitle {
    font-size: 11px; color: var(--text-muted); font-style: italic;
    line-height: 1.3; margin-bottom: 4px;
    display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}

/* Vehículo/Máquina */
.card-machine {
    font-size: 11px; color: var(--text-secondary);
    line-height: 1.35; margin-bottom: 3px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* Componente a reparar */
.card-component {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 10.5px; font-weight: 600;
    color: var(--brand-blue);
    background: rgba(27,79,160,0.10);
    border-radius: 4px;
    padding: 2px 7px;
    margin-bottom: 5px;
    max-width: 100%;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Título de la tarjeta (fallback cuando no hay máquina) */
.card-title {
    font-size: 12.5px; font-weight: 600; color: var(--text-primary);
    line-height: 1.3; margin-bottom: 6px;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

/* Tags */
.card-tags { display: flex; flex-wrap: wrap; gap: 3px; margin-bottom: 6px; justify-content: center; }
.tag-badge {
    font-size: 10px; font-weight: 700; letter-spacing: 0.3px;
    padding: 2px 7px;
    border-radius: 3px;
    line-height: 1.4;
    text-transform: uppercase;
}

/* Fecha de creación */
.card-date {
    display: flex; align-items: center; gap: 4px;
    font-size: 11px; color: var(--text-muted);
    margin-bottom: 5px;
    justify-content: center;
}
.card-date i { font-size: 11px; }

/* Campos de datos de la tarjeta */
.card-fields { margin-bottom: 5px; }
.card-field {
    display: flex; justify-content: center;
    font-size: 11px; margin-bottom: 1px;
    color: var(--text-secondary);
}
.card-field-label { color: var(--text-muted); }
.card-field-value { font-weight: 500; }
.card-field-value.amount { color: var(--text-primary); font-weight: 700; }

/* Avatar en tarjeta */
.avatar {
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; color: #fff;
    flex-shrink: 0;
    font-size: 11px;
    text-transform: uppercase;
}

/* Barras inferiores de la tarjeta */
.card-bars { margin-top: 7px; }

.card-bar-row {
    display: flex; align-items: center; justify-content: space-between;
    font-size: 10px; color: var(--text-muted);
    margin-bottom: 2px;
}
.bar-track {
    height: 5px; border-radius: 3px;
    background: var(--border);
    overflow: hidden;
    margin-bottom: 4px;
}
.bar-fill { height: 100%; border-radius: 3px; transition: width 0.4s ease; }

/* Colores barra de días */
.bar-danger .bar-fill  { background: linear-gradient(90deg, #dc3545, #ff6b6b); }
.bar-warning .bar-fill { background: linear-gradient(90deg, #fd7e14, #ffc107); }
.bar-ok .bar-fill      { background: linear-gradient(90deg, #28a745, #20c997); }
.bar-neutral .bar-fill { background: var(--border); }

/* Barra de progreso (azul HNI) */
.bar-progress .bar-fill { background: linear-gradient(90deg, var(--brand-blue), #74b9ff); }

/* Badge de adjuntos en tarjeta kanban */
.card-attach-badge {
    display: inline-flex; align-items: center; gap: 3px;
    font-size: 10px; color: var(--text-muted);
    margin-top: 5px;
    padding: 1px 6px;
    background: var(--bg-column);
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
}
.card-attach-badge i { font-size: 10px; }

/* ── Sección de archivos adjuntos (detail view) ── */
.attach-section-hdr {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 16px;
    font-weight: 700; font-size: var(--fz-sm);
    background: var(--bg-app);
    border-bottom: 1px solid var(--border);
    border-left: 4px solid #fd7e14;
}
.attach-toggle-btn {
    background: none; border: none; cursor: pointer;
    color: var(--text-muted); padding: 2px 6px;
    border-radius: var(--radius); transition: all var(--transition);
    display: flex; align-items: center; gap: 4px;
    font-size: var(--fz-xs); font-weight: 700;
}
.attach-toggle-btn:hover { background: var(--bg-column); color: var(--text-primary); }
.attach-toggle-btn i { transition: transform 0.2s; }
.attach-toggle-btn.open i { transform: rotate(180deg); }

.attach-body { padding: 14px 16px; }

/* Grid de adjuntos */
.attach-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
    margin-bottom: 4px;
}
.attach-item {
    position: relative;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-column);
    transition: box-shadow var(--transition);
}
.attach-item:hover { box-shadow: 0 2px 10px rgba(0,0,0,0.12); }
.attach-img {
    width: 100%; height: 100px; object-fit: cover; display: block;
    cursor: pointer; transition: opacity var(--transition);
}
.attach-img:hover { opacity: 0.85; }
.attach-file-icon {
    width: 100%; height: 100px; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 6px;
    color: var(--text-muted); cursor: pointer; text-decoration: none;
}
.attach-file-icon i { font-size: 32px; }
.attach-file-icon span { font-size: 11px; font-weight: 600; text-align: center; padding: 0 6px; word-break: break-all; }
.attach-item-footer {
    padding: 4px 8px; font-size: 10px; color: var(--text-muted);
    border-top: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    background: var(--bg-card);
}
.attach-del-btn {
    background: none; border: none; cursor: pointer;
    color: var(--brand-red); opacity: 0.5; padding: 1px 3px;
    border-radius: 3px; font-size: 11px; line-height: 1;
}
.attach-del-btn:hover { opacity: 1; background: rgba(201,51,41,0.08); }

/* Lightbox simple */
.attach-lightbox {
    display: none; position: fixed; inset: 0; z-index: 9999;
    background: rgba(0,0,0,0.88); align-items: center; justify-content: center;
    cursor: zoom-out;
}
.attach-lightbox.open { display: flex; }
.attach-lightbox img { max-width: 92vw; max-height: 92vh; border-radius: var(--radius); box-shadow: 0 8px 40px rgba(0,0,0,0.5); }
.attach-lightbox-close {
    position: absolute; top: 16px; right: 20px;
    color: #fff; font-size: 28px; cursor: pointer; opacity: 0.8; line-height: 1;
    background: none; border: none;
}
.attach-lightbox-close:hover { opacity: 1; }

/* Drop zone */
.attach-dropzone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 14px;
    text-align: center;
    color: var(--text-muted);
    font-size: var(--fz-sm);
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition);
    margin-top: 10px;
}
.attach-dropzone:hover, .attach-dropzone.drag-over {
    border-color: #fd7e14;
    background: rgba(253,126,20,0.05);
    color: #fd7e14;
}

/* ============================================================
   MODAL DETALLE ODT
   ============================================================ */
.modal-overlay {
    position: fixed; inset: 0;
    background: var(--bg-overlay);
    z-index: 2000;
    display: flex; align-items: flex-start; justify-content: center;
    padding: 20px;
    overflow-y: auto;
    animation: fadeIn 0.15s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-box {
    background: var(--bg-modal);
    border-radius: 12px;
    box-shadow: var(--shadow-modal);
    width: 100%; max-width: 820px;
    animation: slideUp 0.2s ease;
    border: 1px solid var(--border);
}
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }

.modal-header {
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 10px;
}
.modal-header h2 { font-size: 16px; font-weight: 700; flex: 1; }
.modal-body { padding: 20px 22px; }
.modal-footer {
    padding: 14px 22px;
    border-top: 1px solid var(--border);
    display: flex; gap: 8px; justify-content: flex-end;
}
.btn-close-modal {
    background: transparent; border: none; cursor: pointer;
    font-size: 20px; color: var(--text-muted); line-height: 1;
    border-radius: 4px; padding: 2px 6px;
    transition: all var(--transition);
}
.btn-close-modal:hover { color: var(--danger); background: rgba(220,53,69,0.1); }

/* Tabs dentro del modal */
.modal-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.modal-tab {
    padding: 8px 16px; font-size: 13px; font-weight: 500;
    border: none; background: transparent; cursor: pointer;
    color: var(--text-muted); border-bottom: 2px solid transparent;
    transition: all var(--transition); margin-bottom: -1px;
}
.modal-tab.active { color: var(--brand-blue); border-bottom-color: var(--brand-blue); }
.modal-tab-content { display: none; }
.modal-tab-content.active { display: block; }

/* ============================================================
   FORMULARIO ODT
   ============================================================ */
.odt-form-page { padding: 16px 20px; overflow-y: auto; height: calc(100vh - var(--header-h) - var(--navbar-h)); }
.form-section {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 18px 20px;
    margin-bottom: 16px;
}
.form-section-title {
    font-size: 13px; font-weight: 700; color: var(--text-secondary);
    text-transform: uppercase; letter-spacing: 0.5px;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 8px;
}
/* Número de paso en formulario de creación */
.step-num {
    display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 22px; border-radius: 50%;
    background: var(--brand-blue); color: #fff;
    font-size: 12px; font-weight: 700; flex-shrink: 0;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}
.form-col-full { grid-column: 1 / -1; }

.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-label { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.form-control {
    padding: 7px 10px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 13px;
    transition: border-color var(--transition);
    width: 100%;
    font-family: inherit;
}
.form-control:focus { outline: none; border-color: var(--brand-blue); box-shadow: 0 0 0 2px rgba(27,79,160,0.15); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }

/* Tabla de ítems */
.items-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.items-table th {
    background: var(--bg-column); color: var(--text-muted);
    font-weight: 600; text-transform: uppercase; font-size: 10px; letter-spacing: 0.5px;
    padding: 6px 8px; text-align: left; border-bottom: 1px solid var(--border);
}
.items-table td { padding: 4px 4px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.items-table tr:last-child td { border-bottom: none; }
.items-table .form-control { padding: 4px 6px; font-size: 12px; }
.btn-remove-row { background: transparent; border: none; cursor: pointer; color: var(--text-muted); font-size: 15px; }
.btn-remove-row:hover { color: var(--danger); }

/* Costos cotización */
.costs-grid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px;
}
.cost-row {
    display: flex; align-items: center; gap: 8px;
}
.cost-label { flex: 1; font-size: 12px; color: var(--text-secondary); }
.cost-input { width: 110px; }
.cost-subtotal { background: var(--bg-column) !important; font-weight: 700; }
.cost-total-row {
    grid-column: 1 / -1;
    background: rgba(27,79,160,0.07);
    border-radius: var(--radius);
    padding: 10px 12px;
    display: flex; justify-content: space-between; align-items: center;
}
.cost-total-row .cost-label { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.cost-total-value { font-size: 20px; font-weight: 800; color: var(--brand-blue); }

/* ============================================================
   NOTAS
   ============================================================ */
/* ---- Badges de rol en pestañas de detalle ---- */
.role-badge-bar {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px;
    border-radius: var(--radius);
    border: 1px solid;
    margin-bottom: 16px;
    font-size: 12px;
}
.role-badge-odt {
    background: rgba(108,117,125,0.08);
    border-color: rgba(108,117,125,0.20);
    color: var(--text-secondary);
}
.role-badge-bodega {
    background: rgba(27,79,160,0.07);
    border-color: rgba(27,79,160,0.18);
    color: var(--text-secondary);
}
.role-badge-produccion {
    background: rgba(111,66,193,0.07);
    border-color: rgba(111,66,193,0.18);
    color: var(--text-secondary);
}

/* ---- Bloques de info en pestaña Información ---- */
.info-block {
    background: var(--bg-app);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 12px;
}
.info-block-title {
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.5px; color: var(--text-muted);
    margin-bottom: 10px;
    display: flex; align-items: center; gap: 5px;
}
.info-val {
    font-size: 13px; font-weight: 600; color: var(--text-primary);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 7px 10px;
    min-height: 34px;
    line-height: 1.4;
}

.notes-list { display: flex; flex-direction: column; gap: 10px; }
.note-item {
    background: var(--bg-column);
    border-radius: var(--radius);
    padding: 10px 12px;
    border-left: 3px solid var(--brand-blue);
}
.note-meta { display: flex; gap: 8px; align-items: center; margin-bottom: 5px; font-size: 11px; color: var(--text-muted); }
.note-meta strong { color: var(--text-primary); }
.note-content { font-size: 13px; color: var(--text-primary); white-space: pre-wrap; }
.note-form { display: flex; gap: 8px; margin-top: 12px; }
.note-form textarea { flex: 1; min-height: 60px; }

/* ============================================================
   HISTORIAL
   ============================================================ */
.history-list { display: flex; flex-direction: column; gap: 0; }
.history-item {
    display: flex; gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
}
.history-item:last-child { border-bottom: none; }
.history-icon {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: rgba(27,79,160,0.10);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    color: var(--brand-blue);
    font-size: 12px;
}
.history-desc { flex: 1; color: var(--text-secondary); }
.history-desc strong { color: var(--text-primary); }
.history-time { color: var(--text-muted); font-size: 11px; white-space: nowrap; }

/* ============================================================
   ADMIN TABLES
   ============================================================ */
.page-container { padding: 20px; overflow-y: auto; height: calc(100vh - var(--header-h) - var(--navbar-h)); }
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.page-title { font-size: 20px; font-weight: 700; display: flex; align-items: center; gap: 8px; }

.data-table-wrap { background: var(--bg-card); border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
    background: var(--bg-column); color: var(--text-muted);
    font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px;
    padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border);
}
.data-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); color: var(--text-primary); font-size: 13px; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(27,79,160,0.04); }

/* Badges de rol */
.role-badge {
    display: inline-block; padding: 2px 8px; border-radius: var(--radius-pill);
    font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px;
}
.role-admin      { background: rgba(201,51,41,0.12);  color: var(--brand-red); }
.role-gerencia   { background: rgba(111,66,193,0.15);  color: #6f42c1; }
.role-vendedor   { background: rgba(27,79,160,0.12);   color: var(--brand-blue); }
.role-bodega     { background: rgba(23,162,184,0.15);  color: #17a2b8; }
.role-compras    { background: rgba(253,126,20,0.15);  color: #fd7e14; }
.role-produccion { background: rgba(40,167,69,0.15);   color: #28a745; }
.role-calidad    { background: rgba(255,193,7,0.15);   color: #e0a800; }

/* ============================================================
   RECURSOS — Personal y Maquinaria
   ============================================================ */
.resources-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 16px; overflow-y: auto; height: calc(100vh - var(--header-h) - var(--navbar-h)); }
@media (max-width: 900px) { .resources-grid { grid-template-columns: 1fr; } }

.resource-panel { background: var(--bg-card); border-radius: var(--radius); border: 1px solid var(--border); display: flex; flex-direction: column; }
.resource-panel-header {
    padding: 14px 18px 10px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
}
.resource-panel-title { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 7px; }
.resource-panel-body { padding: 12px; overflow-y: auto; flex: 1; }

.resource-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin-bottom: 6px;
    background: var(--bg-app);
    transition: all var(--transition);
}
.resource-item:hover { border-color: var(--brand-blue); background: rgba(27,79,160,0.04); }
.resource-info { flex: 1; }
.resource-name { font-weight: 600; font-size: 13px; color: var(--text-primary); }
.resource-sub  { font-size: 11px; color: var(--text-muted); }
.resource-hours { text-align: right; }
.hours-avail { font-size: 16px; font-weight: 700; color: var(--success); }
.hours-used  { font-size: 11px; color: var(--text-muted); }
.hours-bar   { width: 80px; height: 4px; background: var(--border); border-radius: 2px; margin-top: 3px; margin-left: auto; }
.hours-bar-fill { height: 100%; border-radius: 2px; background: var(--success); transition: width 0.4s; }
.hours-bar-fill.overloaded { background: var(--danger); }
.hours-bar-fill.busy { background: var(--warning); }

/* ============================================================
   AUTH / LOGIN
   ============================================================ */
.login-page {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-app);
    padding: 20px;
}
.login-card {
    background: var(--bg-card);
    border-radius: 14px;
    box-shadow: var(--shadow-modal);
    padding: 40px 36px;
    width: 100%; max-width: 400px;
    border: 1px solid var(--border);
}
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo-img { height: 80px; width: auto; object-fit: contain; }
.login-logo-text { font-size: 32px; font-weight: 800; }
.login-logo-text .hni { color: var(--brand-blue); }
.login-logo-text .erp { color: var(--text-muted); font-size: 20px; }
.login-subtitle { color: var(--text-muted); font-size: 12px; text-align: center; margin-top: 6px; letter-spacing: 0.3px; }
.login-divider { border: none; border-top: 1px solid var(--border); margin: 22px 0; }
.login-error { background: rgba(201,51,41,0.10); color: var(--brand-red); border: 1px solid rgba(201,51,41,0.30); border-radius: var(--radius); padding: 10px 14px; font-size: 13px; margin-bottom: 16px; }

/* ============================================================
   FLASH MESSAGES
   ============================================================ */
.flash-message {
    margin: 10px 16px 0;
    padding: 10px 14px;
    border-radius: var(--radius);
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; font-weight: 500;
    animation: slideDown 0.3s ease;
}
@keyframes slideDown { from { transform: translateY(-10px); opacity: 0; } to { transform: none; opacity: 1; } }
.flash-success { background: rgba(40,167,69,0.12); color: var(--success); border: 1px solid rgba(40,167,69,0.25); }
.flash-error   { background: rgba(201,51,41,0.10); color: var(--brand-red); border: 1px solid rgba(201,51,41,0.25); }
.btn-close-flash { margin-left: auto; background: transparent; border: none; cursor: pointer; font-size: 18px; color: inherit; line-height: 1; }

/* ============================================================
   UTILIDADES
   ============================================================ */
.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-8 { gap: 8px; }
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--danger) !important; }
.fw-bold { font-weight: 700; }
.mt-8 { margin-top: 8px; }
.mb-0 { margin-bottom: 0; }
.d-none { display: none !important; }
@media (min-width: 576px) { .d-sm-inline { display: inline !important; } }
@media (min-width: 768px) { .d-md-inline { display: inline !important; } }

/* User menu dropdown */
.user-menu { position: relative; cursor: pointer; display: flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: var(--radius); transition: background var(--transition); }
.user-menu:hover { background: rgba(27,79,160,0.08); }
[data-theme="dark"] .user-menu:hover { background: rgba(255,255,255,0.08); }
.user-name { font-size: 13px; color: var(--text-header); }
.user-menu > i { color: var(--text-muted); }

.user-dropdown {
    position: absolute; top: calc(100% + 8px); right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-modal);
    min-width: 200px;
    z-index: 2000;
    display: none;
    overflow: hidden;
}
.user-dropdown.open { display: block; animation: slideUp 0.15s ease; }
.user-dropdown-header { display: flex; align-items: center; gap: 10px; padding: 12px 14px; }
.user-dropdown-header strong { display: block; font-size: 13px; color: var(--text-primary); }
.user-dropdown-header small { color: var(--text-muted); font-size: 11px; }
.user-dropdown hr { border: none; border-top: 1px solid var(--border); margin: 0; }
.user-dropdown a { display: flex; align-items: center; gap: 8px; padding: 9px 14px; color: var(--text-secondary); font-size: 13px; transition: all var(--transition); }
.user-dropdown a:hover { background: rgba(27,79,160,0.08); color: var(--brand-blue); }

/* Urgente indicator */
.urgente-badge { position: absolute; top: 7px; right: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--brand-red); animation: pulse 1.5s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(201,51,41,0.5); } 50% { box-shadow: 0 0 0 5px rgba(201,51,41,0); } }

/* Scrollbar global */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* Inputs en dark mode */
[data-theme="dark"] .form-control { color: var(--text-primary); }
[data-theme="dark"] select.form-control option { background: var(--bg-input); }

/* ---- Notification bell ---- */
.notif-wrap { position: relative; }
.notif-badge {
    position: absolute; top: 2px; right: 2px;
    background: var(--brand-red); color: #fff;
    border-radius: 50px; font-size: 9px; font-weight: 800;
    min-width: 16px; height: 16px;
    display: flex; align-items: center; justify-content: center;
    padding: 0 3px; line-height: 1;
    border: 1.5px solid var(--bg-header);
    pointer-events: none;
}
.notif-panel {
    position: absolute; top: calc(100% + 10px); right: 0;
    width: 360px; max-width: 95vw;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow-modal);
    z-index: 3000; overflow: hidden;
}
.notif-panel-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 11px 14px; border-bottom: 1px solid var(--border);
    font-size: 13px; font-weight: 700; color: var(--text-primary);
}
.btn-text {
    background: none; border: none; cursor: pointer;
    color: var(--brand-blue); font-size: 11px; font-weight: 600;
    display: flex; align-items: center; gap: 4px;
    padding: 3px 6px; border-radius: var(--radius);
    transition: background var(--transition);
}
.btn-text:hover { background: rgba(27,79,160,0.10); }
.notif-list { max-height: 380px; overflow-y: auto; }
.notif-item {
    display: flex; gap: 10px; align-items: flex-start;
    padding: 10px 14px; border-bottom: 1px solid var(--border);
    cursor: pointer; transition: background var(--transition);
    text-decoration: none; color: inherit;
}
.notif-item:hover { background: rgba(27,79,160,0.05); }
.notif-item.unread { background: rgba(27,79,160,0.06); }
.notif-item.unread:hover { background: rgba(27,79,160,0.11); }
.notif-icon {
    width: 32px; height: 32px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; flex-shrink: 0;
}
.notif-icon.success { background: rgba(40,167,69,0.12);  color: var(--success); }
.notif-icon.info    { background: rgba(27,79,160,0.12);  color: var(--brand-blue); }
.notif-icon.warning { background: rgba(255,193,7,0.15);  color: #d4a017; }
.notif-icon.danger  { background: rgba(201,51,41,0.10);  color: var(--brand-red); }
.notif-body { flex: 1; min-width: 0; }
.notif-title { font-size: 12px; font-weight: 700; color: var(--text-primary); margin-bottom: 2px; }
.notif-msg   { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-time  { font-size: 10px; color: var(--text-muted); white-space: nowrap; margin-top: 3px; }
.notif-unread-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand-blue); flex-shrink: 0; margin-top: 6px; }
.notif-empty { text-align: center; padding: 28px 16px; color: var(--text-muted); font-size: 12px; }

/* ---- Column admin: role pills ---- */
.roles-pill-list { display: flex; flex-wrap: wrap; gap: 3px; }
.roles-pill { display: inline-block; padding: 2px 7px; border-radius: 10px; font-size: 10px; font-weight: 600; background: rgba(27,79,160,0.12); color: var(--brand-blue); }
.roles-pill--green  { background: rgba(40,167,69,0.10);   color: var(--success); }
.roles-pill--orange { background: rgba(253,126,20,0.12); color: var(--orange); }

/* ---- Role checkboxes in admin ---- */
.role-checks { display: flex; flex-direction: column; gap: 5px; }
.role-check-label { display: flex; align-items: center; gap: 6px; font-size: 12px; cursor: pointer; color: var(--text-secondary); }
.role-check-label input { accent-color: var(--brand-blue); width: 14px; height: 14px; }
.role-checks-hint { font-size: 10px; color: var(--text-muted); margin-bottom: 3px; }

/* ---- Visibility admin chips ---- */
.vis-role-label { display: flex; align-items: center; cursor: pointer; }
.vis-role-label input[type=checkbox] { display: none; }
.vis-role-chip {
    display: inline-block; padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 600;
    border: 1.5px solid var(--border); color: var(--text-muted); background: transparent;
    transition: all .15s; user-select: none;
}
.vis-role-label input:checked + .vis-role-chip { background: var(--brand-blue); color: #fff; border-color: var(--brand-blue); }
.vis-role-label:hover .vis-role-chip { border-color: var(--brand-blue); color: var(--brand-blue); }

/* ---- Cotización inner tabs ---- */
.cot-tab {
    padding: 7px 14px; font-size: 12px; font-weight: 600;
    border: none; background: none; color: var(--text-secondary);
    border-bottom: 2px solid transparent; cursor: pointer;
    transition: all var(--transition);
}
.cot-tab:hover { color: var(--brand-blue); }
.cot-tab.active { color: var(--brand-blue); border-bottom-color: var(--brand-blue); }
.cot-tab-content { display: none; }

/* ---- Header: logo accent line ---- */
.app-header::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--brand-red) 0%, var(--brand-blue) 60%, transparent 100%);
}

/* Responsive */
@media (max-width: 768px) {
    .kanban-col { min-width: 240px; max-width: 240px; }
    .header-stats { display: none; }
    .resources-grid { grid-template-columns: 1fr; }
    .nav-item span { display: none; }
    .nav-dropdown-toggle span { display: none; }
}

/* ============================================================
   FONT-SCALE OVERRIDES — all app text uses CSS var sizes
   ============================================================ */
.col-name       { font-size: var(--fz-sm); }
.col-count      { font-size: var(--fz-sm); }
.col-total-usd  { font-size: var(--fz-sm); }
.col-add-btn    { font-size: var(--fz-xl); }
.card-num       { font-size: var(--fz-sm); }
.card-client    { font-size: var(--fz-sm); }
.card-machine   { font-size: var(--fz-sm); }
.card-component { font-size: var(--fz-sm); }
.card-title     { font-size: var(--fz-sm); }
.tag-badge      { font-size: var(--fz-sm); }
.card-date      { font-size: var(--fz-sm); }
.card-field     { font-size: var(--fz-sm); }
.card-bar-row   { font-size: var(--fz-sm); }
.card-actions button { font-size: var(--fz-sm); }

.form-label     { font-size: var(--fz-sm); }
.form-control   { font-size: var(--fz-base); }
.btn            { font-size: var(--fz-sm); }
.btn-sm         { font-size: var(--fz-sm); }

.modal-tab      { font-size: var(--fz-sm); }
.data-table th  { font-size: var(--fz-sm); }
.data-table td  { font-size: var(--fz-sm); }
.role-badge     { font-size: var(--fz-sm); }
.info-block-title { font-size: var(--fz-sm); }
.info-val       { font-size: var(--fz-sm); }
.note-content   { font-size: var(--fz-sm); }
.note-meta      { font-size: var(--fz-sm); }
.history-item   { font-size: var(--fz-sm); }

.nav-item       { font-size: var(--fz-sm); }
.nav-dropdown-toggle { font-size: var(--fz-sm); }
.nav-dropdown-menu a { font-size: var(--fz-sm); }

.user-dropdown a  { font-size: var(--fz-sm); }
.user-dropdown-header strong { font-size: var(--fz-sm); }
.user-dropdown-header small  { font-size: var(--fz-sm); }
.user-name        { font-size: var(--fz-sm); }

.notif-title    { font-size: var(--fz-sm); }
.notif-msg      { font-size: var(--fz-sm); }
.notif-time     { font-size: var(--fz-sm); }
.page-title     { font-size: var(--fz-xl); }
.flash-message  { font-size: var(--fz-sm); }
.cot-tab        { font-size: var(--fz-sm); }
.roles-pill     { font-size: var(--fz-sm); }
.role-check-label { font-size: var(--fz-sm); }
.vis-role-chip  { font-size: var(--fz-sm); }
.stat-chip      { font-size: var(--fz-sm); }

/* ---- Font-size controller button ---- */
.font-size-btn {
    background: transparent; border: 1px solid var(--border);
    cursor: pointer; color: var(--text-header);
    height: 32px; padding: 0 9px;
    border-radius: var(--radius);
    display: flex; align-items: center; gap: 3px;
    font-size: 12px; font-weight: 700;
    transition: all var(--transition);
    user-select: none;
}
.font-size-btn:hover { background: rgba(27,79,160,0.08); border-color: var(--brand-blue); }
.font-size-btn.font-active { background: rgba(27,79,160,0.1); border-color: var(--brand-blue); }
[data-theme="dark"] .font-size-btn { border-color: rgba(255,255,255,0.15); }
[data-theme="dark"] .font-size-btn.font-active { background: rgba(116,185,255,0.12); border-color: #74b9ff; }
.font-size-btn .fz-label { font-size: 11px; letter-spacing: 0.5px; color: var(--text-muted); }

/* ODT List view */
.odt-list-page { padding: 16px 20px; overflow-y: auto; height: calc(100vh - var(--header-h) - var(--navbar-h)); }
.odt-list-filters {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 12px 16px;
    margin-bottom: 16px;
}
.odt-list-table-wrap { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.odt-list-table { width: 100%; border-collapse: collapse; }
.odt-list-table th {
    background: var(--bg-column); color: var(--text-muted);
    font-size: var(--fz-sm); font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px;
    padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.odt-list-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: var(--fz-sm); vertical-align: middle; }
.odt-list-table tr:last-child td { border-bottom: none; }
.odt-list-table tr:hover td { background: rgba(27,79,160,0.04); cursor: pointer; }
.odt-num-badge {
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--brand-blue); color: #fff;
    border-radius: 6px; padding: 2px 8px;
    font-size: var(--fz-sm); font-weight: 700; letter-spacing: 0.3px;
}
.odt-status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; flex-shrink: 0; }

/* Admin settings page */
.settings-section { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.settings-section-title { font-size: var(--fz-md); font-weight: 700; margin-bottom: 14px; padding-bottom: 8px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px; }
