/* ============================================
   Sli Software TimeKeeper — Apple HIG Design System
   ============================================ */

:root {
    /* Typography */
    --font-primary: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', system-ui, sans-serif;
    --font-mono: 'SF Mono', SFMono-Regular, ui-monospace, Menlo, monospace;

    /* Apple System Colors */
    --color-blue: #007AFF;
    --color-green: #34C759;
    --color-orange: #FF9500;
    --color-red: #FF3B30;
    --color-purple: #AF52DE;
    --color-pink: #FF2D55;
    --color-teal: #5AC8FA;
    --color-yellow: #FFCC00;
    --color-indigo: #5856D6;

    /* Backgrounds */
    --bg-primary: #F2F2F7;
    --bg-secondary: #FFFFFF;
    --bg-tertiary: #E5E5EA;

    /* Text */
    --text-primary: #1C1C1E;
    --text-secondary: #8E8E93;
    --text-tertiary: #AEAEB2;

    /* Spacing & Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.06), 0 8px 24px rgba(0,0,0,0.04);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.08), 0 16px 48px rgba(0,0,0,0.06);

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;

    /* Sidebar */
    --sidebar-width: 260px;
    --sidebar-bg: #1C1C2E;
}

/* ============================================
   Reset & Base
   ============================================ */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    font-family: var(--font-primary);
    font-size: 15px;
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--color-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============================================
   App Shell
   ============================================ */

.app-shell {
    display: flex;
    min-height: 100vh;
}

/* ============================================
   Sidebar
   ============================================ */

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform var(--transition-normal);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 20px 20px;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #FFFFFF;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.sidebar-logo svg { color: var(--color-blue); }

.sidebar-close {
    display: none;
    background: none;
    border: none;
    color: #8E8E93;
    cursor: pointer;
    padding: 4px;
}

.sidebar-nav {
    flex: 1;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    color: #A0A0B0;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.nav-item:hover {
    background: rgba(255,255,255,0.06);
    color: #FFFFFF;
    text-decoration: none;
}

.nav-item.active {
    background: var(--color-blue);
    color: #FFFFFF;
}

.nav-item.active svg { stroke: #FFFFFF; }

.sidebar-footer {
    padding: 12px;
    border-top: 1px solid rgba(255,255,255,0.06);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.logout-link:hover { color: var(--color-red) !important; }

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.3);
    z-index: 99;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

/* ============================================
   Main Content
   ============================================ */

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 32px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--bg-tertiary);
    position: sticky;
    top: 0;
    z-index: 50;
}

.hamburger {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 4px;
}

.top-bar-user { margin-left: auto; }

.user-greeting {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.page-content {
    flex: 1;
    padding: 32px;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

/* ============================================
   Page Animations
   ============================================ */

.page-animate {
    animation: pageIn 0.3s ease forwards;
}

@keyframes pageIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   Page Header
   ============================================ */

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.page-header h1 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

/* ============================================
   Cards
   ============================================ */

.card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 24px;
    transition: box-shadow var(--transition-normal);
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card h3 {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 16px;
    letter-spacing: -0.2px;
}

.card h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 12px;
}

.form-card { margin-bottom: 24px; }


/* ============================================
   Metric Cards
   ============================================ */

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.metrics-3 { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }

.metric-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 20px 24px;
    border-left: 4px solid var(--accent-color);
    transition: all var(--transition-normal);
}

.metric-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.metric-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.metric-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--accent-color);
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.metric-subtext {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 4px;
    font-weight: 500;
}

/* ============================================
   Charts
   ============================================ */

.charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.chart-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 24px;
}

.chart-card h3 {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 16px;
}

.chart-card.full-width { margin-bottom: 24px; }

.chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.chart-header h3 { margin-bottom: 0; }

.chart-toggle {
    display: flex;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    padding: 2px;
}

.chart-toggle button {
    padding: 6px 14px;
    border: none;
    background: none;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.chart-toggle button.active {
    background: var(--bg-secondary);
    color: var(--color-blue);
    box-shadow: var(--shadow-sm);
}

/* ============================================
   Radzen DataGrid Theme Overrides
   ============================================ */

.rz-datatable {
    font-family: var(--font-primary) !important;
    border: none !important;
}

.rz-datatable .rz-datatable-thead > tr > th {
    font-size: 12px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    color: var(--text-secondary) !important;
    background: var(--bg-secondary) !important;
    border-color: var(--bg-tertiary) !important;
}

.rz-datatable .rz-datatable-tbody > tr > td {
    font-size: 14px !important;
    color: var(--text-primary) !important;
    border-color: #F0F0F5 !important;
    vertical-align: middle !important;
}

.rz-datatable .rz-datatable-tbody > tr:hover > td {
    background: #F0F0F8 !important;
}

.rz-datatable .rz-datatable-tfoot > tr > td {
    font-size: 13px !important;
    color: var(--text-secondary) !important;
    background: var(--bg-secondary) !important;
    border-color: var(--bg-tertiary) !important;
}

.rz-pager {
    border-top: 1px solid var(--bg-tertiary) !important;
    font-family: var(--font-primary) !important;
}

.rz-datatable .rz-sortable-column .rzi-sort-asc,
.rz-datatable .rz-sortable-column .rzi-sort-desc {
    color: var(--color-blue) !important;
}

/* Make Radzen grid inputs match our form style */
.rz-datatable input,
.rz-datatable select,
.rz-datatable textarea {
    font-family: var(--font-primary);
}

/* ============================================
   Buttons
   ============================================ */

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: var(--color-blue);
    color: #FFFFFF;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-primary);
}

.btn-primary:hover { background: #0066D6; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,122,255,0.3); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-primary);
}

.btn-secondary:hover { background: #D5D5DA; }

.btn-danger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: var(--color-red);
    color: #FFFFFF;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-primary);
}

.btn-danger:hover { background: #D63029; }

.btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: none;
    color: var(--color-blue);
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-primary);
}

.btn-ghost:hover { background: rgba(0,122,255,0.06); }
.btn-ghost:disabled { color: var(--text-tertiary); cursor: not-allowed; }

.btn-sm { padding: 6px 14px; font-size: 13px; }

.btn-full { width: 100%; justify-content: center; }

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.btn-icon:hover { background: var(--bg-tertiary); }
.btn-delete:hover { background: rgba(255,59,48,0.1); }

/* ============================================
   Forms
   ============================================ */

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #E5E5EA;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-family: var(--font-primary);
    color: var(--text-primary);
    background: var(--bg-secondary);
    transition: all var(--transition-fast);
    outline: none;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--color-blue);
    box-shadow: 0 0 0 3px rgba(0,122,255,0.15);
}

textarea { resize: vertical; }

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-row .form-group { flex: 1; }
.flex-1 { flex: 1 !important; }
.flex-2 { flex: 2 !important; }

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 20px;
}

.form-error {
    padding: 10px 14px;
    background: rgba(255,59,48,0.08);
    color: var(--color-red);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 16px;
}

.form-success {
    padding: 10px 14px;
    background: rgba(52,199,89,0.08);
    color: var(--color-green);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 16px;
}

.form-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: rgba(255,149,0,0.08);
    color: var(--color-orange);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 16px;
}

.form-hint {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 8px;
}

.computed-value {
    padding: 12px 14px;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 700;
    color: var(--color-green);
}

/* ============================================
   Toggle Switch (Apple-style)
   ============================================ */

.toggle-group { margin-bottom: 16px; }

.toggle-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    font-weight: 500 !important;
    color: var(--text-primary) !important;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 26px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #E5E5EA;
    border-radius: 26px;
    transition: background var(--transition-fast);
}

.toggle-slider::before {
    content: "";
    position: absolute;
    height: 22px;
    width: 22px;
    left: 2px;
    bottom: 2px;
    background: #FFFFFF;
    border-radius: 50%;
    transition: transform var(--transition-fast);
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.toggle-switch input:checked + .toggle-slider { background: var(--color-green); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(18px); }

.toggle-switch.sm { width: 36px; height: 22px; }
.toggle-switch.sm .toggle-slider::before { height: 18px; width: 18px; }
.toggle-switch.sm input:checked + .toggle-slider::before { transform: translateX(14px); }

/* ============================================
   Project Badge
   ============================================ */

.project-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: var(--project-color);
    background: color-mix(in srgb, var(--project-color) 12%, transparent);
    white-space: nowrap;
}

/* ============================================
   Status Pill
   ============================================ */

.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.status-active {
    color: var(--pill-color);
    background: color-mix(in srgb, var(--pill-color) 12%, transparent);
}

.status-inactive {
    color: var(--pill-color);
    background: color-mix(in srgb, var(--pill-color) 10%, transparent);
}

/* ============================================
   Filters Bar
   ============================================ */

.filters-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    align-items: end;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group input, .filter-group select {
    width: auto;
    min-width: 140px;
}

.date-filter {
    display: flex;
    align-items: center;
    gap: 8px;
}

.date-filter input {
    width: auto;
    min-width: 140px;
}

.date-sep {
    color: var(--text-tertiary);
    font-size: 13px;
}

/* ============================================
   Bulk Actions
   ============================================ */

.bulk-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: rgba(0,122,255,0.06);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.bulk-actions span {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-blue);
    margin-right: 4px;
}


/* ============================================
   Projects Grid
   ============================================ */

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.project-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 20px;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.project-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.project-card.inactive { opacity: 0.6; }

.project-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.project-color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.project-card-header h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    flex: 1;
}

.project-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 20px;
    margin-bottom: 12px;
}

.stat { display: flex; flex-direction: column; min-width: 0; }

.stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-outstanding {
    color: #FF9500;
}

.stat-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.project-last-activity {
    font-size: 12px;
    color: var(--text-tertiary);
}

/* ============================================
   Color Picker
   ============================================ */

.color-picker {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.color-swatch {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.color-swatch:hover { transform: scale(1.15); }
.color-swatch.selected { border-color: var(--text-primary); box-shadow: 0 0 0 2px var(--bg-secondary); }

/* ============================================
   Modal
   ============================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-dialog {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 540px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.25s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 0;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
}
.modal-close:hover { background: var(--bg-tertiary); color: var(--text-primary); }

.modal-body { padding: 20px 24px; }
.modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 0 24px 20px;
}

.confirm-dialog {
    padding: 24px;
    max-width: 400px;
}

.confirm-dialog h3 { margin-bottom: 8px; }
.confirm-dialog p { color: var(--text-secondary); margin-bottom: 20px; }

.dialog-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* ============================================
   Export
   ============================================ */

.export-actions-group {
    display: flex;
    flex-direction: column;
}

.export-buttons {
    display: flex;
    gap: 8px;
}

.export-summary-bar {
    display: flex;
    gap: 24px;
    padding: 16px 0;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--bg-tertiary);
    flex-wrap: wrap;
}

.summary-item { display: flex; flex-direction: column; }

.summary-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-tertiary);
}

.summary-value {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
}

.summary-value.green { color: var(--color-green); }
.summary-value.orange { color: var(--color-orange); }
.summary-value.blue { color: var(--color-blue); }
.summary-value.teal { color: var(--color-teal); }

/* Export format toggle */
.export-format-toggle {
    display: flex;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    padding: 2px;
}

.format-btn {
    padding: 8px 18px;
    border: none;
    background: none;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-primary);
}

.format-btn:hover {
    color: var(--text-primary);
}

.format-btn.active {
    background: var(--bg-secondary);
    color: var(--color-blue);
    box-shadow: var(--shadow-sm);
    font-weight: 600;
}

/* ============================================
   Settings
   ============================================ */

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 24px;
}

/* ============================================
   Login Page
   ============================================ */

.login-layout {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 400px;
}

.login-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 40px 32px;
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo h1 {
    font-size: 24px;
    font-weight: 700;
    margin-top: 12px;
    letter-spacing: -0.3px;
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 4px;
}

.login-form .form-group { margin-bottom: 20px; }

.login-form input[type="text"],
.login-form input[type="password"] {
    padding: 14px 16px;
    font-size: 15px;
}

/* Shake animation */
.shake {
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
    20%, 40%, 60%, 80% { transform: translateX(4px); }
}

/* ============================================
   Empty States
   ============================================ */

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-tertiary);
    font-size: 14px;
}

.empty-state-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    text-align: center;
    padding: 48px 24px;
}

.empty-state-card svg { margin-bottom: 16px; }

.empty-state-card p {
    color: var(--text-secondary);
    font-size: 15px;
    margin-bottom: 20px;
}

/* ============================================
   Loading State
   ============================================ */

.loading-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-secondary);
    font-size: 14px;
}

/* ============================================
   Error Page
   ============================================ */

.error-page {
    text-align: center;
    padding: 80px 24px;
}

.error-page h1 {
    font-size: 24px;
    margin-bottom: 8px;
}

.error-page p { color: var(--text-secondary); margin-bottom: 24px; }

.error-detail {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-bottom: 24px;
}

.error-detail code {
    font-family: var(--font-mono);
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 4px;
}

/* ============================================
   Blazor Error UI
   ============================================ */

#blazor-error-ui {
    background: var(--color-red);
    color: #fff;
    padding: 12px 24px;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    display: none;
    text-align: center;
    font-size: 14px;
}

#blazor-error-ui .reload {
    color: #fff;
    text-decoration: underline;
    margin-left: 8px;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
}

/* Goal amount styling */
.goal-amount {
    font-size: 28px;
    font-weight: 700;
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 1024px) {
    .charts-row { grid-template-columns: 1fr; }
    .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-close { display: block; }

    .sidebar-overlay.visible {
        display: block;
        opacity: 1;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
    }

    .hamburger { display: block; }

    .page-content {
        padding: 20px 16px;
        box-sizing: border-box;
        max-width: 100%;
    }

    .top-bar { padding: 12px 16px; }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-header h1 { font-size: 22px; }

    .date-filter { width: 100%; }
    .date-filter input { min-width: 0; flex: 1; }

    .metrics-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
    .metric-value { font-size: 22px; }

    .form-row { flex-direction: column; gap: 0; }

    .filters-bar { flex-direction: column; }
    .filter-group { width: 100%; box-sizing: border-box; }
    .filter-group input, .filter-group select { width: 100%; flex: 1; min-width: 0; }

    .card, .chart-card, .form-card {
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Radzen grid responsive - allow horizontal scroll on mobile */
    .rz-datatable-scrollable-wrapper { overflow-x: auto !important; -webkit-overflow-scrolling: touch; }
    .rz-datatable .rz-datatable-tbody > tr > td { font-size: 13px !important; }
    .rz-datatable .rz-datatable-thead > tr > th { font-size: 11px !important; }

    .project-grid { grid-template-columns: 1fr; }

    .export-buttons { flex-direction: column; }

    .bulk-actions { flex-wrap: wrap; }

    .goal-amount { font-size: 24px; }
}

@media (max-width: 480px) {
    .metrics-grid { grid-template-columns: 1fr; gap: 8px; }
    .metric-card { padding: 14px 16px; }
    .metric-value { font-size: 20px; }

    .login-card { padding: 32px 24px; }

    .goal-amount { font-size: 22px; }
}
