:root {
    --primary-color: #1e1b4b; /* Deep blue-purple */
    --sidebar-bg: #1e2235; /* Dark sidebar from screenshot */
    --sidebar-active: #2a2f4c;
    --sidebar-text: #9ca3af;
    --sidebar-text-active: #ffffff;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #111827;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    
    --accent-blue: #4f46e5;
    --accent-blue-light: #818cf8;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Sidebar Configuration */
.sidebar {
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    transition: width 0.3s ease;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 10;
}
.sidebar-expanded .sidebar { width: 250px; }
.sidebar-collapsed .sidebar { width: 80px; }

.logo-container {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    white-space: nowrap;
    overflow: hidden;
    height: 72px; /* match top header height */
}
.logo-text { font-size: 1.25rem; font-weight: 700; color: #fff; letter-spacing: 1px; }
.sidebar-collapsed .logo-text { display: none; }

.nav-menu { list-style: none; padding: 1rem 0; flex-grow: 1; }
.nav-item {
    display: flex;
    align-items: center;
    padding: 0.8rem 1.5rem;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
    overflow: hidden;
}
.nav-item:hover { color: #fff; background-color: rgba(255,255,255,0.05); }
.nav-item.active { background-color: var(--sidebar-active); color: var(--sidebar-text-active); border-left: 3px solid var(--accent-blue-light); }
.nav-item svg { margin-right: 1rem; flex-shrink: 0; }
.sidebar-collapsed .nav-item { padding: 0.8rem; justify-content: center; }
.sidebar-collapsed .nav-item svg { margin-right: 0; }
.sidebar-collapsed .nav-text { display: none; }

.logout-container { padding: 1rem 0; border-top: 1px solid rgba(255,255,255,0.05); }
.logout-btn { display: flex; align-items: center; padding: 0.8rem 1.5rem; color: #ef4444; text-decoration: none; white-space: nowrap; overflow: hidden;}
.logout-btn:hover { background-color: rgba(239, 68, 68, 0.1); }
.logout-btn svg { margin-right: 1rem; flex-shrink: 0; }
.sidebar-collapsed .logout-btn { padding: 0.8rem; justify-content: center; }
.sidebar-collapsed .logout-btn svg { margin-right: 0; }

/* Main Content Area */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Top Header Bar */
.top-header {
    height: 72px;
    background: #fff;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
}
.header-left { display: flex; align-items: center; gap: 2rem; }
.header-brand { font-size: 1.25rem; font-weight: 700; color: #1e1b4b; display: flex; align-items: center; }
.global-search { 
    display: flex; align-items: center; background: #f3f4f6; padding: 0.5rem 1rem; border-radius: 20px; 
    border: 1px solid #e5e7eb; width: 300px;
}
.global-search svg { color: #9ca3af; margin-right: 0.5rem; }
.global-search input { background: transparent; border: none; outline: none; font-size: 0.85rem; width: 100%; color: #374151; }

.header-actions { display: flex; align-items: center; gap: 1.5rem; }
.header-actions svg { color: #6b7280; cursor: pointer; transition: color 0.2s; }
.header-actions svg:hover { color: #111827; }

/* Buttons */
.btn-dark {
    background-color: #111827; color: white; border: none; padding: 0.6rem 1.2rem;
    border-radius: 6px; font-size: 0.85rem; font-weight: 600; cursor: pointer;
    display: flex; align-items: center; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.btn-dark:hover { background-color: #000; transform: translateY(-1px); box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
.btn-dark:active { transform: scale(0.95); }
.btn-primary {
    background-color: var(--accent-blue); color: white; border: none; padding: 0.6rem 1.2rem;
    border-radius: 6px; font-size: 0.85rem; font-weight: 600; cursor: pointer;
    display: flex; align-items: center; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.btn-primary:hover { background-color: #4338ca; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3); }
.btn-primary:active { transform: scale(0.95); }

/* Page Content */
.content-body { padding: 2rem; width: 100%; margin: 0 auto; }
.page-title-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 2rem 2rem 1.5rem; margin: 0 auto; width: 100%;
}

/* Metrics Grid (Dynamic Layout) */
.metrics-grid {
    display: flex; gap: 1.5rem; justify-content: space-between; overflow-x: auto;
    padding: 0 2rem; margin: 0 auto 2rem; width: 100%;
}
.metric-card {
    flex: 1; min-width: 200px;
    background: var(--card-bg); padding: 1.5rem; border-radius: 16px;
    display: flex; align-items: center; gap: 1.25rem;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.6);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}
.metric-icon {
    width: 52px; height: 52px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.metric-info h3 { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.5px; margin-bottom: 0.35rem; text-transform: uppercase; }
.metric-info p { font-size: 1.75rem; font-weight: 700; line-height: 1; }

/* Charts */
.charts-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem;
    padding: 0 2rem; margin: 0 auto 2rem; width: 100%;
}
.chart-card {
    background: var(--card-bg); padding: 1.5rem; border-radius: 16px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
.chart-header {
    font-size: 1rem; font-weight: 600; color: #111827;
    display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1rem;
}

/* Tables & CRM */
.table-container { background: var(--card-bg); border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); border: 1px solid var(--border-color); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 1.25rem 1.5rem; text-align: left; }
th { background-color: #f9fafb; font-size: 0.85rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 1px solid var(--border-color); }
td { font-size: 0.95rem; border-bottom: 1px solid var(--border-color); color: var(--text-main); transition: background-color 0.3s ease; }
.table-row { transition: all 0.3s ease; }
.table-row:hover { background-color: #f8fafc; }
.row-success { animation: flashSuccess 2.5s ease-out; }
@keyframes flashSuccess {
    0% { background-color: rgba(16, 185, 129, 0.2); transform: scale(1.01); box-shadow: 0 0 15px rgba(16, 185, 129, 0.3); z-index: 10; position: relative; }
    5% { background-color: rgba(16, 185, 129, 0.3); }
    100% { background-color: transparent; transform: scale(1); box-shadow: none; z-index: 1; }
}
.text-blue { color: var(--accent-blue); font-weight: 500; }

/* Badges */
.badge { display: inline-block; padding: 0.25rem 0.75rem; border-radius: 9999px; font-size: 0.75rem; font-weight: 600; }
.badge-green { background-color: #d1fae5; color: #059669; }

/* Auth */
.video-bg-container { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; overflow: hidden; z-index: -1; background: #000; }
.video-bg-container video { position: absolute; top: 50%; left: 50%; min-width: 100%; min-height: 100%; width: auto; height: auto; transform: translateX(-50%) translateY(-50%); object-fit: cover; }
.auth-container { height: 100vh; display: flex; width: 100%; align-items: center; justify-content: center; position: relative; z-index: 10; }
.glass-panel { background: rgba(255, 255, 255, 0.25); backdrop-filter: blur(30px) saturate(150%); -webkit-backdrop-filter: blur(30px) saturate(150%); border: 1px solid rgba(255, 255, 255, 0.4); box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1); border-radius: 24px; }
.login-card { padding: 3rem; width: 100%; max-width: 420px; }
.login-card h2 { color: #111827; margin-bottom: 0.5rem; }
.login-card p { color: #6b7280; margin-bottom: 2rem; font-size: 0.9rem; }
.form-group { margin-bottom: 1.5rem; }
.form-group label { display: block; font-size: 0.875rem; font-weight: 500; color: #374151; margin-bottom: 0.5rem; }
.form-control { width: 100%; padding: 0.75rem 1rem; border: 1px solid #d1d5db; border-radius: 8px; font-size: 0.875rem; }
.form-control:focus { outline: none; border-color: #4f46e5; box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1); }
.login-card .btn-primary { width: 100%; justify-content: center; padding: 0.875rem; font-size: 1rem; }

/* Pagination & Server Pills */
.server-pills { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.server-pill { padding: 0.5rem 1.25rem; border-radius: 20px; background: #fff; color: #6b7280; font-size: 0.875rem; font-weight: 500; text-decoration: none; border: 1px solid #e5e7eb; transition: all 0.2s; }
.server-pill:hover { background: #f9fafb; border-color: #d1d5db; }
.server-pill.active { background: var(--accent-blue); color: white; border-color: var(--accent-blue); }
.pagination { display: flex; gap: 0.5rem; }
.page-btn { padding: 0.5rem 1rem; border: 1px solid #e5e7eb; border-radius: 6px; color: #374151; text-decoration: none; font-size: 0.875rem; font-weight: 500; background: #fff; transition: background 0.2s; }
.page-btn:hover { background: #f9fafb; }
.bottom-bar { display: flex; justify-content: space-between; align-items: center; background: white; padding: 1rem 1.5rem; }

@media (max-width: 1200px) {
    .metrics-grid { grid-template-columns: 1fr 1fr; }
    .charts-grid { grid-template-columns: 1fr; }
}
