/* ============================================================
   JAMAT WASSIYAT PORTAL — site.css
   Bootstrap 5.3 + Bootstrap Icons 1.11
   ============================================================ */

/* ---- Brand tokens ---- */
:root {
    --sidebar-width:        240px;
    --sidebar-bg:           #1a2332;
    --sidebar-text:         #adb5bd;
    --sidebar-active-bg:    #2d3f55;
    --sidebar-active-text:  #ffffff;
    --sidebar-hover-bg:     #243044;
    --sidebar-section-label:#6c757d;
    --content-bg:           #f4f6f9;

    /* Primary accent — derived from sidebar navy, used everywhere */
    --accent:               #2563eb;
    --accent-hover:         #1d4ed8;
    --accent-light:         #eff6ff;
    --accent-border:        #bfdbfe;

    /* Bootstrap overrides via CSS custom properties */
    --bs-primary:           #2563eb;
    --bs-primary-rgb:       37, 99, 235;
    --bs-link-color:        #2563eb;
    --bs-link-hover-color:  #1d4ed8;
    --bs-focus-ring-color:  rgba(37, 99, 235, 0.25);

    --radius:               0.45rem;
    --radius-lg:            0.65rem;
    --shadow-sm:            0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
    --shadow:               0 4px 12px rgba(0,0,0,.10), 0 2px 4px rgba(0,0,0,.06);
    --transition:           150ms ease;
}

/* ---- Base ---- */
html, body {
    height: 100%;
    font-size: 15px;
    color: #1e293b;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition);
}
a:hover { color: var(--accent-hover); }

/* ---- Layout ---- */
#wrapper { min-height: 100vh; }

#sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background-color: var(--sidebar-bg);
    position: fixed;
    top: 0; left: 0; bottom: 0;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 100;
    scrollbar-width: thin;
    scrollbar-color: #2d3f55 transparent;
}
#sidebar::-webkit-scrollbar { width: 4px; }
#sidebar::-webkit-scrollbar-thumb { background: #2d3f55; border-radius: 2px; }

#page-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    background-color: var(--content-bg);
    flex: 1;
}

/* ---- Sidebar ---- */
.sidebar-brand {
    color: #ffffff;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.sidebar-footer {
    display: flex;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid #2d3f55;
    color: var(--sidebar-text);
    font-size: 0.8rem;
}
.sidebar-footer a { color: var(--sidebar-text); }
.sidebar-footer a:hover { color: #ffffff; }

.nav-section-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--sidebar-section-label);
    padding: 0.85rem 0.75rem 0.2rem;
    list-style: none;
}

#sidebar .nav-link {
    color: var(--sidebar-text);
    font-size: 0.875rem;
    padding: 0.45rem 0.75rem;
    border-radius: var(--radius);
    transition: background-color var(--transition), color var(--transition);
}
#sidebar .nav-link:hover {
    background-color: var(--sidebar-hover-bg);
    color: #ffffff;
}
#sidebar .nav-link.active {
    background-color: var(--accent);
    color: #ffffff;
}
#sidebar .nav-link i { opacity: 0.85; }
#sidebar .nav-link.active i,
#sidebar .nav-link:hover i { opacity: 1; }

/* Sidebar search */
#sidebar .form-control {
    background-color: #243044;
    border-color: #2d3f55;
    color: #e2e8f0;
    font-size: 0.8rem;
}
#sidebar .form-control::placeholder { color: #6c757d; }
#sidebar .form-control:focus {
    background-color: #2d3f55;
    border-color: var(--accent);
    color: #ffffff;
    box-shadow: none;
}
#sidebar .btn-outline-secondary {
    border-color: #2d3f55;
    color: #adb5bd;
}
#sidebar .btn-outline-secondary:hover {
    background-color: #2d3f55;
    color: #ffffff;
}

/* ---- Page headings ---- */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}
.page-header h1 {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0;
    color: #0f172a;
}

/* ---- Breadcrumb ---- */
.breadcrumb {
    font-size: 0.8rem;
    margin-bottom: 0;
}
.breadcrumb-item + .breadcrumb-item::before { color: #94a3b8; }
.breadcrumb-item a { color: #64748b; }
.breadcrumb-item a:hover { color: var(--accent); }
.breadcrumb-item.active { color: #475569; }

/* ---- Cards ---- */
.card {
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}
.card-header {
    background-color: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.875rem 1.25rem;
}

/* ---- Stat cards (dashboard) ---- */
.stat-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-left: 4px solid var(--accent);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition), transform var(--transition);
}
.stat-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}
.stat-card .stat-value {
    font-size: 1.9rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1;
}
.stat-card .stat-label {
    font-size: 0.78rem;
    color: #64748b;
    margin-top: 0.3rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.stat-card .stat-icon {
    font-size: 1.6rem;
    color: var(--accent);
    opacity: 0.35;
}

/* Accent variants for stat cards */
.stat-card.stat-success  { border-left-color: #16a34a; }
.stat-card.stat-warning  { border-left-color: #d97706; }
.stat-card.stat-danger   { border-left-color: #dc2626; }
.stat-card.stat-info     { border-left-color: #0891b2; }
.stat-card.stat-muted    { border-left-color: #94a3b8; }

/* ---- Tables ---- */
.table-compact th,
.table-compact td {
    padding: 0.5rem 0.875rem;
    font-size: 0.875rem;
    vertical-align: middle;
}
.table-compact thead th {
    background-color: #f8fafc;
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #475569;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
}
.table-compact tbody tr {
    transition: background-color var(--transition);
}
.table-compact tbody tr:hover {
    background-color: var(--accent-light);
}
.table-compact tbody tr.clickable-row {
    cursor: pointer;
}
.table-compact td a {
    font-weight: 500;
}

/* Table wrapper card */
.table-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.table-card .table-compact {
    margin-bottom: 0;
}
.table-card .table-compact thead th:first-child { padding-left: 1.25rem; }
.table-card .table-compact td:first-child       { padding-left: 1.25rem; }
.table-card .table-compact thead th:last-child  { padding-right: 1.25rem; }
.table-card .table-compact td:last-child        { padding-right: 1.25rem; }

/* Table toolbar (search + buttons above table) */
.table-toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e2e8f0;
    background: #ffffff;
    flex-wrap: wrap;
}

/* ---- Buttons ---- */
.btn {
    font-weight: 500;
    border-radius: var(--radius);
    transition: background-color var(--transition), border-color var(--transition),
                box-shadow var(--transition), transform var(--transition);
    letter-spacing: 0.01em;
}
.btn:active { transform: translateY(1px); }

.btn-sm {
    font-size: 0.8rem;
    padding: 0.3rem 0.75rem;
    border-radius: 0.35rem;
}

/* Primary */
.btn-primary {
    background-color: var(--accent);
    border-color: var(--accent);
}
.btn-primary:hover, .btn-primary:focus {
    background-color: var(--accent-hover);
    border-color: var(--accent-hover);
    box-shadow: 0 4px 10px rgba(37,99,235,0.3);
}

/* Outline primary */
.btn-outline-primary {
    color: var(--accent);
    border-color: var(--accent);
}
.btn-outline-primary:hover {
    background-color: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 4px 10px rgba(37,99,235,0.25);
}

/* Secondary */
.btn-outline-secondary:hover {
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

/* Danger */
.btn-danger {
    background-color: #dc2626;
    border-color: #dc2626;
}
.btn-danger:hover {
    background-color: #b91c1c;
    border-color: #b91c1c;
    box-shadow: 0 4px 10px rgba(220,38,38,0.3);
}
.btn-outline-danger:hover {
    box-shadow: 0 2px 6px rgba(220,38,38,0.2);
}

/* Success */
.btn-success {
    background-color: #16a34a;
    border-color: #16a34a;
}
.btn-success:hover {
    background-color: #15803d;
    border-color: #15803d;
    box-shadow: 0 4px 10px rgba(22,163,74,0.3);
}

/* ---- Forms ---- */
.form-control, .form-select {
    border-color: #cbd5e1;
    border-radius: var(--radius);
    font-size: 0.9rem;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus, .form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}
.form-control-sm, .form-select-sm {
    font-size: 0.85rem;
    border-radius: 0.35rem;
}
.form-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.3rem;
}
.form-text {
    font-size: 0.75rem;
    color: #94a3b8;
}

/* Readonly / disabled */
.form-control[readonly] {
    background-color: #f8fafc;
    color: #64748b;
}

/* ---- Badges ---- */
.badge {
    font-weight: 600;
    letter-spacing: 0.02em;
    border-radius: 0.3rem;
    padding: 0.3em 0.6em;
    font-size: 0.72em;
}

.badge-active     { background-color: #16a34a; color: #fff; }
.badge-suspended  { background-color: #d97706; color: #fff; }
.badge-cancelled  { background-color: #dc2626; color: #fff; }
.badge-deceased   { background-color: #475569; color: #fff; }
.badge-pending    { background-color: #0891b2; color: #fff; }

/* ---- Alerts ---- */
.alert {
    border-radius: var(--radius);
    border-left-width: 4px;
    font-size: 0.875rem;
}
.alert-success { border-left-color: #16a34a; }
.alert-danger  { border-left-color: #dc2626; }
.alert-warning { border-left-color: #d97706; }
.alert-info    { border-left-color: #0891b2; }

/* ---- Tabs ---- */
.nav-tabs {
    border-bottom: 2px solid #e2e8f0;
    gap: 0.25rem;
}
.nav-tabs .nav-link {
    color: #64748b;
    font-size: 0.85rem;
    font-weight: 500;
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    padding: 0.6rem 1rem;
    margin-bottom: -2px;
    transition: color var(--transition), border-color var(--transition);
}
.nav-tabs .nav-link:hover { color: var(--accent); border-bottom-color: var(--accent-border); }
.nav-tabs .nav-link.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    background: transparent;
    font-weight: 600;
}

/* ---- Detail panels (bg-light cards on detail pages) ---- */
.card.border-0.bg-light {
    background-color: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: var(--radius-lg);
}

/* ---- Login page ---- */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #1a2332 60%, #1e3a5f 100%);
}
.login-card {
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}
.login-card .login-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #0f172a;
    text-align: center;
    margin-bottom: 0.25rem;
}
.login-card .login-subtitle {
    font-size: 0.8rem;
    color: #64748b;
    text-align: center;
    margin-bottom: 2rem;
}

/* ---- Utility ---- */
.text-muted { color: #64748b !important; }
.small, small { font-size: 0.82em; }
hr { border-color: #e2e8f0; opacity: 1; }

/* Status workflow strip */
.workflow-step {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.9rem;
    border-radius: 2rem;
    font-size: 0.8rem;
    font-weight: 600;
}
.workflow-step.done    { background: #dcfce7; color: #15803d; }
.workflow-step.current { background: var(--accent); color: #fff; }
.workflow-step.pending { background: #f1f5f9; color: #94a3b8; }
