/* PropBudget — Modern SaaS Theme */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ── Base ── */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    background: #f1f5f9;
    color: #1e293b;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    letter-spacing: -0.01em;
    color: #0f172a;
}

/* ── Navbar ── */
.navbar {
    background: #fff !important;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    padding: 0.5rem 1rem;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.2rem;
    color: #4f46e5 !important;
    letter-spacing: -0.02em;
}

.navbar .nav-link {
    color: #64748b !important;
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.4rem 0.85rem !important;
    border-radius: 6px;
    margin: 0 2px;
    transition: color 0.15s, background 0.15s;
}

.navbar .nav-link:hover {
    color: #4f46e5 !important;
    background: #eef2ff;
}

.navbar .nav-link.active {
    color: #4f46e5 !important;
    background: #eef2ff;
    font-weight: 600;
}

.navbar .navbar-text {
    color: #64748b !important;
    font-size: 0.85rem;
}

/* ── Cards ── */
.card {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    transition: box-shadow 0.2s ease, transform 0.15s ease;
    background: #fff;
}

.card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.card-header {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    border-radius: 12px 12px 0 0 !important;
    font-weight: 600;
    padding: 0.75rem 1.25rem;
}

.card-body {
    padding: 1.25rem;
}

.card-title {
    font-weight: 600;
    font-size: 1.05rem;
}

/* ── Buttons ── */
.btn {
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.15s ease;
}

.btn-primary {
    background: #4f46e5;
    border-color: #4f46e5;
}

.btn-primary:hover, .btn-primary:focus {
    background: #4338ca;
    border-color: #4338ca;
    box-shadow: 0 2px 8px rgba(79,70,229,0.3);
}

.btn-outline-primary {
    color: #4f46e5;
    border-color: #4f46e5;
}

.btn-outline-primary:hover {
    background: #4f46e5;
    border-color: #4f46e5;
}

.btn-success {
    background: #059669;
    border-color: #059669;
}

.btn-success:hover {
    background: #047857;
    border-color: #047857;
}

.btn-outline-success {
    color: #059669;
    border-color: #059669;
}

.btn-outline-success:hover {
    background: #059669;
    border-color: #059669;
}

.btn-outline-danger {
    color: #dc2626;
    border-color: #dc2626;
}

.btn-outline-danger:hover {
    background: #dc2626;
    border-color: #dc2626;
}

.btn-outline-secondary {
    color: #64748b;
    border-color: #cbd5e1;
}

.btn-outline-secondary:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #334155;
}

.btn-sm {
    padding: 0.3rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-lg {
    border-radius: 10px;
    padding: 0.625rem 1.5rem;
}

/* ── Forms ── */
.form-control, .form-select {
    border-radius: 8px;
    border-color: #e2e8f0;
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus, .form-select:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}

.form-label {
    font-weight: 500;
    font-size: 0.85rem;
    color: #475569;
    margin-bottom: 0.35rem;
}

.form-control-sm, .form-select-sm {
    border-radius: 6px;
    font-size: 0.8125rem;
}

/* ── Progress ── */
.progress {
    border-radius: 8px;
    background: #e2e8f0;
    overflow: hidden;
}

.progress-bar {
    background: #4f46e5;
    border-radius: 8px;
    transition: width 0.4s ease;
}

.progress-bar.bg-success {
    background: #059669 !important;
}

/* ── Tables ── */
.table-dark {
    --bs-table-bg: #1e293b;
    --bs-table-border-color: #334155;
}

.table-dark th {
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: #f8fafc;
}

/* ── Alerts ── */
.alert {
    border-radius: 10px;
    border: none;
    font-size: 0.875rem;
}

.alert-info {
    background: #eff6ff;
    color: #1e40af;
}

.alert-success {
    background: #ecfdf5;
    color: #065f46;
}

.alert-warning {
    background: #fffbeb;
    color: #92400e;
}

.alert-danger {
    background: #fef2f2;
    color: #991b1b;
}

/* ── Badges ── */
.badge {
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.75rem;
    padding: 0.3em 0.65em;
}

.badge.bg-danger {
    background: #fef2f2 !important;
    color: #dc2626;
}

.badge.bg-secondary {
    background: #f1f5f9 !important;
    color: #64748b;
}

/* ── AG Grid overrides ── */
.ag-theme-alpine {
    --ag-font-size: 13px;
    --ag-font-family: 'Inter', sans-serif;
    --ag-border-radius: 8px;
    --ag-row-hover-color: #f0f4ff;
    --ag-selected-row-background-color: #eef2ff;
    --ag-range-selection-border-color: #4f46e5;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

/* Override highlight for manually edited cells */
.cell-overridden {
    background-color: #fef9c3 !important;
}

/* ── Sparkline ── */
.sparkline {
    display: block;
}

/* ── Step indicator (wizard) ── */
.step-indicator {
    transition: all 0.2s ease;
    font-size: 12px;
    border-radius: 8px !important;
    border: 1px solid transparent;
}

.step-indicator:hover {
    background: #eef2ff !important;
    border-color: #c7d2fe;
}

/* ── Dashboard summary cards ── */
#summary-cards .card {
    min-width: 110px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

#summary-cards .card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* ── Loading overlay ── */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    backdrop-filter: blur(2px);
}

/* ── Page container spacing ── */
.container-fluid {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

/* ── Spinner ── */
.spinner-border {
    color: #4f46e5;
}

/* ── Scrollbar (webkit) ── */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ── Misc ── */
hr {
    border-color: #e2e8f0;
    opacity: 1;
}

code {
    color: #4f46e5;
    background: #f1f5f9;
    padding: 0.15em 0.4em;
    border-radius: 4px;
    font-size: 0.85em;
}

.text-muted {
    color: #94a3b8 !important;
}
