@import 'utilities.css';
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    /* Modern Palette */
    --primary: #4f46e5;
    /* Indigo-600: Deeper, more premium than standard blue */
    --primary-dark: #4338ca;
    --primary-light: #eef2ff;
    --secondary: #94a3b8;
    /* Slate-400 */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;

    /* Backgrounds */
    --bg-body: #f1f5f9;
    /* Slate-100: Crisp and cool */
    --bg-card: #ffffff;
    --bg-sidebar: #0f172a;
    /* Slate-900: Premium Dark Sidebar */

    /* Text */
    --text-main: #334155;
    --text-muted: #94a3b8;
    --text-heading: #0f172a;

    /* Layout */
    --sidebar-width: 250px;
    --header-height: 80px;
    --card-radius: 24px;
    /* Slightly more rounded */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* Effects */
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1),
        0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1),
        0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1),
        0 8px 10px -6px rgb(0 0 0 / 0.1);
    --shadow-premium: 0 25px 50px -12px rgb(0 0 0 / 0.15);
    /* Deep, soft shadow */
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    outline: none;
}

body {
    font-family: 'Outfit', sans-serif;
    /* Switched to Outfit for a modern, geometric look */
    background-color: var(--bg-body);
    color: var(--text-main);
    display: flex;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.6;
    /* Increased line height for comfort */
    letter-spacing: -0.01em;
    /* Tight, modern tracking */
}

/* --- Premium Sidebar --- */
.sidebar {
    /* width removed - controlled by admin.css */
    background-color: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(226, 232, 240, 0.6);
    position: fixed;
    top: 0;
    bottom: 0;
    /* height: 100vh;  <-- Removed fixed 100vh to avoid limiting */
    /* Allow the entire sidebar to scroll if content is too long */
    z-index: 50;
    padding: 1rem 0.75rem;
    /* Reduced padding to fit more */
    box-shadow: var(--shadow-sm);
    /* No overflow property, content will just exist. */
}

.logo-area {
    min-height: auto;
    /* Allow it to be as small as content */
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    /* Minimal padding */
    margin-bottom: 0;
    /* Remove gap between logo and menu */
}

.logo-img {
    max-width: 100%;
    height: auto;
    max-height: 80px;
    /* Adjusted size */
    object-fit: contain;
    transition: transform 0.3s ease;
    /* filter: brightness(0) invert(1); */
    /* Make logo white for dark sidebar - Disabled to show actual logo */
}

.logo-img:hover {
    transform: scale(1.05);
}

.logo-area span {
    color: var(--danger);
}

.nav-menu {
    /* Removed overflow:auto to disable scrolling */
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    /* Tighter gap */
    padding-right: 0;
    flex: 1;
    /* Take available space */
}

/* Custom Scrollbar */
.nav-menu::-webkit-scrollbar {
    width: 4px;
}

.nav-menu::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 0.85rem 1.25rem;
    color: var(--text-muted);
    /* Light text for dark sidebar */
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    border-radius: 12px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    margin-bottom: 4px;
}

.nav-item:hover {
    color: white;
    background-color: rgba(255, 255, 255, 0.1);
    /* Glassy hover */
    transform: translateX(4px);
}

.nav-item.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 0 20px rgba(79, 70, 229, 0.4);
    /* Glowing effect */
}

.nav-icon {
    width: 24px;
    margin-right: 12px;
    text-align: center;
    font-size: 1.1rem;
}

.nav-arrow {
    margin-left: auto;
    font-size: 0.75rem;
    opacity: 0.7;
    transition: transform 0.2s;
}

.nav-item:hover .nav-arrow {
    transform: translateX(2px);
}

.logout-btn {
    margin-top: auto;
    background-color: transparent;
    color: var(--secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.85rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: var(--transition);
}

.logout-btn:hover {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border-color: var(--danger);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.2);
}

/* --- Main Layout --- */
.main-content {
    margin-left: 250px;
    /* Match sidebar width from admin.css */
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    /* Allow ONLY main content to scroll */
    height: 100vh;
    /* Make main content fill height */
}

/* --- Glassy Header --- */
header {
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.85);
    /* Slightly more opaque */
    backdrop-filter: blur(16px);
    /* Stronger blur */
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 3rem;
    position: sticky;
    top: 0;
    z-index: 40;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
    /* Subtle depth */
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    font-weight: 600;
    /* Reduced from 700 */
    font-size: 1.25rem;
    color: var(--text-heading);
    letter-spacing: -0.025em;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 2rem;
    position: relative;
    /* Added for dropdown */
}

/* Dropdown Styles */
.user-profile {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 8px;
    transition: background 0.2s;
    user-select: none;
    gap: 0.75rem;
    /* Gap between avatar and info */
}

.user-profile:hover {
    background: rgba(0, 0, 0, 0.03);
}

.user-info {
    font-weight: 500;
    color: var(--text-heading);
    display: flex;
    align-items: center;
}

.profile-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 60px;
    /* Below header */
    background-color: white;
    min-width: 180px;
    box-shadow: 0px 10px 30px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.04);
    overflow: hidden;
    transform-origin: top right;
}

.profile-dropdown.show {
    display: block;
    animation: dropdownFadeIn 0.15s ease-out;
}

.dropdown-item {
    color: var(--text-body);
    padding: 12px 16px;
    text-decoration: none;
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}

.dropdown-item i {
    width: 20px;
    margin-right: 10px;
    opacity: 0.6;
    font-size: 1rem;
    transition: opacity 0.2s;
}

.dropdown-item:hover {
    background-color: #f8fafc;
    color: var(--primary);
    padding-left: 20px;
    /* Subtle Shift */
}

.dropdown-item:hover i {
    opacity: 1;
}

.dropdown-item.logout-item {
    border-top: 1px solid #f1f5f9;
    color: var(--danger);
}

.dropdown-item.logout-item:hover {
    background-color: #fef2f2;
    color: #dc2626;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.icon-btn {
    background: transparent;
    border: none;
    font-size: 1.25rem;
    color: var(--secondary);
    cursor: pointer;
    position: relative;
    padding: 8px;
    border-radius: 50%;
    transition: var(--transition);
}

.icon-btn:hover {
    background-color: #f1f5f9;
    color: var(--primary);
}

.badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: var(--danger);
    color: white;
    font-size: 0.6rem;
    font-weight: 600;
    /* Reduced from 800 */
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    background-color: white;
    border: 1px solid #e2e8f0;
    transition: var(--transition);
    cursor: pointer;
}

.user-profile:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e2e8f0;
}

/* --- Dashboard Content Area --- */
.content-wrapper {
    padding: 2.5rem 3rem;
}

.card {
    background-color: var(--bg-card);
    border-radius: var(--card-radius);
    padding: 2rem;
    position: relative;
    border: 1px solid #f1f5f9;
    box-shadow: var(--shadow-premium);
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 25px 30px -5px rgba(0, 0, 0, 0.08);
    /* Even deeper shadow on hover */
}

/* Grids */
.grid-top {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

/* Welcome Card - The Hero */
.welcome-card {
    grid-column: 1 / 2;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    /* Premium Indigo-Purple gradient */
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.welcome-info h2 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
    /* Reduced from 800 to be less aggressive */
    color: white;
    /* Explicitly white for contrast on blue */
}

.welcome-info p {
    font-size: 1.05rem;
    /* Slightly larger for comfort */
    opacity: 0.95;
    font-weight: 400;
    margin-bottom: 2rem;
}

.user-dash-btn {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}

.user-dash-btn:hover {
    background: white;
    color: var(--primary);
    transform: scale(1.05);
    /* Slight pop */
}

.income-stat {
    background: rgba(255, 255, 255, 0.15);
    padding: 1.5rem;
    border-radius: 16px;
    backdrop-filter: blur(10px);
    min-width: 160px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.income-label {
    font-size: 0.85rem;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.income-val {
    font-size: 2rem;
    font-weight: 600;
    /* Reduced from 800 */
    margin-bottom: 0.5rem;
}

.trend-up {
    color: #4ade80;
    /* Brighter green */
    font-weight: 600;
    font-size: 0.85rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 2px 8px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Stats Grid */
.stats-grid {
    grid-column: 2 / 4;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.stat-card {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.stat-title {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    /* Reduced from 600 */
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: transform 0.3s ease;
}

.stat-card:hover .stat-icon {
    transform: rotate(15deg);
    /* Playful interaction */
}

.bg-purple-light {
    background: #f5f3ff;
    color: #7c3aed;
}

.bg-green-light {
    background: #ecfdf5;
    color: #059669;
}

.bg-teal-light {
    background: #f0fdfa;
    color: #0d9488;
}

.bg-orange-light {
    background: #fff7ed;
    color: #ea580c;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 600;
    /* Reduced from 800 */
    color: var(--text-heading);
    letter-spacing: -0.03em;
}

.stat-trend {
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.text-success {
    color: var(--success);
}

.text-danger {
    color: var(--danger);
}

.text-orange {
    color: var(--warning);
}

.text-primary {
    color: var(--primary);
}

/* Charts Area */
.charts-row {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    font-weight: 600;
    /* Reduced from 700 */
    font-size: 1rem;
    color: var(--text-heading);
}

.chart-header span {
    position: relative;
    padding-left: 1rem;
}

.chart-header span::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 20px;
    background: var(--primary);
    border-radius: 2px;
}

/* Bottom Grid */
.bottom-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 2rem;
}

/* List Items */
.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border: 1px solid #f1f5f9;
    border-radius: 12px;
    margin-bottom: 0.75rem;
    background: #f8fafc;
    transition: var(--transition);
}

.list-item:hover {
    background: white;
    border-color: var(--primary-light);
    box-shadow: var(--shadow-sm);
    transform: translateX(5px);
}

.list-label {
    font-weight: 500;
    /* Reduced from 600 */
    color: var(--secondary);
    font-size: 0.9rem;
}

.list-val {
    color: var(--text-heading);
    font-weight: 500;
    /* Reduced from 600 */
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
}

/* Tabs */
.tab-nav {
    display: flex;
    gap: 1.5rem;
    border-bottom: 2px solid #f1f5f9;
    margin-bottom: 1.5rem;
}

.tab-link {
    padding-bottom: 1rem;
    color: var(--text-muted);
    cursor: pointer;
    font-weight: 500;
    /* Reduced from 600 */
    font-size: 0.95rem;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: color 0.2s;
}

.tab-link.active {
    color: var(--primary);
    border-color: var(--primary);
}

/* Responsive */
@media (max-width: 1400px) {
    .grid-top {
        grid-template-columns: 1fr 1fr;
    }

    .stats-grid {
        grid-column: 2 / 3;
        grid-template-columns: 1fr 1fr;
    }

    .welcome-card {
        grid-column: 1 / 2;
    }
}

/* --- Mobile Responsiveness --- */
@media (max-width: 1024px) {
    .grid-top {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-column: 1 / -1;
        grid-template-columns: 1fr 1fr;
    }

    .welcome-card {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    :root {
        --sidebar-width: 0px;
    }

    .sidebar {
        /* width controlled by admin.css */
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.1);
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        width: 100%;
    }

    header {
        padding: 0 1.5rem;
    }

    .content-wrapper {
        padding: 1.5rem;
    }

    .grid-top,
    .stats-grid,
    .charts-row,
    .bottom-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .welcome-card {
        flex-direction: column;
        align-items: flex-start;
        padding-bottom: 5rem;
    }

    .income-stat {
        width: 100%;
        margin-top: 1rem;
    }

    .welcome-card .fa-hand-holding-usd {
        bottom: 1rem;
        right: 1rem;
    }

    .overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 45;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s;
    }

    .overlay.active {
        opacity: 1;
        pointer-events: all;
    }
}

/* --- Tree / Network View --- */
.network-container {
    background: white;
    border-radius: var(--card-radius);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    height: calc(100vh - 140px);
    overflow: hidden;
    position: relative;
    border: 1px solid #e2e8f0;
    display: flex;
    justify-content: center;
    background-image: radial-gradient(#e2e8f0 1px, transparent 1px);
    background-size: 20px 20px;
}

.controls {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.5rem;
    z-index: 10;
    background: white;
    padding: 0.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    border: 1px solid #e2e8f0;
}

.control-btn {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    background: white;
    color: var(--secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.2s;
}

.control-btn:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
}

.tree-wrapper {
    transition: transform 0.3s ease-out;
    transform-origin: center top;
    padding-top: 3rem;
}

/* Genealogy CSS Tree */
.tree ul {
    padding-top: 20px;
    position: relative;
    transition: all 0.5s;
    display: flex;
    justify-content: center;
}

.tree li {
    float: left;
    text-align: center;
    list-style-type: none;
    position: relative;
    padding: 20px 10px 0 10px;
    transition: all 0.5s;
}

.tree li::before,
.tree li::after {
    content: '';
    position: absolute;
    top: 0;
    right: 50%;
    border-top: 2px solid #cbd5e1;
    width: 50%;
    height: 20px;
}

.tree li::after {
    right: auto;
    left: 50%;
    border-left: 2px solid #cbd5e1;
}

.tree li:only-child::after,
.tree li:only-child::before {
    display: none;
}

.tree li:only-child {
    padding-top: 0;
}

.tree li:first-child::before,
.tree li:last-child::after {
    border: 0 none;
}

.tree li:last-child::before {
    border-right: 2px solid #cbd5e1;
    border-radius: 0 5px 0 0;
}

.tree li:first-child::after {
    border-radius: 5px 0 0 0;
}

.tree ul ul::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    border-left: 2px solid #cbd5e1;
    width: 0;
    height: 20px;
}

/* The Node Card */
.node-content {
    background: white;
    border: 2px solid #cbd5e1;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--text-main);
    font-size: 0.85rem;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    border-radius: 12px;
    width: 140px;
    transition: all 0.3s;
    position: relative;
    z-index: 2;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.node-content:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

/* Plan Specific Node Backgrounds (40% Opacity) */
.node-content.starter {
    background: rgba(148, 163, 184, 0.4) !important;
}

.node-content.pro {
    background: rgba(37, 99, 235, 0.4) !important;
}

.node-content.expert {
    background: rgba(76, 29, 149, 0.4) !important;
}

.node-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 0.5rem;
    border: 2px solid #e2e8f0;
}

.node-name {
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.node-rank {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    position: absolute;
    top: 10px;
    right: 10px;
}

.status-active {
    background-color: var(--success);
}

.status-inactive {
    background-color: var(--text-muted);
}

.add-node-btn {
    width: 24px;
    height: 24px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    bottom: -12px;
    font-size: 0.8rem;
    border: 2px solid white;
    opacity: 0;
    transition: opacity 0.2s;
}

.node-content:hover .add-node-btn {
    opacity: 1;
}

/* Modal */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.modal {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    width: 400px;
    box-shadow: var(--shadow-premium);
    animation: modalIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 85vh;
    overflow-y: auto;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-input:focus {
    border-color: var(--primary);
}

/* --- Premium Sidebar (Smart Layout) --- */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(226, 232, 240, 0.6);
    position: fixed;
    top: 0;
    bottom: 0;
    height: 100vh;
    z-index: 50;
    padding: 1.5rem 1rem;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.logo-area {
    min-height: auto;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.5rem 1.5rem 0.5rem;
    margin-bottom: 0;
    flex-shrink: 0;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-right: 0;
    flex: 1;
    overflow-y: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.nav-menu::-webkit-scrollbar {
    display: none;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    color: var(--secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    border-radius: 12px;
    transition: var(--transition);
    position: relative;
    flex-shrink: 0;
}

.logout-btn {
    margin-top: auto;
    background-color: #fef2f2;
    color: var(--danger);
    border: 1px solid #fee2e2;
    padding: 1rem;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    transition: var(--transition);
    flex-shrink: 0;
}

/* --- Data Entry Forms --- */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-heading);
    font-size: 0.95rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-heading);
    transition: var(--transition);
    background: #f8fafc;
}

.form-input:focus {
    background: white;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-input.error {
    border-color: var(--danger);
    background: #fef2f2;
}

.form-input.success {
    border-color: var(--success);
    background: #f0fdf4;
}

.error-msg {
    color: var(--danger);
    font-size: 0.8rem;
    margin-top: 0.4rem;
    display: none;
}

/* Password Toggle */
.password-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    cursor: pointer;
    background: none;
    border: none;
    font-size: 1rem;
}

.password-toggle:hover {
    color: var(--text-heading);
}

/* ITI Override */
.iti {
    width: 100%;
}

.iti__flag {
    background-image: url('https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/17.0.8/img/flags.png');
}

@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {
    .iti__flag {
        background-image: url('https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/17.0.8/img/flags@2x.png');
    }
}

.iti__country-list {
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: var(--shadow-lg);
    font-family: inherit;
    z-index: 100 !important;
}

.status-unpaid {
    background-color: var(--warning);
}

.status-restricted {
    background-color: var(--danger);
}

.status-deleted {
    background-color: #64748b;
}

.bg-highlight-item {
    background: #f0f9ff !important;
}

.bg-pink-item {
    background: #fdf2f8 !important;
}

/* Footer Styles */
.dashboard-footer {
    background: var(--bg-card);
    border-top: 1px solid #e2e8f0;
    padding: 1rem 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
    width: 100%;
}

.dashboard-footer p {
    margin: 0;
    line-height: 1.5;
}

.dashboard-footer strong {
    color: var(--text-heading);
    font-weight: 600;
}

@media (max-width: 768px) {
    .dashboard-footer {
        padding: 0.75rem 1rem;
        font-size: 0.75rem;
    }
}

/* --- Footer Layout -- */
footer {
    background: white;
    padding: 4rem 1rem 1rem;
    border-top: 1px solid #e2e8f0;
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 3rem;
    max-width: 1200px;
    margin: 0 auto 3rem;
    text-align: left;
}

.footer-logo {
    height: 40px;
    margin-bottom: 1.5rem;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #f1f5f9;
    color: var(--text-muted);
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }

    .footer-logo {
        margin: 0 auto 1.5rem;
    }
}