/* =============================================================================
   assets/css/custom.css — Global overrides for Bootstrap 5
   ============================================================================= */

/* ── Google Font ──────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ── CSS Variables ────────────────────────────────────────────────────────── */
:root {
    --navbar-bg:      #0f172a;
    --sidebar-bg:     #1e293b;
    --sidebar-width:  240px;
    --sidebar-link:   #94a3b8;
    --sidebar-active: #38bdf8;
    --accent:         #0ea5e9;
    --accent-hover:   #0284c7;
    --body-bg:        #f1f5f9;
    --card-shadow:    0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
}

/* ── Base ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--body-bg);
    font-size: 0.875rem;
    color: #334155;
    padding-top: 56px;   /* fixed navbar offset */
}

/* ── Navbar ───────────────────────────────────────────────────────────────── */
.bg-navbar { background-color: var(--navbar-bg) !important; }

/* ── Sidebar ──────────────────────────────────────────────────────────────── */
#sidebar {
    width: var(--sidebar-width);
    min-height: calc(100vh - 56px);
    background-color: var(--sidebar-bg);
    position: sticky;
    top: 56px;
    align-self: flex-start;
    overflow-y: auto;
    padding-top: 1rem;
}

.sidebar-link {
    color: var(--sidebar-link);
    border-radius: 6px;
    padding: 0.45rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 500;
    transition: background .15s, color .15s;
    text-decoration: none;
}
.sidebar-link:hover {
    background: rgba(255,255,255,.07);
    color: #e2e8f0;
}
.sidebar-link.active {
    background: rgba(56,189,248,.15);
    color: var(--sidebar-active) !important;
}
.sidebar-link i {
    font-size: 1rem;
}

.sidebar-section-label {
    list-style: none;
    color: #475569;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: .08em;
    padding: 0.75rem 0.75rem 0.25rem;
    text-transform: uppercase;
}

/* ── Page content area ────────────────────────────────────────────────────── */
#page-content {
    min-height: calc(100vh - 56px);
}

/* ── Cards ────────────────────────────────────────────────────────────────── */
.card {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: var(--card-shadow);
}
.card-header {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    font-weight: 600;
    padding: 0.85rem 1.25rem;
    border-radius: 10px 10px 0 0 !important;
}

/* ── Tables ───────────────────────────────────────────────────────────────── */
.table {
    font-size: 0.8125rem;
    vertical-align: middle;
}
.table thead th {
    background: #f8fafc;
    color: #64748b;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    border-bottom: 2px solid #e2e8f0;
}
.table-hover tbody tr:hover {
    background: #f0f9ff;
}

/* ── Stat cards on dashboard ──────────────────────────────────────────────── */
.stat-card {
    border-radius: 12px;
    border: none;
    padding: 1.25rem 1.5rem;
    color: #fff;
    position: relative;
    overflow: hidden;
}
.stat-card .stat-icon {
    font-size: 2.5rem;
    opacity: .25;
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
}
.stat-card .stat-value { font-size: 2rem; font-weight: 700; }
.stat-card .stat-label { font-size: 0.8rem; opacity: .85; }

/* Stage badge colors */
.bg-purple { background-color: #7c3aed !important; }

/* ── Role badge in navbar ─────────────────────────────────────────────────── */
.bg-role {
    background: rgba(255,255,255,.15);
    font-size: 0.7rem;
    letter-spacing: .04em;
    padding: .25em .6em;
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
}
.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

/* ── Pagination ───────────────────────────────────────────────────────────── */
.pagination .page-link {
    font-size: 0.8rem;
    color: var(--accent);
}
.pagination .page-item.active .page-link {
    background: var(--accent);
    border-color: var(--accent);
}

/* ── Form controls ────────────────────────────────────────────────────────── */
.form-control:focus, .form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(14,165,233,.15);
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    #sidebar {
        position: fixed;
        z-index: 1040;
        left: -240px;
        transition: left .25s ease;
    }
    #sidebar.open {
        left: 0;
    }
    #page-content {
        width: 100%;
    }
}
