/* Garage Budget Manager - Clean Corporate Theme */

:root {
    --ink-900: #0f172a;
    --ink-700: #334155;
    --ink-500: #64748b;
    --ink-300: #cbd5f5;
    --line-200: #e2e8f0;
    --line-100: #f1f5f9;
    --brand-600: #2563eb;
    --brand-500: #3b82f6;
    --brand-100: #dbeafe;
    --success-600: #16a34a;
    --warning-600: #f59e0b;
    --danger-600: #dc2626;
    --radius-lg: 18px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.08);
    --shadow-tight: 0 8px 18px rgba(15, 23, 42, 0.12);
}

html {
    scroll-behavior: smooth;
    overflow-y: scroll;
}

body {
    font-family: 'Manrope', 'Segoe UI', sans-serif;
    color: var(--ink-900);
    background-color: #f8fafc;
    background-image:
        radial-gradient(circle at 20% 20%, rgba(37, 99, 235, 0.08), transparent 45%),
        linear-gradient(180deg, rgba(248, 250, 252, 0.96), rgba(241, 245, 249, 0.98)),
        linear-gradient(0deg, rgba(148, 163, 184, 0.15) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.12) 1px, transparent 1px);
    background-size: auto, auto, 36px 36px, 36px 36px;
    min-height: 100vh;
}

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    * {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

.app-shell {
    display: flex;
    flex-direction: column;
}

.app-main {
    padding: 20px;
}

.skip-link {
    position: absolute;
    left: -999px;
    top: -999px;
    background: #ffffff;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-soft);
    z-index: 999;
}

.skip-link:focus {
    left: 1.5rem;
    top: 1.5rem;
}

/* Navigation */
.navbar {
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--line-200);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
    backdrop-filter: blur(12px);
}

.navbar-brand {
    font-weight: 800;
    color: var(--ink-900) !important;
    letter-spacing: -0.4px;
}

.brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--brand-600), #1d4ed8);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.85rem;
}

.nav-link {
    color: var(--ink-700) !important;
    font-weight: 600;
    border-radius: var(--radius-sm);
    padding: 0.55rem 0.9rem !important;
    transition: all 0.2s ease;
}

.nav-link:hover,
.nav-link:focus {
    color: var(--ink-900) !important;
    background: var(--line-100);
}

.team-pill {
    background: var(--brand-100);
    color: var(--brand-600);
    font-weight: 700;
    font-size: 0.75rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
}

/* Typography */
.page-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
    letter-spacing: -0.6px;
}

.page-subtitle {
    color: var(--ink-500);
    font-size: 0.98rem;
}

.section-title {
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--ink-900);
}

/* Cards */
.card {
    border: 1px solid var(--line-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    background: white;
}

.card-header {
    background: white;
    border-bottom: 1px solid var(--line-200);
    padding: 1.25rem 1.5rem;
    font-weight: 700;
}

.card-body {
    padding: 1.5rem;
}

.stat-card {
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    right: -40px;
    top: -40px;
    width: 140px;
    height: 140px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.16), transparent 70%);
}

.stat-number {
    font-size: 1.6rem;
    font-weight: 800;
}

.stat-label {
    color: var(--ink-500);
    font-weight: 600;
}

/* Buttons */
.btn-primary {
    background: var(--brand-600);
    border: none;
    font-weight: 700;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-tight);
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-outline-primary {
    color: var(--brand-600);
    border: 1px solid var(--brand-600);
    font-weight: 600;
    border-radius: var(--radius-sm);
}

.btn-outline-primary:hover {
    background: var(--brand-600);
    color: white;
}

.btn-soft {
    background: var(--line-100);
    color: var(--ink-700);
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
}

.btn-soft:hover {
    background: var(--line-200);
}

/* Forms */
.form-control,
.form-select {
    border-radius: var(--radius-sm);
    border: 1px solid var(--line-200);
    padding: 0.65rem 0.85rem;
    font-size: 0.95rem;
    background: white;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--brand-500);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

.form-label {
    color: var(--ink-700);
    font-weight: 600;
}

/* Tables */
.table {
    border-radius: var(--radius-md);
    overflow: hidden;
}

.table thead th {
    background: var(--line-100);
    color: var(--ink-700);
    font-weight: 700;
    border-bottom: 1px solid var(--line-200);
}

.table tbody tr:hover {
    background: #f8fafc;
}

/* Alerts */
.alert-soft {
    border-radius: var(--radius-md);
    padding: 0.9rem 1.1rem;
    border: 1px solid var(--line-200);
    background: white;
}

.alert-warning-soft {
    border-left: 4px solid var(--warning-600);
}

.alert-danger-soft {
    border-left: 4px solid var(--danger-600);
}

/* Badges */
.badge-role {
    background: var(--brand-100);
    color: var(--brand-600);
    font-weight: 700;
    padding: 0.3rem 0.6rem;
    border-radius: 999px;
}

.badge-muted {
    background: var(--line-100);
    color: var(--ink-500);
}

/* Progress */
.progress {
    height: 10px;
    border-radius: 999px;
    background: var(--line-100);
}

.progress-bar {
    background: linear-gradient(90deg, var(--brand-500), var(--brand-600));
}

/* Footer */
.app-footer {
    padding: 1.5rem 0 2rem;
    background: white;
    border-top: 1px solid var(--line-200);
}

.footer-link {
    color: var(--ink-700);
    font-weight: 600;
    text-decoration: none;
    margin-left: 0.4rem;
}

.footer-link:hover {
    color: var(--brand-600);
}

/* Notifications */
.notification-container {
    position: fixed;
    top: 84px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 360px;
}

.notification {
    padding: 14px 16px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: white;
    background: var(--ink-900);
}

.notification.success { background: var(--success-600); }
.notification.error { background: var(--danger-600); }
.notification.warning { background: var(--warning-600); }
.notification.info { background: var(--ink-900); }

.notification-close {
    margin-left: auto;
    background: rgba(255, 255, 255, 0.25);
    border: none;
    color: white;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification.hide {
    animation: slideOut 0.3s ease-out forwards;
}

@keyframes slideOut {
    to {
        opacity: 0;
        transform: translateX(200px);
    }
}

/* Auth */
.auth-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: center;
}

.auth-hero {
    background: white;
    border: 1px solid var(--line-200);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-soft);
}

.auth-hero h3 {
    font-weight: 800;
    margin-bottom: 1rem;
}

.auth-hero ul {
    list-style: none;
    padding: 0;
    margin: 0;
    color: var(--ink-500);
}

.auth-hero li {
    margin-bottom: 0.6rem;
}

/* Utilities */
.kpi-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: var(--line-100);
    color: var(--ink-700);
    font-weight: 600;
    font-size: 0.85rem;
}

.table-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    color: var(--ink-500);
    font-size: 0.9rem;
}

.hide-mobile {
    display: inline;
}

.action-row .btn {
    min-width: 180px;
}

details summary {
    cursor: pointer;
    list-style: none;
}

details summary::-webkit-details-marker {
    display: none;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-responsive table {
    min-width: 640px;
}

/* Responsive */
@media (max-width: 991px) {
    .auth-wrapper {
        grid-template-columns: 1fr;
    }

    .navbar-collapse {
        padding-top: 0.75rem;
    }

    .navbar .nav-link {
        width: 100%;
    }
}

@media (max-width: 576px) {
    .app-main {
        padding: 20px;
    }

    .page-title {
        font-size: 1.4rem;
    }

    .page-subtitle {
        font-size: 0.9rem;
    }

    .notification-container {
        left: 16px;
        right: 16px;
        max-width: none;
    }

    .team-pill {
        margin-top: 0.5rem;
    }

    .card-header,
    .card-body {
        padding: 0.9rem;
    }

    .table-meta {
        flex-direction: column;
        gap: 0.35rem;
    }

    .btn {
        width: 100%;
    }

    .btn + .btn {
        margin-top: 0.5rem;
    }

    .row.g-3 > * {
        margin-bottom: 0.6rem;
    }

    .stat-number {
        font-size: 1.2rem;
    }

    .notification {
        font-size: 0.9rem;
    }

    .table-responsive table {
        min-width: 560px;
    }

    .hide-mobile {
        display: none !important;
    }

    .action-row {
        width: 100%;
    }

    .action-row .btn {
        width: 100%;
        min-width: 0;
        padding: 0.65rem 0.9rem;
        font-size: 0.95rem;
    }

    .stat-card {
        margin-bottom: 0.75rem;
    }

    .navbar {
        padding: 0.4rem 0;
    }

    .navbar-brand {
        font-size: 1.05rem;
    }

    .card {
        border-radius: 14px;
    }

    .form-control,
    .form-select {
        padding: 0.6rem 0.75rem;
    }
}

@media print {
    nav, footer, .btn, .notification-container {
        display: none !important;
    }

    body {
        background: white;
    }
}
