/* ===== Google Fonts: Merriweather (serif headings) + Inter (body) ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Merriweather:wght@700;900&display=swap');

:root {
    /* Deep forest + cream (classic government) */
    --forest: #2E5A43; /* primary */
    --forest-d: #1E3D2E; /* dark    */
    --forest-l: #3B6E52; /* hover   */
    --cream: #F4F0E6; /* page bg */
    --cream-2: #FBF9F2; /* soft    */
    --brass: #B08A46; /* warm gold accent */
    --brick: #9E3B34; /* muted red */
    --ink: #26261F;
    --muted: #6C6B5D;
    --line: #E2DCCB;
    --card: #FFFFFF;
    /* status */
    --ok: #4E8A5F;
    --bad: #A23B34;
    --nodata: #9A968A;
}

body {
    font-family: 'Inter',system-ui,Arial,sans-serif;
    background: var(--cream);
    color: var(--ink);
}

h1, h2, h3, .page-title, .mast-titles h1 {
    font-family: 'Merriweather',Georgia,serif;
}

/* Lucide icons render as <svg>; keep them sized + aligned */
[data-lucide] {
    width: 1em;
    height: 1em;
    vertical-align: -0.125em;
    stroke-width: 2;
    display: inline-block;
}

/* ---------- Official strip + masthead ---------- */
.gov-strip {
    background: var(--forest-d);
    color: #e7ddc4;
    font-size: 11.5px;
    padding: 4px 18px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    letter-spacing: .02em;
}

    .gov-strip .flag {
        color: var(--brass);
    }

.masthead {
    background: var(--cream-2);
    border-bottom: 3px solid var(--brass);
    padding: 9px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.seal {
    width: 58px;
    height: 58px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .seal img {
        width: 58px;
        height: 58px;
        object-fit: contain;
    }

.mast-titles h1 {
    font-size: 16px;
    font-weight: 900;
    margin: 0;
    color: var(--forest-d);
    letter-spacing: .01em;
    line-height: 1.15;
}

.mast-titles .sub {
    font-size: 12px;
    color: var(--muted);
}

.mast-titles .office {
    font-size: 10.5px;
    color: var(--brick);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-top: 2px;
}

.mast-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 14px;
}

.ubox {
    text-align: right;
    font-size: 12.5px;
    line-height: 1.35;
}

    .ubox .name {
        font-weight: 600;
        color: var(--forest-d);
    }

    .ubox .role {
        font-size: 10px;
        background: var(--brass);
        color: #3a2c07;
        padding: 1px 9px;
        border-radius: 10px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: .04em;
    }

.btn-gov-key {
    background: #fff;
    color: var(--forest);
    border: 1px solid var(--line);
}

.btn-logout {
    background: var(--brick);
    color: #fff;
    border: none;
    font-size: 12.5px;
    padding: 7px 13px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

    .btn-logout:hover {
        background: #7f2c26;
        color: #fff;
    }

/* ---------- Shell ---------- */
.shell {
    display: flex;
    min-height: calc(100vh - 96px);
}

.sidebar {
    width: 274px;
    background: var(--forest);
    color: #e9f0e9;
    flex-shrink: 0;
    padding: 6px 0 24px;
}

.side-search {
    margin: 10px 12px 8px;
    background: rgba(255,255,255,.12);
    border-radius: 8px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #cde0d2;
}

    .side-search input {
        border: none;
        background: transparent;
        color: #fff;
        font-size: 12.5px;
        width: 100%;
        outline: none;
    }

        .side-search input::placeholder {
            color: #b6ccbc;
        }

/* ---------- Collapsible tree ---------- */
.tree-solo {
    padding-left: 16px !important;
}

.tree-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 16px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #a9c6b0;
    user-select: none;
}

    .tree-head:hover {
        background: var(--forest-l);
    }

    .tree-head .chev {
        margin-left: auto;
        transition: transform .2s;
    }

.tree-group.collapsed .chev {
    transform: rotate(-90deg);
}

.tree-group.collapsed .tree-items {
    display: none;
}

.tree-link {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 16px 9px 44px;
    font-size: 13.5px;
    color: #eef4ee;
    text-decoration: none;
    border-left: 3px solid transparent;
}

    .tree-link:hover {
        background: var(--forest-l);
        color: #fff;
    }

    .tree-link.active {
        background: var(--forest-d);
        color: #fff;
        border-left-color: var(--brass);
        font-weight: 600;
    }

    .tree-link [data-lucide] {
        width: 17px;
        height: 17px;
    }

    .tree-link .pill {
        margin-left: auto;
        background: var(--brick);
        color: #fff;
        font-size: 10px;
        padding: 1px 7px;
        border-radius: 9px;
        font-weight: 700;
    }

/* ---------- Content ---------- */
.content {
    flex: 1;
    padding: 22px 28px;
}

.page-title {
    font-weight: 900;
    color: var(--forest-d);
    font-size: 1.45rem;
}

    .page-title [data-lucide] {
        color: var(--brass);
        margin-right: .4rem;
        width: 1.1em;
        height: 1.1em;
    }

.crumb {
    color: var(--muted);
}

/* ---------- Cards / tables ---------- */
.card {
    border: 1px solid var(--line);
}

.card-header {
    color: var(--forest-d);
    font-weight: 600;
    background: var(--cream-2) !important;
}

.table thead.table-light th, .table-light {
    background: var(--cream-2);
    color: var(--forest-d);
}

/* ---------- Stat cards ---------- */
.stat-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-top: 3px solid var(--forest);
    border-radius: 10px;
    padding: 1rem;
    height: 100%;
}

    .stat-card.teal {
        border-top-color: var(--ok);
    }

    .stat-card.amber {
        border-top-color: var(--brass);
    }

    .stat-card.danger {
        border-top-color: var(--brick);
    }

.stat-value {
    font-size: 1.9rem;
    font-weight: 700;
    color: var(--forest-d);
    line-height: 1;
    font-family: 'Merriweather',serif;
}

.stat-label {
    font-size: .72rem;
    color: var(--muted);
    margin-top: .4rem;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.progress-bar {
    background: var(--forest);
}

/* ---------- Buttons ---------- */
.btn-brand {
    background: var(--forest);
    color: #fff;
    font-weight: 600;
}

    .btn-brand:hover {
        background: var(--forest-d);
        color: #fff;
    }

.btn-outline-secondary {
    border-color: var(--line);
}

/* ---------- Footer ---------- */
.footgov {
    background: var(--forest-d);
    color: #c9d8cc;
    font-size: 11px;
    text-align: center;
    padding: 10px;
}

/* ---------- Login (building photo + green overlay) ---------- */
.auth-body {
    min-height: 100vh;
}

.login-wrap {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: url('/img/munisipyo.jpg') center/cover no-repeat;
}

    .login-wrap::before {
        content: '';
        position: absolute;
        inset: 0;
        background: linear-gradient(135deg, rgba(31,120,55,.90), rgba(30,61,46,.94));
    }

.login-card {
    position: relative;
    z-index: 1;
    background: var(--cream-2);
    border-radius: 14px;
    padding: 2.25rem;
    width: 100%;
    max-width: 430px;
    box-shadow: 0 20px 55px rgba(0,0,0,.4);
    border-top: 5px solid var(--brass);
}

.login-brand {
    text-align: center;
    margin-bottom: 1.5rem;
}

.login-logo {
    width: 88px;
    height: 88px;
    margin: 0 auto .6rem;
}

    .login-logo img {
        width: 88px;
        height: 88px;
        object-fit: contain;
    }

.login-brand .rep {
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .06em;
}

.login-brand h1 {
    font-family: 'Merriweather',serif;
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--forest-d);
    margin: .25rem 0 0;
}

.login-brand p {
    font-size: .82rem;
    color: var(--muted);
    margin: .35rem 0 .5rem;
}

.login-office {
    display: inline-block;
    font-size: .7rem;
    background: var(--cream);
    color: var(--brick);
    border-radius: 20px;
    padding: .2rem .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.input-group-text {
    background: var(--cream);
    border-right: 0;
    color: var(--forest);
}

.input-group .form-control {
    border-left: 0;
}

    .input-group .form-control:focus {
        box-shadow: none;
        border-color: var(--line);
    }

/* ---------- Dropzone ---------- */
.dropzone {
    border: 2.5px dashed #c6bfa9;
    border-radius: 12px;
    background: var(--cream-2);
    padding: 44px 20px;
    text-align: center;
    cursor: pointer;
    transition: .15s;
}

    .dropzone:hover, .dropzone.dragover {
        border-color: var(--forest);
        background: #eef4ec;
    }

    .dropzone .dz-icon [data-lucide] {
        width: 3rem;
        height: 3rem;
        color: var(--forest);
    }

    .dropzone h5 {
        color: var(--forest-d);
        margin: .4rem 0 .2rem;
    }

.badge.bg-success {
    background: var(--ok) !important;
}

.badge.bg-danger {
    background: var(--bad) !important;
}

@media (max-width:768px) {
    .shell {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }

    .content {
        padding: 1rem;
    }

    .mast-titles h1 {
        font-size: 13.5px;
    }
}
