/* ============================================================
   CueBuzz Portal Script — Main Stylesheet
   Author: CueBuzz Marketing Solutions
   Dark Navy + Gold Accent Theme
   Font: Plus Jakarta Sans + Syne
   ============================================================ */

:root {
    --sidebar-width: 270px;
    --sidebar-bg: #0d1b3e;
    --sidebar-border: rgba(255,255,255,0.07);
    --sidebar-text: rgba(255,255,255,0.75);
    --sidebar-active-bg: rgba(255,193,7,0.12);
    --sidebar-active-text: #ffc107;
    --sidebar-hover-bg: rgba(255,255,255,0.06);
    --accent: #ffc107;
    --accent-dark: #e6a800;
    --accent-rgb: 255,193,7;
    --primary: #1a3a6b;
    --primary-light: #2255a4;
    --bg: #f0f3f9;
    --card-bg: #ffffff;
    --text: #1a2332;
    --text-muted: #6b7591;
    --border: #e5e9f2;
    --navbar-height: 64px;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --radius: 14px;
    --shadow: 0 2px 20px rgba(0,0,0,0.06);
    --shadow-lg: 0 8px 40px rgba(0,0,0,0.12);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    overflow-x: hidden;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 0.3s ease;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.sidebar-header {
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--sidebar-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: var(--navbar-height);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    width: 38px; height: 38px;
    background: linear-gradient(135deg, var(--accent), #ff9800);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-size: 18px;
    box-shadow: 0 4px 15px rgba(255,193,7,0.4);
}

.logo-text {
    font-family: 'Syne', sans-serif;
    font-weight: 800;
    font-size: 15px;
    color: #fff;
    line-height: 1.2;
}

.sidebar-user {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--sidebar-border);
}

.user-avatar {
    position: relative;
    flex-shrink: 0;
}

.user-avatar img {
    width: 42px; height: 42px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent);
}

.user-status-dot {
    position: absolute;
    bottom: 2px; right: 2px;
    width: 10px; height: 10px;
    background: var(--success);
    border-radius: 50%;
    border: 2px solid var(--sidebar-bg);
}

.user-name {
    font-weight: 600;
    font-size: 13px;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

.rank-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    margin-top: 3px;
}

.sidebar-wallet {
    margin: 12px 16px;
    background: linear-gradient(135deg, #1a3a6b, #2255a4);
    border-radius: 12px;
    padding: 14px 16px;
    border: 1px solid rgba(255,193,7,0.2);
}

.wallet-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.6);
    margin-bottom: 4px;
}

.wallet-amount {
    font-family: 'Syne', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--accent);
}

.sidebar-nav {
    list-style: none;
    padding: 8px 0;
    flex: 1;
}

.nav-section-title {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: rgba(255,255,255,0.3);
    padding: 12px 20px 4px;
    text-transform: uppercase;
}

.nav-item { position: relative; }

.nav-item .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-weight: 500;
    font-size: 13.5px;
    border-radius: 0;
    transition: all 0.2s;
    position: relative;
}

.nav-item .nav-link:hover {
    background: var(--sidebar-hover-bg);
    color: #fff;
}

.nav-item.active > .nav-link,
.nav-item .nav-link.active {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-active-text);
    font-weight: 600;
}

.nav-item.active > .nav-link::before {
    content: '';
    position: absolute;
    left: 0; top: 50%;
    transform: translateY(-50%);
    width: 3px; height: 24px;
    background: var(--accent);
    border-radius: 0 3px 3px 0;
}

.nav-item .nav-link i:first-child {
    font-size: 17px;
    width: 20px;
    flex-shrink: 0;
}

.nav-arrow { font-size: 10px !important; transition: transform 0.2s; }

.sub-nav {
    list-style: none;
    padding: 4px 0 4px 52px;
    background: rgba(0,0,0,0.15);
}

.sub-nav li a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    font-size: 12.5px;
    border-radius: 6px;
    transition: all 0.2s;
}

.sub-nav li a:hover, .sub-nav li a.active {
    color: var(--accent);
    background: rgba(255,193,7,0.08);
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--sidebar-border);
    display: flex;
    gap: 8px;
}

.sidebar-footer-link {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px;
    border-radius: 8px;
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    font-size: 12px;
    background: rgba(255,255,255,0.05);
    transition: all 0.2s;
}

.sidebar-footer-link:hover { background: rgba(255,255,255,0.1); color: #fff; }
.sidebar-footer-link.text-danger:hover { background: rgba(239,68,68,0.1); color: #ef4444; }

/* ============================================================
   MAIN WRAPPER
   ============================================================ */
.main-wrapper {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s ease;
}

/* ============================================================
   TOP NAVBAR
   ============================================================ */
.top-navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--navbar-height);
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 16px;
    box-shadow: 0 1px 10px rgba(0,0,0,0.05);
}

.navbar-title {
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: 18px;
    color: var(--text);
    flex: 1;
}

.sidebar-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text);
    font-size: 22px;
    padding: 6px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    transition: background 0.2s;
}

.sidebar-toggle-btn:hover { background: var(--bg); }

.navbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-icon-btn {
    position: relative;
    background: var(--bg);
    border: none;
    color: var(--text-muted);
    font-size: 17px;
    width: 38px; height: 38px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.nav-icon-btn:hover { background: var(--border); color: var(--text); }

.notification-dot {
    position: absolute;
    top: 6px; right: 6px;
    width: 8px; height: 8px;
    background: var(--danger);
    border-radius: 50%;
    border: 2px solid var(--card-bg);
}

.nav-profile-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg);
    border: none;
    padding: 5px 12px 5px 5px;
    border-radius: 10px;
    cursor: pointer;
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    font-family: 'Plus Jakarta Sans', sans-serif;
    transition: background 0.2s;
}

.nav-profile-btn:hover { background: var(--border); }

.nav-profile-btn img {
    width: 30px; height: 30px;
    border-radius: 50%;
    object-fit: cover;
}

/* ============================================================
   PAGE CONTENT
   ============================================================ */
.page-content {
    flex: 1;
    padding: 24px;
}

.page-footer {
    padding: 16px 24px;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    background: var(--card-bg);
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: box-shadow 0.2s, transform 0.2s;
}

.card:hover { box-shadow: var(--shadow-lg); }

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border);
    padding: 16px 20px;
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-body { padding: 20px; }

/* Stat Cards */
.stat-card {
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
    position: relative;
}

.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }

.stat-card::after {
    content: '';
    position: absolute;
    right: -20px; top: -20px;
    width: 100px; height: 100px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
}

.stat-icon {
    width: 52px; height: 52px;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.stat-content .stat-value {
    font-family: 'Syne', sans-serif;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.1;
}

.stat-content .stat-label {
    font-size: 12px;
    font-weight: 500;
    margin-top: 4px;
    opacity: 0.85;
}

.stat-card-1 { background: linear-gradient(135deg, #1a3a6b, #2255a4); color: #fff; }
.stat-card-1 .stat-icon { background: rgba(255,255,255,0.15); color: var(--accent); }

.stat-card-2 { background: linear-gradient(135deg, #166534, #16a34a); color: #fff; }
.stat-card-2 .stat-icon { background: rgba(255,255,255,0.15); color: #86efac; }

.stat-card-3 { background: linear-gradient(135deg, #7c3aed, #a855f7); color: #fff; }
.stat-card-3 .stat-icon { background: rgba(255,255,255,0.15); color: #e9d5ff; }

.stat-card-4 { background: linear-gradient(135deg, #c05621, #ed8936); color: #fff; }
.stat-card-4 .stat-icon { background: rgba(255,255,255,0.15); color: #fed7aa; }

.stat-card-5 { background: linear-gradient(135deg, #0f766e, #14b8a6); color: #fff; }
.stat-card-5 .stat-icon { background: rgba(255,255,255,0.15); color: #99f6e4; }

.stat-card-6 { background: linear-gradient(135deg, #9f1239, #e11d48); color: #fff; }
.stat-card-6 .stat-icon { background: rgba(255,255,255,0.15); color: #fecdd3; }

/* ============================================================
   TABLES
   ============================================================ */
.table-responsive { border-radius: var(--radius); overflow: hidden; }

.table {
    margin-bottom: 0;
    font-size: 13.5px;
}

.table thead th {
    background: #f8fafc;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-bottom: 2px solid var(--border);
    padding: 12px 16px;
    white-space: nowrap;
}

.table tbody td {
    padding: 12px 16px;
    vertical-align: middle;
    border-bottom: 1px solid var(--border);
}

.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #f8fafc; }

/* ============================================================
   FORMS
   ============================================================ */
.form-control, .form-select {
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 13.5px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fff;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(26,58,107,0.1);
    outline: none;
}

.form-label {
    font-weight: 600;
    font-size: 12.5px;
    color: var(--text);
    margin-bottom: 6px;
}

.input-group-text {
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    color: var(--text-muted);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 600;
    border-radius: 10px;
    padding: 9px 18px;
    font-size: 13.5px;
    transition: all 0.2s;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    box-shadow: 0 4px 15px rgba(26,58,107,0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-light), #2d6fd6);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(26,58,107,0.4);
    color: #fff;
}

.btn-warning {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #1a2332;
    box-shadow: 0 4px 15px rgba(255,193,7,0.3);
}

.btn-warning:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(255,193,7,0.4);
    color: #1a2332;
}

.btn-success {
    background: linear-gradient(135deg, #166534, #16a34a);
    color: #fff;
}

.btn-danger {
    background: linear-gradient(135deg, #9f1239, #e11d48);
    color: #fff;
}

.btn-outline-primary {
    border: 1.5px solid var(--primary);
    color: var(--primary);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--primary);
    color: #fff;
}

.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 8px; }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 600;
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 20px;
}

/* ============================================================
   PAGE HEADER
   ============================================================ */
.page-header {
    margin-bottom: 24px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.page-header-left h1 {
    font-family: 'Syne', sans-serif;
    font-size: 24px;
    font-weight: 800;
    color: var(--text);
    margin: 0;
}

.page-header-left p {
    color: var(--text-muted);
    font-size: 13px;
    margin: 4px 0 0;
}

.breadcrumb {
    background: none;
    padding: 0;
    margin: 0;
    font-size: 12px;
}

.breadcrumb-item a { color: var(--primary-light); text-decoration: none; }
.breadcrumb-item.active { color: var(--text-muted); }

/* ============================================================
   MLM TREE
   ============================================================ */
.tree-node {
    display: inline-block;
    text-align: center;
    position: relative;
    padding: 0 10px;
}

.tree-card {
    background: var(--card-bg);
    border: 1.5px solid var(--border);
    border-radius: 12px;
    padding: 12px 16px;
    min-width: 120px;
    display: inline-block;
    transition: all 0.2s;
    cursor: pointer;
}

.tree-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.tree-card.level-1 { border-color: var(--accent); }
.tree-card img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.tree-card .tree-name { font-size: 12px; font-weight: 600; margin-top: 6px; }
.tree-card .tree-rank { font-size: 10px; color: var(--text-muted); }

/* ============================================================
   REFERRAL LINK BOX
   ============================================================ */
.referral-box {
    background: linear-gradient(135deg, #0d1b3e, #1a3a6b);
    border-radius: var(--radius);
    padding: 24px;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.referral-box::before {
    content: '';
    position: absolute;
    right: -40px; top: -40px;
    width: 200px; height: 200px;
    border-radius: 50%;
    background: rgba(255,193,7,0.08);
}

.referral-link-input {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 13px;
    width: 100%;
}

/* ============================================================
   PROPERTY CARD
   ============================================================ */
.property-card {
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--card-bg);
    transition: all 0.2s;
}

.property-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

.property-img {
    height: 180px;
    object-fit: cover;
    width: 100%;
    background: linear-gradient(135deg, #1a3a6b, #2255a4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: rgba(255,255,255,0.3);
}

.property-badge {
    position: absolute;
    top: 12px; left: 12px;
    background: var(--accent);
    color: #1a2332;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    text-transform: uppercase;
}

/* ============================================================
   ALERTS
   ============================================================ */
.flash-alert {
    border-radius: var(--radius);
    border: none;
    font-size: 13.5px;
    font-weight: 500;
}

/* ============================================================
   OVERLAY
   ============================================================ */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    backdrop-filter: blur(2px);
}

/* ============================================================
   TIMELINE
   ============================================================ */
.timeline { position: relative; padding-left: 24px; }
.timeline::before { content: ''; position: absolute; left: 8px; top: 0; bottom: 0; width: 2px; background: var(--border); }
.timeline-item { position: relative; margin-bottom: 20px; }
.timeline-dot { position: absolute; left: -20px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--primary-light); border: 2px solid var(--card-bg); }
.timeline-dot.success { background: var(--success); }
.timeline-dot.warning { background: var(--warning); }
.timeline-dot.danger { background: var(--danger); }

/* ============================================================
   PROGRESS
   ============================================================ */
.progress {
    height: 8px;
    border-radius: 10px;
    background: var(--bg);
}

.progress-bar {
    border-radius: 10px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .sidebar-overlay.show { display: block; }

    .main-wrapper {
        margin-left: 0;
    }

    .page-content { padding: 16px; }
}

@media (max-width: 576px) {
    .stat-card { padding: 16px; }
    .stat-content .stat-value { font-size: 18px; }
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.auth-wrapper {
    min-height: 100vh;
    background: linear-gradient(135deg, #0d1b3e 0%, #1a3a6b 50%, #0f3460 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.auth-wrapper::before {
    content: '';
    position: absolute;
    width: 600px; height: 600px;
    background: rgba(255,193,7,0.04);
    border-radius: 50%;
    top: -200px; right: -200px;
}

.auth-wrapper::after {
    content: '';
    position: absolute;
    width: 400px; height: 400px;
    background: rgba(255,193,7,0.04);
    border-radius: 50%;
    bottom: -100px; left: -100px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: rgba(255,255,255,0.97);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    position: relative;
    z-index: 1;
}

.auth-logo {
    text-align: center;
    margin-bottom: 28px;
}

.auth-logo .logo-icon {
    width: 56px; height: 56px;
    margin: 0 auto 12px;
    font-size: 26px;
}

.auth-logo h2 {
    font-family: 'Syne', sans-serif;
    font-weight: 800;
    font-size: 22px;
    color: var(--text);
    margin: 0;
}

.auth-logo p {
    color: var(--text-muted);
    font-size: 13px;
    margin: 4px 0 0;
}

.auth-card .btn-primary {
    width: 100%;
    padding: 12px;
    font-size: 15px;
}

.register-wider { max-width: 520px; }

/* ============================================================
   UTILS
   ============================================================ */
.text-accent { color: var(--accent); }
.text-primary-dark { color: var(--primary); }
.bg-light-blue { background: #f0f6ff; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }
.font-syne { font-family: 'Syne', sans-serif; }
.rounded-xl { border-radius: var(--radius); }
.border-accent { border-color: var(--accent) !important; }
.gap-1 { gap: 4px; }
.cursor-pointer { cursor: pointer; }

/* Avatar stack */
.avatar-stack { display: flex; }
.avatar-stack img {
    width: 28px; height: 28px;
    border-radius: 50%;
    border: 2px solid #fff;
    margin-left: -8px;
    object-fit: cover;
}
.avatar-stack img:first-child { margin-left: 0; }

/* ============================================================
   CUEBUZZ DASHBOARD STAT CARDS
   ============================================================ */
.dash-stat-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 16px 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    height: 100%;
    transition: box-shadow 0.2s, transform 0.2s;
}
.dash-stat-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}
.dash-stat-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.dash-stat-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
    font-family: 'Syne', sans-serif;
    line-height: 1.1;
    margin-bottom: 4px;
}
.dash-stat-sub {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.4;
}
.dash-stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

/* ============================================================
   SIDEBAR SUBMENU (CueBuzz Style)
   ============================================================ */
.sidebar-nav .has-sub > .nav-link {
    position: relative;
}
.sidebar-nav .nav-arrow {
    transition: transform 0.25s;
    font-size: 11px;
}
.sidebar-nav .has-sub.open > .nav-link .nav-arrow,
.sidebar-nav .has-sub > .nav-link[aria-expanded="true"] .nav-arrow {
    transform: rotate(180deg);
}
.sub-nav {
    list-style: none;
    padding: 4px 0 4px 16px;
    margin: 0;
    background: rgba(0,0,0,0.15);
}
.sub-nav li a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    font-size: 12.5px;
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.15s;
}
.sub-nav li a:hover,
.sub-nav li a.active {
    color: #fff;
    background: rgba(255,255,255,0.1);
}
.sub-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ============================================================
   MISC HELPERS
   ============================================================ */
.font-syne { font-family: 'Syne', sans-serif; }
.fw-600 { font-weight: 600 !important; }
.fw-700 { font-weight: 700 !important; }
.fw-800 { font-weight: 800 !important; }
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
}
.page-header-left h1 {
    font-family: 'Syne', sans-serif;
    font-weight: 800;
    font-size: 22px;
    color: var(--text);
    margin: 0 0 3px;
}
.page-header-left p {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
}
.timeline { padding: 0; }
.timeline-item {
    position: relative;
    padding: 0 0 14px 20px;
    border-left: 2px solid var(--border);
}
.timeline-dot {
    position: absolute;
    left: -5px;
    top: 3px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
}
.timeline-dot.success { background: var(--success); }
.timeline-item:last-child { padding-bottom: 0; border-left-color: transparent; }
.dashboard-welcome {
    padding: 16px 20px;
    background: linear-gradient(135deg, #0d1b3e, #1a3a6b);
    border-radius: var(--radius);
    color: #fff;
}
.dashboard-welcome h4 { color: #fff; }

/* ============================================================
   SIDEBAR COLLAPSE TRANSITIONS
   ============================================================ */
.sidebar .collapse { transition: none; }
.sidebar-nav .nav-link-toggle { cursor: pointer; }

/* Active nav item indicator */
.sidebar-nav .nav-item.active > .nav-link {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-active-text);
    font-weight: 600;
    border-radius: 10px;
    position: relative;
}
.sidebar-nav .nav-item.active > .nav-link::before {
    content: '';
    position: absolute;
    left: 0; top: 50%;
    transform: translateY(-50%);
    width: 3px; height: 20px;
    background: var(--accent);
    border-radius: 0 3px 3px 0;
}

/* ============================================================
   STAT CARD GRID RESPONSIVE
   ============================================================ */
@media (max-width: 576px) {
    .dash-stat-value { font-size: 18px; }
    .dash-stat-icon { width: 36px; height: 36px; font-size: 16px; }
}

/* ============================================================
   PROPERTY CARD
   ============================================================ */
.property-card {
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}
.property-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.property-card-img { height: 200px; background: #f0f3f9; overflow: hidden; }
.property-card-img img { width: 100%; height: 100%; object-fit: cover; }
.property-card-badge { position: absolute; top: 12px; left: 12px; }
.property-card-body { padding: 16px; }
.property-price { font-size: 20px; font-weight: 800; color: var(--primary); font-family: 'Syne', sans-serif; }

/* ============================================================
   ID CARD PRINT OVERRIDE
   ============================================================ */
@media print {
    .sidebar, .top-navbar, .flash-alert, .btn, .page-header { display: none !important; }
    .main-wrapper { margin: 0 !important; padding: 0 !important; }
    .page-content { padding: 0 !important; }
    #idCardFront, #idCardBack { box-shadow: none !important; }
}

/* ============================================================
   NETWORK TREE
   ============================================================ */
.tree-wrap { padding: 30px 20px; overflow-x: auto; }
.tree-ul, .tree-ul ul { list-style: none; padding: 0; margin: 0; display: flex; justify-content: center; }
.tree-ul li { position: relative; padding: 20px 8px 0; text-align: center; transition: all 0.2s; }
.tree-ul li::before, .tree-ul li::after {
    content: ''; position: absolute; top: 0; right: 50%;
    border-top: 2px solid #e5e9f2; width: 50%; height: 20px;
}
.tree-ul li::after { right: auto; left: 50%; border-left: 2px solid #e5e9f2; }
.tree-ul li:only-child::before, .tree-ul li:only-child::after { display: none; }
.tree-ul li:first-child::before, .tree-ul li:last-child::after { border: 0 none; }
.tree-ul li:last-child::before { border-right: 2px solid #e5e9f2; border-radius: 0 5px 0 0; }
.tree-ul li:first-child::after { border-radius: 5px 0 0 0; }
.tree-ul ul { padding-top: 20px; position: relative; }
.tree-ul ul::before { content: ''; position: absolute; top: 0; left: 50%; border-left: 2px solid #e5e9f2; height: 20px; }
.tree-node {
    display: inline-block; background: #fff; border: 1.5px solid #e5e9f2;
    border-radius: 10px; padding: 10px 14px; min-width: 90px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06); transition: box-shadow 0.2s;
}
.tree-node:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.12); }
.tree-node.root { border-color: #ffc107; background: #fffbeb; }

/* ============================================================
   TICKET THREAD
   ============================================================ */
.ticket-msg { border-radius: 0 12px 12px 0; }

/* ============================================================
   PACKAGE CARD SELECTOR
   ============================================================ */
.pkg-card { cursor: pointer; }
.pkg-card input[type="radio"]:checked + .card { border-color: var(--primary) !important; background: #f0f6ff; }
.pkg-card .card { border: 2px solid transparent; transition: all 0.2s; }
.pkg-card .card:hover { border-color: rgba(26,58,107,0.3); }

/* ============================================================
   RESPONSIVE TABLE
   ============================================================ */
@media (max-width: 768px) {
    .table thead { display: none; }
    .table tr { display: block; margin-bottom: 12px; border: 1px solid var(--border); border-radius: 10px; padding: 8px; }
    .table td { display: flex; justify-content: space-between; padding: 6px 8px; font-size: 12px; border: none; }
    .table td::before { content: attr(data-label); font-weight: 600; color: var(--text-muted); margin-right: 8px; }
}
