:root {
    --green: #1B5E20;
    --green-dark: #0D3311;
    --green-mid: #2E7D32;
    --green-light: #E8F5E9;
    --green-soft: #C8E6C9;
    --text: #1B1B1B;
    --muted: #6B7280;
    --border: #E0E0E0;
    --bg: #F3F4F6;
    --card: #FFFFFF;
    --danger: #8B1E2D;
    --radius: 12px;
    --shadow: 0 10px 30px rgba(0, 0, 0, .08);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.5;
}

a { color: var(--green-mid); }

/* ---------------- Top bar ---------------- */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 28px;
    background: linear-gradient(90deg, var(--green-dark), var(--green));
    color: #fff;
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand img { width: 42px; height: 42px; border-radius: 50%; background: #fff; padding: 2px; }
.brand .org { font-weight: 700; font-size: 15px; line-height: 1.1; }
.brand .sub { font-size: 12px; opacity: .85; }

.topnav a {
    color: #fff;
    text-decoration: none;
    margin-left: 22px;
    font-size: 14px;
    opacity: .9;
}
.topnav a:hover { opacity: 1; }

/* ---------------- Landing ---------------- */
.landing-wrap {
    min-height: calc(100vh - 66px - 54px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
}

.landing-card {
    background: var(--card);
    border-radius: 16px;
    box-shadow: var(--shadow);
    max-width: 520px;
    width: 100%;
    padding: 40px 44px;
    text-align: center;
}

.landing-card .logo-circle {
    width: 90px; height: 90px; border-radius: 50%;
    border: 3px solid var(--green-soft);
    margin: 0 auto 16px;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden; background: #fff;
}
.landing-card .logo-circle img { width: 78px; height: 78px; object-fit: contain; }
.landing-card h1 { font-size: 22px; margin: 6px 0 4px; color: var(--green-dark); }
.landing-card .tagline { color: var(--muted); font-size: 13px; margin: 0 0 14px; }
.landing-card .desc { color: #374151; font-size: 14px; margin: 0 auto 22px; max-width: 420px; }

.divider { border: none; border-top: 1px solid var(--border); margin: 28px 0; }

.mobile-section h3 { color: var(--green-dark); margin: 0 0 4px; }
.mobile-section p { color: var(--muted); font-size: 13px; margin: 0 0 16px; }
.qr { width: 180px; height: 180px; margin: 0 auto 10px; display: block; }
.apk-link { font-size: 12px; word-break: break-all; display: block; margin-bottom: 14px; }

/* ---------------- Footer ---------------- */
.footer {
    text-align: center;
    padding: 16px;
    color: var(--muted);
    font-size: 12px;
}

/* ---------------- Buttons ---------------- */
.btn {
    display: inline-block;
    border: none;
    border-radius: 8px;
    padding: 11px 22px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: filter .15s ease;
}
.btn:hover { filter: brightness(1.05); }
.btn-primary { background: var(--green); color: #fff; }
.btn-outline { background: #fff; color: var(--green); border: 1.5px solid var(--green); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { display: block; width: 100%; }

/* ---------------- Auth / forms ---------------- */
.auth-wrap {
    min-height: calc(100vh - 66px);
    display: flex; align-items: center; justify-content: center;
    padding: 40px 16px;
}
.auth-card {
    background: var(--card);
    border-radius: 16px;
    box-shadow: var(--shadow);
    max-width: 400px; width: 100%;
    padding: 36px;
    text-align: center;
}
.auth-card .logo-circle {
    width: 72px; height: 72px; border-radius: 50%;
    border: 3px solid var(--green-soft);
    margin: 0 auto 14px; overflow: hidden; background: #fff;
    display: flex; align-items: center; justify-content: center;
}
.auth-card .logo-circle img { width: 60px; height: 60px; object-fit: contain; }
.auth-card h2 { margin: 0 0 20px; color: var(--green-dark); }

.field { text-align: left; margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.field input, .field select {
    width: 100%; padding: 11px 12px;
    border: 1px solid var(--border); border-radius: 8px;
    font-size: 14px; background: #fff;
}
.field input:focus, .field select:focus { outline: 2px solid var(--green-soft); border-color: var(--green-mid); }
.show-pass { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; margin: -6px 0 16px; }

.alert { padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; text-align: left; }
.alert-error { background: #F8D7DA; color: var(--danger); }
.alert-info { background: var(--green-light); color: var(--green-dark); }
.note { font-size: 12px; color: var(--muted); margin-top: 18px; }

/* ---------------- Dashboard shell ---------------- */
.layout { display: flex; min-height: calc(100vh - 66px); }
.sidebar {
    width: 230px; background: var(--green-dark); color: #fff;
    padding: 18px 0; flex-shrink: 0;
}
.sidebar .me { padding: 0 20px 18px; border-bottom: 1px solid rgba(255,255,255,.15); margin-bottom: 10px; }
.sidebar .me .name { font-weight: 700; }
.sidebar .me .role { font-size: 12px; opacity: .8; text-transform: capitalize; }
.sidebar nav a {
    display: block; color: #fff; text-decoration: none;
    padding: 11px 20px; font-size: 14px; opacity: .85; cursor: pointer;
}
.sidebar nav a:hover { background: rgba(255,255,255,.08); opacity: 1; }
.sidebar nav a.active { background: var(--green-mid); opacity: 1; border-left: 4px solid #fff; padding-left: 16px; }

.content { flex: 1; padding: 28px 32px; overflow-x: auto; }
.content h1 { margin: 0 0 4px; font-size: 24px; color: var(--green-dark); }
.content .page-sub { color: var(--muted); margin: 0 0 22px; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 18px; margin-bottom: 28px; }
.stat {
    background: var(--card); border-radius: var(--radius); padding: 20px;
    box-shadow: var(--shadow); border-left: 5px solid var(--green-mid);
}
.stat .num { font-size: 30px; font-weight: 800; color: var(--green-dark); }
.stat .lbl { color: var(--muted); font-size: 13px; }

.panel { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; margin-bottom: 24px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.panel-head h2 { margin: 0; font-size: 18px; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--border); font-size: 14px; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
tr:hover td { background: #fafafa; }
.empty { color: var(--muted); padding: 20px; text-align: center; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge-green { background: var(--green-light); color: var(--green-dark); }
.badge-gray { background: #eee; color: #555; }

.hide { display: none !important; }

/* ---------------- Modal ---------------- */
.modal-backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,.45);
    display: flex; align-items: center; justify-content: center; z-index: 50;
}
.modal {
    background: #fff; border-radius: var(--radius); padding: 26px;
    width: 100%; max-width: 440px; box-shadow: var(--shadow);
    max-height: 90vh; overflow-y: auto;
}
.modal h3 { margin: 0 0 18px; color: var(--green-dark); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.checklist { max-height: 200px; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px; padding: 8px; }
.checklist label { display: flex; align-items: center; gap: 8px; padding: 5px; font-size: 14px; }

@media (max-width: 720px) {
    .layout { flex-direction: column; }
    .sidebar { width: 100%; display: flex; flex-wrap: wrap; }
    .sidebar .me { width: 100%; }
    .sidebar nav { display: flex; flex-wrap: wrap; width: 100%; }
    .landing-card, .auth-card { padding: 28px 22px; }
}
