:root {
    --red-50:  #fff1f2;
    --red-100: #ffe0e3;
    --red-200: #ffc6cc;
    --red-400: #f4525f;
    --red:     #e11d2e;
    --red-600: #c2101f;
    --red-700: #9b0b17;

    --ink:     #0a0a0d;
    --ink-2:   #14141b;
    --white:   #ffffff;
    --muted:   #6b7280;
    --muted-2: #9aa1ad;

    --bg:      #f6f6f8;
    --card:    #ffffff;
    --line:    #ececf1;
    --line-2:  #f4f4f7;

    --ok:      #0f9d58;
    --ok-soft: #e7f8ef;
    --warn:    #b45309;
    --warn-soft:#fff5e6;
    --dan:     #d92d20;
    --dan-soft:#fdeceb;

    --radius:  16px;
    --radius-sm: 11px;
    --shadow-1: 0 1px 2px rgba(10, 10, 13, .05), 0 1px 3px rgba(10, 10, 13, .04);
    --shadow-2: 0 8px 24px rgba(10, 10, 13, .08);
    --shadow-red: 0 8px 20px rgba(225, 29, 46, .28);
    --ease: cubic-bezier(.22, .61, .36, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
    font-family: "Inter", "Segoe UI", Roboto, -apple-system, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--ink);
    font-size: 14px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
code {
    background: #f1f1f5;
    color: var(--red-700);
    padding: 1px 6px;
    border-radius: 6px;
    font-size: 12px;
    font-family: Consolas, Monaco, monospace;
}

body::before,
body::after {
    content: "";
    position: fixed;
    z-index: 0;
    border-radius: 50%;
    filter: blur(70px);
    opacity: .5;
    pointer-events: none;
}
body::before {
    width: 420px; height: 420px;
    top: -160px; right: -120px;
    background: radial-gradient(circle, rgba(225, 29, 46, .30), transparent 68%);
    animation: floaty 18s var(--ease) infinite alternate;
}
body::after {
    width: 380px; height: 380px;
    bottom: -160px; left: -120px;
    background: radial-gradient(circle, rgba(10, 10, 13, .16), transparent 70%);
    animation: floaty 22s var(--ease) infinite alternate-reverse;
}
@keyframes floaty {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to   { transform: translate3d(-24px, 26px, 0) scale(1.08); }
}

.shell { display: flex; min-height: 100vh; position: relative; z-index: 1; }

.sidebar {
    width: 262px;
    flex-shrink: 0;
    background: linear-gradient(180deg, var(--ink) 0%, #0e0e14 55%, var(--ink-2) 100%);
    color: #cdd2dc;
    display: flex;
    flex-direction: column;
    padding: 16px 12px 14px;
    position: relative;
}
.sidebar::after {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: linear-gradient(90deg, var(--red), #ff6b76 55%, transparent);
}
.brand { display: flex; gap: 11px; align-items: center; padding: 4px 8px 16px; }
.brand-mark {
    width: 40px; height: 40px;
    border-radius: 13px;
    background: linear-gradient(135deg, var(--red) 0%, #ff5a67 100%);
    color: #fff;
    display: grid; place-items: center;
    font-weight: 800; letter-spacing: .5px;
    box-shadow: var(--shadow-red);
    animation: pop .5s var(--ease) both;
}
.brand strong { display: block; color: #fff; font-size: 14px; line-height: 1.25; }
.brand small { color: #8b93a3; font-size: 11px; }
@keyframes pop {
    from { transform: scale(.75); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

.sidebar::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 13, .5);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s var(--ease);
    z-index: -1;
}
.sidebar.open::before { opacity: 1; pointer-events: auto; }

.nav-grup {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .14em;
    color: #6a7386;
    margin: 18px 10px 7px;
}
.nav-item {
    display: flex; align-items: center; gap: 11px;
    padding: 10px 11px;
    border-radius: 11px;
    font-size: 13px;
    margin-bottom: 2px;
    position: relative;
    overflow: hidden;
    transition: background .18s var(--ease), color .18s var(--ease), transform .18s var(--ease);
}
.nav-item svg { width: 17px; height: 17px; flex-shrink: 0; opacity: .85; transition: transform .2s var(--ease); }
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; transform: translateX(2px); }
.nav-item:hover svg { transform: scale(1.08); }
.nav-item.active {
    background: linear-gradient(90deg, rgba(225, 29, 46, .28), rgba(225, 29, 46, .06));
    color: #fff;
    font-weight: 600;
}
.nav-item.active::before {
    content: "";
    position: absolute; left: 0; top: 12%; bottom: 12%;
    width: 3px; border-radius: 0 4px 4px 0;
    background: var(--red);
    box-shadow: 0 0 12px rgba(225, 29, 46, .8);
    animation: growBar .3s var(--ease) both;
}
@keyframes growBar { from { transform: scaleY(.2); opacity: 0; } to { transform: scaleY(1); opacity: 1; } }

.sidebar-foot { margin-top: auto; padding: 10px 6px 0; }
.quota-box {
    background: linear-gradient(140deg, rgba(225, 29, 46, .16), rgba(255, 255, 255, .04));
    border: 1px solid rgba(255, 255, 255, .09);
    border-radius: 14px;
    padding: 11px 13px;
}
.quota-box small { display: block; color: #98a0b1; font-size: 11px; }
.quota-box strong {
    color: #fff; font-size: 19px;
    background: linear-gradient(90deg, #fff, #ffb3b9);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-overlay {
    position: fixed; inset: 0;
    background: rgba(10, 10, 13, .5);
    opacity: 0; pointer-events: none;
    transition: opacity .25s var(--ease);
    z-index: 60;
}
.sidebar-overlay.show { opacity: 1; pointer-events: auto; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(9px);
    border-bottom: 1px solid var(--line);
    padding: 14px 22px;
    display: flex; align-items: center; gap: 14px;
    position: sticky; top: 0; z-index: 15;
}
.topbar h1 { font-size: 17px; margin: 0; letter-spacing: -.01em; }
.crumb { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.topbar-user { margin-left: auto; display: flex; align-items: center; gap: 10px; text-align: right; }
.topbar-user strong { display: block; font-size: 13px; }
.topbar-user small { color: var(--muted); font-size: 11px; }
.avatar {
    width: 38px; height: 38px; border-radius: 50%;
    background: linear-gradient(135deg, var(--red), #ff6b76);
    color: #fff; display: grid; place-items: center;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(225, 29, 46, .3);
}
.burger {
    display: none;
    background: #fff; border: 1px solid var(--line);
    width: 38px; height: 38px; border-radius: 11px;
    font-size: 17px; cursor: pointer; color: var(--ink);
    transition: transform .15s var(--ease), border-color .15s var(--ease);
}
.burger:hover { transform: scale(1.05); border-color: var(--red-200); }

.content { padding: 22px; flex: 1; }
.foot {
    padding: 15px 22px;
    color: var(--muted);
    font-size: 12px;
    border-top: 1px solid var(--line);
    background: #fff;
}

.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1080px) { .g4, .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px)  { .g4, .g3, .g2 { grid-template-columns: 1fr; } }

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow-1);
    transition: box-shadow .25s var(--ease), transform .25s var(--ease), border-color .25s var(--ease);
}
.card:hover { box-shadow: var(--shadow-2); border-color: var(--line-2); }
.card > h3 { margin: 0 0 4px; font-size: 14px; }
.card .sub { color: var(--muted); font-size: 12px; margin: 0; }

.stat {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 15px 16px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-1);
    transition: transform .22s var(--ease), box-shadow .22s var(--ease);
}
.stat::after {
    content: "";
    position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
    background: linear-gradient(90deg, var(--red), #ff8a94);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .35s var(--ease);
}
.stat:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); }
.stat:hover::after { transform: scaleX(1); }
.stat .label {
    color: var(--muted);
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: .05em;
    font-weight: 600;
}
.stat .value { font-size: 21px; font-weight: 750; margin-top: 6px; letter-spacing: -.02em; }
.stat .value.sm { font-size: 16.5px; }
.stat .hint { font-size: 11px; color: var(--muted-2); margin-top: 4px; }

.section-title {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; margin: 24px 0 11px; flex-wrap: wrap;
}
.section-title h2 {
    font-size: 15px; margin: 0;
    display: flex; align-items: center; gap: 9px;
}
.section-title h2::before {
    content: "";
    width: 4px; height: 15px; border-radius: 3px;
    background: linear-gradient(180deg, var(--red), #ff8a94);
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow-1);
    -webkit-overflow-scrolling: touch;
}
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table th {
    text-align: left;
    background: #fbfbfd;
    color: #4b5563;
    font-weight: 650;
    padding: 10px;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
table td { padding: 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table tr:hover td { background: var(--red-50); }
table tr:last-child td { border-bottom: 0; }

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 650;
    white-space: nowrap;
}
.badge-success { background: var(--ok-soft); color: var(--ok); }
.badge-warning { background: var(--warn-soft); color: var(--warn); animation: softPulse 2.4s var(--ease) infinite; }
.badge-danger  { background: var(--dan-soft); color: var(--dan); }
.badge-info    { background: var(--red-50); color: var(--red-600); }
.badge-muted   { background: #f1f1f5; color: var(--muted); }
@keyframes softPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(180, 83, 9, .26); }
    50%      { box-shadow: 0 0 0 4px rgba(180, 83, 9, 0); }
}

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    background: linear-gradient(135deg, var(--red) 0%, var(--red-600) 100%);
    color: #fff; border: 0; border-radius: 11px;
    padding: 10px 16px; font-size: 13px; font-weight: 650;
    cursor: pointer; font-family: inherit;
    position: relative; overflow: hidden;
    box-shadow: 0 4px 12px rgba(225, 29, 46, .22);
    transition: transform .16s var(--ease), box-shadow .16s var(--ease);
}
.btn::after {
    content: "";
    position: absolute; inset: 0;
    background: linear-gradient(120deg, transparent 20%, rgba(255, 255, 255, .34), transparent 80%);
    transform: translateX(-120%);
    transition: transform .55s var(--ease);
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(225, 29, 46, .3); }
.btn:hover::after { transform: translateX(120%); }
.btn:active { transform: translateY(0) scale(.99); }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-sm { padding: 6px 11px; font-size: 12px; border-radius: 9px; box-shadow: none; }
.btn-ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); box-shadow: none; }
.btn-ghost:hover { border-color: var(--red-200); color: var(--red-600); }
.btn-ok { background: linear-gradient(135deg, #12b76a, #0f9d58); box-shadow: 0 4px 12px rgba(15, 157, 88, .25); }
.btn-warn { background: linear-gradient(135deg, #f59e0b, #b45309); box-shadow: 0 4px 12px rgba(180, 83, 9, .25); }
.btn-danger { background: linear-gradient(135deg, #ef4444, var(--dan)); box-shadow: 0 4px 12px rgba(217, 45, 32, .25); }

label { display: block; font-size: 12.5px; font-weight: 650; margin: 13px 0 5px; color: #33343c; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search], select, textarea {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid #e2e2ea;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: inherit;
    background: #fff;
    color: var(--ink);
    transition: border-color .16s var(--ease), box-shadow .16s var(--ease);
}
input:hover, select:hover, textarea:hover { border-color: #d3d3de; }
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--red);
    box-shadow: 0 0 0 4px rgba(225, 29, 46, .12);
}
textarea { min-height: 110px; resize: vertical; line-height: 1.55; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 720px) { .form-row { grid-template-columns: 1fr; } }
.help { color: var(--muted); font-size: 11.5px; margin-top: 5px; line-height: 1.55; }

.alert { padding: 12px 15px; border-radius: 13px; margin-bottom: 14px; font-size: 13px; border: 1px solid transparent; }
.alert-ok   { background: var(--ok-soft);  color: #11603c; border-color: #c6f0da; }
.alert-err  { background: var(--dan-soft); color: #912018; border-color: #fbd3cf; }
.alert-info { background: var(--red-50);   color: var(--red-700); border-color: var(--red-200); }

.toast-wrap {
    position: fixed; right: 18px; bottom: 18px;
    display: flex; flex-direction: column; gap: 10px;
    z-index: 90; max-width: min(360px, calc(100vw - 36px));
}
.toast {
    background: #fff;
    border: 1px solid var(--line);
    border-left: 4px solid var(--red);
    border-radius: 13px;
    padding: 12px 15px;
    font-size: 13px;
    box-shadow: var(--shadow-2);
    animation: toastIn .35s var(--ease) both;
    cursor: pointer;
}
.toast.ok  { border-left-color: var(--ok); }
.toast.err { border-left-color: var(--dan); }
.toast.hide { animation: toastOut .3s var(--ease) both; }
@keyframes toastIn  { from { opacity: 0; transform: translateX(24px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateX(24px); } }

.code-box {
    position: relative;
    background: linear-gradient(160deg, var(--ink) 0%, var(--ink-2) 100%);
    color: #e6e8ef;
    border-radius: 13px;
    padding: 15px;
    font-family: Consolas, Monaco, monospace;
    font-size: 11.5px;
    overflow: auto;
    line-height: 1.65;
    white-space: pre-wrap;
    word-break: break-word;
    border: 1px solid #23232e;
}
.copy-btn { position: absolute; right: 9px; top: 9px; z-index: 2; }

.pill { display: inline-block; background: #f6f6f8; border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px; font-size: 11.5px; margin: 0 6px 6px 0; }
.empty { padding: 34px; text-align: center; color: var(--muted); font-size: 13px; }

.pager { display: flex; gap: 6px; margin-top: 14px; flex-wrap: wrap; }
.pager a, .pager span {
    padding: 7px 12px; border: 1px solid var(--line); border-radius: 10px;
    background: #fff; font-size: 12.5px;
    transition: transform .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease);
}
.pager a:hover { transform: translateY(-1px); border-color: var(--red-200); color: var(--red-600); }
.pager .cur { background: linear-gradient(135deg, var(--red), var(--red-600)); color: #fff; border-color: transparent; box-shadow: var(--shadow-red); }

.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tabs a {
    padding: 10px 14px; font-size: 13px; color: var(--muted);
    border-bottom: 2px solid transparent;
    border-radius: 10px 10px 0 0;
    transition: color .18s var(--ease), border-color .18s var(--ease), background .18s var(--ease);
}
.tabs a:hover { color: var(--ink); background: #fbfbfd; }
.tabs a.on { color: var(--red-600); border-color: var(--red); font-weight: 650; }

.thumb {
    width: 66px; height: 88px; border-radius: 11px;
    background: linear-gradient(135deg, #f4f4f7, #ececf1);
    display: grid; place-items: center;
    font-size: 11px; color: var(--muted); overflow: hidden;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }

.modal {
    position: fixed; inset: 0;
    background: rgba(10, 10, 13, .55);
    display: none; align-items: center; justify-content: center;
    padding: 18px; z-index: 80;
}
.modal.open { display: flex; animation: fadeIn .2s var(--ease) both; }
.modal-inner {
    background: #fff; border-radius: 18px;
    max-width: 760px; width: 100%; max-height: 90vh; overflow: auto;
    padding: 20px;
    box-shadow: 0 24px 60px rgba(10, 10, 13, .3);
    animation: modalIn .26s var(--ease) both;
}
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.modal-head h3 { margin: 0; font-size: 15px; }
.close-x {
    background: #f4f4f7; border: 0; width: 32px; height: 32px; border-radius: 50%;
    cursor: pointer; font-size: 16px; line-height: 1; color: var(--muted);
    transition: background .16s var(--ease), transform .16s var(--ease), color .16s var(--ease);
}
.close-x:hover { background: var(--dan-soft); color: var(--dan); transform: rotate(90deg); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }

@keyframes riseIn {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
}
.content > * { animation: riseIn .42s var(--ease) both; }
.content > *:nth-child(2) { animation-delay: .04s; }
.content > *:nth-child(3) { animation-delay: .08s; }
.content > *:nth-child(4) { animation-delay: .12s; }
.content > *:nth-child(5) { animation-delay: .16s; }
.content > *:nth-child(6) { animation-delay: .2s; }
.content > *:nth-child(n+7) { animation-delay: .24s; }

.spinner {
    width: 22px; height: 22px; border-radius: 50%;
    border: 3px solid rgba(225, 29, 46, .2);
    border-top-color: var(--red);
    animation: spin .8s linear infinite;
    display: inline-block; vertical-align: -4px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton {
    background: linear-gradient(90deg, #f1f1f5 25%, #e8e8ee 37%, #f1f1f5 63%);
    background-size: 400% 100%;
    animation: shimmer 1.3s ease-in-out infinite;
    border-radius: 8px;
    height: 14px;
}
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }

.bar-chart { display: flex; align-items: flex-end; gap: 8px; height: 132px; padding: 8px 2px 0; }
.bar-chart .bar-item { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 7px; height: 100%; }
.bar-chart .bar {
    width: 100%;
    border-radius: 8px 8px 4px 4px;
    background: linear-gradient(180deg, var(--red), #ff8a94);
    min-height: 3px;
    transform-origin: bottom;
    animation: barGrow .6s var(--ease) both;
    transition: filter .18s var(--ease);
}
.bar-chart .bar:hover { filter: brightness(1.08); }
.bar-chart .bar-label { font-size: 10.5px; color: var(--muted-2); white-space: nowrap; }
@keyframes barGrow { from { transform: scaleY(0); opacity: .4; } to { transform: scaleY(1); opacity: 1; } }

.gauge { height: 9px; border-radius: 999px; background: #f1f1f5; overflow: hidden; }
.gauge > span {
    display: block; height: 100%; border-radius: 999px;
    background: linear-gradient(90deg, var(--red), #ff8a94);
    animation: gaugeIn .8s var(--ease) both;
}
@keyframes gaugeIn { from { transform: scaleX(0); transform-origin: left; } to { transform: scaleX(1); transform-origin: left; } }

:focus-visible { outline: 3px solid rgba(225, 29, 46, .45); outline-offset: 2px; border-radius: 8px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cfcfd8; border-radius: 999px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #b6b6c2; background-clip: content-box; }

@media (max-width: 900px) {
    .sidebar {
        position: fixed; inset: 0 auto 0 0;
        transform: translateX(-104%);
        transition: transform .28s var(--ease);
        z-index: 70;
        box-shadow: 24px 0 60px rgba(10, 10, 13, .35);
    }
    .sidebar.open { transform: none; }
    .burger { display: grid; place-items: center; }
    .content { padding: 16px; }
    .topbar { padding: 12px 16px; }
    .topbar-user strong { font-size: 12px; }
    .topbar-user small { display: none; }
    .toast-wrap { left: 14px; right: 14px; bottom: 14px; max-width: none; }
}

/* --- Aksesibilitas & kenyamanan (v3) --- */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 9999;
    background: var(--red);
    color: #fff;
    padding: 10px 14px;
    border-radius: 0 0 12px 0;
    font-weight: 700;
    text-decoration: none;
}
.skip-link:focus { left: 0; }

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.nav-item:focus-visible {
    outline: 3px solid rgba(225, 29, 46, .55);
    outline-offset: 2px;
}

.table-wrap { scrollbar-width: thin; }
.table-wrap::-webkit-scrollbar { height: 8px; }
.table-wrap::-webkit-scrollbar-thumb { background: #d7d7de; border-radius: 8px; }

.help a, .sub a { color: var(--red-600); font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }
}
