/* ============================================================
   OrgFin - Modern UI Styles
   ============================================================ */

/* ── Base ────────────────────────────────────────────────────── */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

/* ── Form inputs ─────────────────────────────────────────────── */
.input-field {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    background: #fff;
    transition: all 0.2s;
    outline: none;
}
.input-field:focus {
    border-color: #818cf8;
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.15);
}
.input-field:hover:not(:focus) {
    border-color: #cbd5e1;
}
select.input-field {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236b7280' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.25rem;
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn-primary {
    display: inline-flex; align-items: center; gap: 0.375rem;
    padding: 0.5rem 1.125rem;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #fff; border-radius: 0.75rem; font-size: 0.875rem; font-weight: 600;
    border: none; cursor: pointer;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
    transition: all 0.2s;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4); }
.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: 0.375rem;
    padding: 0.5rem 1.125rem;
    background: #fff; color: #475569;
    border: 1.5px solid #e2e8f0; border-radius: 0.75rem;
    font-size: 0.875rem; font-weight: 500; cursor: pointer;
    transition: all 0.2s;
}
.btn-secondary:hover { background: #f8fafc; border-color: #cbd5e1; }

.btn-danger {
    display: inline-flex; align-items: center; gap: 0.375rem;
    padding: 0.5rem 1.125rem;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #fff; border-radius: 0.75rem; font-size: 0.875rem; font-weight: 600;
    border: none; cursor: pointer;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
    transition: all 0.2s;
}
.btn-danger:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4); }

.btn-sm { padding: 0.375rem 0.75rem; font-size: 0.75rem; border-radius: 0.5rem; }
.btn-icon {
    padding: 0.5rem; border-radius: 0.625rem; border: none; background: transparent;
    color: #94a3b8; cursor: pointer; transition: all 0.2s;
}
.btn-icon:hover { background: #f1f5f9; color: #475569; }

/* ── Sidebar ─────────────────────────────────────────────────── */
.sidebar-gradient {
    background: linear-gradient(180deg, #1e1b4b 0%, #312e81 50%, #3730a3 100%);
}

.nav-item {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.625rem 1rem;
    font-size: 0.875rem; color: rgba(255,255,255,0.65);
    border-radius: 0.75rem; cursor: pointer;
    transition: all 0.2s; text-decoration: none;
}
.nav-item:hover {
    background: rgba(255,255,255,0.1); color: #fff;
}
.nav-item.active {
    background: rgba(255,255,255,0.15); color: #fff; font-weight: 600;
    box-shadow: inset 3px 0 0 #a78bfa;
}
.nav-item svg { opacity: 0.8; }
.nav-item.active svg { opacity: 1; }

/* Light sidebar variant (admin) */
.sidebar-light .nav-item {
    color: #64748b;
}
.sidebar-light .nav-item:hover {
    background: #f1f5f9; color: #4f46e5;
}
.sidebar-light .nav-item.active {
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    color: #4338ca; font-weight: 600;
    box-shadow: inset 3px 0 0 #6366f1;
}

/* ── Cards ───────────────────────────────────────────────────── */
.stat-card {
    background: #fff;
    border-radius: 1rem;
    padding: 1.25rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}
.stat-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}
.stat-card-value {
    font-size: 1.75rem; font-weight: 800; color: #1e293b; margin-top: 0.25rem;
    letter-spacing: -0.025em;
}
.stat-card-label {
    font-size: 0.8rem; font-weight: 500; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.05em;
}

/* Colored stat cards */
.stat-card-blue { border-left: 4px solid #6366f1; }
.stat-card-green { border-left: 4px solid #10b981; }
.stat-card-amber { border-left: 4px solid #f59e0b; }
.stat-card-red { border-left: 4px solid #ef4444; }
.stat-card-purple { border-left: 4px solid #8b5cf6; }

/* ── Page layout ─────────────────────────────────────────────── */
.page-header {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
    gap: 1rem; margin-bottom: 1.5rem;
}
.page-title {
    font-size: 1.375rem; font-weight: 800; color: #0f172a;
    letter-spacing: -0.025em;
}

/* ── Top bar ─────────────────────────────────────────────────── */
.topbar {
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

/* ── Table wrapper ───────────────────────────────────────────── */
.table-wrap {
    background: #fff; border-radius: 1rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    overflow: hidden;
}

/* ── Mobile bottom nav ───────────────────────────────────────── */
@media (max-width: 768px) {
    .bottom-nav {
        position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
        display: flex; justify-content: space-around;
        background: rgba(255,255,255,0.9);
        backdrop-filter: blur(12px);
        border-top: 1px solid #e5e7eb;
        padding: 0.375rem 0;
        padding-bottom: calc(0.375rem + env(safe-area-inset-bottom));
    }
    .bottom-nav a {
        display: flex; flex-direction: column; align-items: center;
        font-size: 0.6rem; font-weight: 500; color: #94a3b8;
        padding: 0.25rem 0.75rem; text-decoration: none;
        border-radius: 0.5rem; transition: all 0.2s;
    }
    .bottom-nav a.active { color: #6366f1; background: #eef2ff; }
    .bottom-nav svg { width: 1.25rem; height: 1.25rem; margin-bottom: 0.125rem; }
    #main-content { padding-bottom: 5rem; }
}

/* ── Scrollbar ───────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ── Animations ──────────────────────────────────────────────── */
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.animate-fade-in { animation: fadeIn 0.3s ease-out; }

@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.animate-slide-up { animation: slideUp 0.35s ease-out; }

@keyframes pulse-glow { 0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); } 50% { box-shadow: 0 0 0 8px rgba(99,102,241,0); } }
