/* ── Layout ────────────────────────────────────────────────────── */
html {
    scrollbar-gutter: stable; /* reserve scrollbar space always — prevents header shift */
}
body {
    background-color: #f0f2f5;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.navbar {
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
.navbar-brand {
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: 0.01em;
}
.navbar-brand i {
    color: #4dabf7;
}
.nav-link.active {
    color: #fff !important;
    font-weight: 600;
}

/* ── Stat cards ────────────────────────────────────────────────── */
.stat-card {
    border: none;
    border-radius: 14px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.07);
    transition: transform 0.18s, box-shadow 0.18s;
}
.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
}
.stat-card.active {
    border: 2px solid #0d6efd;
    box-shadow: 0 0 0 3px rgba(13,110,253,0.15), 0 4px 14px rgba(0,0,0,0.1);
    transform: translateY(-3px);
}
.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}
.stat-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.1;
}
.stat-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #868e96;
    font-weight: 600;
}

/* ── Content cards ─────────────────────────────────────────────── */
.card {
    border: none;
    border-radius: 14px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.07);
}
.card-header {
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
    border-radius: 14px 14px 0 0 !important;
    padding: 0.9rem 1.25rem;
}
.card-header h5 {
    font-weight: 700;
    font-size: 1rem;
}

/* ── Driver path pill (dashboard name cell) ────────────────────── */
.driver-path {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
    font-size: 10px;
    color: #868e96;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 2px;
}
.dp-icon    { color: #adb5bd; margin-right: 4px; font-size: 9px; }
.dp-hi      { color: #4c6ef5; font-weight: 700; }
.dp-ver     { color: #2f9e44; font-weight: 600; }
.dp-sep     { color: #ced4da; margin: 0 2px; }

/* ── Table ─────────────────────────────────────────────────────── */
.table thead th {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #868e96;
    border-top: none;
    padding: 0.65rem 1rem;
}
.table tbody td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
}
.table tbody tr:last-child td {
    border-bottom: none;
}
.row-jumped > td {
    background-color: #dbeafe !important;
}
.row-jumped > td:first-child {
    box-shadow: inset 4px 0 0 #0288D1;
}
code {
    font-size: 0.82em;
    background: #f1f3f5;
    padding: 2px 6px;
    border-radius: 4px;
    color: #e03131;
}

/* ── Drop zone ─────────────────────────────────────────────────── */
.drop-zone {
    border: 2px dashed #ced4da;
    border-radius: 10px;
    padding: 2.2rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, color 0.2s;
    background: #f8f9fa;
    color: #868e96;
    user-select: none;
}
.drop-zone:hover {
    border-color: #4dabf7;
    background: #e8f4fd;
    color: #1971c2;
}
.drop-zone.drag-over {
    border-color: #228be6;
    background: #dbe9ff;
    color: #1971c2;
}
.drop-zone.has-file {
    border-color: #2f9e44;
    background: #ebfbee;
    color: #2f9e44;
}
.drop-zone .drop-icon {
    font-size: 2.4rem;
    display: block;
    margin-bottom: 0.5rem;
}

/* ── Status badges ─────────────────────────────────────────────── */
.badge-available {
    background-color: #ebfbee;
    color: #2f9e44;
    font-size: 0.75rem;
    padding: 0.35em 0.7em;
    border-radius: 6px;
    font-weight: 600;
}
.badge-missing {
    background-color: #fff9db;
    color: #e67700;
    font-size: 0.75rem;
    padding: 0.35em 0.7em;
    border-radius: 6px;
    font-weight: 600;
}

/* ── Misc ──────────────────────────────────────────────────────── */
.page-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #212529;
}
.page-subtitle {
    color: #868e96;
    font-size: 0.9rem;
}
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #adb5bd;
}
.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
}
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* ── Dashboard toolbar ──────────────────────────────────────────────────── */
#driverToolbar .input-group-text {
    border-color: #dee2e6;
}
#driverToolbar .form-control {
    border-color: #dee2e6;
}
#driverToolbar .form-control:focus {
    box-shadow: none;
    border-color: #86b7fe;
}
#driverToolbar .form-control:focus + .input-group-text,
#driverToolbar .input-group:focus-within .input-group-text {
    border-color: #86b7fe;
}

/* ── Category tabs ───────────────────────────────────────────────────────── */
#categoryTabs .btn {
    border-radius: 999px;
    font-size: 0.78rem;
    padding: 0.25rem 0.75rem;
    transition: all 0.15s;
}

/* ── Pagination bar ──────────────────────────────────────────────────────── */
.cat-pagination {
    border-radius: 0 0 14px 14px;
    font-size: 0.82rem;
}
.cat-pagination .pagination {
    margin: 0;
}
.cat-pagination .page-link {
    font-size: 0.78rem;
    padding: 0.25rem 0.55rem;
    border-radius: 6px !important;
    margin: 0 1px;
    border-color: #dee2e6;
}
.cat-pagination .page-item.active .page-link {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

/* ── Sortable column headers ─────────────────────────────────────────────── */
th.sort-col {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    transition: color 0.15s;
}
th.sort-col:hover {
    color: #0d6efd !important;
}
th.sort-col:hover .sort-icon {
    color: #0d6efd !important;
}
.sort-icon {
    font-size: 0.65rem;
    vertical-align: middle;
    opacity: 0.6;
    transition: opacity 0.15s;
}
th.sort-col:hover .sort-icon,
.sort-icon.text-primary {
    opacity: 1;
}

/* ── Collapsible category header ─────────────────────────────────────────── */
.cat-header {
    transition: background 0.15s;
}
.cat-header:hover {
    background: #f8f9fa !important;
}
.cat-chevron {
    font-size: 0.8rem;
    width: 16px;
    text-align: center;
}

/* ── Corrupted Reports page ─────────────────────────────────────────────── */
.badge-type-printer    { background:#dbeafe; color:#1d4ed8; }
.badge-type-nonprinter { background:#f3e8ff; color:#7c3aed; }
.badge-new             { background:#fef3c7; color:#b45309; }
.badge-investigating   { background:#dbeafe; color:#1d4ed8; }
.badge-uploaded        { background:#dcfce7; color:#15803d; }
.badge-resolved        { background:#e2e8f0; color:#475569; }
.badge-status {
    display:inline-block; padding:3px 9px; border-radius:999px;
    font-size:11px; font-weight:700; letter-spacing:.04em;
}
.badge-driver-type {
    display:inline-block; padding:2px 8px; border-radius:4px;
    font-size:11px; font-weight:600;
}
.missing-list { font-size:11px; color:#64748b; max-width:260px; white-space:normal; }
.missing-list code { background:#f1f5f9; padding:1px 4px; border-radius:3px; font-size:10px; display:block; margin:1px 0; }
td { vertical-align:middle !important; }
.action-cell { white-space:nowrap; }
.notes-input { font-size:12px; min-width:140px; }
.online-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #2f9e44;
    margin-right: 6px;
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.4; }
}

/* ── User status badges (user management page) ───────────────────────────── */
.badge-user-active {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    background: #ebfbee;
    color: #2f9e44;
}
.badge-user-inactive {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    background: #f1f3f5;
    color: #868e96;
}

/* ── Permission badges (user management page) ────────────────────────────── */
.perm-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
}
.perm-add     { background: #dbeafe; color: #1d4ed8; }
.perm-delete  { background: #fce7e7; color: #c0392b; }
.perm-licenses { background: #fef3c7; color: #b45309; }
.perm-reports  { background: #fee2e2; color: #b91c1c; }
.perm-admin    { background: #dcfce7; color: #15803d; }
