/* ==========================================================
   APP UI — Toko Bangunan (Clean Modern)
   - Consistent cards, tables, forms
   - Clear category badge
   - Optional dark-mode support via body.theme-dark
========================================================== */

:root {
    --bg: #f5f7fb;
    --card: #ffffff;
    --text: #0f172a;
    --muted: #64748b;
    --border: #e5e7eb;
    --primary: #2563eb;
    --primary-2: #1d4ed8;
    --success: #16a34a;
    --warning: #f59e0b;
    --danger: #ef4444;

    --radius: 16px;
    --radius-sm: 12px;

    --shadow-sm: 0 6px 18px rgba(15, 23, 42, .06);
    --shadow-md: 0 10px 30px rgba(15, 23, 42, .09);

    --focus: 0 0 0 .25rem rgba(37, 99, 235, .20);
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji", "Segoe UI Emoji";
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--primary);
}

a:hover {
    color: var(--primary-2);
}

.container {
    max-width: 1100px;
}

/* =========================
   Navbar
========================= */
.app-navbar {
    background: linear-gradient(90deg, #0b1220, #111b32);
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.app-navbar .navbar-brand {
    font-weight: 800;
    letter-spacing: .2px;
}

.app-navbar .nav-link {
    color: rgba(255, 255, 255, .82) !important;
    font-weight: 600;
}

.app-navbar .nav-link:hover {
    color: #fff !important;
}

.app-navbar .nav-link.active {
    color: #fff !important;
}

.app-navbar .badge {
    font-weight: 700;
    border-radius: 999px;
}

/* =========================
   Cards
========================= */
.card {
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
    box-shadow: var(--shadow-sm);
}

.card .card-body {
    padding: 1.15rem;
}

.card-title {
    font-weight: 800;
    margin-bottom: .25rem;
}

.section-title {
    font-weight: 900;
    letter-spacing: .2px;
}

.section-subtitle {
    color: var(--muted);
    font-size: .9rem;
}

/* =========================
   Buttons
========================= */
.btn {
    border-radius: 12px;
    font-weight: 700;
    padding: .55rem .85rem;
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-2);
    border-color: var(--primary-2);
}

.btn-outline-primary {
    border-color: rgba(37, 99, 235, .35);
    color: var(--primary);
}

.btn-outline-primary:hover {
    background: rgba(37, 99, 235, .08);
    border-color: rgba(37, 99, 235, .55);
    color: var(--primary);
}

/* =========================
   Forms
========================= */
.form-control,
.form-select {
    border-radius: 12px;
    border-color: var(--border);
    min-height: 42px;
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(37, 99, 235, .55);
    box-shadow: var(--focus);
}

.form-label {
    font-weight: 800;
    font-size: .9rem;
}

.form-text {
    color: var(--muted);
}

/* =========================
   Tables
========================= */
.table {
    --bs-table-striped-bg: rgba(2, 6, 23, 0.03);
    --bs-table-hover-bg: rgba(37, 99, 235, 0.06);
}

.table thead th {
    font-size: .85rem;
    font-weight: 900;
    color: #0b1220;
}

.table td {
    color: #0f172a;
}

.table-responsive {
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.table-sticky thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f8fafc;
}

/* helpers */
.money {
    text-align: right;
    white-space: nowrap;
}

.nowrap {
    white-space: nowrap;
}

.small-muted {
    color: var(--muted);
    font-size: .85rem;
}

/* =========================
   Stat chips
========================= */
.chip {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .35rem .65rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, .7);
}

.chip .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary);
}

/* =========================
   Alerts
========================= */
.alert {
    border-radius: 14px;
    border: 1px solid rgba(15, 23, 42, .08);
}

.alert-success {
    border-color: rgba(22, 163, 74, .25);
}

.alert-danger {
    border-color: rgba(239, 68, 68, .25);
}

.alert-info {
    border-color: rgba(37, 99, 235, .20);
}

/* =========================
   Footer small (optional)
========================= */
.app-footer {
    color: var(--muted);
    font-size: .85rem;
}

/* ==========================================================
   Optional Dark Mode
   Add class: <body class="theme-dark">
========================================================== */
body.theme-dark {
    --bg: #070b14;
    --card: #0b1220;
    --text: #e5e7eb;
    --muted: rgba(229, 231, 235, .70);
    --border: rgba(255, 255, 255, .10);
    --shadow-sm: 0 8px 22px rgba(0, 0, 0, .35);
    --shadow-md: 0 14px 40px rgba(0, 0, 0, .45);
}

body.theme-dark .table thead th {
    color: rgba(255, 255, 255, .90);
}

body.theme-dark .table td {
    color: rgba(255, 255, 255, .86);
}

body.theme-dark .table-responsive {
    border-color: rgba(255, 255, 255, .10);
}

body.theme-dark .table-sticky thead th {
    background: #0b1220;
}

body.theme-dark .chip {
    background: rgba(255, 255, 255, .06);
}