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

:root {
    /* Re-point Bootstrap's own primary palette at the brand red so utility
       classes (.text-primary, .bg-primary, .border-primary, spinners, etc.)
       stay in-family without needing per-class overrides everywhere. */
    --bs-primary: #e32726;
    --bs-primary-rgb: 227, 39, 38;
    --bs-link-color: #b81e1e;
    --bs-link-color-rgb: 184, 30, 30;
    --bs-link-hover-color: #7a1414;

    --brand-red: #e32726;
    --brand-red-dark: #b81e1e;
    --brand-red-deep: #7a1414;
    --brand-red-black: #1a0505;
    --brand-ink: #23161a;
    --brand-muted: #8a7278;
    --brand-surface: #fff8f7;
    --brand-surface-alt: #fdeeed;
    --brand-line: #f1dcda;
    --brand-success: #0d8a5f;
    --brand-warning: #e0932c;
    --shadow-sm: 0 4px 14px rgba(122, 20, 20, 0.08);
    --shadow-md: 0 14px 34px rgba(122, 20, 20, 0.12);
    --shadow-lg: 0 22px 50px rgba(26, 5, 5, 0.16);
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 10px;
}

* {
    scrollbar-width: thin;
    scrollbar-color: var(--brand-red) transparent;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--brand-red), var(--brand-red-dark));
    border-radius: 20px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

::-webkit-scrollbar-track {
    background: transparent;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
    color: var(--brand-ink);
    letter-spacing: -0.01em;
    background:
        radial-gradient(circle at 8% 0%, #ffe9e7 0, #ffe9e7 20%, transparent 21%),
        radial-gradient(circle at 96% 4%, #ffefe8 0, #ffefe8 16%, transparent 17%),
        linear-gradient(180deg, #fffaf9 0%, #fdf1ef 100%);
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--brand-ink);
}

a {
    color: var(--brand-red-dark);
}

/* ── Sidebar / brand ─────────────────────────────────────────────────── */

.sidebar {
    width: 280px;
    background:
        radial-gradient(circle at 100% 0%, rgba(227, 39, 38, 0.35) 0%, transparent 45%),
        linear-gradient(165deg, var(--brand-red-black) 0%, var(--brand-red-deep) 55%, var(--brand-red-dark) 120%);
    min-height: 100vh;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    position: sticky;
    top: 0;
    align-self: flex-start;
    height: 100vh;
    overflow-y: auto;
}

.brand-lockup {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.brand-lockup .brand-logo {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.94);
    padding: 5px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.28);
    flex-shrink: 0;
}

.brand-lockup .brand-name {
    color: #fff;
    font-weight: 800;
    font-size: 1.08rem;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.brand-lockup .brand-name small {
    display: block;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
    font-size: 0.7rem;
    letter-spacing: 0.02em;
}

.main-shell {
    backdrop-filter: blur(2px);
}

.hero-band {
    padding: 1.15rem 1.4rem;
    border-radius: var(--radius-lg);
    background: linear-gradient(120deg, #ffffff 0%, var(--brand-surface-alt) 100%);
    border: 1px solid var(--brand-line);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.hero-band::before {
    content: "";
    position: absolute;
    top: -60px;
    right: -60px;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(227, 39, 38, 0.14) 0%, transparent 70%);
}

.glass-chip {
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: var(--radius-sm);
    padding: 0.7rem 0.85rem;
    background: rgba(255, 255, 255, 0.08);
}

.panel-elevated {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.panel-elevated:hover {
    box-shadow: var(--shadow-lg);
}

.card {
    border-radius: var(--radius-md);
}

.card-header {
    border-top-left-radius: var(--radius-lg) !important;
    border-top-right-radius: var(--radius-lg) !important;
    border-bottom: 1px solid var(--brand-line) !important;
}

.list-group-item {
    border: 0;
    border-radius: var(--radius-sm) !important;
    margin-bottom: 4px;
    color: rgba(255, 255, 255, 0.78);
    background: transparent;
    font-weight: 500;
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.list-group-item:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(2px);
}

.list-group-item.active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.16);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
    font-weight: 700;
}

/* ── Tables ───────────────────────────────────────────────────────────── */

.table {
    border-color: var(--brand-line);
}

.table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: linear-gradient(180deg, #fff1f0 0%, #fbe4e2 100%);
    color: var(--brand-red-deep);
    font-weight: 700;
    letter-spacing: 0.2px;
    border-bottom: 1px solid #f3d3d0;
    white-space: nowrap;
}

.table tbody td {
    vertical-align: middle;
    border-color: var(--brand-line);
}

.table tbody tr:nth-child(even) {
    background-color: #fffcfb;
}

.table tbody tr:hover {
    background-color: var(--brand-surface-alt);
}

/* ── Buttons ──────────────────────────────────────────────────────────── */

.btn {
    border-radius: var(--radius-sm);
    font-weight: 600;
    letter-spacing: -0.01em;
}

.btn-primary {
    background: linear-gradient(140deg, var(--brand-red) 0%, var(--brand-red-dark) 100%);
    border: 0;
    box-shadow: 0 8px 20px rgba(227, 39, 38, 0.28);
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(140deg, #cf2120 0%, #a11a1a 100%);
    box-shadow: 0 10px 24px rgba(227, 39, 38, 0.36);
}

.btn-success {
    background: linear-gradient(140deg, #159a6c 0%, var(--brand-success) 100%);
    border: 0;
}

.btn-danger {
    background: linear-gradient(140deg, #ef4444 0%, var(--brand-red-dark) 100%);
    border: 0;
}

.btn-outline-primary {
    border-color: var(--brand-red);
    color: var(--brand-red-dark);
}

.btn-outline-primary:hover {
    background: var(--brand-red);
    border-color: var(--brand-red);
    color: #fff;
}

.btn-outline-light {
    border-color: rgba(255, 255, 255, 0.4);
}

.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.5);
    color: #fff;
}

.btn-outline-danger:hover {
    background: var(--brand-red);
    border-color: var(--brand-red);
}

/* ── Forms ────────────────────────────────────────────────────────────── */

.form-control,
.form-select {
    border-radius: var(--radius-sm);
    border-color: var(--brand-line);
    box-shadow: none;
}

.form-control:focus,
.form-select:focus {
    border-color: #ef7472;
    box-shadow: 0 0 0 0.2rem rgba(227, 39, 38, 0.14);
}

.form-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--brand-ink);
}

.alert {
    border-radius: var(--radius-sm);
    border: 0;
}

.alert-danger {
    background: #fde3e2;
    color: var(--brand-red-deep);
}

/* ── Badges & status pills ───────────────────────────────────────────── */

.badge {
    font-weight: 600;
    letter-spacing: 0.01em;
    border-radius: 8px;
    padding: 0.4em 0.65em;
}

.status-pill {
    font-size: .85rem;
    padding: .35em .75em;
    border-radius: 50rem;
    font-weight: 600;
}

.version-badge {
    font-size: 1.6rem;
    font-weight: 800;
}

/* Login pages */

.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at 15% 15%, rgba(227, 39, 38, 0.16) 0%, transparent 40%),
        radial-gradient(circle at 85% 85%, rgba(122, 20, 20, 0.14) 0%, transparent 45%),
        linear-gradient(180deg, #fffaf9 0%, #fdeeed 100%);
    padding: 1.5rem;
}

.auth-card {
    border: 0;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.auth-logo {
    width: 68px;
    height: 68px;
    border-radius: 18px;
    box-shadow: var(--shadow-md);
    margin-bottom: 0.9rem;
}

.auth-card .btn-primary {
    padding: 0.6rem 1rem;
}

#barangayMap,
#municipalityMap {
    border: 1px solid var(--brand-line);
    border-radius: var(--radius-sm);
}

/* Emergency type / status badges (emergency map) */
.badge-tanod { background: #6c5b52; }
.badge-police { background: #1d3fae; }
.badge-fire { background: var(--brand-red); }
.badge-ambulance { background: var(--brand-success); }
.badge-911 { background: #e0692c; }

.badge-pending { background: var(--brand-warning); color: #2b1a04; }
.badge-acknowledged { background: #1d8fc0; }
.badge-resolved { background: var(--brand-success); }

@media (max-width: 992px) {
    .sidebar {
        width: 240px;
    }
}
