/* LexFlow — Legal Practice Management Styles */
:root {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --bg-sidebar: #1e293b;
    --bg-sidebar-hover: #334155;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-inverse: #f8fafc;
    --border-color: #e2e8f0;
    --accent-primary: #3b82f6;
    --accent-blue: #3b82f6;
    --accent-green: #22c55e;
    --accent-red: #ef4444;
    --accent-purple: #8b5cf6;
    --accent-orange: #f97316;
    --accent-teal: #14b8a6;
    --accent-indigo: #6366f1;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --sidebar-width: 260px;
    --topbar-height: 64px;
    --font-sans: 'Inter', -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}
[data-theme="dark"] {
    --bg-primary: #18181b;
    --bg-secondary: #27272a;
    --bg-tertiary: #3f3f46;
    --bg-sidebar: #09090b;
    --bg-sidebar-hover: #18181b;
    --text-primary: #fafafa;
    --text-secondary: #d4d4d8;
    --text-muted: #71717a;
    --text-inverse: #18181b;
    --border-color: #3f3f46;
}
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body { font-family: var(--font-sans); background: var(--bg-primary); color: var(--text-primary); line-height: 1.5; overflow-x: hidden; }
.app-container { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: var(--sidebar-width); background: var(--bg-sidebar); display: flex; flex-direction: column; z-index: 100; transition: transform 0.3s; }
.sidebar-header { padding: 20px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.logo { display: flex; align-items: center; gap: 12px; }
.logo-icon { width: 40px; height: 40px; background: linear-gradient(135deg, var(--accent-indigo), var(--accent-purple)); border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.logo-icon svg { width: 22px; height: 22px; color: white; }
.logo-text { display: flex; flex-direction: column; }
.logo-name { font-size: 18px; font-weight: 700; color: var(--text-inverse); }
.logo-tag { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.sidebar-nav { flex: 1; padding: 16px 12px; overflow-y: auto; }
.nav-section { margin-bottom: 24px; }
.nav-label { display: block; font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; padding: 0 12px; margin-bottom: 8px; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; color: var(--text-muted); text-decoration: none; border-radius: var(--radius-md); transition: all 0.2s; margin-bottom: 4px; cursor: pointer; }
.nav-item svg { width: 20px; height: 20px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 2; }
.nav-item span:not(.nav-badge) { font-size: 14px; font-weight: 500; flex: 1; }
.nav-item:hover { background: var(--bg-sidebar-hover); color: var(--text-inverse); }
.nav-item.active { background: var(--accent-indigo); color: white; }
.nav-badge { padding: 2px 8px; background: rgba(99,102,241,0.2); color: var(--accent-indigo); font-size: 11px; font-weight: 600; border-radius: 50px; }
.nav-badge.urgent { background: rgba(239,68,68,0.2); color: var(--accent-red); }
.sidebar-footer { padding: 16px 12px; border-top: 1px solid rgba(255,255,255,0.1); }
.back-btn { display: flex; align-items: center; gap: 12px; padding: 10px 12px; color: var(--text-muted); text-decoration: none; border-radius: var(--radius-md); transition: all 0.2s; }
.back-btn svg { width: 18px; height: 18px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 2; }
.back-btn span { font-size: 14px; }
.back-btn:hover { background: var(--bg-sidebar-hover); color: var(--text-inverse); }

/* Main Content */
.main-content { flex: 1; margin-left: var(--sidebar-width); min-height: 100vh; display: flex; flex-direction: column; }
.topbar { height: var(--topbar-height); background: var(--bg-secondary); border-bottom: 1px solid var(--border-color); display: flex; align-items: center; padding: 0 24px; gap: 20px; position: sticky; top: 0; z-index: 50; }
.menu-toggle { display: none; width: 40px; height: 40px; border: none; background: transparent; cursor: pointer; border-radius: var(--radius-md); color: var(--text-secondary); align-items: center; justify-content: center; }
.menu-toggle svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 2; }
.search-bar { flex: 1; max-width: 400px; display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--bg-tertiary); border-radius: var(--radius-md); }
.search-bar svg { width: 18px; height: 18px; stroke: var(--text-muted); fill: none; stroke-width: 2; flex-shrink: 0; }
.search-bar input { flex: 1; border: none; background: transparent; font-size: 14px; color: var(--text-primary); outline: none; }
.topbar-actions { display: flex; align-items: center; gap: 16px; }
.icon-btn { position: relative; width: 40px; height: 40px; border: none; background: transparent; border-radius: var(--radius-md); cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--text-secondary); transition: all 0.2s; }
.icon-btn:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.icon-btn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; }
.icon-sun { display: block; } .icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; } [data-theme="dark"] .icon-moon { display: block; }
.notification-dot { position: absolute; top: 8px; right: 8px; width: 8px; height: 8px; background: var(--accent-red); border-radius: 50%; }
.user-menu { display: flex; align-items: center; gap: 12px; }
.user-avatar { width: 36px; height: 36px; background: linear-gradient(135deg, var(--accent-indigo), var(--accent-purple)); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: white; font-size: 12px; font-weight: 600; }
.user-name { font-size: 14px; font-weight: 500; color: var(--text-primary); display: none; }
@media (min-width: 1024px) { .user-name { display: block; } }

/* Pages */
.page { display: none; flex: 1; padding: 24px; overflow-x: hidden; }
.page.active { display: block; }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-title h1 { font-size: 24px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.page-title p { font-size: 14px; color: var(--text-secondary); }
.demo-badge { display: inline-flex; padding: 6px 12px; background: rgba(99,102,241,0.1); color: var(--accent-indigo); font-size: 12px; font-weight: 600; border-radius: 50px; }
.btn-primary { display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; background: var(--accent-indigo); color: white; font-size: 14px; font-weight: 600; border: none; border-radius: var(--radius-md); cursor: pointer; transition: all 0.2s; }
.btn-primary:hover { background: #4f46e5; }
.btn-primary svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; }
.btn-secondary { padding: 8px 16px; background: var(--bg-tertiary); color: var(--text-primary); font-size: 13px; font-weight: 500; border: 1px solid var(--border-color); border-radius: var(--radius-md); cursor: pointer; transition: all 0.2s; }
.btn-secondary:hover { background: var(--border-color); }

/* Dashboard Grid */
.dashboard-grid { display: grid; gap: 24px; }
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.stat-card { background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 20px; display: flex; align-items: center; gap: 16px; }
.stat-icon { width: 48px; height: 48px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stat-icon svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 2; }
.stat-card.blue .stat-icon { background: rgba(59,130,246,0.1); color: var(--accent-blue); }
.stat-card.green .stat-icon { background: rgba(16,185,129,0.1); color: var(--accent-green); }
.stat-card.purple .stat-icon { background: rgba(139,92,246,0.1); color: var(--accent-purple); }
.stat-card.orange .stat-icon { background: rgba(245,158,11,0.1); color: var(--accent-orange); }
.stat-content { display: flex; flex-direction: column; }
.stat-value { font-size: 24px; font-weight: 700; color: var(--text-primary); font-family: var(--font-mono); }
.stat-label { font-size: 13px; color: var(--text-secondary); }

/* Section Cards */
.section-card { background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 20px; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.section-header h2 { font-size: 16px; font-weight: 600; color: var(--text-primary); }
.section-badge { padding: 4px 12px; background: var(--accent-orange); color: white; font-size: 12px; font-weight: 600; border-radius: 50px; }
.view-all { font-size: 13px; color: var(--accent-indigo); text-decoration: none; font-weight: 500; }
.view-all:hover { text-decoration: underline; }

/* Deadlines */
.deadlines-card { border-left: 4px solid var(--accent-red); }
.deadlines-list { display: flex; flex-direction: column; gap: 12px; }
.deadline-item { display: flex; align-items: center; gap: 16px; padding: 14px; background: var(--bg-tertiary); border-radius: var(--radius-md); transition: all 0.2s; }
.deadline-item:hover { transform: translateX(4px); }
.deadline-item.critical { border-left: 3px solid var(--accent-red); }
.deadline-item.warning { border-left: 3px solid var(--accent-orange); }
.deadline-item.normal { border-left: 3px solid var(--accent-green); }
.deadline-date { text-align: center; min-width: 50px; }
.deadline-date .day { font-size: 20px; font-weight: 700; color: var(--text-primary); }
.deadline-date .month { font-size: 11px; color: var(--text-muted); text-transform: uppercase; }
.deadline-info { flex: 1; }
.deadline-title { font-size: 14px; font-weight: 600; color: var(--text-primary); margin-bottom: 2px; }
.deadline-case { font-size: 12px; color: var(--text-muted); }
.deadline-countdown { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: var(--radius-sm); }
.deadline-countdown.critical { background: rgba(239,68,68,0.1); color: var(--accent-red); }
.deadline-countdown.warning { background: rgba(245,158,11,0.1); color: var(--accent-orange); }
.deadline-countdown.normal { background: rgba(16,185,129,0.1); color: var(--accent-green); }

/* Cases List */
.cases-list { display: flex; flex-direction: column; gap: 12px; }
.case-item { display: flex; align-items: center; gap: 16px; padding: 14px; background: var(--bg-tertiary); border-radius: var(--radius-md); cursor: pointer; transition: all 0.2s; }
.case-item:hover { background: var(--border-color); }
.case-icon { width: 40px; height: 40px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: white; flex-shrink: 0; }
.case-icon.corporate { background: var(--accent-blue); }
.case-icon.litigation { background: var(--accent-red); }
.case-icon.family { background: var(--accent-purple); }
.case-icon.realestate { background: var(--accent-green); }
.case-icon.ip { background: var(--accent-orange); }
.case-icon.criminal { background: #71717a; }
.case-info { flex: 1; min-width: 0; }
.case-number { font-size: 12px; color: var(--text-muted); font-family: var(--font-mono); }
.case-title { font-size: 14px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.case-client { font-size: 12px; color: var(--text-secondary); }
.case-status { padding: 4px 10px; border-radius: var(--radius-sm); font-size: 11px; font-weight: 600; }
.case-status.active { background: rgba(16,185,129,0.1); color: var(--accent-green); }
.case-status.pending { background: rgba(245,158,11,0.1); color: var(--accent-orange); }
.case-status.closed { background: var(--bg-tertiary); color: var(--text-muted); }

/* Activity Chart */
.activity-chart { height: 120px; display: flex; align-items: flex-end; gap: 8px; padding: 16px 0; }
.activity-bar { flex: 1; background: var(--accent-indigo); border-radius: 4px 4px 0 0; transition: height 0.3s; }
.activity-summary { display: flex; justify-content: space-between; padding-top: 16px; border-top: 1px solid var(--border-color); }
.activity-item { text-align: center; }
.activity-label { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.activity-value { font-size: 16px; font-weight: 600; color: var(--text-primary); font-family: var(--font-mono); }

/* Unbilled List */
.unbilled-list { display: flex; flex-direction: column; gap: 12px; }
.unbilled-item { display: flex; align-items: center; justify-content: space-between; padding: 12px; background: var(--bg-tertiary); border-radius: var(--radius-md); }
.unbilled-case { font-size: 14px; font-weight: 500; color: var(--text-primary); }
.unbilled-client { font-size: 12px; color: var(--text-muted); }
.unbilled-amount { font-size: 16px; font-weight: 600; color: var(--accent-green); font-family: var(--font-mono); }

/* Cases Page */
.cases-toolbar { display: flex; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.search-filter { flex: 1; min-width: 250px; display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: var(--radius-md); }
.search-filter svg { width: 18px; height: 18px; stroke: var(--text-muted); fill: none; stroke-width: 2; }
.search-filter input { flex: 1; border: none; background: transparent; font-size: 14px; color: var(--text-primary); outline: none; }
.filter-group { display: flex; gap: 12px; }
.filter-group select { padding: 10px 16px; background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: var(--radius-md); font-size: 14px; color: var(--text-primary); cursor: pointer; }
.cases-table-container { background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: var(--radius-lg); overflow: hidden; }
.cases-table { width: 100%; border-collapse: collapse; }
.cases-table th, .cases-table td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--border-color); }
.cases-table th { background: var(--bg-tertiary); font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.cases-table td { font-size: 14px; color: var(--text-primary); }
.cases-table tr:hover { background: var(--bg-tertiary); }
.table-actions { display: flex; gap: 8px; }
.action-btn { width: 32px; height: 32px; border: none; background: var(--bg-tertiary); border-radius: var(--radius-sm); cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--text-muted); transition: all 0.2s; }
.action-btn:hover { background: var(--accent-indigo); color: white; }
.action-btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }

/* Clients Grid */
.clients-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.client-card { background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 20px; transition: all 0.2s; cursor: pointer; }
.client-card:hover { border-color: var(--accent-indigo); box-shadow: var(--shadow-md); }
.client-header { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.client-avatar { width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 600; color: white; flex-shrink: 0; }
.client-name { font-size: 16px; font-weight: 600; color: var(--text-primary); }
.client-type { font-size: 12px; color: var(--text-muted); }
.client-stats { display: flex; gap: 20px; padding-top: 16px; border-top: 1px solid var(--border-color); }
.client-stat { text-align: center; flex: 1; }
.client-stat-value { display: block; font-size: 18px; font-weight: 600; color: var(--text-primary); font-family: var(--font-mono); }
.client-stat-label { font-size: 11px; color: var(--text-muted); }

/* Documents */
.documents-container { display: grid; grid-template-columns: 240px 1fr; gap: 24px; }
.documents-sidebar { background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 20px; height: fit-content; }
.documents-sidebar h3 { font-size: 14px; font-weight: 600; color: var(--text-secondary); margin-bottom: 16px; }
.folder-tree { display: flex; flex-direction: column; gap: 4px; }
.folder-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-md); cursor: pointer; transition: all 0.2s; color: var(--text-secondary); font-size: 14px; }
.folder-item:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.folder-item.active { background: rgba(99,102,241,0.1); color: var(--accent-indigo); }
.folder-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.folder-item span { flex: 1; }
.folder-count { font-size: 11px; color: var(--text-muted); }
.documents-main { background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 20px; }
.documents-path { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--border-color); }
.documents-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.document-card { background: var(--bg-tertiary); border-radius: var(--radius-md); padding: 16px; text-align: center; cursor: pointer; transition: all 0.2s; }
.document-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.document-icon { width: 48px; height: 48px; margin: 0 auto 12px; display: flex; align-items: center; justify-content: center; font-size: 24px; }
.document-name { font-size: 13px; font-weight: 500; color: var(--text-primary); margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.document-meta { font-size: 11px; color: var(--text-muted); }

/* Time Tracking */
.timetrack-container { display: grid; grid-template-columns: 400px 1fr; gap: 24px; }
.timer-card { background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 32px; text-align: center; }
.timer-display { font-size: 56px; font-weight: 700; font-family: var(--font-mono); color: var(--text-primary); margin-bottom: 8px; }
.timer-case { font-size: 14px; color: var(--text-muted); margin-bottom: 24px; }
.timer-controls { display: flex; gap: 12px; justify-content: center; margin-bottom: 24px; }
.timer-btn { display: flex; align-items: center; gap: 8px; padding: 12px 24px; border: none; border-radius: var(--radius-md); font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.timer-btn svg { width: 18px; height: 18px; fill: currentColor; stroke: none; }
.timer-btn.start { background: var(--accent-green); color: white; }
.timer-btn.start:hover { background: #059669; }
.timer-btn.start.running { background: var(--accent-orange); }
.timer-btn.stop { background: var(--bg-tertiary); color: var(--text-primary); }
.timer-btn.stop:hover { background: var(--accent-red); color: white; }
.timer-form { display: flex; flex-direction: column; gap: 12px; text-align: left; }
.timer-form select, .timer-form textarea { width: 100%; padding: 12px 14px; background: var(--bg-tertiary); border: 1px solid var(--border-color); border-radius: var(--radius-md); font-size: 14px; color: var(--text-primary); font-family: inherit; resize: none; }
.timer-form textarea { height: 80px; }
.timesheet-card { background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 20px; }
.timesheet-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; max-height: 500px; overflow-y: auto; }
.timesheet-entry { display: flex; align-items: center; gap: 16px; padding: 14px; background: var(--bg-tertiary); border-radius: var(--radius-md); }
.timesheet-time { font-size: 18px; font-weight: 700; color: var(--accent-indigo); font-family: var(--font-mono); min-width: 60px; }
.timesheet-info { flex: 1; }
.timesheet-case { font-size: 14px; font-weight: 500; color: var(--text-primary); }
.timesheet-activity { font-size: 12px; color: var(--text-muted); }
.timesheet-amount { font-size: 14px; font-weight: 600; color: var(--accent-green); font-family: var(--font-mono); }
.timesheet-total { display: flex; justify-content: space-between; padding-top: 16px; border-top: 1px solid var(--border-color); font-size: 16px; font-weight: 600; }
.timesheet-total span:last-child { color: var(--accent-indigo); font-family: var(--font-mono); }

/* Billing */
.billing-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 24px; }
.billing-stat { background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 20px; text-align: center; }
.billing-stat-label { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.billing-stat-value { font-size: 28px; font-weight: 700; font-family: var(--font-mono); }
.billing-stat-value.green { color: var(--accent-green); }
.billing-stat-value.orange { color: var(--accent-orange); }
.billing-stat-value.red { color: var(--accent-red); }
.invoices-table-container { background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: var(--radius-lg); overflow: hidden; }
.invoices-table { width: 100%; border-collapse: collapse; }
.invoices-table th, .invoices-table td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--border-color); }
.invoices-table th { background: var(--bg-tertiary); font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; }
.invoices-table td { font-size: 14px; }
.invoices-table tr:hover { background: var(--bg-tertiary); }
.invoice-status { padding: 4px 10px; border-radius: var(--radius-sm); font-size: 11px; font-weight: 600; }
.invoice-status.paid { background: rgba(16,185,129,0.1); color: var(--accent-green); }
.invoice-status.pending { background: rgba(245,158,11,0.1); color: var(--accent-orange); }
.invoice-status.overdue { background: rgba(239,68,68,0.1); color: var(--accent-red); }

/* Calendar */
.calendar-container { background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 24px; margin-bottom: 24px; }
.calendar-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.calendar-header h2 { font-size: 20px; font-weight: 600; }
.cal-nav { width: 36px; height: 36px; border: none; background: var(--bg-tertiary); border-radius: var(--radius-md); cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--text-secondary); transition: all 0.2s; }
.cal-nav:hover { background: var(--accent-indigo); color: white; }
.cal-nav svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-day-header { padding: 10px; text-align: center; font-size: 12px; font-weight: 600; color: var(--text-muted); }
.cal-day { aspect-ratio: 1; padding: 8px; background: var(--bg-tertiary); border-radius: var(--radius-sm); cursor: pointer; position: relative; transition: all 0.2s; }
.cal-day:hover { background: var(--border-color); }
.cal-day.today { background: var(--accent-indigo); color: white; }
.cal-day.other-month { opacity: 0.4; }
.cal-day .day-num { font-size: 13px; font-weight: 500; }
.cal-day .event-dot { position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%); width: 6px; height: 6px; background: var(--accent-red); border-radius: 50%; }
.events-sidebar { background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 20px; }
.events-sidebar h3 { font-size: 16px; font-weight: 600; margin-bottom: 16px; }
.events-list { display: flex; flex-direction: column; gap: 12px; }
.event-item { display: flex; gap: 12px; padding: 12px; background: var(--bg-tertiary); border-radius: var(--radius-md); border-left: 3px solid var(--accent-indigo); }
.event-time { font-size: 13px; font-weight: 600; color: var(--accent-indigo); min-width: 60px; }
.event-title { font-size: 14px; font-weight: 500; color: var(--text-primary); }
.event-type { font-size: 12px; color: var(--text-muted); }

/* Deadlines Page */
.deadlines-container { display: flex; flex-direction: column; gap: 24px; }
.deadline-category { background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 20px; }
.deadline-category h3 { font-size: 16px; font-weight: 600; margin-bottom: 16px; }
.deadline-category.urgent { border-left: 4px solid var(--accent-red); }
.deadline-category.warning { border-left: 4px solid var(--accent-orange); }
.deadline-category.normal { border-left: 4px solid var(--accent-green); }
.deadline-items { display: flex; flex-direction: column; gap: 12px; }

/* Templates Grid */
.templates-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.template-card { background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 24px; text-align: center; cursor: pointer; transition: all 0.2s; }
.template-card:hover { border-color: var(--accent-indigo); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.template-icon { font-size: 40px; margin-bottom: 16px; }
.template-name { font-size: 16px; font-weight: 600; color: var(--text-primary); margin-bottom: 8px; }
.template-desc { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; }
.template-btn { display: inline-flex; padding: 8px 16px; background: var(--accent-indigo); color: white; font-size: 13px; font-weight: 500; border-radius: var(--radius-md); text-decoration: none; }

/* Modal */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 200; align-items: center; justify-content: center; }
.modal-overlay.show { display: flex; }
.modal { background: var(--bg-secondary); border-radius: var(--radius-lg); width: 90%; max-width: 500px; max-height: 90vh; overflow: hidden; box-shadow: var(--shadow-lg); }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; border-bottom: 1px solid var(--border-color); }
.modal-header h2 { font-size: 18px; font-weight: 600; }
.modal-close { width: 32px; height: 32px; border: none; background: transparent; font-size: 24px; color: var(--text-muted); cursor: pointer; border-radius: var(--radius-sm); transition: all 0.2s; }
.modal-close:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.modal-body { padding: 24px; overflow-y: auto; }
.modal-form { display: flex; flex-direction: column; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 13px; font-weight: 500; color: var(--text-secondary); }
.form-group input, .form-group select, .form-group textarea { padding: 10px 14px; background: var(--bg-tertiary); border: 1px solid var(--border-color); border-radius: var(--radius-md); font-size: 14px; color: var(--text-primary); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.btn-submit { padding: 12px 24px; background: var(--accent-indigo); color: white; border: none; border-radius: var(--radius-md); font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.2s; margin-top: 8px; }
.btn-submit:hover { background: #4f46e5; }

/* Toast */
.toast-container { position: fixed; bottom: 24px; right: 24px; display: flex; flex-direction: column; gap: 12px; z-index: 1000; }
.toast { display: flex; align-items: center; gap: 12px; padding: 14px 20px; background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); animation: toastIn 0.3s ease; max-width: 360px; }
@keyframes toastIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.toast.success { border-left: 4px solid var(--accent-green); }
.toast.error { border-left: 4px solid var(--accent-red); }
.toast-message { flex: 1; font-size: 14px; color: var(--text-primary); }

/* Responsive */
@media (max-width: 1200px) {
    .stats-row { grid-template-columns: repeat(2, 1fr); }
    .billing-stats { grid-template-columns: repeat(2, 1fr); }
    .timetrack-container { grid-template-columns: 1fr; }
}
@media (max-width: 1024px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .menu-toggle { display: flex; }
    .documents-container { grid-template-columns: 1fr; }
    .documents-sidebar { display: none; }
}
@media (max-width: 768px) {
    .page { padding: 16px; }
    .topbar { padding: 0 16px; }
    .search-bar { display: none; }
    .stats-row { grid-template-columns: 1fr; }
    .billing-stats { grid-template-columns: 1fr; }
    .filter-group { flex-direction: column; width: 100%; }
    .filter-group select { width: 100%; }
    .form-row { grid-template-columns: 1fr; }
}
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 90; }
.sidebar-overlay.show { display: block; }
