/* ============================================================
   Sporing Pertanahan — Design System
   ============================================================ */
:root {
    --navy-900: #0f2440;
    --navy-800: #16304f;
    --navy-700: #1e3a5f;
    --navy-600: #2c5282;
    --brand:    #2563eb;
    --brand-600:#1d4ed8;
    --accent:   #0d9488;
    --accent-600:#0f766e;
    --emerald:  #059669;
    --amber:    #d97706;
    --red:      #dc2626;
    --sky:      #0284c7;

    --bg:       #f4f6fb;
    --surface:  #ffffff;
    --line:     #e5e9f2;
    --ink:      #1e293b;
    --ink-soft: #64748b;
    --ink-mute: #94a3b8;

    --radius:   14px;
    --radius-sm:9px;
    --shadow-sm: 0 1px 2px rgba(15,36,64,.06), 0 1px 3px rgba(15,36,64,.08);
    --shadow-md: 0 4px 12px rgba(15,36,64,.08), 0 2px 4px rgba(15,36,64,.05);
    --shadow-lg: 0 20px 45px rgba(15,36,64,.18);
    --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--ink); line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
h1,h2,h3 { line-height: 1.25; color: var(--navy-800); }

/* ---------- App shell ---------- */
.layout { display: flex; min-height: 100vh; }
aside {
    width: 250px; flex-shrink: 0; color: #c7d2e4;
    background: linear-gradient(180deg, var(--navy-800) 0%, var(--navy-900) 100%);
    position: sticky; top: 0; height: 100vh; overflow-y: auto;
    display: flex; flex-direction: column;
}
aside .brand { display: flex; align-items: center; gap: .6rem; padding: 1.15rem 1.25rem; color: #fff; border-bottom: 1px solid rgba(255,255,255,.08); }
aside .brand .logo { width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, var(--accent), var(--brand)); display: grid; place-items: center; flex-shrink: 0; }
aside .brand b { font-size: .95rem; font-weight: 700; letter-spacing: .01em; }
aside .brand span { display: block; font-size: .68rem; color: #8fa3c0; font-weight: 400; }
aside nav { padding: .6rem .7rem; flex: 1; }
aside .group { padding: .9rem .6rem .35rem; font-size: .66rem; text-transform: uppercase; letter-spacing: .08em; color: #6f86a8; font-weight: 600; }
aside a.nav {
    display: flex; align-items: center; gap: .7rem; padding: .6rem .7rem; margin: .1rem 0;
    color: #c7d2e4; border-radius: 9px; font-size: .875rem; font-weight: 500; transition: all .15s;
}
aside a.nav svg { width: 18px; height: 18px; flex-shrink: 0; opacity: .85; }
aside a.nav:hover { background: rgba(255,255,255,.07); color: #fff; }
aside a.nav.active { background: linear-gradient(90deg, var(--brand) 0%, var(--navy-600) 100%); color: #fff; box-shadow: var(--shadow-sm); }
aside a.nav.active svg { opacity: 1; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
header.topbar {
    background: rgba(255,255,255,.85); backdrop-filter: blur(8px);
    padding: .85rem 1.75rem; display: flex; align-items: center; justify-content: space-between;
    border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10;
}
header.topbar .page-title { font-size: 1.05rem; font-weight: 600; color: var(--navy-800); }
header.topbar .right { display: flex; align-items: center; gap: 1rem; }
.user-chip { display: flex; align-items: center; gap: .55rem; font-size: .85rem; }
.user-chip .avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--brand), var(--accent)); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .8rem; }
.user-chip .meta b { display: block; font-size: .82rem; font-weight: 600; color: var(--ink); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip .meta span { font-size: .7rem; color: var(--ink-soft); }
.content { padding: 1.75rem; max-width: 1240px; width: 100%; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: .4rem; padding: .55rem 1rem; border-radius: var(--radius-sm); font-size: .85rem; font-weight: 600; border: 0; cursor: pointer; transition: all .15s; text-decoration: none; white-space: nowrap; }
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0); }
.btn-primary { background: linear-gradient(135deg, var(--brand), var(--brand-600)); color: #fff; }
.btn-info { background: var(--sky); color: #fff; }
.btn-success { background: var(--emerald); color: #fff; }
.btn-warning { background: var(--amber); color: #fff; }
.btn-danger { background: var(--red); color: #fff; }
.btn-secondary { background: #eef2f8; color: var(--navy-700); }
.btn-sm { padding: .35rem .7rem; font-size: .76rem; }
.btn-lg { padding: .8rem 1.6rem; font-size: .95rem; border-radius: 11px; }
.actions { display: flex; gap: .4rem; flex-wrap: wrap; }
form.inline { display: inline; }

/* ---------- Cards / page head ---------- */
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.4rem; gap: 1rem; flex-wrap: wrap; }
.page-head h2 { font-size: 1.35rem; font-weight: 700; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 1.35rem; margin-bottom: 1.35rem; }

/* ---------- Stats ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 1.1rem; margin-bottom: 1.35rem; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.35rem; box-shadow: var(--shadow-sm); position: relative; overflow: hidden; transition: all .18s; }
.stat:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--brand); }
.stat.a::before { background: var(--accent); } .stat.g::before { background: var(--emerald); }
.stat.w::before { background: var(--amber); } .stat.s::before { background: var(--sky); }
.stat .ic { width: 40px; height: 40px; border-radius: 11px; background: #eff4ff; color: var(--brand); display: grid; place-items: center; margin-bottom: .8rem; }
.stat.a .ic { background: #e6fbf7; color: var(--accent); } .stat.g .ic { background: #e7f7ef; color: var(--emerald); }
.stat.w .ic { background: #fdf3e5; color: var(--amber); } .stat.s .ic { background: #e5f3fb; color: var(--sky); }
.stat .num { font-size: 2rem; font-weight: 800; color: var(--navy-800); line-height: 1; }
.stat .lbl { font-size: .82rem; color: var(--ink-soft); margin-top: .35rem; font-weight: 500; }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .86rem; }
thead th { text-align: left; padding: .7rem .8rem; background: #f8fafd; color: var(--ink-soft); font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; border-bottom: 2px solid var(--line); position: sticky; top: 0; }
tbody td { padding: .72rem .8rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr { transition: background .12s; }
tbody tr:hover td { background: #f8fafd; }
tbody tr:last-child td { border-bottom: 0; }

/* ---------- Forms ---------- */
.field { margin-bottom: 1.1rem; }
.field label { display: block; font-size: .8rem; font-weight: 600; color: var(--navy-700); margin-bottom: .4rem; }
.field input, .field select, .field textarea {
    width: 100%; padding: .62rem .8rem; border: 1px solid #cdd6e5; border-radius: var(--radius-sm);
    font-size: .9rem; font-family: inherit; color: var(--ink); background: #fcfdff; transition: all .15s;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px rgba(37,99,235,.13); }
.field small { color: var(--ink-soft); font-size: .74rem; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* ---------- Pills / alerts ---------- */
.pill { display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .6rem; border-radius: 999px; font-size: .72rem; font-weight: 700; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-on { background: #e7f7ef; color: #067a4a; }
.pill-off { background: #fdeaea; color: #c02626; }
.alert { padding: .8rem 1rem; border-radius: var(--radius-sm); font-size: .86rem; margin-bottom: 1.2rem; display: flex; align-items: flex-start; gap: .6rem; border: 1px solid transparent; }
.alert-success { background: #e7f7ef; color: #0a6b41; border-color: #b6ecce; }
.alert-error { background: #fdeaea; color: #b42323; border-color: #f6c9c9; }

@media (max-width: 820px) {
    aside { position: fixed; left: -260px; z-index: 100; transition: left .2s; }
    aside.open { left: 0; }
    .row2 { grid-template-columns: 1fr; }
    .content { padding: 1.15rem; }
}
