:root {
    --ink: #0f172a;
    --muted: #64748b;
    --line: #e2e8f0;
    --surface: #f8fafc;
    --primary: #2563eb;
    --primary-light: #eff6ff;
    --accent: #f97316;
    --sidebar: #0f172a;
    --panel-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

body {
    background: var(--surface);
    color: var(--ink);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    letter-spacing: -0.011em;
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    flex: 0 0 260px;
    background: var(--sidebar);
    color: #fff;
    padding: 24px 16px;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.05);
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.brand {
    font-weight: 700;
    font-size: 1.15rem;
    margin-bottom: 24px;
    letter-spacing: 0;
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.82);
    border-radius: 6px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
}

.sidebar .nav-link i {
    width: 18px;
    text-align: center;
}

.sidebar .nav-link:hover,
.sidebar .nav-link:focus {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    transition: margin-left 0.3s ease;
}

.content-inner {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    padding: 24px;
}

.topbar {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px 16px;
}

.metric-card,
.panel,
.login-panel,
.public-panel {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.metric-card {
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
    text-decoration: none;
    color: inherit;
    width: 100%;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.metric-label {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    margin-bottom: 0.5rem;
}

.metric-value {
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1.2;
    color: var(--ink);
}

.panel {
    padding: 24px;
    box-shadow: var(--panel-shadow);
    border: 1px solid var(--line);
    background: #fff;
    transition: box-shadow 0.2s ease;
}

.panel:hover {
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

/* Custom Scrollbar for Tables */
.table-responsive::-webkit-scrollbar {
    height: 6px;
    width: 6px;
}

.table-responsive::-webkit-scrollbar-track {
    background: var(--surface);
}

.table-responsive::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.table thead th {
    background: #f8fafc;
    color: var(--muted);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
}

.table td {
    padding: 16px;
    font-size: 0.875rem;
}

.chart-box {
    position: relative;
    min-height: 310px;
}

.avatar-circle {
    width: 38px;
    height: 38px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    box-shadow: 0 0 10px rgba(37, 99, 235, 0.2);
}

.avatar-circle-sm {
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 12px;
}

.bg-primary-light {
    background-color: var(--primary-light) !important;
}

.extra-small {
    font-size: 11px;
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    z-index: 1500;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-collapsed .sidebar-backdrop {
    display: block;
    opacity: 1;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 18px;
    background: #eef3f7;
}

.login-panel {
    width: min(100%, 420px);
    padding: 28px;
}

.product-thumb {
    width: 72px;
    height: 54px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--line);
}

.table-responsive {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
}

.table thead th {
    color: #475467;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--line);
    background: #fff;
    white-space: nowrap;
}

.table td {
    white-space: nowrap;
    padding: 1rem 0.75rem;
}

.form-control,
.form-select {
    border-color: #cfd7e3;
    border-radius: 6px;
}

.btn {
    border-radius: 6px;
}

.user-sidebar {
    background: #183a37;
}

.qr-thumb {
    width: 86px;
    height: 86px;
    object-fit: contain;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 6px;
}

.public-page {
    min-height: 100vh;
    padding: 28px 14px;
    background: #eef3f7;
}

.public-panel {
    max-width: 880px;
    margin: 0 auto;
    overflow: hidden;
}

.public-image {
    width: 100%;
    height: 340px;
    object-fit: cover;
    background: #dbe3ec;
}

.btn-primary {
    --bs-btn-bg: var(--primary);
    --bs-btn-border-color: var(--primary);
    --bs-btn-hover-bg: #12576d;
    --bs-btn-hover-border-color: #12576d;
    box-shadow: 0 4px 12px rgba(23, 107, 135, 0.2);
}

.nav-link.active {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
    border-left: 3px solid var(--primary);
}

.dropdown-menu {
    z-index: 2100 !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border: none;
}

/* Footer Styling */
.admin-footer {
    padding: 1.5rem 2rem;
    background: white;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    margin-top: auto;
}

.dev-name {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    color: var(--primary);
}

.social-links a {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #f1f5f9;
    color: #64748b;
    margin: 0 6px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.social-links a:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(23, 107, 135, 0.3);
}

.sidebar-toggle {
    width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    padding: 0;
}

.sidebar-collapsed .sidebar {
    width: 400px;
    flex-basis: 82px;
    padding-left: 14px;
    padding-right: 14px;
}

.sidebar-collapsed .brand,
.sidebar-collapsed .sidebar .small,
/* .sidebar-collapsed .sidebar .nav-link span {
    display: none;
} */

.sidebar-collapsed .sidebar .nav-link {
    justify-content: start;
    padding-left: 20px;
    padding-right: 0;
}

@media (max-width: 991.98px) {
    .sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: -300px;
        width: 280px;
        z-index: 2050;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .sidebar-collapsed .sidebar {
        left: 0;
        box-shadow: 20px 0 60px rgba(15, 23, 42, 0.25);
    }

    .sidebar .nav-link span {
        display: inline-block !important;
    }

    .sidebar-collapsed .sidebar .nav {
        display: flex !important;
    }

    .content {
        margin-left: 0 !important;
    }

    .content-inner {
        padding: 1rem;
    }

    .topbar {
        /* flex-direction: column; */
        align-items: flex-start !important;
        gap: 12px;
        padding: 1rem;
    }

    .topbar .h5 {
        font-size: 1.1rem;
    }

    .panel {
        padding: 1rem;
    }

    /* Stack header title and button */
    .d-flex.justify-content-between.align-items-center.mb-4 {
        /* flex-direction: column; */
        align-items: flex-start !important;
        gap: 1rem;
    }

    .d-flex.justify-content-between.align-items-center.mb-4 button,
    /* .d-flex.justify-content-between.align-items-center.mb-4 a {
        width: 100%;
    } */

    .table thead th {
        font-size: 0.7rem;
        padding: 8px;
    }

    .table td {
        padding: 12px 8px;
        font-size: 0.8rem;
    }
}

@media (min-width: 992px) {
    /* .content {
        margin-left: 260px;
    } */

    .sidebar-collapsed .content {
        margin-left: 82px;
    }
}