/* === AdvisorTime Design System === */
@import url('https://fonts.googleapis.com/css2?family=Geist+Mono:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #1e293b;
    --primary-light: #334155;
    --primary-dark: #0f172a;
    --accent: #3b82f6;
    --accent-light: #93bbfd;
    --accent-dark: #2563eb;

    --billable: #10b981;
    --billable-light: #d1fae5;
    --billable-bg: #ecfdf5;
    --overhead: #f59e0b;
    --overhead-light: #fef3c7;
    --overhead-bg: #fffbeb;
    --danger: #ef4444;
    --info: #06b6d4;

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --bg-page: #f8fafc;
    --bg-card: #ffffff;
    --bg-subtle: #f1f5f9;

    --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.04);

    --radius-sm: 6px;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    --transition: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

[data-bs-theme="dark"] {
    --primary: #1e293b;
    --primary-light: #334155;
    --primary-dark: #0f172a;
    --billable-bg: rgba(16,185,129,0.1);
    --overhead-bg: rgba(245,158,11,0.1);
    --bg-page: #0f172a;
    --bg-card: #1e293b;
    --bg-subtle: #1e293b;
    --border: #334155;
    --border-light: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.2);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.4);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.5);
    --shadow-xl: 0 20px 25px rgba(0,0,0,0.6);
}

/* === Base === */
* { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
    font-family: 'Geist Mono', monospace;
    color: var(--text-primary);
    background: var(--bg-page);
    line-height: 1.6;
    transition: background-color var(--transition-slow), color var(--transition-slow);
}

/* === Typography === */
h1, h2, h3, h4, h5, h6 { font-weight: 700; letter-spacing: -0.025em; color: var(--text-primary); }
h1 { font-size: 1.875rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
.text-muted { color: var(--text-muted) !important; }

/* === Navigation === */
.app-navbar {
    background: #1e293b !important;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding: 0;
}
.app-navbar .container { padding-top: 0; padding-bottom: 0; }
.app-navbar .navbar-brand {
    font-weight: 800;
    font-size: 1.2rem;
    letter-spacing: -0.5px;
    color: white !important;
    padding: 16px 0;
}
.app-navbar .nav-link {
    color: rgba(255,255,255,0.85) !important;
    font-weight: 500;
    font-size: 0.85rem;
    padding: 18px 12px !important;
    position: relative;
    transition: color var(--transition);
    white-space: nowrap;
}
.app-navbar .nav-link:hover { color: white !important; }
.app-navbar .nav-link.active { color: white !important; }
.app-navbar .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 12px;
    right: 12px;
    height: 2px;
    background: var(--accent);
    border-radius: 2px 2px 0 0;
}

/* === Cards === */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    transition: box-shadow var(--transition), transform var(--transition);
}
.card:hover { box-shadow: var(--shadow-sm); }
.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border);
    padding: 14px 20px;
    font-weight: 600;
    font-size: 0.9rem;
}
.card-body { padding: 20px; }

/* === Stat Cards === */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    transition: all var(--transition);
}
.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}
.stat-card .stat-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.2;
}
.stat-card .stat-sub {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 2px;
}
.stat-card.billable { border-left: 3px solid var(--billable); }
.stat-card.overhead { border-left: 3px solid var(--overhead); }
.stat-card.revenue { border-left: 3px solid var(--accent); }
.stat-card.rate { border-left: 3px solid var(--info); }

/* === Badges === */
.badge {
    font-weight: 500;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    letter-spacing: 0.01em;
}
.badge-billable { background-color: var(--billable) !important; color: white; }
.badge-overhead { background-color: var(--overhead) !important; color: white; }
.badge-active { background-color: var(--billable) !important; color: white; }
.badge-inactive { background-color: var(--text-muted) !important; color: white; }

/* === Tables === */
.table { border-collapse: separate; border-spacing: 0; margin-bottom: 0; }
.table thead th {
    background: var(--bg-subtle);
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    padding: 10px 16px;
    white-space: nowrap;
}
.table tbody td {
    padding: 12px 16px;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.875rem;
}
.table tbody tr { transition: background var(--transition); }
.table tbody tr:hover { background: var(--bg-subtle); }
.table tbody tr:last-child td { border-bottom: none; }
.table tfoot td {
    padding: 12px 16px;
    border-top: 2px solid var(--border);
    font-weight: 600;
}

/* === Timesheet Entries === */
.entry-billable { border-left: 3px solid var(--billable); }
.entry-overhead { border-left: 3px solid var(--overhead); }

/* === Progress Bars === */
.progress {
    border-radius: var(--radius-full);
    background: var(--bg-subtle);
    overflow: hidden;
    border: none;
}
.progress-bar {
    transition: width var(--transition-slow);
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 600;
}

/* === Forms === */
.form-control, .form-select {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 14px;
    font-size: 0.875rem;
    transition: border-color var(--transition), box-shadow var(--transition);
    background-color: var(--bg-card);
    color: var(--text-primary);
}
.form-control:focus, .form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}
.form-label {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-primary);
    margin-bottom: 6px;
}
.form-text { font-size: 0.8rem; color: var(--text-muted); }
.form-check-input:checked { background-color: var(--accent); border-color: var(--accent); }

/* === Auth === */
.auth-wrapper {
    min-height: calc(100vh - 20px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: 40px;
    border: 1px solid var(--border);
}
.auth-logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 6px;
}
.auth-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 32px;
}

/* === Buttons === */
.btn {
    font-weight: 500;
    font-size: 0.875rem;
    border-radius: var(--radius);
    padding: 8px 16px;
    transition: all var(--transition);
    letter-spacing: -0.01em;
}
.btn-sm { padding: 5px 12px; font-size: 0.8rem; }
.btn-xs { padding: 3px 8px; font-size: 0.7rem; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); box-shadow: var(--shadow-sm); }
.btn-outline-primary { color: var(--accent); border-color: var(--accent); }
.btn-outline-primary:hover, .btn-outline-primary.active { background: var(--accent); border-color: var(--accent); color: white; }
.btn-billable { background: var(--billable); border-color: var(--billable); color: white; }
.btn-billable:hover { background: #059669; border-color: #059669; color: white; }
.btn-outline-light { border-color: rgba(255,255,255,0.2); color: rgba(255,255,255,0.8); }
.btn-outline-light:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.35); color: white; }

/* === Page Header === */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}
.page-header h1, .page-header h2 { margin-bottom: 0; }

/* === Timer === */
.timer-display {
    font-family: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 1px;
    min-width: 70px;
    color: white;
}

/* === Empty States === */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}
.empty-state .icon { font-size: 3rem; margin-bottom: 16px; opacity: 0.4; }

/* === Utilities === */
.text-billable { color: var(--billable) !important; }
.text-overhead { color: var(--overhead) !important; }
.text-accent { color: var(--accent) !important; }
.bg-billable-light { background: var(--billable-bg) !important; }
.bg-overhead-light { background: var(--overhead-bg) !important; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }

/* === Responsive === */
@media (max-width: 991px) {
    .app-navbar .nav-link { padding: 10px 14px !important; }
    .app-navbar .nav-link.active::after { display: none; }
}

@media (max-width: 768px) {
    .stat-card .stat-value { font-size: 1.4rem; }
    .stat-card { padding: 16px; }
}

@media (max-width: 576px) {
    .container { padding-left: 12px; padding-right: 12px; }
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }
    .stat-card .stat-value { font-size: 1.2rem; }
    .stat-card { padding: 14px 16px; }
    .table thead th { padding: 8px 10px; font-size: 0.65rem; }
    .table tbody td { padding: 10px; font-size: 0.85rem; }
    .auth-card { padding: 24px; margin: 12px; }
    .list-group-item .d-flex { flex-direction: column; align-items: flex-start !important; gap: 8px; }
    #timer-bar.d-flex { flex-wrap: wrap; gap: 6px; }
    #timer-bar select, #timer-bar input[type="text"] { max-width: 100% !important; flex: 1 1 auto; }
    form[style*="max-width: 500px"], form[style*="max-width: 600px"] { max-width: 100% !important; }
    .d-flex.flex-wrap.gap-1 .btn { margin: 2px; }
    .page-header { margin-bottom: 16px; }
}
