/* ============================================================================
   CSS CUSTOM PROPERTIES (Design Tokens)
   ============================================================================ */
:root {
    --primary:        #2563eb;
    --primary-light:  #dbeafe;
    --success:        #16a34a;
    --warning:        #d97706;
    --danger:         #dc3545;
    --bg-surface:     #ffffff;
    --bg-secondary:   #f4f6f9;
    --border:         #e4e6ea;
    --border-md:      #d0d3da;
    --text-primary:   #1a1d23;
    --text-secondary: #4b5262;
    --text-muted:     #8b93a5;
    --card-bg:        #ffffff;
    --surface:        #f8fafc;
    --radius-sm:      4px;
    --radius-md:      6px;

    /* Timeline — prefixed tl- to avoid conflicts */
    --tl-ff:       'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --tl-surface:  var(--bg-primary, #ffffff);
    --tl-surface2: var(--bg-secondary, #f3f4f6);
    --tl-line:     var(--border, #e4e6ea);
    --tl-line2:    var(--border-md, #d0d3da);
    --tl-ink:      var(--text-primary, #1a1d23);
    --tl-ink2:     var(--text-secondary, #4b5262);
    --tl-ink3:     var(--text-muted, #8b93a5);
    --tl-accent:   var(--primary, #2563eb);
    --tl-acc-lt:   var(--primary-light, #dbeafe);
    --tl-ok:       #16a34a;
    --tl-ok-bg:    #f0fdf4;
    --tl-warn:     #b45309;
    --tl-warn-bg:  #fffbeb;
    --tl-err:      #b91c1c;
    --tl-err-bg:   #fef2f2;
    --tl-r:        var(--radius-md, 6px);
    --tl-r-sm:     var(--radius-sm, 4px);
    --tl-node:     28px;
    --tl-spine-x:  13px;
}


/* ============================================================================
   RESET & BASE
   ============================================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f7fa;
    color: #2c3e50;
}


/* ============================================================================
   TOP BAR
   ============================================================================ */
.topbar {
    display: flex;
    align-items: center;
    height: 54px;
    padding: 0 20px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 200;
    gap: 16px;
}

.topbar-user-label {
    font-size: 12.5px;
    color: var(--text-muted);
    color: #fff;
}

.topbar-avatar {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--primary) 0%, rgba(0,167,193) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 500;
    color: #fff;
    flex-shrink: 0;
}

.header {
    background: linear-gradient(135deg, rgba(8, 0.28, 0.28) 0%, rgba(0,167,193) 100%);
    color: #ffffff;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: relative;
}

.header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.header p {
    opacity: 0.9;
    font-size: 1.1rem;
}

.header-user {
    position: absolute;
    top: 2rem;
    right: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-logout {
    padding: 0.5rem 1rem;
    background: rgba(255,255,255,0.2);
    border: 1px solid white;
    color: white;
    border-radius: 5px;
    cursor: pointer;
    transition: transform 0.3s;
}

.btn-logout:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.05);
}


/* ============================================================================
   LAYOUT — SIDEBAR & MAIN CONTENT
   ============================================================================ */
.container {
    display: flex;
    max-width: 1800px;
    margin: 0 auto;
}

.sidebar {
    width: 228px;
    background: white;
    border-right: 1px solid var(--border);
    padding: 16px 10px 20px;
    position: sticky;
    top: 54px;
    height: calc(100vh - 54px);
    overflow-y: auto;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border-md); border-radius: 2px; }

.sidebar-section-label {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    text-transform: uppercase;
    padding: 12px 10px 5px;
    margin-top: 4px;
}

/* Legacy elements hidden in new sidebar */
.sidebar h3 { display: none; }
.sidebar > .search-box:not(.topbar-search) { display: none; }

.sidebar-add-section {
    padding: 4px 10px 2px;
}

.btn-sidebar-add {
    width: 100%;
    font-size: 12px !important;
    padding: 6px 12px !important;
    border-radius: var(--radius-md) !important;
}

.sidebar-section-nav {
    margin-left: 8px;
}

.nav-item-admin {
    margin-top: 8px;
    border-top: 1px solid var(--border);
    padding-top: 10px;
}

.nav-icon {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    opacity: 0.65;
    transition: opacity 0.15s;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    margin-bottom: 1px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.15s;
    font-size: 13px;
    color: var(--text-muted);
    border-left: none;
    border-bottom: none;
}

.nav-item:last-child { border-bottom: none; }

.nav-item:hover {
    background: rgba(255,255,255,0.05);
    color: var(--text-primary);
    border-left-color: transparent;
}

.nav-item:hover .nav-icon { opacity: 1; }

.nav-item.active {
    background: var(--primary-light);
    color: var(--text-primary);
    font-weight: 500;
    border-left: none;
    border-bottom: none;
}

.nav-item.active .nav-icon { opacity: 1; }

/* Sub-navigation items (section links injected by JS) */
.nav-subitem {
    padding: 6px 10px;
    margin: 1px 0;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background 0.15s;
    font-size: 12px;
    color: var(--text-muted);
}

.nav-subitem:hover {
    background: rgba(255,255,255,0.05);
    color: var(--text-secondary);
}

.main-content {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    padding: 2rem;
}

.search-box {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e0e6ed;
    border-radius: 5px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.search-box:focus {
    outline: none;
    border-color: #667eea;
}


/* ============================================================================
   BUTTONS (global)
   ============================================================================ */
.btn-primary {
    background: #6a6c75;
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 5px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary:hover {
    background: #cccaca;
    color: black;
    transform: scale(1.05);
}

.btn-secondary {
    padding: 0.5rem 1rem;
    background: #6a6c75;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-secondary:hover { opacity: 0.9; }

.btn-danger {
    background: #dc3545;
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 5px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-danger:hover { background: #c82333; }

.btn-small {
    padding: 0.25rem 0.75rem;
    font-size: 0.85rem;
}

.btn-export {
    padding: 0.5rem 1rem;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    font-weight: 600;
    transition: opacity 0.2s;
}

.btn-export:hover { opacity: 0.9; }

.btn-upload {
    background: white;
    color: #000000;
    border: none;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    font-weight: 400;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 1rem;
    transition: transform 0.2s;
}

.btn-upload:hover { transform: scale(1.05); }


/* ============================================================================
   FORMS
   ============================================================================ */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #2c3e50;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e0e6ed;
    border-radius: 5px;
    font-size: 1rem;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.error-message {
    color: #dc3545;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: #f8d7da;
    border-radius: 5px;
    display: none;
}

.editable {
    cursor: text;
    padding: 0.25rem;
    border-radius: 3px;
    transition: all 0.3s;
}

.editable:hover {
    background: #fff;
    box-shadow: 0 0 0 2px #667eea;
}

.editable:focus {
    outline: none;
    background: #fff;
    box-shadow: 0 0 0 2px #667eea;
}


/* ============================================================================
   MODALS
   ============================================================================ */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    overflow: auto;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 2rem;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    max-height: 80vh;
    overflow-y: auto;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover { color: #000; }

/* Persona / wide modal overlay */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(3px);
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    padding: 2rem 1rem;
}

.modal-overlay .modal-box {
    background: var(--card-bg, #ffffff);
    border-radius: 12px;
    width: 100%;
    max-width: 900px;
    margin: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
}

.modal-overlay .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border, #e2e8f0);
    background: var(--bg-surface, #f8fafc);
}

.modal-overlay .modal-body {
    padding: 1.5rem;
    max-height: 75vh;
    overflow-y: auto;
}

.modal-overlay .modal-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-muted, #64748b);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.modal-overlay .modal-close:hover { background: var(--border, #e2e8f0); }

.modal-wide { max-width: 900px !important; width: 90vw; }


/* ============================================================================
   LOGIN MODAL
   ============================================================================ */
#loginModal {
    background: rgba(15,23,42,0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    align-items: center;
    justify-content: center;
}

#loginModal .modal-content.login-box {
    background: #ffffff;
    border-radius: 16px;
    padding: 0;
    max-width: 420px;
    width: 92%;
    box-shadow: 0 24px 64px rgba(0,0,0,0.28), 0 0 0 1px rgba(255,255,255,0.06);
    overflow: hidden;
    animation: loginSlideIn 0.3s cubic-bezier(0.34,1.56,0.64,1);
    max-height: 92vh;
    overflow-y: auto;
}

@keyframes loginSlideIn {
    from { opacity: 0; transform: translateY(-24px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.login-header {
    background: linear-gradient(135deg, rgba(8,0.28,0.28) 0%, rgba(0,167,193) 100%);
    padding: 2rem 2rem 1.75rem;
    text-align: center;
}

.login-header .login-logo {
    width: 48px;
    height: 48px;
    background: rgba(255,255,255,0.15);
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
    font-size: 1.5rem;
}

.login-header h2 {
    color: rgba(255,255,255,0.65);
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
    letter-spacing: 0.01em;
}

.login-header p {
    color: rgba(255,255,255,0.65);
    font-size: 0.82rem;
    margin: 0;
}

.login-body {
    padding: 1.75rem 2rem 2rem;
}

#loginModal .form-group label {
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #ffffff;
    margin-bottom: 0.4rem;
}

#loginModal .form-group input[type="text"],
#loginModal .form-group input[type="password"] {
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    padding: 0.7rem 0.9rem;
    font-size: 0.95rem;
    background: #f8fafc;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#loginModal .form-group input:focus {
    outline: none;
    border-color: #2563eb;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}

#loginModal .btn-primary {
    width: 100%;
    padding: 0.8rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    background: linear-gradient(135deg, rgba(8,0.28,0.28) 0%, rgba(0,167,193) 100%);
    border: none;
    cursor: pointer;
    color: #fff;
    transition: opacity 0.2s, transform 0.1s;
    margin-top: 0.25rem;
}

#loginModal .btn-primary:hover { opacity: 0.92; }
#loginModal .btn-primary:active { transform: scale(0.99); }

#loginModal h2 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.5rem;
}

#totpVerifyCode,
#totpSetupCode {
    text-align: center;
    font-size: 1.8rem !important;
    letter-spacing: 0.5em;
    font-weight: 700;
    border: 2px solid #cbd5e1 !important;
    border-radius: 10px !important;
    background: #f8fafc !important;
    padding: 0.75rem !important;
}

#totpVerifyCode:focus,
#totpSetupCode:focus {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.12) !important;
}

.qr-container {
    background: #f1f5f9;
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    margin: 1rem 0;
}

.qr-container img {
    border-radius: 8px;
    width: 180px;
    height: 180px;
    border: none !important;
}

.login-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 1rem 0;
}

.login-security-note {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #f1f5f9;
}

.login-security-note svg {
    flex-shrink: 0;
    color: #22c55e;
}


/* ============================================================================
   BADGES (shared across all modules)
   ============================================================================ */
.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-new        { background: #d4edda; color: #155724; }
.badge-success    { background: #d4edda; color: #155724; }
.badge-info       { background: #d1ecf1; color: #0c5460; }
.badge-approved   { background: #d1ecf1; color: #0c5460; }
.badge-active     { background: #d4edda; color: #155724; }
.badge-warning    { background: #fff3cd; color: #856404; }
.badge-under_review { background: #fff3cd; color: #856404; }
.badge-retired    { background: #e2e3e5; color: #383d41; }
.badge-rejected   { background: #f8d7da; color: #721c24; }
.badge-danger     { background: #f8d7da; color: #721c24; }
.badge-outdated   { background: #f3e8ff; color: #9333ea; }
.badge-eol        { background: #fee2e2; color: #dc2626; }
.badge-soon       { background: #fef3c7; color: #d97706; }
.badge-ok         { background: #dcfce7; color: #16a34a; }
.badge-unknown    { background: #f1f5f9; color: #64748b; }

/* Status badges (section/document views) */
.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-badge.compliant     { background: #d4edda; color: #155724; }
.status-badge.in-progress   { background: #fff3cd; color: #856404; }
.status-badge.non-compliant { background: #f8d7da; color: #721c24; }
.status-badge.draft         { background: #e2e3e5; color: #383d41; }
.status-badge.approved      { background: #d4edda; color: #155724; }
.status-badge.archived      { background: #f8d7da; color: #721c24; }
.status-badge.in_review     { background: #ffc107; color: #333; }

/* Inline flag badges (discrepancy table) */
.badge-retired-flag {
    background: #fff3cd;
    color: #92400e;
    border: 1px solid #f59e0b;
    font-weight: 700;
}

.badge-rejected-flag {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #dc3545;
    font-weight: 700;
}

.badge-remove {
    background: #fff3cd;
    color: #92400e;
    border: 1px solid #f59e0b;
    font-weight: 600;
}


/* ============================================================================
   LOADING OVERLAY & SPINNER
   ============================================================================ */
.loading-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.loading-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem auto;
}

@keyframes spin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes loginSlideIn {
    from { opacity: 0; transform: translateY(-24px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}


/* ============================================================================
   DASHBOARD
   ============================================================================ */
.dashboard {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.dashboard h2 {
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

.dashboard-tabs {
    display: flex;
    border-bottom: 2px solid #ddd;
    margin-bottom: 20px;
}

.tab-btn {
    padding: 10px 20px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 16px;
    border-bottom: 3px solid transparent;
    transition: 0.3s;
}

.tab-btn.active {
    border-bottom: 3px solid #007bff;
    color: #007bff;
    font-weight: bold;
}

.tab-btn:hover { background-color: #f8f9fa; }

/* Stat cards row */
.dash-stat-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 1rem;
    margin-bottom: 1rem;
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.dash-stat-card {
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
}

.dash-stat-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted, #6c757d);
    margin-bottom: 0.4rem;
}

.dash-stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary, #1a1a2e);
    line-height: 1.1;
}

.dash-stat-sub {
    font-size: 0.8rem;
    color: var(--text-muted, #6c757d);
    margin-top: 0.3rem;
}

.dash-progress-track {
    height: 6px;
    background: var(--border-color, #e0e0e0);
    border-radius: 3px;
    margin-top: 0.6rem;
    overflow: hidden;
}

.dash-progress-fill {
    height: 100%;
    background: var(--primary, #2563eb);
    border-radius: 3px;
    transition: width 0.6s ease;
}

/* Two-column layout */
.dash-main-grid {
    display: grid;
    margin-bottom: 1rem;
    gap: 1.5rem;
    align-items: start;
    width: 100%;
}

.dash-side {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
    margin-top: 3rem;
}

.dash-panel {
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    width: 100%;
    box-sizing: border-box;
}

.dash-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.dash-panel-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary, #1a1a2e);
}

/* Section progress bars */
.section-progress-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

.section-progress-item {
    width: 100%;
    min-width: 0;
}

.section-progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.3rem;
}

.section-progress-title {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-primary, #1a1a2e);
}

.section-progress-pct {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted, #6c757d);
}

.progress-bar-track {
    height: 8px;
    background: var(--border-color, #e0e0e0);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease;
}

.section-progress-sub {
    font-size: 0.75rem;
    color: var(--text-muted, #6c757d);
    margin-top: 0.25rem;
}

/* Activity feed */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 240px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.activity-icon {
    font-size: 1rem;
    width: 28px;
    height: 28px;
    background: var(--bg-secondary, #f4f6f9);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.activity-label {
    font-size: 0.82rem;
    font-weight: 500;
    text-transform: capitalize;
    color: var(--text-primary, #1a1a2e);
}

.activity-meta {
    font-size: 0.75rem;
    color: var(--text-muted, #6c757d);
}

.no-activity {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Quick actions */
.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.quick-action-btn {
    background: var(--bg-secondary, #f4f6f9);
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: 8px;
    padding: 0.75rem 0.5rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    transition: background 0.2s, border-color 0.2s;
}

.quick-action-btn:hover {
    background: var(--primary-light, #eff6ff);
    border-color: var(--primary, #2563eb);
}

.qa-icon  { font-size: 1.4rem; }
.qa-label {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-primary, #1a1a2e);
    text-align: center;
}

/* Status cards (legacy) */
.status-card { padding: 1.5rem; border-radius: 8px; text-align: center; }
.status-card.compliant    { background: #d4edda; border-left: 4px solid #28a745; }
.status-card.in-progress  { background: #fff3cd; border-left: 4px solid #ffc107; }
.status-card.non-compliant{ background: #f8d7da; border-left: 4px solid #dc3545; }
.status-card .number { font-size: 2.5rem; font-weight: bold; margin-bottom: 0.5rem; }
.status-card .label  { font-size: 0.9rem; text-transform: uppercase; font-weight: 600; }

/* Dashboard overview layout */
.overview-layout {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 1.5rem;
    align-items: start;
}

.overview-main { min-width: 0; }

.overview-sidebar {
    position: sticky;
    top: 1rem;
}

.quick-links-panel {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-top: 3px solid #667eea;
    border-radius: 8px;
    padding: 1rem;
}

.quick-links-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #dee2e6;
}

.quick-links-header h3 {
    margin: 0;
    font-size: 0.95rem;
    color: #495057;
    font-weight: 600;
}

.overview-sidebar #dashboardLinks {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.overview-sidebar .link-item {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 0.6rem 0.75rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.overview-sidebar .link-item:hover {
    border-color: #667eea;
    box-shadow: 0 2px 6px rgba(102,126,234,0.15);
}

.overview-sidebar .link-item a {
    font-size: 0.875rem;
    font-weight: 500;
    color: #667eea;
    text-decoration: none;
    display: block;
}

.overview-sidebar .link-item a:hover { text-decoration: underline; }

.overview-sidebar .link-item p {
    font-size: 0.775rem;
    color: #6c757d;
    margin: 0.25rem 0 0.4rem 0;
}

.overview-sidebar .btn-danger {
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
}

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

.dashboard-link-content  { flex: 1; }
.dashboard-link-title    { font-weight: 600; color: #667eea; margin-bottom: 0.25rem; }
.dashboard-link-desc     { font-size: 0.9rem; color: #6c757d; }
.dashboard-link-actions  { display: flex; gap: 0.5rem; }


/* ============================================================================
   SECTIONS PAGE
   ============================================================================ */
.section {
    background: white;
    margin-bottom: 1.5rem;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.section-header {
    padding: 1.5rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
    border-left: 4px solid #6c6e6d;
    border-right: 4px solid #6c6e6d;
    transition: all 0.3s;
    margin-bottom: 1.5rem;
}

.section-header:hover { background: #e9ecef; }
.section-header h3    { font-size: 1.2rem; color: #2c3e50; }
.section-header h2    { margin: 0; }

.section-header h3,
.section-header p { margin: 0; }
.section-header p { color: #6c757d; }

.section-header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.section-header .status-badge {
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
}

.section-content { padding: 1.5rem; display: none; }
.section.active .section-content { display: block; }
.section.active .section-header  { background: #667eea; color: white; }
.section.active .section-header h3 { color: white; }

.expand-icon { transition: transform 0.3s; }
.section.active .expand-icon { transform: rotate(180deg); }

/* Section cards grid */
#sectionCards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.section-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border-left: none;
    border-top: 4px solid #6c757d;
    display: flex;
    flex-direction: column;
}

.section-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.section-card.status-compliant     { border-top-color: #28a745; }
.section-card.status-in-progress   { border-top-color: #ffc107; }
.section-card.status-non-compliant { border-top-color: #dc3545; }

.section-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.section-card-header h3 { margin: 0; font-size: 1.2rem; }

.section-card-body { display: grid; gap: 0.5rem; }
.card-stat { font-size: 0.9rem; color: #6c757d; }

.section-detail {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Info grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.info-item {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 5px;
}

.info-item label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #667eea;
    font-size: 0.9rem;
}

.info-item .value { color: #2c3e50; }

/* Tabs (section detail) */
.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid #dee2e6;
}

.tab-button {
    background: none;
    border: none;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    font-size: 1rem;
    color: #6c757d;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}

.tab-button:hover      { color: #667eea; }
.tab-button.active     { color: #667eea; border-bottom-color: #667eea; }
.tab-content           { padding: 1rem 0; }

/* Requirements */
.requirement-item {
    background: white;
    border-left: 4px solid #6c757d;
    padding: 1rem;
    margin-bottom: 0.75rem;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.requirement-item.status-met      { border-left-color: #28a745; }
.requirement-item.status-partial  { border-left-color: #ffc107; }
.requirement-item.status-not_met  { border-left-color: #dc3545; }
.requirement-item.status-n_a      { border-left-color: #6c757d; }

.req-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.req-status { font-weight: 600; font-size: 0.9rem; }
.req-text   { margin: 0.5rem 0; line-height: 1.5; }

.req-notes {
    margin: 0.5rem 0;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 4px;
    font-size: 0.9rem;
    font-style: italic;
}

.req-actions { margin-top: 0.5rem; }

.req-actions select {
    padding: 0.25rem 0.5rem;
    border: 1px solid #dee2e6;
    border-radius: 4px;
}

.req-notes-section { margin: 0.5rem 0; }

.req-notes-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted, #888);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.inline-edit-notes .notes-text {
    display: block;
    padding: 0.35rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    min-height: 1.8rem;
    background: var(--input-bg, rgba(0,0,0,0.05));
    transition: background 0.15s;
}

.inline-edit-notes .notes-text:hover { background: var(--hover-bg, rgba(0,0,0,0.15)); }

.notes-placeholder { color: var(--text-muted, #aaa); }

.notes-textarea {
    width: 100%;
    padding: 0.4rem 0.5rem;
    border: 1px solid var(--border-color, #ddd);
    border-radius: 4px;
    font-size: 0.9rem;
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
    background: var(--input-bg, #fff);
    color: var(--text-primary, #333);
}

.notes-textarea:focus {
    outline: none;
    border-color: var(--primary-color, #4a90e2);
    box-shadow: 0 0 0 2px rgba(74,144,226,0.15);
}

.notes-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.4rem;
}

/* Notes box */
.notes {
    background: #fffbea;
    padding: 1rem;
    border-radius: 5px;
    border-left: 4px solid #ffc107;
    margin-top: 1rem;
}

.notes h4 { margin-bottom: 0.5rem; color: #856404; }

/* Evidence */
.evidence-list { list-style: none; margin-top: 1rem; }

.evidence-list li {
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 5px;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.evidence-list li:before { content: "📄"; margin-right: 0.5rem; }
.evidence-item-content   { flex: 1; }
.evidence-item-actions   { display: flex; gap: 0.5rem; }

.last-updated {
    text-align: right;
    color: #6c757d;
    font-size: 0.9rem;
    margin-top: 2rem;
    padding: 1rem;
}


/* ============================================================================
   SCOPE PAGE
   ============================================================================ */
.scope-content {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    line-height: 1.8;
}

.scope-content h2 { color: #667eea; margin-top: 1.5rem; margin-bottom: 0.5rem; }
.scope-content h3 { color: #495057; margin-top: 1rem; margin-bottom: 0.5rem; }
.scope-content li { margin-left: 1.5rem; margin-bottom: 0.5rem; }

.scope-editor {
    width: 100%;
    min-height: 400px;
    padding: 1rem;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    resize: vertical;
}

/* ============================================================================
   NOTES PAGE
   ============================================================================ */
.notes-display {
    min-height: 200px;
}

.notes-tips-panel .notes-tips-body {
    padding: 0.25rem 0;
    font-size: 0.82rem;
    color: #495057;
    line-height: 2;
}

.notes-tips-body p  { margin: 0; }
.notes-tips-body code {
    background: #f0f4ff;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 0.8rem;
    color: #667eea;
}

/* ============================================================================
   DOCUMENTS
   ============================================================================ */
.document-item {
    background: white;
    padding: 1rem;
    margin-bottom: 0.75rem;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.doc-name { font-weight: 600; margin-bottom: 0.5rem; }

.doc-register-overview {
    background: var(--bg-secondary, #f8f9ff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

.doc-overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.doc-overview-card {
    background: var(--bg-primary, #fff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 6px;
    padding: 0.75rem;
    font-size: 0.875rem;
}

.doc-overview-card strong {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--text-primary, #2d3748);
}

.doc-overview-card p {
    margin: 0;
    color: var(--text-muted, #718096);
    line-height: 1.4;
}

.doc-overview-icon { font-size: 1.25rem; margin-bottom: 0.25rem; }

/* Version history */
.version-list {
    max-height: 500px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.version-item {
    padding: 1.25rem;
    background: #f8f9fa;
    border-left: 4px solid #667eea;
    margin-bottom: 1rem;
    border-radius: 4px;
    transition: all 0.2s;
}

.version-item:hover    { background: #e9ecef; border-left-width: 6px; }
.version-item strong   { color: #667eea; }
.version-item div      { margin: 0.25rem 0; }
.version-item a        { display: inline-block; margin-top: 0.5rem; }

#docVersionInfo             { border-left: 4px solid #667eea; }
#docVersionInfo small       { display: block; }

.evidence-section-badge {
    display: inline-block;
    padding: 2px 8px;
    background: var(--primary-light, #e8f0fe);
    color: var(--primary, #1a73e8);
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 300;
    white-space: nowrap;
}

/* Link items */
.link-item {
    background: white;
    padding: 1rem;
    margin-bottom: 0.75rem;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.link-item a            { color: #667eea; text-decoration: none; font-weight: 600; }
.link-item a:hover      { text-decoration: underline; }
.link-item p            { margin: 0.5rem 0; color: #6c757d; font-size: 0.9rem; }

.file-link {
    display: inline-block;
    color: #667eea;
    text-decoration: none;
    padding: 0.5rem 1rem;
    background: #f0f4ff;
    border-radius: 5px;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    transition: all 0.3s;
}

.file-link:hover { background: #667eea; color: white; }


/* ============================================================================
   DATA TABLE (shared generic table)
   ============================================================================ */
.data-table-scroll {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;   /* smooth scroll on Safari/Chrome Mac */
}

   .data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 900px;
    background: white;
}

.data-table th {
    background: #f8f9fa;
    padding: 0.75rem;
    text-align: left;
    font-weight: 500;
    border-bottom: 2px solid #dee2e6;
}

.data-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #dee2e6;
    font-size: 0.8rem;
    font-weight: 300;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.td-actions {
    white-space: nowrap !important;
    width: 1% !important;
    overflow: visible !important;
    max-width: none !important;
}

.data-table td.td-wrap {
    white-space: normal;
    word-break: break-word;
    max-width: 200px;
}

.data-table tr:hover { background: #f8f9fa; }

.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: #6c757d;
}

.empty-state p { margin: 0.5rem 0; }


/* ============================================================================
   SOFTWARE REGISTER — TAB NAV
   ============================================================================ */
.software-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #e0e0e0;
}

.soft-tab {
    padding: 0.75rem 1.5rem;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 1rem;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    position: relative;
}

.soft-tab:hover        { background: #f5f5f5; color: #333; }
.soft-tab.active       { border-bottom-color: #667eea; color: #667eea; font-weight: 600; }

/* Tab badge (pending count) */
.tab-badge {
    position: absolute;
    top: -6px; right: -6px;
    background: var(--danger, #dc3545);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 10px;
    padding: 1px 5px;
    min-width: 16px;
    text-align: center;
    line-height: 1.4;
}


/* ============================================================================
   SOFTWARE REGISTER — UPLOAD / FEED
   ============================================================================ */
.upload-box {
    background: linear-gradient(135deg, rgba(2,95,99) 0%, rgba(0,167,193) 100%);
    color: white;
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    text-align: center;
}

.upload-box h2  { color: white; margin: 0 0 0.5rem 0; }
.upload-box p   { margin: 0.5rem 0; opacity: 0.95; }

.upload-info {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.3);
}

.upload-info p { margin: 0.5rem 0; font-size: 0.9rem; }

.feed-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.feed-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.feed-meta h3    { margin: 0; }
.feed-stat       { font-size: 0.82rem; color: var(--text-muted); }
.feed-actions    { display: flex; gap: 0.5rem; align-items: center; }

.feed-stats-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.stat-chip {
    background: var(--surface, #f8fafc);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.4rem 0.8rem;
    text-align: center;
    min-width: 80px;
}

.stat-value { display: block; font-size: 1.3rem; font-weight: 700; line-height: 1.2; }
.stat-label { display: block; font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }

.feed-search-bar { margin-bottom: 0.75rem; }


/* ── Software Stats ──────────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}
.stats-category-card {
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: 10px;
    padding: 1.25rem;
}
.stats-category-header {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: 1rem;
    padding-bottom: .75rem;
    border-bottom: 1px solid var(--border-color, #e0e0e0);
}
.stats-category-icon { font-size: 1.3rem; }
.stats-category-title { font-size: .95rem; font-weight: 600; margin: 0; }
.stats-empty { color: var(--text-muted, #888); font-size: .85rem; font-style: italic; }
.stat-app-block { margin-bottom: 1rem; }
.stat-app-block:last-child { margin-bottom: 0; }
.stat-app-header { display: flex; justify-content: space-between; margin-bottom: .3rem; }
.stat-app-name { font-weight: 600; font-size: .875rem; }
.stat-app-total { font-size: .8rem; color: var(--text-muted, #888); }
.stat-versions-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.stat-versions-table th {
    text-align: left; padding: .25rem .4rem;
    color: var(--text-muted, #888); font-weight: 500;
    border-bottom: 1px solid var(--border-color, #e0e0e0);
}
.stat-versions-table td { padding: .3rem .4rem; border-bottom: 1px solid var(--border-color-light, #f5f5f5); }
.stat-version { font-family: monospace; }
.stat-eol-date { color: var(--text-muted, #888); font-size: .78rem; }
.stat-badge { font-size: .72rem; font-weight: 600; padding: .1rem .4rem; border-radius: 4px; }
.stat-badge.eol      { background: #fde8e8; color: #c0392b; }
.stat-badge.expiring { background: #fef3cd; color: #856404; }
.stat-badge.outdated { background: #fff3e0; color: #e65100; }
.stat-badge.ok       { background: #e8f5e9; color: #2e7d32; }
.stats-loading, .stats-error { color: var(--text-muted, #888); font-size: .875rem; padding: 1rem 0; }

/* ============================================================================
   SOFTWARE REGISTER — REVIEW QUEUE
   ============================================================================ */
.queue-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.queue-header h3 { margin: 0 0 0.25rem; }
.sub-text        { font-size: 0.83rem; color: var(--text-muted); margin: 0; }

.row-actions { display: flex; gap: 0.4rem; }

.btn-approve {
    background: var(--success, #16a34a);
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 0.25rem 0.6rem;
    font-size: 0.8rem;
    cursor: pointer;
    font-weight: 600;
}

.btn-approve:hover { opacity: 0.88; }

.btn-reject {
    background: var(--danger, #dc3545);
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 0.25rem 0.6rem;
    font-size: 0.8rem;
    cursor: pointer;
    font-weight: 600;
}

.btn-reject:hover { opacity: 0.88; }


/* ============================================================================
   SOFTWARE REGISTER — APP CARDS
   ============================================================================ */
.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.app-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.1s;
    cursor: pointer;
    border-left: none;
    border-top: 4px solid #6c757d;
    display: flex;
    flex-direction: column;
}

.app-card:hover         { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.app-card.pending       { border-top: 4px solid #ffc107; }
.app-card.master        { border-top: 4px solid #28a745; }
.app-card.retired       { opacity: 0.6; border-top-color: #6c757d; }

.app-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e9ecef;
}

.app-card-header h4 { margin: 0; color: #2c3e50; font-size: 1.1rem; }

.badges {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    align-items: flex-end;
}

.app-eol-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}

.app-details            { margin: 1rem 0; }
.app-details p          { margin: 0.5rem 0; font-size: 0.9rem; color: #495057; }
.app-details strong     { color: #2c3e50; }

.version-info {
    background: #f8f9fa;
    padding: 0.75rem;
    border-radius: 6px;
    margin-bottom: 0.75rem;
}

.version-info p { margin: 0.25rem 0; }

.app-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

.btn-edit {
    flex: 1;
    padding: 0.5rem 1rem;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: opacity 0.2s;
    background: #f8f9fa;
    color: #495057;
}

.btn-edit:hover { background: #e9ecef; }

.btn-retire {
    flex: 1;
    padding: 0.5rem 1rem;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: opacity 0.2s;
    background: #f8f9fa;
    color: #dc3545;
}

.btn-retire:hover { background: #fff5f5; }

.btn-unretire {
    background: #17a2b8;
    color: white;
    border: none;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.78rem;
    cursor: pointer;
    white-space: nowrap;
}

.btn-unretire:hover { background: #138496; }


/* ============================================================================
   SOFTWARE REGISTER — MASTER REGISTER TABLE
   ============================================================================ */
/* Master register filter row — sits below the queue-header */
.master-filter-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.filter-input {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    width: 200px;
    font-size: 0.85rem;
}

.checkbox-label { display: flex; align-items: center; gap: 4px; font-size: 0.85rem; }

/* View toggle */
.view-toggle {
    display: flex;
    gap: 0.25rem;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    overflow: hidden;
}

.view-toggle-btn {
    padding: 0.5rem 1rem;
    border: none;
    background: white;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.view-toggle-btn:hover  { background: #f8f9fa; }
.view-toggle-btn.active { background: #667eea; color: white; font-weight: 600; }

/* Table wrapper */
.table-wrapper {
    width: 100%;
    max-width: 100%;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow-x: auto;
}



/* Master table */
.master-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
    table-layout: fixed;
}

.master-table thead   { background: #f8f9fa; }

.master-table th {
    padding: 0.55rem 0.45rem;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
    white-space: normal;
    word-break: break-word;
    vertical-align: bottom;
    line-height: 1.2;
}

.master-table td {
    padding: 0.5rem 0.45rem;
    border-bottom: 1px solid #e9ecef;
    color: #212529;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: top;
}

.master-table td.cell-wrap {
    white-space: normal;
    word-break: break-word;
}

.master-table tbody tr:hover        { background: #f8f9fa; }
.master-table tbody tr.retired-row  { opacity: 0.6; background: #f8f9fa; }

/*
 * 12-column widths — must total 100%
 *  1  Software          15%
 *  2  Installed          7%
 *  3  Latest             6%
 *  4  EOL Status         7%
 *  5  EOL Date           6%
 *  6  EOL Detail         7%
 *  7  Approval           7%
 *  8  Owner             10%
 *  9  Devices            4%
 * 10  Affected Users    10%
 * 11  Justification     13%
 * 12  Actions            8%
 *                     = 100%
 */
.master-table th:nth-child(1)  { width: 15%; }
.master-table th:nth-child(2)  { width: 7%; }
.master-table th:nth-child(3)  { width: 6%; }
.master-table th:nth-child(4)  { width: 7%; }
.master-table th:nth-child(5)  { width: 6%; }
.master-table th:nth-child(6)  { width: 7%; }
.master-table th:nth-child(7)  { width: 7%; }
.master-table th:nth-child(8)  { width: 10%; }
.master-table th:nth-child(9)  { width: 4%; text-align: center; }
.master-table th:nth-child(10) { width: 10%; }
.master-table th:nth-child(11) { width: 13%; }
.master-table th:nth-child(12) { width: 8%; }

/* Table action buttons */
.table-actions {
    display: flex;
    gap: 0.2rem;
    flex-wrap: wrap;
}

.btn-sm {
    padding: 0.2rem 0.4rem;
    border: 1px solid #dee2e6;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.78rem;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-sm:hover { background: #f8f9fa; transform: scale(1.05); }

/* Utility classes */
.retired-row        { opacity: 0.65; }
.truncate           { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 0; }
.mono               { font-family: monospace; font-size: 0.82rem; }
.version-newer      { color: var(--warning, #d97706); font-family: monospace; }
.text-muted         { color: var(--text-muted); }
.manual-check-link  { font-size: 0.78rem; white-space: nowrap; }
.error-msg          { color: var(--danger, #dc3545); padding: 1rem; }


/* Info strip below controls */
.master-info-strip {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.5rem 0 0.6rem;
    padding: 0.45rem 0.75rem;
    background: var(--surface, #f8fafc);
    border-left: 3px solid var(--primary, #2563eb);
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.eol-last-run {
    white-space: nowrap;
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* EOL tier explanation panel */
.eol-tier-panel {
    margin-bottom: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.8rem;
    background: var(--surface, #f8fafc);
}

.eol-tier-panel summary {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-muted);
    list-style: none;
    user-select: none;
}

.eol-tier-panel summary::-webkit-details-marker { display: none; }
.eol-tier-panel[open] summary { border-bottom: 1px solid var(--border); }

.eol-tier-body {
    padding: 0.6rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.eol-tier-row {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
}

.eol-tier-badge {
    display: inline-block;
    min-width: 52px;
    text-align: center;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 1px;
}

.eol-tier-badge.t1  { background: #dbeafe; color: #1d4ed8; }
.eol-tier-badge.t2  { background: #dcfce7; color: #15803d; }
.eol-tier-badge.t2b { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
.eol-tier-badge.t3  { background: #fff3cd; color: #92400e; }
.eol-tier-badge.t4  { background: #f3e8ff; color: #7c3aed; }

/* ============================================================================
   SOFTWARE REGISTER — PERSONAS
   ============================================================================ */
.personas-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.personas-header h3  { margin: 0 0 0.25rem; }
.persona-actions     { display: flex; gap: 0.5rem; }

.job-status-line {
    display: block;
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    min-height: 1.2em;
}

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

.persona-card {
    background: var(--card-bg, #fff);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem;
    cursor: pointer;
    transition: box-shadow 0.15s;
}

.persona-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.1); }

.persona-card-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.persona-icon { font-size: 1.4rem; }

.persona-stats {
    display: flex;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

.persona-stats span::before        { content: '• '; }
.persona-stats span:first-child::before { content: ''; }

.persona-desc      { font-size: 0.82rem; color: var(--text-muted); margin: 0.25rem 0; }
.persona-generated { font-size: 0.75rem; color: var(--text-muted); margin: 0.4rem 0 0; }

.persona-card-actions {
    margin-top: 0.6rem;
    border-top: 1px solid var(--border);
    padding-top: 0.5rem;
}

/* Persona detail modal */
.persona-detail-body         { display: flex; flex-direction: column; gap: 1.5rem; }
.persona-section             { margin-bottom: 1.5rem; }

.persona-detail-body .persona-section h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted, #64748b);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border, #e2e8f0);
}

.empty-msg { text-align: center; color: var(--text-muted); padding: 1rem; }


/* ============================================================================
   SOFTWARE REGISTER — DISCREPANCIES
   ============================================================================ */
.discrepancy-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.discrepancy-header h3 { margin: 0 0 0.25rem; }
.disc-summary          { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }

.disc-card {
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--card-bg, #fff);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.disc-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.device-name  { font-size: 1rem; }
.device-meta  { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.2rem; }

.disc-card-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.disc-table     { font-size: 0.85rem; }
.email-link     { font-size: 0.8rem; color: var(--primary, #3b82f6); }
.btn-sm-text    { font-size: 0.8rem; padding: 0.3rem 0.7rem; }

.row-remove { background: #fff8f0; }
.row-addon  { background: #f0f8ff; }


/* ============================================================================
   TIMELINE GUIDE  (all selectors prefixed tl-)
   ============================================================================ */
.tl-page         { display: grid; grid-template-columns: 1fr 296px; gap: 24px; padding: 28px 24px; max-width: 1280px; margin: 0 auto; }
.tl-col-main     { min-width: 0; }
.tl-col-side     { display: flex; flex-direction: column; gap: 16px; }

.tl-title-row    { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 24px; gap: 16px; flex-wrap: wrap; }
.tl-page-title   { font-size: 1.1rem; font-weight: 600; color: var(--tl-ink); letter-spacing: -.01em; }
.tl-page-title span { color: var(--tl-ink3); font-weight: 400; margin-left: 6px; font-size: 13px; }
.tl-controls-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tl-ctrl-group   { display: flex; align-items: center; gap: 6px; }
.tl-ctrl-label   { font-size: 11px; font-weight: 500; color: var(--tl-ink3); text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
.tl-ctrl-input   { font-size: 12px; color: var(--tl-ink); background: var(--tl-surface); border: 1px solid var(--tl-line2); border-radius: var(--tl-r-sm); padding: 5px 8px; outline: none; transition: border-color .15s; font-family: inherit; }
.tl-ctrl-input:focus { border-color: var(--tl-accent); }
.tl-btn-config   { font-size: 12px; font-weight: 500; color: var(--tl-ink2); background: var(--tl-surface); border: 1px solid var(--tl-line2); border-radius: var(--tl-r-sm); padding: 5px 10px; cursor: pointer; display: flex; align-items: center; gap: 5px; transition: border-color .15s, color .15s; font-family: inherit; }
.tl-btn-config:hover { border-color: var(--tl-accent); color: var(--tl-accent); }

.tl-readiness-row   { display: flex; align-items: center; gap: 10px; margin: 0 0 28px; }
.tl-readiness-label { font-size: 11px; font-weight: 500; color: var(--tl-ink3); text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; width: 80px; flex-shrink: 0; }
.tl-readiness-track { flex: 1; height: 3px; background: var(--tl-line); border-radius: 2px; overflow: hidden; }
.tl-readiness-fill  { height: 100%; background: var(--tl-accent); border-radius: 2px; transition: width .6s ease; }
.tl-readiness-pct   { font-size: 12px; font-weight: 500; color: var(--tl-accent); width: 36px; text-align: right; }

/* Spine */
.tl-spine        { position: relative; padding-left: calc(var(--tl-node) + 16px); }
.tl-spine-thread { position: absolute; left: var(--tl-spine-x); top: 14px; bottom: 14px; width: 1px; background: var(--tl-line); }
.tl-spine-fill   { position: absolute; left: 0; top: 0; width: 100%; background: var(--tl-accent); border-radius: 1px; transition: height .8s ease; }
.tl-spine-today  {
    position: absolute; left: 50%; transform: translate(-50%,-50%);
    width: 9px; height: 9px; border-radius: 50%;
    background: var(--tl-accent); border: 2px solid var(--tl-surface);
    box-shadow: 0 0 0 1px var(--tl-accent);
    transition: top .8s ease; z-index: 3;
}
.tl-spine-today::after {
    content: 'Today'; position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    font-size: 10px; font-weight: 600; color: var(--tl-accent); white-space: nowrap; letter-spacing: .03em;
}

/* Phase */
.tl-phase    { position: relative; margin-bottom: 4px; }
.tl-node     { position: absolute; left: calc(-1 * var(--tl-node) - 16px); top: 14px; width: var(--tl-node); height: var(--tl-node); border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 1px solid var(--tl-line2); background: var(--tl-surface); z-index: 2; transition: border-color .2s, background .2s; }
.tl-node svg { width: 12px; height: 12px; display: block; }
.tl-node-done   { background: var(--tl-ok);      border-color: var(--tl-ok);     color: #fff; }
.tl-node-active { background: var(--tl-accent);  border-color: var(--tl-accent); color: #fff; }
.tl-node-warn   { background: var(--tl-warn-bg); border-color: var(--tl-warn);   color: var(--tl-warn); }
.tl-node-future { background: var(--tl-surface); border-color: var(--tl-line2);  color: var(--tl-ink3); }
.tl-node-active::after { content: ''; position: absolute; inset: -5px; border-radius: 50%; border: 1px solid var(--tl-accent); opacity: .3; animation: tl-ring 2s ease-out infinite; }
@keyframes tl-ring { 0%{transform:scale(1);opacity:.3} 100%{transform:scale(1.6);opacity:0} }

/* Cards */
.tl-card        { background: var(--tl-surface); border: 1px solid var(--tl-line); border-radius: var(--tl-r); overflow: hidden; cursor: pointer; transition: border-color .15s; }
.tl-card:hover  { border-color: var(--tl-line2); }
.tl-card-active { border-color: var(--tl-accent); }
.tl-card-warn   { border-color: var(--tl-warn); }
.tl-card-done   { opacity: .78; }
.tl-card-done:hover { opacity: 1; }
.tl-card-head   { display: flex; align-items: center; justify-content: space-between; padding: 13px 16px; gap: 12px; user-select: none; }
.tl-card-head-left  { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tl-status-bar  { width: 3px; height: 28px; border-radius: 2px; flex-shrink: 0; }
.tl-bar-done    { background: var(--tl-ok); }
.tl-bar-active  { background: var(--tl-accent); }
.tl-bar-warn    { background: var(--tl-warn); }
.tl-bar-future  { background: var(--tl-line2); }
.tl-card-title  { font-size: 13px; font-weight: 600; color: var(--tl-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-card-head-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.tl-timing      { font-size: 11px; color: var(--tl-ink3); white-space: nowrap; font-family: monospace; }
.tl-edit-icon   { display: none; color: var(--tl-ink3); cursor: pointer; padding: 2px; border-radius: 3px; transition: color .15s; }
.tl-edit-icon:hover { color: var(--tl-accent); }
.tl-card-head:hover .tl-edit-icon { display: flex; }
.tl-chevron     { color: var(--tl-ink3); transition: transform .2s; flex-shrink: 0; }
.tl-open .tl-chevron { transform: rotate(180deg); }
.tl-card-body   { max-height: 0; overflow: hidden; transition: max-height .28s ease; border-top: 0px solid var(--tl-line); }
.tl-open .tl-card-body { border-top-width: 1px; }
.tl-card-inner  { padding: 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.tl-col-title   { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--tl-ink3); margin-bottom: 8px; }
.tl-list        { list-style: none; display: flex; flex-direction: column; gap: 5px; }
.tl-list li     { font-size: 12px; color: var(--tl-ink2); display: flex; align-items: flex-start; gap: 7px; line-height: 1.45; }
.tl-list li::before { content: ''; width: 4px; height: 4px; border-radius: 50%; background: var(--tl-ink3); flex-shrink: 0; margin-top: 6px; }

/* Live strip */
.tl-live-strip  { grid-column: 1/-1; border-top: 1px solid var(--tl-line); padding-top: 12px; margin-top: 4px; }
.tl-live-title  { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--tl-ink3); display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.tl-live-dot    { width: 5px; height: 5px; border-radius: 50%; background: var(--tl-ok); animation: tl-blink 2s infinite; flex-shrink: 0; }
@keyframes tl-blink { 50%{opacity:.3} }
.tl-live-row    { display: flex; align-items: center; justify-content: space-between; padding: 5px 0; border-bottom: 1px solid var(--tl-line); font-size: 12px; }
.tl-live-row:last-child { border-bottom: none; }
.tl-live-name   { color: var(--tl-ink2); flex: 1; }

/* Pills */
.tl-pill        { font-size: 10px; font-weight: 500; padding: 2px 7px; border-radius: 10px; white-space: nowrap; font-family: monospace; }
.tl-pill.tl-ok  { background: var(--tl-ok-bg);   color: var(--tl-ok); }
.tl-pill.tl-warn{ background: var(--tl-warn-bg);  color: var(--tl-warn); }
.tl-pill.tl-err { background: var(--tl-err-bg);   color: var(--tl-err); }
.tl-pill.tl-acc { background: var(--tl-acc-lt);   color: var(--tl-accent); }

/* Drawer */
.tl-drawer-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.15); z-index: 40; }
.tl-drawer-overlay.tl-drawer-open { display: block; }
.tl-drawer      { position: fixed; top: 0; right: 0; bottom: 0; width: 340px; background: var(--tl-surface); border-left: 1px solid var(--tl-line); z-index: 50; display: flex; flex-direction: column; transform: translateX(100%); transition: transform .22s ease; }
.tl-drawer.tl-drawer-open { transform: translateX(0); }
.tl-drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--tl-line); }
.tl-drawer-head h3 { font-size: 13px; font-weight: 600; color: var(--tl-ink); }
.tl-drawer-close { background: none; border: none; cursor: pointer; color: var(--tl-ink3); padding: 3px; border-radius: 4px; transition: color .15s; }
.tl-drawer-close:hover { color: var(--tl-ink); }
.tl-drawer-body { flex: 1; overflow-y: auto; padding: 20px; }
.tl-drawer-sec-title { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--tl-ink3); margin-bottom: 8px; }
.tl-cfg-row     { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--tl-line); gap: 12px; }
.tl-cfg-row:last-child { border-bottom: none; }
.tl-cfg-name    { font-size: 12px; color: var(--tl-ink2); flex: 1; }
.tl-cfg-inputs  { display: flex; align-items: center; gap: 4px; }
.tl-cfg-input   { font-family: monospace; font-size: 12px; width: 50px; padding: 4px 6px; border: 1px solid var(--tl-line2); border-radius: var(--tl-r-sm); color: var(--tl-ink); background: var(--tl-surface); outline: none; text-align: center; transition: border-color .15s; }
.tl-cfg-input:focus { border-color: var(--tl-accent); }
.tl-cfg-sep     { font-size: 11px; color: var(--tl-ink3); }
.tl-drawer-footer { padding: 16px 20px; border-top: 1px solid var(--tl-line); display: flex; gap: 8px; }
.tl-btn-apply   { flex: 1; font-size: 12px; font-weight: 500; padding: 7px 14px; background: var(--tl-accent); color: #fff; border: none; border-radius: var(--tl-r-sm); cursor: pointer; transition: opacity .15s; font-family: inherit; }
.tl-btn-apply:hover { opacity: .88; }
.tl-btn-reset   { font-size: 12px; padding: 7px 12px; background: none; color: var(--tl-ink3); border: 1px solid var(--tl-line2); border-radius: var(--tl-r-sm); cursor: pointer; transition: color .15s; font-family: inherit; }
.tl-btn-reset:hover { color: var(--tl-ink); }

/* Sidebar panels */
.tl-panel       { background: var(--tl-surface); border: 1px solid var(--tl-line); border-radius: var(--tl-r); overflow: hidden; }
.tl-panel-head  { padding: 11px 14px; border-bottom: 1px solid var(--tl-line); display: flex; align-items: center; justify-content: space-between; }
.tl-panel-title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--tl-ink3); }
.tl-panel-badge { font-size: 9px; font-weight: 500; padding: 1px 6px; border-radius: 3px; background: var(--tl-acc-lt); color: var(--tl-accent); text-transform: uppercase; letter-spacing: .04em; }
.tl-panel-body  { padding: 12px 14px; }
.tl-stat-grid   { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tl-stat-cell   { padding: 10px; border-radius: var(--tl-r-sm); border: 1px solid var(--tl-line); }
.tl-stat-val    { font-size: 1.4rem; font-weight: 500; line-height: 1; margin-bottom: 3px; }
.tl-stat-lbl    { font-size: 10px; color: var(--tl-ink3); line-height: 1.3; }
.tl-stat-cell.tl-ok   .tl-stat-val { color: var(--tl-ok); }
.tl-stat-cell.tl-warn .tl-stat-val { color: var(--tl-warn); }
.tl-stat-cell.tl-err  .tl-stat-val { color: var(--tl-err); }
.tl-stat-cell.tl-acc  .tl-stat-val { color: var(--tl-accent); }
.tl-bar-row     { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--tl-line); }
.tl-bar-row:last-child { border-bottom: none; }
.tl-bar-name    { font-size: 11px; color: var(--tl-ink2); width: 100px; flex-shrink: 0; }
.tl-bar-track   { flex: 1; height: 3px; background: var(--tl-line); border-radius: 2px; overflow: hidden; }
.tl-bar-fill    { height: 100%; border-radius: 2px; transition: width .5s ease; }
.tl-bar-ok      { background: var(--tl-ok); }
.tl-bar-warn    { background: var(--tl-warn); }
.tl-bar-err     { background: var(--tl-err); }
.tl-bar-pct     { font-size: 10px; color: var(--tl-ink3); width: 28px; text-align: right; font-family: monospace; }
.tl-list-row    { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--tl-line); font-size: 11px; }
.tl-list-row:last-child { border-bottom: none; }
.tl-list-name   { color: var(--tl-ink2); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-list-meta   { color: var(--tl-ink3); font-size: 10px; font-family: monospace; flex-shrink: 0; }
.tl-empty       { font-size: 11px; color: var(--tl-ink3); padding: 8px 0; text-align: center; }


/* ============================================================================
   RESPONSIVE OVERRIDES
   ============================================================================ */
@media print {
    .sidebar, .search-box, .header-user, .btn-primary, .btn-danger, .btn-logout { display: none; }
    .section-content { display: block !important; }
    .section { page-break-inside: avoid; }
}

@media (max-width: 1280px) {
    .table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .master-table  { table-layout: auto; min-width: 1100px; font-size: 0.75rem; }
    .data-table    { min-width: 850px; }
}

@media (max-width: 1200px) {
    .control-bar { flex-direction: column; align-items: stretch; }
    .action-bar  { justify-content: space-between; }
}

@media (max-width: 1024px) {
    .overview-layout         { grid-template-columns: 1fr; }
    .overview-sidebar        { position: static; }
    .overview-sidebar #dashboardLinks { flex-direction: row; flex-wrap: wrap; }
    .dash-main-grid          { grid-template-columns: 1fr; }
    .dash-stat-row           { grid-template-columns: repeat(2, 1fr); }
    .dash-side               { width: 100%; }
}

@media (max-width: 900px) {
    .tl-page       { grid-template-columns: 1fr; }
    .tl-card-inner { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .section-card-header { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
    .tabs                { overflow-x: auto; }
    .data-table          { font-size: 0.85rem; }
    .data-table th,
    .data-table td       { padding: 0.5rem; }
    .apps-grid           { grid-template-columns: 1fr; }
    .filter-bar          { flex-direction: column; align-items: stretch; }
    .filter-bar select   { width: 100%; }
    .view-toggle         { display: none; }
}

@media (max-width: 600px) {
    .dash-stat-row       { grid-template-columns: 1fr; }
    .quick-actions-grid  { grid-template-columns: repeat(2, 1fr); }
}
