/* ============================================================
   VENDAMASTER PRO — Premium Design System
   ============================================================ */
:root {
    /* ── Sidebar ── */
    --sb-width: 258px;
    --sb-collapsed-width: 68px;
    --sb-bg: #09162A;
    --sb-bg2: #0D1E38;
    --sb-border: rgba(255,255,255,0.06);
    --sb-hover: rgba(255,255,255,0.055);
    --sb-active-bg: rgba(99,102,241,0.18);
    --sb-active-border: #6366f1;
    --sb-text: rgba(148,163,184,1);
    --sb-text-hover: rgba(203,213,225,1);
    --sb-text-active: #ffffff;
    --sb-section-label: #4b5e78;

    /* ── Topbar ── */
    --topbar-h: 56px;
    --topbar-bg: #ffffff;
    --topbar-border: #e8edf3;

    /* ── Content ── */
    --content-bg: #F0F4F9;

    /* ── Brand colors (kept for existing components) ── */
    --primary-color: #4F46E5;
    --primary-dark: #4338CA;
    --primary-light: #818CF8;
    --secondary-color: #10B981;
    --danger-color: #EF4444;
    --warning-color: #F59E0B;
    --dark-bg: #0F172A;
    --dark-secondary: #1E293B;
    --light-bg: #F8FAFC;
    --border-color: #E2E8F0;
}

/* ── Base ── */
*, *::before, *::after { box-sizing: border-box; }

body, .app-body {
    background: var(--content-bg);
    color: #334155;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    margin: 0;
    padding: 0;
    font-size: 0.85rem;
}

/* ============================================================
   APP LAYOUT
   ============================================================ */
.app-body { min-height: 100vh; }

/* ── Sidebar ── */
.app-sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sb-width);
    height: 100vh;
    background: linear-gradient(180deg, var(--sb-bg) 0%, var(--sb-bg2) 100%);
    border-right: 1px solid var(--sb-border);
    display: flex;
    flex-direction: column;
    z-index: 1050;
    transition: width .28s cubic-bezier(.4,0,.2,1),
                transform .28s cubic-bezier(.4,0,.2,1);
    overflow: hidden;
    box-shadow: 4px 0 28px rgba(0,0,0,.22);
}

.app-sidebar.sb-collapsed { width: var(--sb-collapsed-width); }

/* Logo */
.sb-logo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px 0 16px;
    height: 62px;
    border-bottom: 1px solid var(--sb-border);
    flex-shrink: 0;
}

.sb-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    overflow: hidden;
    white-space: nowrap;
    min-width: 0;
}

.sb-brand-icon {
    width: 34px; height: 34px;
    border-radius: 9px;
    background: linear-gradient(135deg, #4F46E5 0%, #0EA5E9 100%);
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(79,70,229,.45);
}

.sb-brand-text {
    font-size: 1.02rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -.02em;
    white-space: nowrap;
    overflow: hidden;
    transition: opacity .2s, max-width .28s;
    max-width: 160px;
}

.sb-brand-text strong { color: var(--primary-light); }

.sb-collapse-btn {
    width: 26px; height: 26px;
    border: 1px solid var(--sb-border);
    border-radius: 6px;
    background: rgba(255,255,255,.05);
    color: var(--sb-text);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: all .2s;
    flex-shrink: 0;
}

.sb-collapse-btn:hover { background: rgba(255,255,255,.12); color: #fff; }
.app-sidebar.sb-collapsed .sb-collapse-btn svg { transform: rotate(180deg); }

/* Nav */
.sb-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 10px 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.08) transparent;
}

.sb-nav::-webkit-scrollbar { width: 3px; }
.sb-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.08); border-radius: 4px; }

.sb-section { margin-bottom: 2px; }

.sb-section-label {
    display: block;
    font-size: .62rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--sb-section-label);
    padding: 10px 18px 3px;
    white-space: nowrap;
    overflow: hidden;
    transition: opacity .2s;
}

.sb-menu { list-style: none; padding: 0 9px; margin: 0; }

.sb-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8.5px 11px;
    border-radius: 9px;
    color: var(--sb-text);
    text-decoration: none;
    font-size: .855rem;
    font-weight: 500;
    transition: all .18s ease;
    white-space: nowrap;
    position: relative;
    cursor: pointer;
    border: 1px solid transparent;
}

.sb-link:hover {
    background: var(--sb-hover);
    color: var(--sb-text-hover);
}

.sb-link.sb-active {
    background: var(--sb-active-bg);
    color: var(--sb-text-active);
    font-weight: 600;
    border-color: rgba(99,102,241,.25);
}

.sb-link.sb-active::before {
    content: '';
    position: absolute;
    left: -9px; top: 22%; height: 56%;
    width: 3px;
    background: var(--sb-active-border);
    border-radius: 0 3px 3px 0;
}

.sb-icon {
    width: 20px; height: 20px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    color: inherit;
}

.sb-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity .2s, max-width .28s;
    max-width: 160px;
}

.sb-arrow {
    flex-shrink: 0;
    transition: transform .22s ease;
    color: var(--sb-section-label);
}

.sb-link[aria-expanded="true"] .sb-arrow,
.sb-link.sb-active .sb-arrow { transform: rotate(180deg); }

/* Submenu */
.sb-submenu { list-style: none; padding: 2px 0 4px 40px; margin: 0; }

.sb-sub-link {
    display: block;
    padding: 6.5px 11px;
    border-radius: 7px;
    color: var(--sb-text);
    text-decoration: none;
    font-size: .815rem;
    font-weight: 450;
    transition: all .18s;
    white-space: nowrap;
}

.sb-sub-link:hover { color: var(--sb-text-hover); background: var(--sb-hover); }
.sb-sub-link.sb-active { color: var(--primary-light); font-weight: 600; }

.sb-sub-divider { height: 1px; background: var(--sb-border); margin: 4px 0 4px 11px; }

/* Collapsed: hide text */
.app-sidebar.sb-collapsed .sb-brand-text,
.app-sidebar.sb-collapsed .sb-label,
.app-sidebar.sb-collapsed .sb-arrow,
.app-sidebar.sb-collapsed .sb-section-label,
.app-sidebar.sb-collapsed .sb-user-info,
.app-sidebar.sb-collapsed .sb-user-menu-btn {
    opacity: 0;
    pointer-events: none;
    max-width: 0;
    overflow: hidden;
}

.app-sidebar.sb-collapsed .sb-link { justify-content: center; padding-left: 0; padding-right: 0; }
.app-sidebar.sb-collapsed .sb-menu { padding: 0 5px; }
.app-sidebar.sb-collapsed .sb-submenu { display: none !important; }
.app-sidebar.sb-collapsed .sb-section-label { display: none; }
.app-sidebar.sb-collapsed .sb-user { justify-content: center; }

/* User section */
.sb-user-section { border-top: 1px solid var(--sb-border); padding: 10px 9px; flex-shrink: 0; }

.sb-user {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 9px;
    border-radius: 10px;
    background: rgba(255,255,255,.04);
    transition: background .2s;
}

.sb-user-avatar {
    width: 34px; height: 34px;
    border-radius: 8px;
    background: linear-gradient(135deg, #22d3ee 0%, #6366f1 100%);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: transform .2s;
}

.sb-user-avatar:hover { transform: scale(1.06); }

.sb-user-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

.sb-user-initials {
    color: #fff; font-weight: 800; font-size: 12px;
    display: flex; align-items: center; justify-content: center;
    width: 100%; height: 100%; position: absolute;
}

.sb-user-cam {
    position: absolute; right: -1px; bottom: -1px;
    width: 13px; height: 13px; font-size: 8px;
    background: rgba(0,0,0,.55); border-radius: 3px;
    display: flex; align-items: center; justify-content: center;
    pointer-events: none;
}

.sb-user-info { flex: 1; min-width: 0; overflow: hidden; }

.sb-user-name {
    display: block; font-size: .78rem; font-weight: 600;
    color: var(--sb-text-active);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.sb-user-email {
    display: block; font-size: .68rem; color: var(--sb-text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.sb-user-menu-btn {
    width: 24px; height: 24px;
    border: 1px solid var(--sb-border);
    border-radius: 5px;
    background: transparent;
    color: var(--sb-text);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; flex-shrink: 0;
    transition: all .2s;
}

.sb-user-menu-btn:hover { background: rgba(255,255,255,.1); color: #fff; }

.sb-user-dropdown {
    background: #1a2535 !important;
    border: 1px solid rgba(255,255,255,.1) !important;
    border-radius: 11px !important;
    box-shadow: 0 16px 40px rgba(0,0,0,.4) !important;
    padding: 5px 0 !important;
}

.sb-user-dropdown .dropdown-item {
    color: #cbd5e1 !important;
    font-size: .83rem;
    padding: 8px 15px;
    display: flex; align-items: center;
    transition: all .15s;
}

.sb-user-dropdown .dropdown-item:hover { background: rgba(255,255,255,.07) !important; color: #fff !important; }
.sb-user-dropdown .dropdown-item.text-danger { color: #f87171 !important; }
.sb-user-dropdown .dropdown-divider { border-color: rgba(255,255,255,.09) !important; }

/* ── App Shell ── */
.app-shell {
    margin-left: var(--sb-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left .28s cubic-bezier(.4,0,.2,1);
    background: var(--content-bg);
}

.app-shell.shell-collapsed { margin-left: var(--sb-collapsed-width); }

/* ── Topbar ── */
.app-topbar {
    position: sticky; top: 0; z-index: 900;
    height: var(--topbar-h);
    background: var(--topbar-bg);
    border-bottom: 1px solid var(--topbar-border);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 20px 0 16px;
    box-shadow: 0 1px 5px rgba(15,23,42,.05);
    flex-shrink: 0;
}

.topbar-left, .topbar-right { display: flex; align-items: center; gap: 10px; }

.topbar-toggle {
    width: 34px; height: 34px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: transparent;
    color: #64748b;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: all .18s;
}

.topbar-toggle:hover { background: #f1f5f9; color: #334155; border-color: #cbd5e1; }

.topbar-username { font-size: .82rem; font-weight: 600; color: #64748b; }

/* ── Topbar User Section ── */
.topbar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.03);
    transition: background .2s;
}

.topbar-user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: linear-gradient(135deg, #22d3ee 0%, #6366f1 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: transform .2s;
}

.topbar-user-avatar:hover {
    transform: scale(1.08);
}

.topbar-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.topbar-user-initials {
    color: #fff;
    font-weight: 800;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    position: absolute;
}

.topbar-user-cam {
    position: absolute;
    right: -1px;
    bottom: -1px;
    width: 15px;
    height: 15px;
    font-size: 9px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.topbar-user-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.topbar-user-name {
    display: block;
    font-size: .83rem;
    font-weight: 600;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-user-email {
    display: block;
    font-size: .72rem;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-user-menu-btn {
    width: 28px;
    height: 28px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: transparent;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all .2s;
}

.topbar-user-menu-btn:hover {
    background: #f1f5f9;
    color: #334155;
    border-color: #cbd5e1;
}

.topbar-user-dropdown {
    background: #fff;
    border: 1px solid #e2e8f0 !important;
    border-radius: 10px !important;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.1) !important;
    padding: 5px 0 !important;
}

.topbar-user-dropdown .dropdown-item {
    color: #475569 !important;
    font-size: .83rem;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all .15s;
}

.topbar-user-dropdown .dropdown-item:hover {
    background: #f8fafc !important;
    color: #0f172a !important;
}

.topbar-user-dropdown .dropdown-item.text-danger {
    color: #ef4444 !important;
}

.topbar-user-dropdown .dropdown-divider {
    border-color: #e2e8f0 !important;
}

/* ── Main & Footer ── */
.app-main { flex: 1; padding: 22px 22px 16px; }

.app-footer {
    background: linear-gradient(135deg, #09162A 0%, #0D1E38 100%);
    color: rgba(148,163,184,.88);
    padding: 14px 20px;
    font-size: .84rem;
    font-weight: 500;
    flex-shrink: 0;
    border-top: 1px solid rgba(255,255,255,.04);
}

.app-footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px 18px;
    flex-wrap: wrap;
}

.app-footer-brand {
    color: rgba(148,163,184,.95);
}

.app-footer-links {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.app-footer-links a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 999px;
    background: rgba(255,255,255,.06);
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    letter-spacing: .1px;
    transition: all .22s ease;
}

.app-footer-links a i {
    color: #ffffff;
    font-size: .9rem;
    line-height: 1;
}

.app-footer-links a:hover {
    color: #ffffff;
    background: rgba(255,255,255,.14);
    border-color: rgba(255,255,255,.3);
    transform: translateY(-1px);
    box-shadow: 0 8px 16px -10px rgba(0,0,0,.65);
}

.app-footer-links a:focus-visible {
    outline: 2px solid rgba(255,255,255,.6);
    outline-offset: 2px;
}

@media (max-width: 768px) {
    .app-footer-content {
        justify-content: center;
        text-align: center;
    }
}

/* Backdrop */
.sidebar-backdrop {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.52);
    z-index: 1040;
    opacity: 0;
    transition: opacity .28s;
}

.sidebar-backdrop.sb-backdrop-visible { display: block; opacity: 1; }

/* ── Mobile ── */
@media (max-width: 991px) {
    .app-sidebar { transform: translateX(-100%); width: var(--sb-width) !important; }
    .app-sidebar.sb-open { transform: translateX(0); }
    .app-shell { margin-left: 0 !important; }
    .app-main { padding: 14px; }
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
    border: 1px solid rgba(226,232,240,.8);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(15,23,42,.05), 0 4px 14px rgba(15,23,42,.04);
    transition: all .25s ease;
}

.card:hover { box-shadow: 0 6px 24px rgba(15,23,42,.1); border-color: transparent; }

.hero-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, #6366F1 100%);
    color: #ffffff;
    border-radius: 16px;
    padding: 3rem;
}

.feature-card { border-left: 4px solid var(--primary-color); }

/* ============================================================
   TABLES
   ============================================================ */
.table-card {
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #dbe5f1;
    box-shadow: 0 14px 30px rgba(15,23,42,.08);
    overflow: hidden;
}

.table-card .table, .table-responsive .table { margin-bottom: 0; }

.table {
    --bs-table-bg: transparent;
    --bs-table-striped-bg: #f8fbff;
    --bs-table-hover-bg: #eef4ff;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.775rem;
}

.table thead { background: linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%); border-bottom: 1px solid #dbe5f1; }

.table thead th {
    font-size: .71rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    font-weight: 700;
    color: #334155;
    border-bottom: 1px solid #dbe5f1;
    padding-top: .65rem;
    padding-bottom: .65rem;
    padding-left: .9rem;
    padding-right: .9rem;
}

.table tbody tr:hover { background: rgba(79,70,229,.05); }
.table tbody td { 
    padding-top: .6rem; 
    padding-bottom: .6rem; 
    padding-left: .9rem;
    padding-right: .9rem;
    border-bottom: 1px solid #edf2f7; 
    color: #1e293b;
    font-size: 0.75rem;
    vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: 0; }

.table-responsive {
    background: #ffffff;
    border: 1px solid #dbe5f1;
    border-radius: 14px;
    box-shadow: 0 14px 30px rgba(15,23,42,.08);
    overflow: hidden;
}

.badge { 
    padding: .35rem .75rem; 
    border-radius: 6px; 
    font-weight: 600;
    font-size: 0.7rem;
}

/* ============================================================
   DASHBOARD PREMIUM
   ============================================================ */
.dash-welcome {
    background: linear-gradient(135deg, #1e1b4b 0%, #3730a3 42%, #1d4ed8 100%);
    border-radius: 18px;
    padding: 20px 24px;
    color: #fff;
    position: relative;
    overflow: hidden;
    font-size: 0.95rem;
}

.dash-welcome::before {
    content: '';
    position: absolute;
    top: -50px; right: -30px;
    width: 220px; height: 220px;
    background: rgba(255,255,255,.04);
    border-radius: 50%;
}

.dash-welcome::after {
    content: '';
    position: absolute;
    bottom: -55px; right: 100px;
    width: 150px; height: 150px;
    background: rgba(255,255,255,.03);
    border-radius: 50%;
}

.kpi-card {
    background: #fff;
    border-radius: 15px;
    padding: 16px 18px;
    box-shadow: 0 1px 3px rgba(15,23,42,.06), 0 4px 14px rgba(15,23,42,.04);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    transition: all .22s ease;
    border: 1px solid rgba(226,232,240,.8);
    height: 100%;
}

.kpi-card:hover { transform: translateY(-3px); box-shadow: 0 8px 28px rgba(15,23,42,.1); border-color: transparent; }

.kpi-icon {
    width: 42px; height: 42px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    font-size: 18px;
}

.kpi-icon.green  { background: linear-gradient(135deg,#d1fae5,#6ee7b7); }
.kpi-icon.blue   { background: linear-gradient(135deg,#dbeafe,#93c5fd); }
.kpi-icon.purple { background: linear-gradient(135deg,#ede9fe,#c4b5fd); }
.kpi-icon.red    { background: linear-gradient(135deg,#fee2e2,#fca5a5); }
.kpi-icon.amber  { background: linear-gradient(135deg,#fef3c7,#fcd34d); }
.kpi-icon.sky    { background: linear-gradient(135deg,#e0f2fe,#7dd3fc); }

.kpi-body { flex: 1; min-width: 0; }

.kpi-label {
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #94a3b8;
    margin-bottom: 2px;
}

.kpi-value {
    font-size: 1.35rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.1;
    letter-spacing: -.03em;
}

.kpi-value.text-success { color: #059669 !important; }
.kpi-value.text-danger  { color: #dc2626 !important; }
.kpi-value.text-info    { color: #0284c7 !important; }
.kpi-value.text-primary { color: #4338ca !important; }

.kpi-sub { font-size: .68rem; color: #94a3b8; margin-top: 2px; }

/* Alert cards */
.alert-card {
    background: #fff;
    border-radius: 15px;
    border: 1px solid rgba(226,232,240,.8);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(15,23,42,.06), 0 4px 14px rgba(15,23,42,.04);
    height: 100%;
}

.alert-card-header {
    padding: 12px 18px;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    display: flex; align-items: center; gap: 7px;
}

.alert-card-header.warning { background: linear-gradient(135deg,#fef9c3,#fde68a); color: #854d0e; }
.alert-card-header.info    { background: linear-gradient(135deg,#dbeafe,#bfdbfe); color: #1e40af; }

.alert-card-body { padding: 4px 0; }

.alert-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    border-bottom: 1px solid #f8fafc;
    font-size: .75rem;
    color: #475569;
}

.alert-row:last-child { border-bottom: none; }

.badge-val {
    background: #f1f5f9;
    color: #475569;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: .7rem;
    font-weight: 700;
}

.badge-val.danger  { background: #fee2e2; color: #dc2626; }
.badge-val.warning { background: #fef3c7; color: #d97706; }
.badge-val.info    { background: #dbeafe; color: #1d4ed8; }

/* Ranking cards */
.rank-card {
    background: #fff;
    border-radius: 15px;
    border: 1px solid rgba(226,232,240,.8);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(15,23,42,.06), 0 4px 14px rgba(15,23,42,.04);
    height: 100%;
}

.rank-card-header {
    padding: 11px 16px;
    border-bottom: 1px solid #f1f5f9;
    display: flex; align-items: center; gap: 9px;
    font-weight: 700;
    font-size: .78rem;
    color: #0f172a;
}

.rank-icon {
    width: 26px; height: 26px;
    border-radius: 7px;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px;
}

.rank-row {
    display: flex; align-items: center; gap: 11px;
    padding: 8px 16px;
    border-bottom: 1px solid #f8fafc;
    transition: background .18s;
}

.rank-row:last-child { border-bottom: none; }
.rank-row:hover { background: #f8fafc; }

.rank-badge {
    width: 20px; height: 20px;
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    font-size: .65rem; font-weight: 800;
    flex-shrink: 0;
}

.rank-badge.r1 { background: #fef3c7; color: #d97706; }
.rank-badge.r2 { background: #f1f5f9; color: #64748b; }
.rank-badge.r3 { background: #fff7ed; color: #c2410c; }
.rank-badge.r4, .rank-badge.r5 { background: #f8fafc; color: #94a3b8; }

.rank-name { flex: 1; font-size: .75rem; font-weight: 600; color: #334155; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-amount { font-size: .73rem; font-weight: 700; color: #059669; white-space: nowrap; }
.rank-qty { font-size: .68rem; color: #94a3b8; white-space: nowrap; }
.rank-empty { padding: 22px; text-align: center; color: #94a3b8; font-size: .78rem; }

/* ============================================================
   PAGE HEADER
   ============================================================ */
.page-header { margin-bottom: 1.5rem; }
.page-header h2 { color: #0f172a; font-weight: 700; font-size: 1.45rem; }

.page-header h2 svg { flex-shrink: 0; filter: drop-shadow(0 2px 4px rgba(0,0,0,.1)); }
.page-header h2 .text-danger  { color: #ef4444 !important; }
.page-header h2 .text-success { color: #10b981 !important; }

/* ============================================================
   MODAL
   ============================================================ */
.modal-content { border-radius: 14px; }

.modal-header {
    padding: 1.4rem;
    background: linear-gradient(135deg, rgba(79,70,229,.05) 0%, rgba(99,102,241,.05) 100%);
}

.modal-title { color: white; }
.modal-body { padding: 1.4rem; }

.alert-info {
    background: rgba(59,130,246,.1);
    border-color: #3B82F6;
    color: #1E40AF;
}

/* ============================================================
   FOOTER (kept for backward compat)
   ============================================================ */
.footer {
    background: linear-gradient(135deg, #09162A 0%, #0D1E38 100%);
    color: rgba(148,163,184,.8);
    padding: 14px 0;
    width: 100%;
    bottom: 0;
    border-top: 1px solid rgba(255,255,255,.04);
}

/* ============================================================
   FORM CONTROLS
   ============================================================ */
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 .2rem rgba(79,70,229,.22);
}

.stat-card {
    background: linear-gradient(135deg, #667EEA 0%, #764BA2 100%);
    color: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 1.5rem;
}

.chart-container { position: relative; height: 300px; margin-top: 2rem; }

/* ============================================================
   LOGIN
   ============================================================ */
.login-card {
    border-radius: 16px;
    background: #ffffff;
    animation: slideIn .5s ease-out;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.login-icon { font-size: 3rem; animation: bounce 2s infinite; }

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-10px); }
}

.login-card .form-label { color: #1E293B; font-size: .93rem; }
.login-card .input-group { border-radius: 10px; overflow: hidden; }

.login-card .input-group .form-control {
    border: 1px solid #E2E8F0;
    padding: .72rem 1rem;
    font-size: 1rem;
}

.login-card .input-group .form-control:focus {
    background-color: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 .2rem rgba(79,70,229,.15);
}

.login-card .input-group .input-group-text { font-size: 1.2rem; }

.divider-line { position: relative; margin: 1.5rem 0; }

.divider-line::before {
    content: '';
    position: absolute;
    top: 50%; left: 0; right: 0;
    height: 1px;
    background: #E2E8F0;
    z-index: 0;
}

.divider-line span {
    position: relative;
    display: inline-block;
    padding: 0 1rem;
    background: #ffffff;
    z-index: 1;
}

/* ============================================================
   REPORT LAYOUT
   ============================================================ */
.relatorio-content-wide { --bs-gutter-x: 0; width: 100%; }
.relatorio-content-wide > [class*="col-"] { width: 100%; max-width: 1860px; margin: 0 auto; }
.relatorio-content-wide > [class*="col-"] > .card { width: 100%; }
.relatorio-content-wide .table { font-size: .87rem; }
.relatorio-content-wide .table thead th { font-size: .74rem; padding-top: .68rem; padding-bottom: .68rem; }
.relatorio-content-wide .table tbody td { padding-top: .58rem; padding-bottom: .58rem; }

@media (max-width: 992px) {
    .relatorio-content-wide > [class*="col-"] { max-width: 100%; }
}

/* ============================================================
   FORM LAYOUT ENHANCEMENTS
   ============================================================ */
.fm-form-row { justify-content: center; }
.fm-form-col { width: 100%; max-width: 1120px; }

.fm-form-card {
    border: 1px solid #E2E8F0;
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(15,23,42,.08);
    background: #ffffff;
    overflow: hidden;
    padding: 0 !important;
}

.fm-form-card:hover { box-shadow: 0 14px 36px rgba(15,23,42,.12); }

.fm-form-header {
    background: linear-gradient(135deg, #334155 0%, #1e293b 55%, #0f172a 100%);
    border-bottom: 1px solid rgba(255,255,255,.12);
    padding: 1.05rem 2rem;
    color: white;
}

.fm-form-title {
    color: #f8fafc;
    font-weight: 800;
    font-size: clamp(1.35rem, 2vw, 1.95rem);
    letter-spacing: -.015em;
    margin: 0 !important;
    border: 0 !important;
    text-transform: capitalize;
}

.fm-form-card > *:not(.fm-form-header):not(.fm-form-footer) { padding: 1.4rem 2rem !important; }
.fm-form-card .tab-content { padding-top: 1rem; }

.fm-form-footer {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border-top: 1px solid #e2e8f0;
    padding: 1.25rem 2rem;
    margin: 0;
}

.fm-form-card > .fm-form-footer {
    border-radius: 0 0 17px 17px;
}

.fm-form-footer .d-flex { margin: 0 !important; gap: .75rem !important; }
.fm-form-footer .btn { min-height: 42px; padding: .55rem 1.5rem; font-weight: 600; }
/* ============================================================
   TABS
   ============================================================ */
.conta-tabs-full { display: flex; width: 100%; gap: 8px; flex-wrap: nowrap; }
.conta-tabs-full .nav-item { flex: 1 1 0; min-width: 0; }

.conta-tabs-full .nav-link {
    width: 100%;
    min-height: 52px;
    display: block !important;
    white-space: nowrap;
    font-size: .93rem;
    font-weight: 600;
}

@media (max-width: 992px) {
    .conta-tabs-full { flex-wrap: wrap; }
    .conta-tabs-full .nav-item { flex: 1 1 calc(50% - 8px); }
}

/* ============================================================
   VENDAS — FINANCE STATUS / KPI CARDS
   ============================================================ */
.finance-status-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(15,23,42,.07);
    overflow: hidden;
    padding: 0;
}

.finance-status-card--premium {
    border-top: 4px solid #334155;
}

.finance-status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #f8fafc;
}

.finance-status-header strong  { color: #f1f5f9; font-size: 1.05rem; }
.finance-status-header .text-muted { color: #94a3b8 !important; }

.finance-status-card .row { padding: 0 1.25rem; }
.finance-status-card .row:last-child { padding-bottom: 1.25rem; }

.finance-kpi {
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    color: #ffffff;
    position: relative;
    overflow: hidden;
}

.finance-kpi::before {
    content: '';
    position: absolute;
    top: -30px; right: -30px;
    width: 120px; height: 120px;
    border-radius: 50%;
    background: rgba(255,255,255,.07);
    pointer-events: none;
}

.finance-kpi::after {
    content: '';
    position: absolute;
    bottom: -20px; left: -20px;
    width: 80px; height: 80px;
    border-radius: 50%;
    background: rgba(255,255,255,.04);
    pointer-events: none;
}

.finance-kpi-label {
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    opacity: .8;
    margin-bottom: .45rem;
}

.finance-kpi-value {
    font-size: clamp(1.35rem, 2.2vw, 1.85rem);
    font-weight: 800;
    letter-spacing: -.025em;
    line-height: 1.1;
}

.finance-kpi--total     { background: linear-gradient(135deg, #334155  0%, #1e293b 100%); }
.finance-kpi--sales-net { background: linear-gradient(135deg, #0891b2  0%, #0e7490 100%); }
.finance-kpi--paid      { background: linear-gradient(135deg, #16a34a  0%, #15803d 100%); }
.finance-kpi--pending   { background: linear-gradient(135deg, #d97706  0%, #b45309 100%); }

.finance-kpi .progress      { background: rgba(255,255,255,.25); border-radius: 6px; }
.finance-kpi .progress-bar  { background: rgba(255,255,255,.85); border-radius: 6px; }