:root {
    --bg-dark: #0f1115;
    --panel-bg: #1a1d24;
    --panel-border: rgba(255, 255, 255, 0.05);
    
    --gold: #d4af37;
    --gold-light: #f3e5ab;
    --gold-hover: #e0bb40;
    
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    
    /* Status Colors */
    --blue: #3b82f6;
    --blue-subtle: rgba(59, 130, 246, 0.1);
    --green: #22c55e;
    --green-subtle: rgba(34, 197, 94, 0.1);
    --purple: #a855f7;
    --purple-subtle: rgba(168, 85, 247, 0.1);
    --orange: #f59e0b;
    --orange-subtle: rgba(245, 158, 11, 0.1);
    --cyan: #06b6d4;
    --cyan-subtle: rgba(6, 182, 212, 0.1);
    --red: #ef4444;
    --red-subtle: rgba(239, 68, 68, 0.1);
    
    --font-main: 'Inter', sans-serif;
    --font-heading: 'Cinzel', serif;
    
    --sidebar-width: 260px;
    --header-height: 70px;
}

html {
    font-size: 14px;
}
@media (max-width: 1600px) { html { font-size: 13px; } }
@media (max-width: 1366px) { html { font-size: 11px; } }

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: rgba(212, 175, 55, 0.4) transparent;
}

/* Custom Webkit Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.3);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(212, 175, 55, 0.6);
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-main);
    overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; }

/* Utilities */
.text-gold { color: var(--gold); }
.text-muted { color: var(--text-muted); }
.text-blue { color: var(--blue); }
.text-green { color: var(--green); }
.text-purple { color: var(--purple); }
.text-orange { color: var(--orange); }
.text-cyan { color: var(--cyan); }
.text-red { color: var(--red); }

.bg-blue { background-color: var(--blue); }
.bg-green { background-color: var(--green); }
.bg-purple { background-color: var(--purple); }
.bg-orange { background-color: var(--orange); }
.bg-cyan { background-color: var(--cyan); }

.bg-blue-subtle { background-color: var(--blue-subtle); }
.bg-green-subtle { background-color: var(--green-subtle); }
.bg-purple-subtle { background-color: var(--purple-subtle); }
.bg-orange-subtle { background-color: var(--orange-subtle); }
.bg-red-subtle { background-color: var(--red-subtle); }
.bg-gray-subtle { background-color: rgba(255,255,255,0.05); }

.mr-2 { margin-right: 0.5rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.float-right { float: right; }
.invisible { visibility: hidden; }

.panel-glass {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 10px;
}

/* APP LAYOUT */
.app-container {
    display: flex;
    height: 100vh;
}

/* SIDEBAR */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--panel-bg);
    border-right: 1px solid var(--panel-border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    gap: 1rem;
    border-bottom: 1px solid var(--panel-border);
}

.sidebar-logo-text h2 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--gold-light);
    line-height: 1.2;
}

.sidebar-logo-text .highlight {
    color: var(--gold);
    font-size: 1.3rem;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem 0;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: all 0.2s;
    gap: 1rem;
}

.sidebar-nav li a i {
    width: 20px;
    text-align: center;
}

.sidebar-nav li.active a, .sidebar-nav li a:hover {
    color: var(--text-main);
    background: rgba(255,255,255,0.03);
}

.sidebar-nav li.active a {
    border-right: 3px solid var(--gold);
}

.sidebar-nav .section-title {
    padding: 1.5rem 1.5rem 0.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 1px;
}

.transition-transform {
    transition: transform 0.3s ease;
}

.submenu-items {
    overflow: hidden;
    transition: max-height 0.3s ease;
    max-height: 500px;
}

.submenu-items.collapsed {
    max-height: 0;
}

.dot-indicator {
    width: 6px;
    height: 6px;
    background-color: var(--gold);
    border-radius: 50%;
    margin-left: 0.5rem;
    margin-right: 0.25rem;
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--panel-border);
}

.support-box {
    background: rgba(212, 175, 55, 0.05);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}

.support-title { font-weight: 600; font-size: 0.9rem; margin-top: 0.5rem; }
.support-subtitle { font-size: 0.75rem; color: var(--text-muted); }

.btn-outline-gold {
    background: transparent;
    border: 1px solid var(--gold);
    color: var(--gold);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    width: 100%;
    font-weight: 500;
    transition: all 0.2s;
}
.btn-outline-gold:hover {
    background: var(--gold);
    color: var(--bg-dark);
}

/* MAIN WRAPPER */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* TOP NAV */
.top-nav {
    height: var(--header-height);
    background-color: var(--bg-dark);
    border-bottom: 1px solid var(--panel-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
}

.menu-toggle {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
}

.nav-search {
    display: flex;
    align-items: center;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 6px;
    padding: 0.5rem 1rem;
    width: 350px;
}

.nav-search i { color: var(--text-muted); margin-right: 0.5rem; }
.nav-search input {
    background: transparent;
    border: none;
    color: var(--text-main);
    outline: none;
    flex: 1;
    font-family: var(--font-main);
}
.nav-search .shortcut-key {
    background: rgba(255,255,255,0.1);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-icon {
    position: relative;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
}
.nav-icon:hover { color: var(--text-main); }
.nav-icon.badge::after {
    content: attr(data-count);
    position: absolute;
    top: -5px;
    right: -8px;
    background: var(--gold);
    color: var(--bg-dark);
    font-size: 0.6rem;
    font-weight: bold;
    padding: 2px 5px;
    border-radius: 10px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    cursor: pointer;
}

.user-profile img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
}
.user-profile .name { font-weight: 600; font-size: 0.9rem; }
.user-profile .role { font-size: 0.75rem; color: var(--text-muted); }

/* CONTENT AREA */
.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* PAGE HEADER */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.header-actions {
    display: flex;
    gap: 1rem;
}

.btn-primary {
    background: var(--gold);
    color: var(--bg-dark);
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-secondary {
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--panel-border);
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.btn-secondary:hover { background: rgba(255,255,255,0.05); }

/* KPI CARDS */
.kpi-cards {
    display: flex;
    gap: 1rem;
}

.kpi-card {
    flex: 1;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 10px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.icon-bg {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.25rem;
}
.icon-bg.bg-blue { background: var(--blue-subtle); }
.icon-bg.bg-green { background: var(--green-subtle); }
.icon-bg.bg-purple { background: var(--purple-subtle); }
.icon-bg.bg-orange { background: var(--orange-subtle); }
.icon-bg.bg-cyan { background: var(--cyan-subtle); }

.kpi-info .kpi-title { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.25rem; }
.kpi-info .kpi-value { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.25rem; }
.kpi-info .kpi-trend { font-size: 0.75rem; font-weight: 500; }

/* MAIN LAYOUT (TABLE + RIGHT STATS) */
.main-layout {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

/* TABLE SECTION */
.table-section {
    flex: 1;
    padding: 1.5rem;
    min-width: 0; /* allows flex children to shrink */
}

.table-filters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.table-filters .search-box {
    display: flex;
    align-items: center;
    background: var(--bg-dark);
    border: 1px solid var(--panel-border);
    border-radius: 6px;
    padding: 0.5rem 1rem;
    width: 300px;
    gap: 0.5rem;
}

.table-filters .search-box input {
    background: transparent;
    border: none;
    color: var(--text-main);
    outline: none;
    width: 100%;
}

.filter-dropdowns {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.filter-dropdowns select {
    background: var(--bg-dark);
    color: var(--text-main);
    border: 1px solid var(--panel-border);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    outline: none;
    appearance: none;
    padding-right: 2rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
}

.btn-filter {
    background: var(--bg-dark);
    border: 1px solid var(--panel-border);
    color: var(--text-main);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-text {
    background: transparent;
    border: none;
    color: var(--blue);
    padding: 0.5rem;
    font-weight: 500;
}

.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.data-table th {
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 600;
    padding: 1rem;
    border-bottom: 1px solid var(--panel-border);
    letter-spacing: 0.5px;
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.02);
    vertical-align: middle;
}

.data-table tr:hover td {
    background: rgba(255,255,255,0.02);
}

.subtext {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Table Cells specialized */
.prospect-cell, .project-cell, .advisor-cell {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.avatar-initials {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 600;
    font-size: 0.85rem;
    color: #fff;
}

.prospect-cell .name { font-weight: 600; }
.project-cell img { width: 40px; height: 30px; border-radius: 4px; object-fit: cover; }
.project-name { font-weight: 600; }

.contact-cell .phone { font-weight: 500; margin-bottom: 0.2rem; }

.badge-stage {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}
.bg-blue-light { background: var(--blue-subtle); color: var(--blue); }
.bg-purple-light { background: var(--purple-subtle); color: var(--purple); }
.bg-orange-light { background: var(--orange-subtle); color: var(--orange); }
.bg-gray-light { background: rgba(255,255,255,0.1); color: var(--text-main); }

.avatar-sm { width: 24px; height: 24px; border-radius: 50%; }

.priority { font-weight: 600; font-size: 0.85rem; }

.actions-cell { display: flex; gap: 0.5rem; }
.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-muted);
    width: 30px;
    height: 30px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-icon:hover { background: rgba(255,255,255,0.1); color: var(--text-main); }

/* Pagination */
.pagination-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--panel-border);
}

.pagination {
    display: flex;
    gap: 0.25rem;
}

.pagination button {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 500;
}
.pagination button.active {
    background: var(--gold);
    color: var(--bg-dark);
}
.pagination button:hover:not(.active) {
    background: rgba(255,255,255,0.05);
}
.pagination .ellipsis { padding: 0 0.5rem; align-self: center; color: var(--text-muted); }

.rows-per-page select {
    background: transparent;
    color: var(--text-muted);
    border: none;
    outline: none;
}

/* RIGHT STATS */
.right-stats {
    width: 320px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.stat-box {
    padding: 1.5rem;
}

.box-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.box-header h3 { font-size: 1rem; font-weight: 600; }
.mini-select {
    background: transparent;
    color: var(--text-muted);
    border: none;
    font-size: 0.8rem;
    outline: none;
}

.summary-list {
    list-style: none;
}

.summary-list li {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.summary-list .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.75rem;
}

.summary-list .val {
    margin-left: auto;
    color: var(--text-main);
    font-weight: 600;
}

.view-report, .view-all {
    display: block;
    text-align: center;
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    cursor: pointer;
    text-decoration: none;
}
.view-report:hover { color: var(--text-main); }

/* Funnel */
.funnel-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.funnel {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.funnel-level {
    height: 35px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 4px;
}

/* Task List */
.task-list {
    list-style: none;
}

.task-list li {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.task-list li:last-child { border-bottom: none; padding-bottom: 0; }

.task-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.task-info { flex: 1; }
.task-info .title { font-size: 0.85rem; font-weight: 500; margin-bottom: 0.2rem; }
.task-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
}

/* User Dropdown Menu */
.user-profile {
    position: relative;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    width: 220px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    padding: 0.5rem 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 100;
}

.user-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown a {
    padding: 0.75rem 1.25rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
    transition: background 0.2s;
}

.user-dropdown a:hover {
    background: rgba(255,255,255,0.05);
}

.user-dropdown a i {
    color: var(--text-muted);
    width: 16px;
    text-align: center;
}

.user-dropdown a.text-red i {
    color: var(--red);
}

.dropdown-divider {
    height: 1px;
    background: var(--panel-border);
    margin: 0.5rem 0;
}

/* Sidebar Collapse */
.sidebar {
    transition: margin-left 0.3s ease, width 0.3s ease;
}

body.sidebar-collapsed .sidebar {
    margin-left: calc(-1 * var(--sidebar-width));
}

.main-wrapper {
    transition: width 0.3s ease;
}
