:root {
    --green: #0f8f4e;
    --green-dark: #08713d;
    --green-soft: #eaf7f0;
    --ink: #17212b;
    --muted: #6b7682;
    --line: #e4e9ee;
    --surface: #ffffff;
    --bg: #f4f7f6;
    --danger: #dc3545;
    --shadow: 0 12px 32px rgba(24, 45, 38, .08);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }

.app-shell {
    width: 100%;
    max-width: 820px;
    min-height: 100vh;
    margin: 0 auto;
    background: var(--surface);
    box-shadow: 0 0 0 1px rgba(0,0,0,.02);
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(255,255,255,.96);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
}
.topbar-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
}
.brand-logo {
    width: 44px;
    height: 44px;
    object-fit: contain;
    flex: 0 0 44px;
}
.brand-copy { min-width: 0; }
.brand-name {
    margin: 0;
    color: var(--green-dark);
    font-size: 15px;
    font-weight: 800;
    letter-spacing: .2px;
}
.brand-app {
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.back-btn {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #fff;
    color: #38444f;
    flex: 0 0 42px;
}

.content { padding: 20px 18px 96px; }
.hero {
    position: relative;
    overflow: hidden;
    padding: 22px;
    border-radius: 22px;
    color: #fff;
    background: linear-gradient(135deg, #08713d 0%, #14a55d 100%);
    box-shadow: 0 16px 38px rgba(15,143,78,.22);
}
.hero::after {
    content: "";
    position: absolute;
    width: 170px;
    height: 170px;
    right: -65px;
    top: -65px;
    border-radius: 50%;
    background: rgba(255,255,255,.09);
}
.hero-eyebrow {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.25px;
    text-transform: uppercase;
    opacity: .86;
}
.hero h1 {
    position: relative;
    z-index: 1;
    margin: 7px 0 8px;
    font-size: 24px;
    line-height: 1.22;
}
.hero p {
    position: relative;
    z-index: 1;
    margin: 0;
    max-width: 540px;
    font-size: 13px;
    line-height: 1.55;
    opacity: .9;
}
.hero-date {
    display: inline-flex;
    margin-top: 15px;
    padding: 8px 11px;
    border-radius: 10px;
    background: rgba(255,255,255,.14);
    font-size: 12px;
    font-weight: 700;
}

.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin: 26px 2px 12px;
}
.section-title {
    margin: 0;
    font-size: 17px;
    font-weight: 800;
}
.section-subtitle {
    margin-top: 4px;
    font-size: 12px;
    color: var(--muted);
}

.sidang-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px;
    border-radius: 18px;
    color: #fff;
    background: linear-gradient(135deg, #0e8e4d, #15ad61);
    box-shadow: 0 12px 26px rgba(15,143,78,.18);
    transition: transform .15s ease;
}
.sidang-card:active, .service-card:active { transform: scale(.985); }
.sidang-icon, .service-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}
.sidang-icon {
    width: 50px;
    height: 50px;
    border-radius: 15px;
    background: rgba(255,255,255,.17);
    font-size: 22px;
}
.sidang-copy { flex: 1; min-width: 0; }
.sidang-copy strong { display: block; font-size: 16px; }
.sidang-copy span { display: block; margin-top: 4px; font-size: 12px; opacity: .86; }
.chevron { opacity: .8; }

.service-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 12px;
}
.service-card {
    min-height: 132px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 8px 22px rgba(25,45,38,.055);
    transition: transform .15s ease, box-shadow .15s ease;
}
.service-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.service-icon {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    font-size: 18px;
}
.service-arrow { color: #9aa4ae; font-size: 13px; }
.service-name { margin-top: 13px; font-size: 15px; font-weight: 800; }
.service-desc { margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.service-card.purple .service-icon { background: #f1e8ff; color: #8026d7; }
.service-card.amber .service-icon { background: #fff4d8; color: #b87900; }
.service-card.green .service-icon { background: #e5f7ec; color: #0a8b4a; }
.service-card.slate .service-icon { background: #edf1f4; color: #5d6975; }
.service-card.blue .service-icon { background: #e6f1ff; color: #1474df; }
.service-card.red .service-icon { background: #ffe7e9; color: #cf3040; }

.status-link {
    display: flex;
    align-items: center;
    gap: 13px;
    margin-top: 13px;
    padding: 16px 17px;
    border-radius: 17px;
    border: 1px solid #cdebf0;
    background: #effbfc;
    color: #087f91;
}
.status-link .icon {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: #d8f3f6;
    flex: 0 0 42px;
}
.status-link strong { display: block; color: #116d7a; font-size: 14px; }
.status-link span { display: block; margin-top: 3px; font-size: 11px; color: #55838a; }
.status-link .chevron { margin-left: auto; }

.card {
    border: 1px solid var(--line);
    border-radius: 20px;
    background: #fff;
    box-shadow: var(--shadow);
}
.card-body { padding: 20px; }
.page-title { margin: 0; font-size: 21px; font-weight: 850; }
.page-desc { margin: 6px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }

.service-summary {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 18px 0;
    padding: 15px;
    border-radius: 16px;
    background: #f7faf8;
    border: 1px solid #e5eee9;
}
.service-summary .big-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: var(--green-soft);
    color: var(--green-dark);
    font-size: 21px;
}
.service-summary strong { display: block; font-size: 15px; }
.service-summary span { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }

.notice {
    display: flex;
    gap: 10px;
    padding: 13px 14px;
    border-radius: 14px;
    background: #fff8e6;
    border: 1px solid #f5e3a9;
    color: #7b641b;
    font-size: 12px;
    line-height: 1.5;
}
.notice.danger { background: #fff0f1; border-color: #f4c8cd; color: #9e2430; }
.notice.success { background: #eaf8ef; border-color: #cbe9d5; color: #1f7442; }

.btn {
    width: 100%;
    min-height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 13px 16px;
    border: 0;
    border-radius: 15px;
    cursor: pointer;
    font-weight: 800;
    text-align: center;
}
.btn-primary { background: var(--green); color: #fff; box-shadow: 0 9px 22px rgba(15,143,78,.2); }
.btn-secondary { background: #f1f4f3; color: #34424b; }
.btn + .btn { margin-top: 10px; }

.form-group { margin-top: 18px; }
.form-label { display: block; margin-bottom: 7px; font-size: 12px; font-weight: 800; color: #45535d; }
.form-control {
    width: 100%;
    height: 54px;
    padding: 0 15px;
    border: 1px solid #d9e0e4;
    border-radius: 14px;
    background: #fff;
    color: #1e2931;
    font-size: 15px;
    outline: none;
}
.form-control:focus { border-color: #54ad7e; box-shadow: 0 0 0 3px rgba(15,143,78,.09); }

.ticket {
    overflow: hidden;
    border: 1px solid #dfe7e2;
    border-radius: 24px;
    background: #fff;
    box-shadow: var(--shadow);
}
.ticket-head {
    padding: 22px 20px 18px;
    text-align: center;
    color: #fff;
    background: linear-gradient(135deg, #08713d, #15a85d);
}
.ticket-check {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    border-radius: 50%;
    background: rgba(255,255,255,.16);
    font-size: 23px;
}
.ticket-head h2 { margin: 0; font-size: 17px; }
.ticket-head p { margin: 5px 0 0; font-size: 12px; opacity: .85; }
.ticket-body { padding: 23px 20px; text-align: center; }
.ticket-label { color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 1.05px; }
.ticket-number { margin: 6px 0 2px; color: var(--green-dark); font-size: 52px; line-height: 1; font-weight: 900; letter-spacing: -1.5px; }
.ticket-service { font-size: 14px; font-weight: 800; }
.ticket-current {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 22px;
}
.ticket-stat {
    padding: 13px 10px;
    border-radius: 14px;
    background: #f5f8f6;
    border: 1px solid #e6ece8;
}
.ticket-stat span { display: block; color: var(--muted); font-size: 10px; }
.ticket-stat strong { display: block; margin-top: 4px; font-size: 16px; }
.ticket-meta { margin-top: 18px; padding-top: 16px; border-top: 1px dashed #d7dfda; color: var(--muted); font-size: 12px; line-height: 1.65; }

.status-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.status-card { padding: 16px; border: 1px solid var(--line); border-radius: 17px; background: #fff; }
.status-card .name { font-size: 13px; font-weight: 800; }
.status-card .now-label { margin-top: 12px; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .8px; }
.status-card .now { margin-top: 2px; color: var(--green-dark); font-size: 24px; font-weight: 900; }
.status-card .mini-row { display: flex; justify-content: space-between; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px solid #edf0ee; color: var(--muted); font-size: 10px; }
.status-card .mini-row strong { color: #34424c; font-size: 11px; }

.sidang-result { margin-top: 18px; }
.case-grid { display: grid; gap: 0; border: 1px solid var(--line); border-radius: 15px; overflow: hidden; }
.case-row { display: grid; grid-template-columns: 120px 1fr; gap: 12px; padding: 11px 13px; border-bottom: 1px solid var(--line); font-size: 12px; line-height: 1.45; }
.case-row:last-child { border-bottom: 0; }
.case-row .key { color: var(--muted); font-weight: 700; }
.case-row .value { color: #27343d; font-weight: 650; overflow-wrap: anywhere; }

.bottom-nav {
    position: fixed;
    left: 50%;
    bottom: 0;
    z-index: 30;
    width: min(820px, 100%);
    transform: translateX(-50%);
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-top: 1px solid var(--line);
    background: rgba(255,255,255,.97);
    backdrop-filter: blur(12px);
}
.bottom-nav a {
    min-height: 64px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: #7b8791;
    font-size: 10px;
    font-weight: 700;
}
.bottom-nav a i { font-size: 17px; }
.bottom-nav a.active { color: var(--green-dark); }

@media (max-width: 520px) {
    .content { padding: 16px 14px 88px; }
    .topbar-inner { padding: 11px 14px; }
    .hero { padding: 19px; border-radius: 19px; }
    .hero h1 { font-size: 21px; }
    .service-grid { gap: 10px; }
    .service-card { min-height: 125px; padding: 14px; }
    .service-name { font-size: 14px; }
    .status-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
    .case-row { grid-template-columns: 105px 1fr; }
}

@media (max-width: 350px) {
    .service-grid, .status-grid { grid-template-columns: 1fr; }
    .case-row { grid-template-columns: 1fr; gap: 3px; }
}

/* ===== Antrian Sidang v2 ===== */
.sidang-page { padding-top: 18px; }
.sidang-intro {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    padding: 18px;
    border-radius: 20px;
    color: #fff;
    background: linear-gradient(135deg, #08713d 0%, #12a158 100%);
    box-shadow: 0 14px 30px rgba(8,113,61,.18);
}
.sidang-intro-icon {
    width: 54px;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 54px;
    border-radius: 17px;
    background: rgba(255,255,255,.16);
    font-size: 23px;
}
.sidang-intro-kicker {
    margin-bottom: 3px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    opacity: .8;
}
.sidang-intro h2 { margin: 0; font-size: 19px; line-height: 1.2; }
.sidang-intro p { margin: 5px 0 0; font-size: 12px; line-height: 1.45; opacity: .88; }
.sidang-form-card { border-radius: 20px; }
.sidang-form-card .card-body { padding: 21px 18px; }
.sidang-error { margin-bottom: 16px; }
.perkara-label {
    margin: 0 0 11px;
    color: #26343d;
    font-size: 14px;
    text-align: center;
}
.case-builder {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 16px 12px;
    border: 1px solid #dfe6e2;
    border-radius: 16px;
    background: #f8faf9;
}
.case-number-wrap { width: 78px; flex: 0 0 78px; }
.case-year-wrap { width: 66px; flex: 0 0 66px; }
.case-number-input,
.case-year-input {
    width: 100%;
    height: 45px;
    padding: 0 8px;
    border: 1px solid #ced8d2;
    border-radius: 10px;
    background: #fff;
    color: #1d2b33;
    outline: 0;
    text-align: center;
    font-size: 14px;
    font-weight: 750;
}
.case-number-input:focus,
.case-year-input:focus {
    border-color: #42a86f;
    box-shadow: 0 0 0 3px rgba(15,143,78,.09);
}
.case-slash,
.case-suffix {
    color: #4d5b64;
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
}
.case-type-options {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 66px;
}
.case-radio {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #26343d;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}
.case-radio input { margin: 0; accent-color: #0f8f4e; }
.case-preview-wrap {
    margin-top: 11px;
    padding: 10px 12px;
    border-radius: 11px;
    background: #edf7f1;
    color: #557065;
    text-align: center;
    font-size: 10px;
    line-height: 1.4;
}
.case-preview-wrap span { margin-right: 3px; }
.case-preview-wrap strong { color: #08713d; font-size: 11px; overflow-wrap: anywhere; }
.sidang-submit { margin-top: 16px; border-radius: 13px; }
.sidang-help {
    display: grid;
    gap: 9px;
    margin-top: 17px;
    padding-top: 16px;
    border-top: 1px solid #edf1ef;
}
.sidang-help-row {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    color: #5c6972;
    font-size: 11px;
    line-height: 1.5;
}
.sidang-help-row > i { margin-top: 2px; color: #139052; }
.sidang-help-row.warning { color: #9a6d13; }
.sidang-help-row.warning > i { color: #dda014; }
.sidang-back { margin-top: 14px; }

@media (max-width: 430px) {
    .case-builder { gap: 5px; padding: 14px 8px; }
    .case-number-wrap { width: 68px; flex-basis: 68px; }
    .case-year-wrap { width: 60px; flex-basis: 60px; }
    .case-type-options { min-width: 58px; }
    .case-number-input, .case-year-input { height: 43px; font-size: 13px; }
    .case-slash, .case-suffix { font-size: 11px; }
    .case-radio { font-size: 11px; }
}

@media (max-width: 350px) {
    .case-builder {
        flex-wrap: wrap;
        justify-content: center;
        row-gap: 10px;
    }
    .case-suffix { min-width: 48px; }
}
