/**
 * HiluxNow V3 — Brand Design System
 * Primary: #EB9022 (Amber/Orange — from logo)
 * Secondary: #637986 (Steel Blue-Grey — from logo)
 * Accent: #99BC13 (Lime Green — from text logo)
 */

/* =====================================================
   BRAND COLOR OVERRIDES (Tabler CSS Variables)
   ===================================================== */
:root {
    --tblr-primary:          #EB9022;
    --tblr-primary-rgb:      235, 144, 34;
    --tblr-primary-lt:       rgba(235, 144, 34, 0.1);
    --tblr-primary-lt-rgb:   235, 144, 34;

    --hn-secondary:          #637986;
    --hn-secondary-rgb:      99, 121, 134;
    --hn-accent:             #99BC13;
    --hn-accent-rgb:         153, 188, 19;

    --hn-sidebar-bg:         #0D1117;
    --hn-sidebar-brand:      #EB9022;
    --hn-sidebar-text:       #8B949E;
    --hn-sidebar-active-bg:  rgba(235, 144, 34, 0.12);
    --hn-sidebar-active-text:#EB9022;
    --hn-sidebar-border:     rgba(255,255,255,0.06);

    --hn-font:               'Inter', 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* =====================================================
   GLOBAL BASE
   ===================================================== */
body {
    font-family: var(--hn-font);
    font-size: 14px;
}

/* Remove Tabler's default blue from links */
a { text-decoration: none; }

/* =====================================================
   SIDEBAR THEME VARIABLES — Light mode overrides
   ===================================================== */
[data-bs-theme="light"] {
    --hn-sidebar-bg:          #ffffff;
    --hn-sidebar-text:        #475569;
    --hn-sidebar-border:      rgba(0, 0, 0, 0.08);
    --hn-sidebar-active-bg:   rgba(235, 144, 34, 0.10);
    --hn-sidebar-active-text: #c97d1a;
    --hn-sidebar-brand:       #EB9022;
}

[data-bs-theme="light"] .hn-sidebar .hn-nav-link:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #1e293b;
}

[data-bs-theme="light"] .hn-sidebar .hn-nav-link[aria-expanded="true"] {
    color: #1e293b;
}

[data-bs-theme="light"] .hn-sidebar-brand-text {
    color: #1e293b;
}

[data-bs-theme="light"] .hn-nav-section-label {
    color: #94a3b8;
}

[data-bs-theme="light"] .hn-sidebar-footer {
    background: #f1f5f9;
    border-top-color: rgba(0, 0, 0, 0.08);
}

[data-bs-theme="light"] .hn-sidebar-footer .user-name {
    color: #1e293b;
}

[data-bs-theme="light"] .hn-sidebar-footer .user-email {
    color: #64748b;
}

/* =====================================================
   SIDEBAR — Themeable
   ===================================================== */
.hn-sidebar {
    background: var(--hn-sidebar-bg) !important;
    border-right: 1px solid var(--hn-sidebar-border);
    min-height: 100vh;
    width: 260px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1030;
    overflow-y: auto;
    overflow-x: hidden;
    transition: left 0.25s ease, transform 0.25s ease;
}

.hn-sidebar::-webkit-scrollbar { width: 4px; }
.hn-sidebar::-webkit-scrollbar-track { background: transparent; }
.hn-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }

/* Brand / Logo area */
.hn-sidebar-brand {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--hn-sidebar-border);
    min-height: 64px;
    text-decoration: none;
}

.hn-sidebar-brand img {
    max-height: 36px;
    width: auto;
}

.hn-sidebar-brand-text {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.3px;
    margin-left: 0.5rem;
}

.hn-sidebar-brand-text span {
    color: var(--hn-sidebar-brand);
}

/* Section label */
.hn-nav-section-label {
    padding: 1.25rem 1.25rem 0.4rem;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--hn-sidebar-text);
}

/* Nav items */
.hn-sidebar .hn-nav {
    list-style: none;
    padding: 0.5rem 0;
    margin: 0;
}

.hn-sidebar .hn-nav-item {
    margin: 1px 0.5rem;
}

.hn-sidebar .hn-nav-link {
    display: flex;
    align-items: center;
    padding: 0.55rem 0.75rem;
    border-radius: 6px;
    color: var(--hn-sidebar-text);
    font-size: 0.8375rem;
    font-weight: 500;
    transition: all 0.15s ease;
    text-decoration: none;
    gap: 0.65rem;
    cursor: pointer;
}

.hn-sidebar .hn-nav-link:hover {
    background: rgba(255,255,255,0.06);
    color: #fff;
}

.hn-sidebar .hn-nav-link.active,
.hn-sidebar .hn-nav-link.active:hover {
    background: var(--hn-sidebar-active-bg);
    color: var(--hn-sidebar-active-text);
}

.hn-sidebar .hn-nav-link .nav-icon {
    font-size: 1.1rem;
    width: 20px;
    min-width: 20px;
    text-align: center;
    color: inherit;
    opacity: 0.85;
}

.hn-sidebar .hn-nav-link .nav-badge {
    margin-left: auto;
    background: rgba(235, 144, 34, 0.2);
    color: var(--hn-sidebar-brand);
    font-size: 0.65rem;
    padding: 1px 6px;
    border-radius: 20px;
    font-weight: 600;
}

.hn-sidebar .hn-nav-link .nav-arrow {
    margin-left: auto;
    font-size: 0.65rem;
    transition: transform 0.2s;
    opacity: 0.5;
}

.hn-sidebar .hn-nav-link[aria-expanded="true"] .nav-arrow { transform: rotate(90deg); }
.hn-sidebar .hn-nav-link[aria-expanded="true"] { color: #fff; }

/* Sub-nav (children) */
.hn-sub-nav {
    list-style: none;
    padding: 0.25rem 0 0.25rem 2.5rem;
    margin: 0;
}

.hn-sub-nav .hn-nav-link {
    font-size: 0.8rem;
    padding: 0.4rem 0.75rem;
}

.hn-sub-nav .hn-nav-link::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    display: inline-block;
    flex-shrink: 0;
    opacity: 0.5;
    transition: opacity 0.15s;
}

.hn-sub-nav .hn-nav-link.active::before,
.hn-sub-nav .hn-nav-link:hover::before { opacity: 1; }

/* User info at bottom */
.hn-sidebar-footer {
    margin-top: auto;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--hn-sidebar-border);
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.hn-sidebar-footer .user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--hn-sidebar-active-bg);
    border: 1px solid rgba(235, 144, 34, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--hn-sidebar-brand);
    flex-shrink: 0;
}

.hn-sidebar-footer .user-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
    line-height: 1.2;
}

.hn-sidebar-footer .user-role {
    font-size: 0.7rem;
    color: var(--hn-sidebar-text);
}

.hn-sidebar-footer .logout-btn {
    margin-left: auto;
    color: var(--hn-sidebar-text);
    font-size: 1rem;
    transition: color 0.15s;
    text-decoration: none;
}

.hn-sidebar-footer .logout-btn:hover { color: #EF4444; }

/* =====================================================
   PAGE WRAPPER
   ===================================================== */
.hn-page-wrapper {
    margin-left: 260px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.25s;
}

/* =====================================================
   TOP NAVBAR
   ===================================================== */
.hn-topbar {
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.45rem 1.1rem;
    border-bottom: 1px solid var(--tblr-border-color);
    background:
        radial-gradient(circle at top right, rgba(var(--tblr-primary-rgb), 0.08), transparent 28%),
        linear-gradient(180deg, rgba(255,255,255,0.96), rgba(248,250,252,0.94));
    backdrop-filter: blur(12px);
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 1020;
}

[data-bs-theme="dark"] .hn-topbar {
    background:
        radial-gradient(circle at top right, rgba(var(--tblr-primary-rgb), 0.16), transparent 30%),
        linear-gradient(180deg, rgba(15,23,42,0.96), rgba(17,24,39,0.94));
}

.hn-topbar-left {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.hn-topbar-context {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.hn-topbar .breadcrumb {
    margin: 0;
    font-size: 0.78rem;
    flex-wrap: wrap;
}

.hn-topbar .breadcrumb-item + .breadcrumb-item::before { opacity: 0.4; }

.hn-topbar-breadcrumb-link {
    color: var(--tblr-primary);
    text-decoration: none;
}

.hn-topbar-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

.hn-topbar-quick-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.2rem 0.25rem;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 999px;
    background: rgba(255,255,255,0.72);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

[data-bs-theme="dark"] .hn-topbar-quick-actions {
    background: rgba(15,23,42,0.65);
    box-shadow: 0 14px 28px rgba(2, 6, 23, 0.28);
}

.hn-topbar-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: var(--tblr-muted);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    position: relative;
}

.hn-topbar-btn:hover {
    background: var(--tblr-active-bg);
    color: var(--tblr-body-color);
}

.hn-topbar-btn .badge-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--tblr-primary);
    border: 2px solid var(--tblr-bg-surface);
}

.hn-topbar-quick-link {
    min-height: 32px;
    padding: 0.38rem 0.72rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    white-space: nowrap;
    flex-shrink: 0;
    font-size: 0.74rem;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    color: #fff;
    background: linear-gradient(135deg, var(--tblr-primary), color-mix(in srgb, var(--tblr-primary) 72%, #ffffff 28%));
    border: 1px solid rgba(var(--tblr-primary-rgb), 0.35);
    box-shadow: 0 10px 18px rgba(var(--tblr-primary-rgb), 0.22);
    transition: all 0.18s ease;
}

.hn-topbar-quick-link:hover {
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 14px 24px rgba(var(--tblr-primary-rgb), 0.28);
    filter: saturate(1.05);
}

.hn-topbar-quick-link i {
    font-size: 0.92rem;
    opacity: 0.95;
}

.hn-topbar-tools {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 999px;
    background: rgba(255,255,255,0.66);
}

[data-bs-theme="dark"] .hn-topbar-tools {
    background: rgba(15,23,42,0.62);
}

/* User avatar in topbar */
.hn-topbar .topbar-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    color: var(--tblr-body-color);
    transition: background 0.15s;
}

.hn-topbar .topbar-user:hover { background: var(--tblr-active-bg); }

.hn-topbar .topbar-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--tblr-primary-lt);
    border: 1px solid rgba(235, 144, 34, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--tblr-primary);
}

.hn-topbar .topbar-user-name {
    font-size: 0.8125rem;
    font-weight: 600;
}

@media (max-width: 991.98px) {
    .hn-topbar {
        padding: 0.4rem 0.9rem;
    }

    .hn-topbar-right {
        gap: 0.5rem;
    }
}

@media (max-width: 767.98px) {
    .hn-topbar {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .hn-topbar-left,
    .hn-topbar-right {
        width: 100%;
    }

    .hn-topbar-right {
        justify-content: flex-end;
    }

    .hn-topbar-context {
        gap: 0.2rem;
    }
}

/* =====================================================
   PAGE BODY
   ===================================================== */
.hn-page-body {
    flex: 1;
    padding: 1.5rem;
}

.hn-page-header {
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.hn-page-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    color: var(--tblr-body-color);
}

.hn-page-subtitle {
    font-size: 0.8125rem;
    color: var(--tblr-muted);
    margin: 0;
}

.hn-page-header-actions { margin-left: auto; display: flex; gap: 0.5rem; }

/* =====================================================
   STAT CARDS
   ===================================================== */
.hn-stat-card {
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    border: 1px solid var(--tblr-border-color);
    background: var(--tblr-bg-surface);
    transition: transform 0.15s, box-shadow 0.15s;
    position: relative;
    overflow: hidden;
}

.hn-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.hn-stat-card .stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.hn-stat-card .stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--tblr-muted);
    margin-bottom: 0.25rem;
}

.hn-stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1;
    color: var(--tblr-body-color);
    margin-bottom: 0.5rem;
    font-variant-numeric: tabular-nums;
}

.hn-stat-card .stat-change {
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.hn-stat-card .stat-change.up { color: #22C55E; }
.hn-stat-card .stat-change.down { color: #EF4444; }
.hn-stat-card .stat-change.neutral { color: var(--tblr-muted); }

.hn-stat-card .stat-period {
    font-size: 0.7rem;
    color: var(--tblr-muted);
    margin-left: 0.35rem;
}

/* Accent bar at top of card */
.hn-stat-card.accent-primary::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--tblr-primary);
    border-radius: 10px 10px 0 0;
}

/* =====================================================
   CHART CARDS
   ===================================================== */
.hn-chart-card {
    border-radius: 10px;
    border: 1px solid var(--tblr-border-color);
    background: var(--tblr-bg-surface);
    overflow: hidden;
}

.hn-chart-card .card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--tblr-border-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: transparent;
}

.hn-chart-card .card-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0;
    color: var(--tblr-body-color);
}

.hn-chart-card .card-body { padding: 0; }

/* =====================================================
   DATA TABLE CARD
   ===================================================== */
.hn-table-card {
    border-radius: 10px;
    border: 1px solid var(--tblr-border-color);
    background: var(--tblr-bg-surface);
    overflow: hidden;
}

.hn-table-card .card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--tblr-border-color);
    display: flex;
    align-items: center;
    background: transparent;
}

.hn-table-card .card-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0;
    color: var(--tblr-body-color);
}

.hn-table-card .card-header a.view-all {
    margin-left: auto;
    font-size: 0.75rem;
    color: var(--tblr-primary);
    text-decoration: none;
    font-weight: 600;
}

.hn-data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}

.hn-data-table th {
    padding: 0.65rem 1.25rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--tblr-muted);
    border-bottom: 1px solid var(--tblr-border-color);
    white-space: nowrap;
    background: var(--tblr-active-bg);
}

.hn-data-table td {
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--tblr-border-color);
    vertical-align: middle;
    color: var(--tblr-body-color);
}

.hn-data-table tr:last-child td { border-bottom: none; }

.hn-data-table tbody tr:hover td {
    background: var(--tblr-active-bg);
}

/* =====================================================
   BADGES
   ===================================================== */
.hn-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    gap: 4px;
    white-space: nowrap;
}

.hn-badge::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

.hn-badge-success { background: rgba(34, 197, 94, 0.12); color: #22C55E; }
.hn-badge-warning { background: rgba(245, 158, 11, 0.12); color: #F59E0B; }
.hn-badge-danger  { background: rgba(239, 68, 68, 0.12); color: #EF4444; }
.hn-badge-info    { background: rgba(59, 130, 246, 0.12); color: #3B82F6; }
.hn-badge-primary { background: rgba(235, 144, 34, 0.12); color: #EB9022; }
.hn-badge-secondary { background: rgba(99, 121, 134, 0.12); color: #637986; }
.hn-badge-muted   { background: rgba(100, 116, 139, 0.12); color: #64748B; }

/* =====================================================
   AUTH / LOGIN PAGE
   ===================================================== */
.hn-auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--tblr-bg-body);
    position: relative;
    overflow: hidden;
}

.hn-auth-page::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(235,144,34,0.08) 0%, transparent 70%);
    top: -150px;
    right: -150px;
    pointer-events: none;
}

.hn-auth-page::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99,121,134,0.06) 0%, transparent 70%);
    bottom: -100px;
    left: -100px;
    pointer-events: none;
}

.hn-auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--tblr-bg-surface);
    border: 1px solid var(--tblr-border-color);
    border-radius: 16px;
    padding: 2.5rem;
    position: relative;
    z-index: 1;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.hn-auth-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.hn-auth-logo img { max-height: 50px; width: auto; }

.hn-auth-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    text-align: center;
}

.hn-auth-subtitle {
    font-size: 0.85rem;
    color: var(--tblr-muted);
    text-align: center;
    margin-bottom: 1.75rem;
}

/* =====================================================
   FORM ENHANCEMENTS
   ===================================================== */
.hn-form-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--tblr-body-color);
    margin-bottom: 0.35rem;
}

.hn-form-control {
    font-size: 0.875rem;
    border-radius: 8px;
    border: 1px solid var(--tblr-border-color);
    background: var(--tblr-bg-surface);
    color: var(--tblr-body-color);
    padding: 0.6rem 0.9rem;
    width: 100%;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.hn-form-control:focus {
    outline: none;
    border-color: var(--tblr-primary);
    box-shadow: 0 0 0 3px rgba(235, 144, 34, 0.15);
}

/* =====================================================
   BUTTONS
   ===================================================== */
.hn-btn-primary {
    background: var(--tblr-primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0.6rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    text-decoration: none;
}

.hn-btn-primary:hover {
    background: #D4811A;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(235, 144, 34, 0.3);
}

.hn-btn-outline {
    background: transparent;
    color: var(--tblr-body-color);
    border: 1px solid var(--tblr-border-color);
    border-radius: 8px;
    padding: 0.55rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    text-decoration: none;
}

.hn-btn-outline:hover {
    background: var(--tblr-active-bg);
    color: var(--tblr-body-color);
    border-color: var(--tblr-border-color-translucent);
}

/* =====================================================
   FOOTER
   ===================================================== */
.hn-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--tblr-border-color);
    font-size: 0.75rem;
    color: var(--tblr-muted);
    display: flex;
    align-items: center;
}

/* =====================================================
   SIDEBAR COLLAPSE — Desktop
   ===================================================== */
@media (min-width: 992px) {
    body.hn-sidebar-hidden .hn-sidebar {
        left: -260px;
    }

    body.hn-sidebar-hidden .hn-page-wrapper {
        margin-left: 0;
    }
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 991.98px) {
    .hn-sidebar {
        transform: translateX(-100%);
        left: 0;
    }

    .hn-sidebar.open { transform: translateX(0); }

    .hn-page-wrapper { margin-left: 0; }
}

/* Sidebar toggle — visible on all screen sizes */
.hn-sidebar-toggle {
    display: flex;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    border-radius: 8px;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    color: var(--tblr-muted);
    transition: all 0.15s;
}

.hn-sidebar-toggle:hover { background: var(--tblr-active-bg); color: var(--tblr-body-color); }

/* Mobile overlay */
.hn-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1029;
}

.hn-sidebar-overlay.active { display: block; }

/* =====================================================
   DARK THEME SPECIFICS
   ===================================================== */
[data-bs-theme="dark"] {
    --tblr-bg-body:     #0D1117;
    --tblr-bg-surface:  #161B22;
    --tblr-active-bg:   rgba(255,255,255,0.04);
    --tblr-border-color: #30363D;
    --tblr-muted:       #8B949E;
}

[data-bs-theme="light"] {
    --tblr-bg-body:     #F5F7FA;
    --tblr-bg-surface:  #FFFFFF;
    --tblr-active-bg:   rgba(0,0,0,0.04);
    --tblr-border-color: #E2E8F0;
    --tblr-muted:       #718096;
}

/* =====================================================
   UTILITY
   ===================================================== */
.text-primary-hn { color: var(--tblr-primary) !important; }
.bg-primary-hn { background: var(--tblr-primary) !important; }
.bg-primary-lt-hn { background: rgba(235, 144, 34, 0.1) !important; }

/* Icon color helpers for stat cards */
.icon-amber  { background: rgba(235, 144, 34, 0.12); color: #EB9022; }
.icon-blue   { background: rgba(59, 130, 246, 0.12); color: #3B82F6; }
.icon-green  { background: rgba(34, 197, 94, 0.12);  color: #22C55E; }
.icon-purple { background: rgba(139, 92, 246, 0.12); color: #8B5CF6; }
.icon-red    { background: rgba(239, 68, 68, 0.12);  color: #EF4444; }
.icon-teal   { background: rgba(20, 184, 166, 0.12); color: #14B8A6; }
.icon-steel  { background: rgba(99, 121, 134, 0.12); color: #637986; }

/* Page transitions */
.hn-page-body { animation: fadeInUp 0.2s ease; }

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* =====================================================
   CENTRALIZED CREATE/EDIT FORM SYSTEM
   ===================================================== */
.v3-form-page {
    max-width: 1520px;
}

.v3-admin-index-page {
    max-width: 1520px;
}

.v3-admin-page-header .page-title {
    font-weight: 800;
    letter-spacing: -0.02em;
}

.v3-admin-filter-card,
.v3-admin-table-card {
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.07);
}

[data-bs-theme="dark"] .v3-admin-filter-card,
[data-bs-theme="dark"] .v3-admin-table-card {
    box-shadow: 0 14px 30px rgba(2, 6, 23, 0.28);
}

.v3-admin-filter-card .card-body {
    background: rgba(248, 250, 252, 0.72);
}

[data-bs-theme="dark"] .v3-admin-filter-card .card-body {
    background: rgba(15, 23, 42, 0.62);
}

.v3-admin-table-card .table thead th {
    font-size: 0.74rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--tblr-muted);
}

.v3-admin-lookup-tabs .v3-admin-tab-btn {
    border-radius: 999px;
    padding-inline: 0.75rem;
    font-weight: 600;
}

.v3-form-page .card:not(.v3-form-panel) {
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.07);
}

[data-bs-theme="dark"] .v3-form-page .card:not(.v3-form-panel) {
    box-shadow: 0 14px 32px rgba(2, 6, 23, 0.28);
}

.v3-form-page .card-header {
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
    background: rgba(248, 250, 252, 0.82);
}

[data-bs-theme="dark"] .v3-form-page .card-header {
    background: rgba(15, 23, 42, 0.64);
}

.v3-form-page .card-title {
    font-weight: 800;
    letter-spacing: -0.01em;
}

.v3-form-page-header .page-title {
    letter-spacing: -0.02em;
    font-weight: 800;
}

.v3-form-shell {
    display: grid;
    gap: 1.25rem;
}

.v3-form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) minmax(300px, 0.9fr);
    gap: 1.25rem;
    align-items: start;
}

.v3-form-main,
.v3-form-side {
    display: grid;
    gap: 1.1rem;
}

.v3-form-panel {
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(255,255,255,0.99), rgba(248,250,252,0.96));
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
    overflow: hidden;
}

[data-bs-theme="dark"] .v3-form-panel {
    background: linear-gradient(180deg, rgba(15,23,42,0.94), rgba(15,23,42,0.88));
    box-shadow: 0 18px 40px rgba(2, 6, 23, 0.33);
}

.v3-form-panel-header {
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
    padding: 1rem 1.2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
}

.v3-form-panel-title {
    margin: 0;
    font-size: 0.98rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.v3-form-panel-subtitle {
    margin: 0.3rem 0 0;
    color: var(--tblr-muted);
    font-size: 0.81rem;
    line-height: 1.55;
}

.v3-form-panel-body {
    padding: 1rem 1.2rem 1.2rem;
}

.v3-form-shell .form-control,
.v3-form-shell .form-select,
.v3-form-shell .input-group-text,
.v3-form-shell .btn {
    border-radius: 12px;
}

.v3-form-shell .form-control,
.v3-form-shell .form-select {
    border-color: rgba(148, 163, 184, 0.24);
    min-height: 38px;
}

[data-bs-theme="dark"] .v3-form-shell .form-control,
[data-bs-theme="dark"] .v3-form-shell .form-select {
    background: rgba(15, 23, 42, 0.74);
    border-color: rgba(148, 163, 184, 0.18);
}

.v3-form-shell .form-control:focus,
.v3-form-shell .form-select:focus {
    border-color: rgba(14, 165, 233, 0.65);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.12);
}

.v3-form-sticky-card {
    position: sticky;
    top: 1rem;
}

/* Stock create/edit (migrated from page-level styles) */
.stock-form-shell {
    display: grid;
    gap: 1.4rem;
}

.stock-form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) minmax(280px, 0.9fr);
    gap: 1.3rem;
    align-items: start;
}

.stock-form-main,
.stock-form-side {
    display: grid;
    gap: 1.1rem;
}

.stock-panel {
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.96));
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
    overflow: hidden;
}

[data-bs-theme="dark"] .stock-panel {
    background: linear-gradient(180deg, rgba(15,23,42,0.95), rgba(15,23,42,0.88));
    box-shadow: 0 18px 44px rgba(2, 6, 23, 0.35);
}

.stock-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.1rem 1.2rem 0;
}

.stock-panel-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.stock-panel-subtitle {
    margin: 0.35rem 0 0;
    color: var(--tblr-muted);
    font-size: 0.82rem;
    line-height: 1.6;
}

.stock-panel-body {
    padding: 1.1rem 1.2rem 1.2rem;
}

.stock-field-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 1rem;
}

.stock-field-grid > .col-span-12 { grid-column: span 12; }
.stock-field-grid > .col-span-6 { grid-column: span 6; }
.stock-field-grid > .col-span-4 { grid-column: span 4; }
.stock-field-grid > .col-span-3 { grid-column: span 3; }

.stock-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.45rem;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--tblr-muted);
}

.stock-label .hint {
    text-transform: none;
    letter-spacing: 0;
    font-weight: 500;
    font-size: 0.75rem;
}

.stock-input,
.stock-select,
.stock-textarea {
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(255, 255, 255, 0.92);
    padding: 0.8rem 0.95rem;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

[data-bs-theme="dark"] .stock-input,
[data-bs-theme="dark"] .stock-select,
[data-bs-theme="dark"] .stock-textarea {
    background: rgba(15, 23, 42, 0.72);
    border-color: rgba(148, 163, 184, 0.16);
    color: #e5e7eb;
}

.stock-input:focus,
.stock-select:focus,
.stock-textarea:focus {
    border-color: rgba(14, 165, 233, 0.7);
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.12);
    transform: translateY(-1px);
}

.stock-accessory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.85rem;
}

.stock-accessory-item {
    position: relative;
}

.stock-accessory-item input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.stock-accessory-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(248, 250, 252, 0.84);
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

[data-bs-theme="dark"] .stock-accessory-card {
    background: rgba(15, 23, 42, 0.72);
}

.stock-accessory-item input:checked + .stock-accessory-card {
    border-color: rgba(14, 165, 233, 0.65);
    box-shadow: 0 14px 28px rgba(14, 165, 233, 0.14);
    transform: translateY(-1px);
}

.stock-accessory-check {
    width: 1.65rem;
    height: 1.65rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: rgba(148, 163, 184, 0.24);
    font-size: 0.9rem;
    flex-shrink: 0;
}

.stock-accessory-item input:checked + .stock-accessory-card .stock-accessory-check {
    background: linear-gradient(135deg, #0284c7, #0ea5e9);
}

.stock-image-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 0.9rem;
}

.stock-image-table thead th {
    border: 0;
    padding: 0 0.75rem 0.25rem;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--tblr-muted);
}

.stock-image-table tbody tr {
    background: rgba(248, 250, 252, 0.9);
    border-radius: 20px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

[data-bs-theme="dark"] .stock-image-table tbody tr {
    background: rgba(15, 23, 42, 0.78);
}

.stock-image-table tbody td {
    padding: 0.95rem 0.75rem;
    vertical-align: middle;
    border: 0;
}

.stock-image-table tbody td:first-child {
    border-top-left-radius: 20px;
    border-bottom-left-radius: 20px;
}

.stock-image-table tbody td:last-child {
    border-top-right-radius: 20px;
    border-bottom-right-radius: 20px;
}

.stock-image-cell {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
}

.stock-image-preview {
    width: 96px;
    height: 96px;
    border-radius: 18px;
    object-fit: cover;
    background: linear-gradient(135deg, rgba(148, 163, 184, 0.2), rgba(226, 232, 240, 0.5));
    border: 1px dashed rgba(148, 163, 184, 0.4);
    flex-shrink: 0;
}

.stock-image-input-wrap {
    flex: 1;
    min-width: 0;
}

.stock-image-meta {
    font-size: 0.78rem;
    color: var(--tblr-muted);
    margin-top: 0.45rem;
}

.stock-image-row.is-marked-delete {
    opacity: 0.6;
}

.stock-side-card {
    position: sticky;
    top: 1rem;
}

.stock-publish-card {
    background:
        radial-gradient(circle at top left, rgba(14, 165, 233, 0.18), transparent 40%),
        linear-gradient(180deg, rgba(15,23,42,0.97), rgba(30,41,59,0.94));
    color: #e2e8f0;
}

.stock-publish-card .stock-panel-title,
.stock-publish-card .stock-panel-subtitle {
    color: #e2e8f0;
}

.stock-publish-card .stock-panel-subtitle {
    opacity: 0.8;
}

.stock-help-list {
    display: grid;
    gap: 0.7rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.stock-help-list li {
    display: flex;
    gap: 0.7rem;
    align-items: flex-start;
    font-size: 0.84rem;
    color: var(--tblr-muted);
}

.stock-help-list i {
    color: var(--tblr-primary);
    margin-top: 0.1rem;
}

.stock-action-group {
    display: grid;
    gap: 0.85rem;
}

.stock-btn-primary {
    min-height: 52px;
    border: 0;
    border-radius: 16px;
    font-weight: 700;
    letter-spacing: 0.01em;
    box-shadow: 0 18px 28px rgba(14, 165, 233, 0.25);
}

.stock-btn-secondary {
    min-height: 46px;
    border-radius: 14px;
    font-weight: 700;
}

/* Invoice create/edit extra polish */
#invoiceForm .vehicle-card .vehicle-card-header {
    background: rgba(148, 163, 184, 0.08);
}

[data-bs-theme="dark"] #invoiceForm .vehicle-card .vehicle-card-header {
    background: rgba(148, 163, 184, 0.1);
}

#invoiceForm .list-group-item-action {
    border-radius: 10px;
}

/* Customer create/edit page enhancements */
.customer-form-shell {
    gap: 1rem;
}

.customer-form-grid {
    grid-template-columns: minmax(0, 1.75fr) minmax(290px, 0.85fr);
}

.customer-side-panel {
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.95));
    color: var(--tblr-body-color);
}

[data-bs-theme="dark"] .customer-side-panel {
    background:
        radial-gradient(circle at top left, rgba(14, 165, 233, 0.16), transparent 42%),
        linear-gradient(180deg, rgba(15,23,42,0.96), rgba(30,41,59,0.93));
    color: #e2e8f0;
}

.customer-side-panel .v3-form-panel-title,
.customer-side-panel .form-label {
    color: var(--tblr-body-color);
}

[data-bs-theme="dark"] .customer-side-panel .v3-form-panel-title,
[data-bs-theme="dark"] .customer-side-panel .form-label {
    color: #e2e8f0;
}

.customer-side-panel .form-select {
    background: var(--tblr-bg-surface);
    border-color: rgba(148, 163, 184, 0.24);
    color: var(--tblr-body-color);
}

[data-bs-theme="dark"] .customer-side-panel .form-select {
    background: rgba(15, 23, 42, 0.68);
    border-color: rgba(148, 163, 184, 0.25);
    color: #e2e8f0;
}

.customer-submit-btn {
    min-height: 46px;
    border: 0;
    border-radius: 14px;
    font-weight: 700;
}

@media (max-width: 1199.98px) {
    .v3-form-grid,
    .stock-form-grid {
        grid-template-columns: 1fr;
    }

    .v3-form-sticky-card,
    .stock-side-card {
        position: static;
    }

}

@media (max-width: 767.98px) {
    .stock-field-grid > .col-span-6,
    .stock-field-grid > .col-span-4,
    .stock-field-grid > .col-span-3 {
        grid-column: span 12;
    }

    .stock-panel-body,
    .stock-panel-header,
    .v3-form-panel-body,
    .v3-form-panel-header {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .stock-image-cell {
        flex-direction: column;
        align-items: flex-start;
    }
}
