/* QRIS Center — panel stylesheet */
:root {
    --navy: #0c1c2c;
    --navy-2: #122a41;
    --navy-3: #1a344d;
    --accent: #12b39a;
    --accent-soft: #e3f8f4;
    --blue: #2f80ed;
    --bg: #f2f6fb;
    --card: #ffffff;
    --text: #142338;
    --muted: #6b8299;
    --line: #e3eaf3;
    --danger: #e5484d;
    --warning: #f5a524;
    --success: #12b39a;
    --radius: 14px;
    --shadow: 0 8px 24px rgba(16, 40, 68, .06);
    --sidebar-w: 248px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
}

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

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: none; }

.app { min-height: 100vh; }

/* ---------- Sidebar ---------- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-w);
    background: linear-gradient(180deg, var(--navy) 0%, #0a1623 100%);
    color: #c9d6e4;
    display: flex;
    flex-direction: column;
    z-index: 40;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 22px 22px 18px;
}

.brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent), #0e8f7d);
    color: #fff;
    font-weight: 800;
    font-size: 15px;
    letter-spacing: .5px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 16px rgba(18, 179, 154, .35);
}

.brand-text {
    display: flex;
    flex-direction: column;
    font-weight: 700;
    color: #fff;
    font-size: 15px;
    line-height: 1.25;
}

.brand-text small {
    font-weight: 600;
    font-size: 10px;
    letter-spacing: 1.6px;
    color: #7d93a9;
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 14px;
    flex: 1;
    overflow-y: auto;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 10px;
    color: #b7c7d8;
    font-weight: 500;
    transition: background .15s ease, color .15s ease;
}

.nav-link:hover {
    background: rgba(255, 255, 255, .06);
    color: #fff;
}

.nav-link.active {
    background: linear-gradient(90deg, rgba(18, 179, 154, .22), rgba(18, 179, 154, .05));
    color: #fff;
    box-shadow: inset 3px 0 0 var(--accent);
}

.nav-icon {
    width: 20px;
    height: 20px;
    display: inline-flex;
    flex: 0 0 20px;
    opacity: .95;
}

.nav-icon svg { width: 100%; height: 100%; }
.icon-btn svg, .logout svg { width: 18px; height: 18px; }

.sidebar-foot {
    padding: 14px;
    border-top: 1px solid rgba(255, 255, 255, .08);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.who {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 6px;
}

.who .avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--navy-2);
    border: 1px solid rgba(255, 255, 255, .12);
    color: var(--accent);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 34px;
    text-transform: uppercase;
}

.who strong {
    display: block;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.who small {
    color: #7d93a9;
    font-size: 11px;
    text-transform: capitalize;
}

.logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 12px;
    border-radius: 10px;
    background: rgba(229, 72, 77, .12);
    color: #ff9d9f;
    font-weight: 600;
    font-size: 13px;
}

.logout:hover { background: rgba(229, 72, 77, .2); color: #fff; }

/* ---------- Main ---------- */
.main {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 28px;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
}

.icon-btn {
    display: none;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--text);
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.topbar-title { flex: 1; min-width: 0; }
.topbar-title h1 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -.2px;
}
.topbar-title span { color: var(--muted); font-size: 12px; }

.topbar-user {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 13px;
    color: #33475f;
    background: #f4f8fc;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 7px 14px;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 3px rgba(18, 179, 154, .18);
    flex: 0 0 8px;
}

.content {
    padding: 24px 28px 40px;
    flex: 1;
    width: 100%;
    max-width: 1400px;
}

.page-foot {
    padding: 16px 28px 26px;
    color: var(--muted);
    font-size: 12px;
}

/* ---------- Alerts ---------- */
.alert {
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 18px;
    font-weight: 500;
    border: 1px solid transparent;
}
.alert-success { background: #e7f8f4; color: #0a7a69; border-color: #bfeee4; }
.alert-danger { background: #fdecec; color: #a52a2f; border-color: #f7c9cb; }
.alert-warning { background: #fdf4e3; color: #8a5a09; border-color: #f5e0b5; }
.alert-info { background: #e9f2fe; color: #1d5bbf; border-color: #c9defb; }

/* ---------- Cards / stats ---------- */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.stat-card {
    position: relative;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px 18px 15px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.stat-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--blue);
}

.stat-card.is-success::before { background: var(--accent); }
.stat-card.is-warning::before { background: var(--warning); }
.stat-card.is-danger::before { background: var(--danger); }
.stat-card.is-info::before { background: var(--blue); }
.stat-card.is-muted::before { background: #95a9bd; }

.stat-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .4px;
}

.stat-value {
    margin-top: 8px;
    font-size: 23px;
    font-weight: 800;
    letter-spacing: -.5px;
    color: var(--text);
    line-height: 1.2;
}

.stat-meta {
    margin-top: 6px;
    color: var(--muted);
    font-size: 12px;
}

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    overflow: hidden;
}

.card-head {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 16px 18px;
    border-bottom: 1px solid var(--line);
}

.card-title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    flex: 1;
    min-width: 160px;
}

.card-body { padding: 18px; }

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* ---------- Tables ---------- */
.table-wrap { width: 100%; overflow-x: auto; }

table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 760px;
}

table.data thead th {
    text-align: left;
    padding: 11px 16px;
    background: #f7fafd;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

table.data tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid #eef3f9;
    vertical-align: middle;
}

table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr:hover { background: #fafcff; }

.cell-main { font-weight: 600; color: var(--text); }
.cell-sub { color: var(--muted); font-size: 12px; }
.mono { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: 12px; }
.nowrap { white-space: nowrap; }
.text-right { text-align: right; }
.muted { color: var(--muted); }
.strong { font-weight: 700; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }

.empty {
    padding: 42px 18px;
    text-align: center;
    color: var(--muted);
}
.empty strong { display: block; color: var(--text); margin-bottom: 4px; }

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.4;
    white-space: nowrap;
}
.badge-success { background: #e2f7f2; color: #0a7a69; }
.badge-warning { background: #fdf3df; color: #8a5a09; }
.badge-info { background: #e7f0fe; color: #1d5bbf; }
.badge-danger { background: #fdeaea; color: #a52a2f; }
.badge-muted { background: #eef2f7; color: #5c7188; }

.countdown {
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 12px;
    font-weight: 700;
    color: #8a5a09;
    background: #fdf3df;
    border-radius: 6px;
    padding: 3px 8px;
}

/* ---------- Filter bar ---------- */
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 130px;
}

.field label {
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .4px;
}

.field.grow { flex: 1; min-width: 190px; }

input[type="text"],
input[type="password"],
input[type="date"],
input[type="number"],
select,
textarea {
    width: 100%;
    border: 1px solid #d7e2ee;
    border-radius: 9px;
    padding: 9px 12px;
    font-size: 13px;
    color: var(--text);
    background: #fff;
    font-family: inherit;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(18, 179, 154, .14);
}

textarea { resize: vertical; min-height: 74px; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid transparent;
    border-radius: 9px;
    padding: 9px 16px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: filter .15s ease, background .15s ease;
    white-space: nowrap;
}

.btn:hover { filter: brightness(.96); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 4px 12px rgba(18, 179, 154, .28); }
.btn-blue { background: var(--blue); color: #fff; }
.btn-ghost { background: #fff; border-color: #d7e2ee; color: #33475f; }
.btn-danger { background: #fff; border-color: #f3c3c5; color: #c03338; }
.btn-success { background: #fff; border-color: #b5e6da; color: #0a7a69; }
.btn-sm { padding: 6px 11px; font-size: 12px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

.toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.toolbar .spacer { flex: 1; }

/* ---------- Tabs / chips ---------- */
.tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    padding: 4px;
    background: #eef3f9;
    border-radius: 11px;
}

.tab {
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    color: #5c7188;
}

.tab.active { background: #fff; color: var(--text); box-shadow: 0 2px 6px rgba(16, 40, 68, .08); }

/* ---------- Pagination ---------- */
.pager {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    padding: 14px 18px;
    border-top: 1px solid var(--line);
}

.pager-link {
    min-width: 32px;
    height: 32px;
    padding: 0 9px;
    border-radius: 8px;
    border: 1px solid #dde7f1;
    background: #fff;
    color: #42586f;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pager-link.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.pager-gap { color: var(--muted); padding: 0 2px; }
.pager-info { margin-left: auto; color: var(--muted); font-size: 12px; }

/* ---------- Modal ---------- */
.modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(8, 20, 33, .55);
}

.modal.open { display: flex; }

.modal-card {
    width: 100%;
    max-width: 460px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 26px 60px rgba(4, 14, 26, .35);
    animation: pop .16s ease-out;
}

@keyframes pop {
    from { transform: translateY(8px) scale(.98); opacity: 0; }
    to { transform: none; opacity: 1; }
}

.modal-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--line);
}

.modal-head h3 { margin: 0; font-size: 15px; flex: 1; }

.modal-close {
    border: none;
    background: #f2f6fb;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    font-size: 16px;
    line-height: 1;
    color: #5c7188;
    cursor: pointer;
}

.modal-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.modal-foot {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 14px 20px 18px;
    border-top: 1px solid var(--line);
}

.summary-box {
    background: #f7fafd;
    border: 1px solid var(--line);
    border-radius: 11px;
    padding: 12px 14px;
    font-size: 13px;
}
.summary-box .row { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; }
.summary-box .row span:first-child { color: var(--muted); }
.summary-box .row span:last-child { font-weight: 600; text-align: right; }

/* ---------- Login ---------- */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(900px 500px at 15% 0%, rgba(18, 179, 154, .28), transparent 60%),
        radial-gradient(800px 500px at 90% 100%, rgba(47, 128, 237, .3), transparent 60%),
        #0a1623;
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: #fff;
    border-radius: 20px;
    padding: 30px 28px 26px;
    box-shadow: 0 30px 70px rgba(0, 0, 0, .4);
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.login-card h1 { margin: 0 0 4px; font-size: 20px; letter-spacing: -.3px; }
.login-card .sub { margin: 0 0 20px; color: var(--muted); font-size: 13px; }

.login-form { display: flex; flex-direction: column; gap: 14px; }

.login-foot {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 11px;
    text-align: center;
}

/* ---------- Overlay / responsive ---------- */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(8, 20, 33, .5);
    z-index: 35;
    display: none;
}

.overlay.show { display: block; }

@media (max-width: 1080px) {
    .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); transition: transform .22s ease; }
    .sidebar.open { transform: none; }
    .main { margin-left: 0; }
    .icon-btn { display: inline-flex; }
    .topbar { padding: 12px 16px; }
    .content { padding: 18px 16px 32px; }
    .page-foot { padding: 14px 16px 22px; }
    .topbar-user { display: none; }
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stat-value { font-size: 19px; }
}

@media (max-width: 560px) {
    .stat-grid { grid-template-columns: 1fr; }
    .filters .field { flex: 1 1 100%; }
    .filters .field.half { flex: 1 1 calc(50% - 5px); }
    .card-head { padding: 14px; }
    .card-body { padding: 14px; }
    .toolbar { gap: 8px; }
    .toolbar .spacer { display: none; }
}
