* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: #f6f4ef;
    color: #20241f;
}
a { color: #3d5a80; }
.top {
    background: #3d5a80;
    color: #fff;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.top .brand { display: flex; align-items: center; gap: .6rem; }
.top .brand img { height: 52px; width: auto; max-width: 150px; background: transparent; border-radius: 0; padding: 0; object-fit: contain; }
.top h1 { font-size: 1.1rem; margin: 0; }
.top a.logout {
    color: #fff;
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.4);
    padding: .4rem .8rem;
    border-radius: 6px;
    text-decoration: none;
    font-size: .8rem;
}
.wrap { max-width: 1100px; margin: 0 auto; padding: 1.5rem; }
.auth-bg {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background:
        linear-gradient(rgba(20,40,30,.45), rgba(20,40,30,.55)),
        linear-gradient(180deg, #a9d3c8 0%, #dfe9d8 55%, #f3ecd8 100%);
    position: relative;
    overflow: hidden;
}
.auth-bg::before {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 46%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 400'%3E%3Crect x='60' y='120' width='260' height='280' fill='%23233246'/%3E%3Crect x='340' y='60' width='220' height='340' fill='%233d5a80'/%3E%3Crect x='580' y='150' width='200' height='250' fill='%23233246'/%3E%3Crect x='800' y='90' width='240' height='310' fill='%233d5a80'/%3E%3Crect x='1060' y='170' width='140' height='230' fill='%23233246'/%3E%3Cg fill='%23f3ecd8' opacity='0.85'%3E%3Crect x='90' y='150' width='24' height='30'/%3E%3Crect x='140' y='150' width='24' height='30'/%3E%3Crect x='190' y='150' width='24' height='30'/%3E%3Crect x='240' y='150' width='24' height='30'/%3E%3Crect x='90' y='210' width='24' height='30'/%3E%3Crect x='140' y='210' width='24' height='30'/%3E%3Crect x='190' y='210' width='24' height='30'/%3E%3Crect x='240' y='210' width='24' height='30'/%3E%3Crect x='90' y='270' width='24' height='30'/%3E%3Crect x='140' y='270' width='24' height='30'/%3E%3Crect x='190' y='270' width='24' height='30'/%3E%3Crect x='240' y='270' width='24' height='30'/%3E%3Crect x='370' y='100' width='26' height='32'/%3E%3Crect x='425' y='100' width='26' height='32'/%3E%3Crect x='480' y='100' width='26' height='32'/%3E%3Crect x='370' y='165' width='26' height='32'/%3E%3Crect x='425' y='165' width='26' height='32'/%3E%3Crect x='480' y='165' width='26' height='32'/%3E%3Crect x='370' y='230' width='26' height='32'/%3E%3Crect x='425' y='230' width='26' height='32'/%3E%3Crect x='480' y='230' width='26' height='32'/%3E%3Crect x='370' y='295' width='26' height='32'/%3E%3Crect x='425' y='295' width='26' height='32'/%3E%3Crect x='480' y='295' width='26' height='32'/%3E%3Crect x='610' y='180' width='22' height='28'/%3E%3Crect x='655' y='180' width='22' height='28'/%3E%3Crect x='700' y='180' width='22' height='28'/%3E%3Crect x='610' y='235' width='22' height='28'/%3E%3Crect x='655' y='235' width='22' height='28'/%3E%3Crect x='700' y='235' width='22' height='28'/%3E%3Crect x='830' y='125' width='26' height='32'/%3E%3Crect x='885' y='125' width='26' height='32'/%3E%3Crect x='940' y='125' width='26' height='32'/%3E%3Crect x='995' y='125' width='26' height='32'/%3E%3Crect x='830' y='190' width='26' height='32'/%3E%3Crect x='885' y='190' width='26' height='32'/%3E%3Crect x='940' y='190' width='26' height='32'/%3E%3Crect x='995' y='190' width='26' height='32'/%3E%3Crect x='830' y='255' width='26' height='32'/%3E%3Crect x='885' y='255' width='26' height='32'/%3E%3Crect x='940' y='255' width='26' height='32'/%3E%3Crect x='995' y='255' width='26' height='32'/%3E%3Crect x='1085' y='200' width='22' height='28'/%3E%3Crect x='1130' y='200' width='22' height='28'/%3E%3Crect x='1085' y='255' width='22' height='28'/%3E%3Crect x='1130' y='255' width='22' height='28'/%3E%3C/g%3E%3C/svg%3E");
    background-repeat: repeat-x;
    background-position: bottom;
    background-size: 1200px 400px;
    opacity: .5;
}
.auth-bg .login-card { position: relative; z-index: 1; box-shadow: 0 12px 32px rgba(0,0,0,.18); }
.auth-bg.custom-bg::before { display: none; }
.auth-bg.custom-bg { background-size: cover; background-position: center; }
.auth-brand {
    position: relative; z-index: 1;
    text-align: center; color: #fff; margin-bottom: 1.2rem;
}
.auth-brand img { height: 170px; width: auto; max-width: 320px; margin-bottom: .8rem; background: transparent; border-radius: 0; padding: 0; object-fit: contain; }
.auth-brand h1 { font-size: 1.6rem; margin: 0 0 .2rem; letter-spacing: .3px; }
.auth-brand p { margin: 0; font-size: .85rem; opacity: .9; }
.nav-actions { display: flex; align-items: center; gap: .6rem; }
.nav-actions .home-btn {
    color: #fff;
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.4);
    padding: .4rem .8rem;
    border-radius: 6px;
    text-decoration: none;
    font-size: .8rem;
}
.nav-actions .home-btn:hover { background: rgba(255,255,255,.28); }
.login-wrap { display: flex; align-items: center; justify-content: center; min-height: 90vh; }
.card {
    background: #fff;
    border: 1px solid #e2e0d6;
    border-radius: 10px;
    padding: 1.2rem 1.4rem;
    margin-bottom: 1.2rem;
}
.login-card { max-width: 380px; width: 100%; }
label { display: block; font-size: .78rem; color: #6b6f66; margin: .7rem 0 .25rem; }
input, select, textarea {
    width: 100%;
    padding: .55rem .6rem;
    border: 1px solid #e2e0d6;
    border-radius: 6px;
    font-size: .9rem;
    font-family: inherit;
}
textarea { min-height: 80px; resize: vertical; }
.btn {
    background: #3d5a80;
    color: #fff;
    border: none;
    padding: .6rem 1.1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: .85rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
}
.btn.small { padding: .35rem .7rem; font-size: .75rem; }
.btn.secondary { background: #fff; color: #3d5a80; border: 1px solid #3d5a80; }
.btn.ghost { background: transparent; color: #20241f; border: 1px solid #e2e0d6; }
.btn.danger { background: #a13f2f; }
.tabs { display: flex; gap: .5rem; margin-bottom: 1.2rem; flex-wrap: wrap; }
.tabs a {
    padding: .5rem 1rem;
    border-radius: 8px;
    border: 1px solid #e2e0d6;
    background: #fff;
    text-decoration: none;
    color: #20241f;
    font-size: .82rem;
}
.tabs a.active { background: #3d5a80; color: #fff; border-color: #3d5a80; }
table { width: 100%; border-collapse: collapse; font-size: .83rem; }
th, td { text-align: left; padding: .55rem .5rem; border-bottom: 1px solid #e2e0d6; }
th { color: #6b6f66; font-size: .72rem; text-transform: uppercase; }
.badge { display: inline-block; padding: .2rem .55rem; border-radius: 20px; font-size: .72rem; font-weight: 600; }
.badge.Received { background: #fbf0df; color: #b5762b; }
.badge.InProgress { background: #e6eefb; color: #2b5aa1; }
.badge.Resolved { background: #e7f2ec; color: #2f6e50; }
.error { color: #a13f2f; font-size: .82rem; background: #fbe9e5; padding: .6rem .8rem; border-radius: 6px; margin-bottom: 1rem; }
.success { color: #2f6e50; font-size: .82rem; background: #e7f2ec; padding: .6rem .8rem; border-radius: 6px; margin-bottom: 1rem; }
.grid { display: grid; gap: 1rem; }
.grid.cols-2 { grid-template-columns: 1fr 1fr; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 700px) { .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr 1fr; } }
.stat .num { font-size: 1.5rem; font-weight: 700; }
.stat .lbl { font-size: .75rem; color: #6b6f66; }
.toolbar { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 1rem; align-items: end; }
.thumb { width: 60px; height: 60px; object-fit: cover; border-radius: 6px; border: 1px solid #e2e0d6; }
.note { background: #fbfaf6; border: 1px solid #e2e0d6; border-radius: 6px; padding: .4rem .6rem; font-size: .78rem; margin-top: .3rem; }
.empty { text-align: center; color: #6b6f66; padding: 2rem 0; font-size: .85rem; }

/* Category picker cards (like the reference e-Aduan system) */
.cat-card {
    display: block;
    text-decoration: none;
    color: #20241f;
    text-align: center;
    font-weight: 600;
    font-size: .9rem;
    padding: 1.2rem 1rem;
    border-radius: 10px;
    border: 1px solid rgba(0,0,0,.06);
    transition: transform .12s ease;
}
.cat-card:hover { transform: translateY(-2px); }
.cat-card .cnt { display: block; font-weight: 400; font-size: .78rem; margin-top: .3rem; opacity: .75; }

/* Detail block for complaint history (Bil-numbered layout) */
.detail-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.detail-row .col { flex: 1; min-width: 240px; }
.detail-row dl { margin: 0; font-size: .82rem; }
.detail-row dt { color: #6b6f66; margin-top: .5rem; }
.detail-row dd { margin: .1rem 0 0; font-weight: 600; }
