/* =========================================================
   Monitoring Unit & Incar — tema VibeCoder (indigo/violet)
   ========================================================= */

:root {
    --ink: #1F1B3A;
    --muted: #635F82;
    --indigo: #4F46E5;
    --violet: #8B5CF6;
    --line: rgba(115, 105, 180, .16);
    --surface: rgba(255, 255, 255, .62);
    --surface-solid: rgba(255, 255, 255, .92);
    --ok: #0E9F6E;
    --warn: #B45309;
    --bad: #DC2626;
    --radius: 18px;
    --shadow: 0 18px 40px -22px rgba(58, 40, 120, .45);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    color: var(--ink);
    background: #F3F0FF;
    background-image:
        radial-gradient(900px 520px at 8% -8%, rgba(139, 92, 246, .22), transparent 60%),
        radial-gradient(760px 460px at 96% 4%, rgba(79, 70, 229, .18), transparent 62%),
        radial-gradient(680px 520px at 60% 108%, rgba(236, 72, 153, .14), transparent 60%),
        linear-gradient(180deg, #F7F5FF 0%, #F1EEFF 100%);
    background-attachment: fixed;
}

.orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(70px);
    opacity: .5;
    pointer-events: none;
    z-index: 0;
}
.orb--1 { width: 320px; height: 320px; top: -90px; left: -60px;  background: radial-gradient(circle, rgba(139,92,246,.55), transparent 70%); }
.orb--2 { width: 380px; height: 380px; top: 180px; right: -140px; background: radial-gradient(circle, rgba(56,189,248,.42), transparent 70%); }
.orb--3 { width: 300px; height: 300px; bottom: -120px; left: 40%; background: radial-gradient(circle, rgba(244,114,182,.38), transparent 70%); }

/* ---------- topbar ---------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    background: rgba(255, 255, 255, .58);
    border-bottom: 1px solid rgba(255, 255, 255, .7);
}
.topbar__inner {
    max-width: 1240px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    justify-content: space-between;
}
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    min-width: 0;
}
.brand__mark {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    font-weight: 700;
    color: #fff;
    font-size: 18px;
    background: linear-gradient(135deg, #4F46E5, #8B5CF6);
    box-shadow: 0 10px 22px -10px rgba(79, 70, 229, .8);
}
.brand__text { display: flex; flex-direction: column; min-width: 0; }
.brand__text strong { font-size: 15.5px; letter-spacing: -.15px; white-space: nowrap; }
.brand__text small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topnav { display: flex; align-items: center; gap: 10px; }

/* ---------- layout ---------- */
.wrap {
    position: relative;
    z-index: 1;
    max-width: 1240px;
    margin: 0 auto;
    padding: 30px 24px 56px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}
.foot {
    position: relative;
    z-index: 1;
    text-align: center;
    color: var(--muted);
    font-size: 12px;
    padding: 8px 24px 34px;
}

.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.hero--compact { align-items: center; }
.hero__eyebrow {
    margin: 0 0 6px;
    font-size: 11.5px;
    letter-spacing: .14em;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--violet);
}
.hero__title { margin: 0; font-size: 27px; letter-spacing: -.6px; font-weight: 700; }
.hero__sub { margin: 8px 0 0; color: var(--muted); font-size: 14px; max-width: 60ch; line-height: 1.55; }

/* ---------- buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 10px 16px;
    font: inherit;
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: transform .14s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
    white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn--primary {
    color: #fff;
    background: linear-gradient(135deg, #4F46E5, #8B5CF6);
    box-shadow: 0 12px 24px -14px rgba(79, 70, 229, .95);
}
.btn--primary:hover { box-shadow: 0 16px 28px -14px rgba(79, 70, 229, 1); }
.btn--ghost {
    color: var(--ink);
    background: rgba(255, 255, 255, .66);
    border-color: rgba(255, 255, 255, .9);
    box-shadow: 0 6px 16px -12px rgba(58, 40, 120, .6);
}
.btn--ghost:hover { background: rgba(255, 255, 255, .9); }
.btn--ghost.is-active { border-color: rgba(79, 70, 229, .35); color: var(--indigo); }
.btn--tiny { padding: 6px 11px; font-size: 12.5px; border-radius: 10px; }
.btn--danger { color: var(--bad); background: rgba(255, 241, 242, .92); border-color: rgba(220, 38, 38, .22); }
.btn--danger:hover { background: rgba(254, 226, 226, 1); }

/* ---------- surfaces ---------- */
.card {
    position: relative;
    background: var(--surface);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, .78);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px 24px;
}
.card__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
}
.card__head--stack { flex-wrap: wrap; align-items: flex-start; }
.card__head h2 { margin: 0; font-size: 15.5px; letter-spacing: -.2px; }
.card__sub { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.card__meta { font-size: 12px; color: var(--muted); }
.head-actions { display: flex; gap: 10px; }

/* ---------- stats ---------- */
.stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
}
.stat {
    position: relative;
    overflow: hidden;
    background: var(--surface);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, .78);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.stat::after {
    content: '';
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #4F46E5, #8B5CF6);
    opacity: .85;
}
.stat--warn::after { background: linear-gradient(90deg, #F59E0B, #FB923C); }
.stat--bad::after  { background: linear-gradient(90deg, #DC2626, #F472B6); }
.stat__label { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.stat__value { font-size: 30px; font-weight: 700; letter-spacing: -1px; line-height: 1.15; }
.stat__hint { font-size: 12px; color: var(--muted); }

/* ---------- panels ---------- */
.panels { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

.bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.bars__row { display: grid; grid-template-columns: 108px 1fr 32px; align-items: center; gap: 12px; }
.bars__label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.bars__track { height: 9px; border-radius: 99px; background: rgba(99, 95, 130, .13); overflow: hidden; }
.bars__fill { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #4F46E5, #8B5CF6); transition: width .35s ease; }
.bars__fill--breakdown { background: linear-gradient(90deg, #DC2626, #F87171); }
.bars__fill--rfu-stanby { background: linear-gradient(90deg, #D97706, #FBBF24); }
.bars__fill--demob { background: linear-gradient(90deg, #64748B, #94A3B8); }
.bars__value { text-align: right; font-size: 13px; font-weight: 700; }

.mini { display: flex; flex-direction: column; gap: 8px; }
.mini__title {
    margin: 6px 0 0;
    font-size: 11.5px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 600;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 11px;
    border-radius: 99px;
    font-size: 12.5px;
    background: rgba(255, 255, 255, .8);
    border: 1px solid rgba(115, 105, 180, .16);
    color: var(--ink);
}
.chip b { font-weight: 700; color: var(--indigo); }
.chip--ok  { background: rgba(236, 253, 245, .95); border-color: rgba(16, 185, 129, .28); color: #065F46; }
.chip--ok b { color: #065F46; }
.chip--bad { background: rgba(255, 241, 242, .95); border-color: rgba(220, 38, 38, .25); color: #991B1B; }
.chip--bad b { color: #991B1B; }
.chip--soft { background: rgba(243, 240, 255, .95); }

/* ---------- notices ---------- */
.alert {
    border-radius: 14px;
    padding: 14px 18px;
    font-size: 13.5px;
    border: 1px solid transparent;
    line-height: 1.5;
}
.alert--ok  { background: rgba(236, 253, 245, .9); border-color: rgba(16, 185, 129, .3); color: #065F46; }
.alert--bad { background: rgba(255, 241, 242, .92); border-color: rgba(220, 38, 38, .28); color: #991B1B; }
.alert__list { margin: 8px 0 0; padding-left: 18px; }

.notice {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 18px;
    padding: 12px 16px;
    border-radius: 13px;
    background: rgba(243, 240, 255, .92);
    border: 1px dashed rgba(139, 92, 246, .4);
    color: #4C1D95;
    font-size: 13px;
}

/* ---------- filters ---------- */
.filters {
    display: grid;
    grid-template-columns: minmax(200px, 1.6fr) repeat(3, minmax(130px, 1fr)) auto;
    gap: 14px;
    align-items: end;
    margin-bottom: 20px;
    padding: 16px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .55);
    border: 1px solid rgba(255, 255, 255, .8);
}
.filters__actions { display: flex; gap: 8px; }

/* ---------- fields ---------- */
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field label {
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
}
.field input[type="text"],
.field input[type="search"],
.field select,
.field textarea {
    width: 100%;
    font: inherit;
    font-size: 14px;
    color: var(--ink);
    background: var(--surface-solid);
    border: 1px solid rgba(115, 105, 180, .22);
    border-radius: 11px;
    padding: 10px 12px;
    transition: border-color .16s ease, box-shadow .16s ease;
}
.field textarea { resize: vertical; min-height: 84px; line-height: 1.5; }
.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: rgba(79, 70, 229, .6);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, .14);
}
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #635F82 50%), linear-gradient(135deg, #635F82 50%, transparent 50%); background-position: calc(100% - 18px) 51%, calc(100% - 13px) 51%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.field select.is-required { border-color: rgba(220, 38, 38, .45); background-color: rgba(255, 245, 245, .95); }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: rgba(220, 38, 38, .6); }
.field .err { color: #B91C1C; font-size: 12px; }
.field .hint { color: var(--muted); font-size: 12px; }
.req { color: #DC2626; }

/* ---------- form ---------- */
.form { padding: 26px; }
.form__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px 20px;
}
.field--wide { grid-column: 1 / -1; }
.form__actions {
    display: flex;
    gap: 12px;
    margin-top: 26px;
    padding-top: 22px;
    border-top: 1px solid rgba(115, 105, 180, .14);
}

.radios { display: flex; gap: 10px; }
.radio {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 11px;
    background: var(--surface-solid);
    border: 1px solid rgba(115, 105, 180, .22);
    cursor: pointer;
    font-size: 13.5px;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    color: var(--ink);
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.radio input { accent-color: #4F46E5; margin: 0; }
.radio:has(input:checked) { border-color: rgba(79, 70, 229, .55); box-shadow: 0 0 0 3px rgba(79, 70, 229, .12); }
.radio--ok:has(input:checked)  { border-color: rgba(16, 185, 129, .55); box-shadow: 0 0 0 3px rgba(16, 185, 129, .12); }
.radio--bad:has(input:checked) { border-color: rgba(220, 38, 38, .5); box-shadow: 0 0 0 3px rgba(220, 38, 38, .1); }

/* ---------- table ---------- */
.card--table { padding: 24px; }
.tablewrap {
    overflow-x: auto;
    border-radius: 14px;
    border: 1px solid rgba(115, 105, 180, .14);
    background: rgba(255, 255, 255, .72);
}
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 1340px; }
.table thead th {
    position: sticky;
    top: 0;
    text-align: left;
    padding: 12px 14px;
    font-size: 11px;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--muted);
    background: rgba(247, 245, 255, .96);
    border-bottom: 1px solid rgba(115, 105, 180, .16);
    white-space: nowrap;
}
.table tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(115, 105, 180, .1);
    vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: rgba(243, 240, 255, .65); }
.cell-strong { font-weight: 700; white-space: nowrap; }
.cell-note { max-width: 220px; color: var(--muted); }
.cell-actions { white-space: nowrap; display: flex; gap: 8px; align-items: center; }
.th-actions { text-align: left; }
.inline-form { display: inline; margin: 0; }
.dash { color: rgba(99, 95, 130, .5); }
.tag {
    display: inline-block;
    margin-left: 8px;
    padding: 1px 7px;
    border-radius: 99px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .03em;
    text-transform: uppercase;
    color: #6D28D9;
    background: rgba(237, 233, 254, .95);
    border: 1px solid rgba(139, 92, 246, .3);
    vertical-align: middle;
}

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 99px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .02em;
    white-space: nowrap;
    border: 1px solid transparent;
}
.badge--ok    { color: #065F46; background: rgba(209, 250, 229, .95); border-color: rgba(16, 185, 129, .32); }
.badge--warn  { color: #92400E; background: rgba(254, 243, 199, .95); border-color: rgba(245, 158, 11, .35); }
.badge--bad   { color: #991B1B; background: rgba(254, 226, 226, .95); border-color: rgba(220, 38, 38, .3); }
.badge--muted { color: #475569; background: rgba(241, 245, 249, .95); border-color: rgba(100, 116, 139, .25); }

/* ---------- empty ---------- */
.empty { text-align: center; padding: 46px 20px 40px; }
.empty__title { margin: 0 0 6px; font-weight: 600; font-size: 15px; }
.empty__sub { margin: 0 0 18px; color: var(--muted); font-size: 13.5px; }
.empty-note { color: var(--muted); font-size: 13px; margin: 0; }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .panels { grid-template-columns: 1fr; }
    .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .filters__actions { grid-column: 1 / -1; }
    .form__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
    .topbar__inner { padding: 12px 16px; gap: 12px; }
    .brand__text small { display: none; }
    .wrap { padding: 22px 16px 44px; gap: 18px; }
    .hero__title { font-size: 22px; }
    .stats { grid-template-columns: 1fr 1fr; gap: 16px; }
    .stat { padding: 14px 16px; }
    .stat__value { font-size: 24px; }
    .card, .card--table { padding: 18px 16px; }
    .filters { grid-template-columns: 1fr; }
    .form__grid { grid-template-columns: 1fr; }
    .form { padding: 18px 16px; }
    .form__actions { flex-direction: column; }
    .form__actions .btn { width: 100%; }
    .bars__row { grid-template-columns: 96px 1fr 28px; }
    .topnav .btn--ghost { display: none; }
    .cell-actions { flex-wrap: wrap; }
}

/* ---------- excel page ---------- */
.stat--ok::after { background: linear-gradient(90deg, #10B981, #34D399); }

.stack { display: flex; flex-direction: column; gap: 12px; margin-top: 4px; align-items: flex-start; }
.stack .btn { width: 100%; }
.hint-block { margin: 16px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.55; }
.hint-block a { color: var(--indigo); font-weight: 600; text-decoration: none; }
.hint-block a:hover { text-decoration: underline; }

.import-form { display: flex; flex-direction: column; gap: 16px; align-items: flex-start; }
.import-form .field { width: 100%; }
.field input[type="file"] {
    width: 100%;
    font: inherit;
    font-size: 13.5px;
    color: var(--ink);
    background: var(--surface-solid);
    border: 1px dashed rgba(115, 105, 180, .38);
    border-radius: 11px;
    padding: 12px;
}
.field input[type="file"]::file-selector-button {
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    margin-right: 12px;
    padding: 7px 13px;
    border-radius: 9px;
    border: 1px solid rgba(79, 70, 229, .3);
    background: rgba(243, 240, 255, 1);
    color: var(--indigo);
    cursor: pointer;
}
.check {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-size: 13px;
    color: var(--muted);
    line-height: 1.5;
    cursor: pointer;
}
.check input { margin: 2px 0 0; accent-color: #4F46E5; width: 16px; height: 16px; flex: 0 0 16px; }

.rules { margin-top: 22px; padding-top: 18px; border-top: 1px solid rgba(115, 105, 180, .14); }
.rules ul { margin: 8px 0 0; padding-left: 18px; color: var(--muted); font-size: 12.5px; line-height: 1.65; }
.rules li + li { margin-top: 4px; }

.import-summary { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.import-note { margin: 14px 0 0; font-size: 12.5px; }
.alert--ok .tablewrap { margin-top: 10px; background: rgba(255, 255, 255, .85); }
.tablewrap--compact { border-color: rgba(16, 185, 129, .25); }
.table--plain { min-width: 0; font-size: 12.5px; }
.table--plain thead th { background: rgba(240, 253, 244, .95); }
.table--plain tbody td { padding: 8px 12px; }

@media (max-width: 720px) {
    .stack .btn { width: 100%; }
    .import-form { align-items: stretch; }
}

/* ---------- gerbang "Pilih Site" ---------- */
.site-chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 99px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .02em;
    color: #4C1D95;
    background: rgba(237, 233, 254, .95);
    border: 1px solid rgba(139, 92, 246, .35);
    white-space: nowrap;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gate {
    display: flex;
    justify-content: center;
    padding: 24px 0 8px;
}
.gate__card {
    width: 100%;
    max-width: 520px;
    background: var(--surface);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, .78);
    border-radius: 22px;
    box-shadow: 0 26px 60px -32px rgba(58, 40, 120, .55);
    padding: 34px 34px 28px;
}
.gate__head { margin-bottom: 22px; }
.gate__badge {
    display: inline-block;
    margin-bottom: 14px;
    padding: 5px 12px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #fff;
    background: linear-gradient(135deg, #4F46E5, #8B5CF6);
}
.gate__title { margin: 0 0 8px; font-size: 26px; letter-spacing: -.6px; }
.gate__sub { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.gate__form { display: flex; flex-direction: column; gap: 18px; }
.gate__submit { width: 100%; padding: 12px 16px; font-size: 14px; }
.gate__note { margin: 20px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.55; }

.field input.is-readonly {
    background: rgba(243, 240, 255, .9);
    color: var(--muted);
    cursor: not-allowed;
}

@media (max-width: 720px) {
    .gate__card { padding: 26px 20px 22px; border-radius: 18px; }
    .gate__title { font-size: 22px; }
    .site-chip { display: none; }
}
