[x-cloak] { display: none !important; }

/* ===== THEME VARIABLES ===== */
:root,

[data-theme="dark"] {
    --bg-dark: #0f1923;
    --bg-panel: #1a2630;
    --bg-sidebar: #111d27;
    --accent: #1D9E75;
    --accent-dark: #0F6E56;
    --text-main: #e0d8cc;
    --text-muted: #6a7a6d;
    --text-faint: #4a5c4d;
    --border: rgba(255,255,255,.07);
    --hover: rgba(255,255,255,.05);
    --item-text: #7a8a7d;
}

[data-theme="light"] {
    --bg-dark: #f4f6f5;
    --bg-panel: #ffffff;
    --bg-sidebar: #ffffff;
    --accent: #1D9E75;
    --accent-dark: #0F6E56;
    --text-main: #1f2d28;
    --text-muted: #6a7a6d;
    --text-faint: #9aa6a0;
    --border: rgba(0,0,0,.09);
    --hover: rgba(0,0,0,.04);
    --item-text: #5a6a5d;
}

* { box-sizing: border-box; }

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: var(--bg-dark);
    color: var(--text-main);
    margin: 0;
    min-height: 100vh;
    transition: background .2s, color .2s;
}

.app-shell { display: flex; min-height: 100vh; position: relative; }

/* ===== SIDEBAR ===== */
.sidebar {
    width: 220px;
    background: var(--bg-sidebar);
    border-right: 0.5px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    z-index: 50;
    transition: transform .25s ease;
}
.sb-brand {
    height: 65px;
    padding: 0 16px;
    border-bottom: 0.5px solid var(--border);
    display: flex;
    align-items: center;
}
.sb-brand-row { display: flex; align-items: center; gap: 10px; }
.sb-icon {
    width: 34px; height: 34px;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    border-radius: 9px; display: flex; align-items: center;
    justify-content: center; font-size: 17px; flex-shrink: 0; color: #fff;
}
.sb-icon img { width: 100%; height: 100%; object-fit: cover; border-radius: 9px; }
.sb-name { font-size: 14px; font-weight: 600; }
.sb-role-badge {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 10px; padding: 2px 8px; border-radius: 20px; margin-top: 3px;
}
.sb-role-badge.admin { background: rgba(127,119,221,.15); color: #7F77DD; }
.sb-role-badge.kasir { background: rgba(29,158,117,.15); color: var(--accent); }
.sb-nav { padding: 10px 8px; flex: 1; overflow-y: auto; }
.sb-section {
    font-size: 10px; font-weight: 600; color: var(--text-faint);
    letter-spacing: .8px; text-transform: uppercase; padding: 10px 8px 4px;
}
.sb-item {
    display: flex; align-items: center; gap: 9px;
    padding: 9px 10px; border-radius: 10px; cursor: pointer;
    color: var(--item-text); font-size: 13px; text-decoration: none;
    transition: all .15s; margin-bottom: 2px;
}
.sb-item i { font-size: 17px; flex-shrink: 0; }
.sb-item:hover { background: var(--hover); color: var(--text-main); }
.sb-item.active { background: rgba(29,158,117,.15); color: var(--accent); }
.sb-footer { padding: 12px 16px; border-top: 0.5px solid var(--border); }
.btn-logout {
    width: 100%; padding: 9px; background: var(--hover);
    border: 0.5px solid var(--border); border-radius: 10px;
    color: var(--item-text); font-size: 13px; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 7px;
    transition: all .15s;
}
.btn-logout:hover { background: rgba(226,75,74,.1); color: #e24b4a; border-color: rgba(226,75,74,.3); }

/* ===== MAIN ===== */
.main { flex: 1; overflow-y: auto; background: var(--bg-dark); min-width: 0; }
.main-header {
    height: 65px;
    padding: 0 22px;
    border-bottom: 0.5px solid var(--border);
    background: var(--bg-sidebar);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.main-header h1 { font-size: 16px; font-weight: 600; margin: 0; }
.main-header p { font-size: 12px; color: var(--text-faint); margin: 2px 0 0; }
.main-body { padding: 20px 22px; }

.header-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.header-titles { min-width: 0; }
.header-titles p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* hamburger + theme toggle buttons */
.icon-btn {
    width: 38px; height: 38px; border-radius: 10px;
    border: 0.5px solid var(--border); background: var(--hover);
    color: var(--text-main); font-size: 19px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; transition: all .15s;
}
.icon-btn:hover { background: var(--accent); color: #fff; border-color: transparent; }
.btn-hamburger { display: none; }

/* ===== PANEL ===== */
.panel { background: var(--bg-panel); border: 0.5px solid var(--border); border-radius: 14px; }

/* ===== BACKDROP (mobile) ===== */
.sb-backdrop {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 40;
}

/* ===== RESPONSIVE: tablet & HP ===== */
@media (max-width: 991px) {
    .sidebar {
        position: fixed;
        top: 0; left: 0; bottom: 0;
        transform: translateX(-100%);
        box-shadow: 4px 0 24px rgba(0,0,0,.3);
    }
    .sidebar.open { transform: translateX(0); }
    .sb-backdrop.show { display: block; }
    .btn-hamburger { display: flex; }
    .main-body { padding: 16px; }
    .main-header { padding: 0 16px; }
}

/* ===== FLASH MESSAGE ===== */
.flash {
    position: fixed;
    top: 18px; right: 18px;
    z-index: 9999;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 13px;
    display: flex; align-items: center; gap: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,.25);
}
.flash-success { background: #1D9E75; color: #fff; }
.flash-error { background: #e24b4a; color: #fff; }

/* ===== TABLE ===== */
.tbl-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; }
table.data th {
    padding: 11px 14px; text-align: left;
    font-size: 11px; font-weight: 600; color: var(--text-faint);
    text-transform: uppercase; letter-spacing: .6px;
    border-bottom: 0.5px solid var(--border);
    white-space: nowrap;
}
table.data td {
    padding: 12px 14px; font-size: 13px;
    color: var(--text-main);
    border-bottom: 0.5px solid var(--border);
}
table.data tr:last-child td { border-bottom: none; }
table.data tr:hover td { background: var(--hover); }

/* ===== BUTTONS ===== */
.btn-primary-c {
    padding: 9px 16px;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #fff; border: none; border-radius: 10px;
    font-size: 13px; font-weight: 500; cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px;
    transition: all .15s;
}
.btn-primary-c:hover { box-shadow: 0 4px 14px rgba(29,158,117,.4); }
.act-btn {
    padding: 6px 11px; border-radius: 8px;
    border: 0.5px solid var(--border); background: var(--hover);
    color: var(--text-muted); font-size: 12px; cursor: pointer;
    transition: all .15s; margin-right: 4px;
}
.act-btn:hover { color: var(--text-main); }
.act-btn.warn:hover { background: rgba(239,159,39,.15); color: #EF9F27; border-color: rgba(239,159,39,.3); }
.act-btn.del:hover { background: rgba(226,75,74,.15); color: #e24b4a; border-color: rgba(226,75,74,.3); }

/* ===== TOOLBAR ===== */
.toolbar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; margin-bottom: 16px; flex-wrap: wrap;
}
@media (max-width: 575px) {
    .toolbar { flex-direction: column; align-items: stretch; }
    .toolbar .search-box { width: 100%; }
    .toolbar .search-box input { width: 100%; }
    .toolbar .btn-primary-c { width: 100%; justify-content: center; }
}
.search-box {
    display: flex; align-items: center; gap: 8px;
    background: var(--bg-panel); border: 0.5px solid var(--border);
    border-radius: 10px; padding: 8px 12px;
}
.search-box input {
    background: transparent; border: none; outline: none;
    color: var(--text-main); font-size: 13px; width: 200px;
}
.search-box i { color: var(--text-faint); }

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed; inset: 0; z-index: 1000;
    background: rgba(0,0,0,.55);
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
.modal-card {
    background: var(--bg-panel);
    border: 0.5px solid var(--border);
    border-radius: 16px;
    width: 100%; max-width: 420px;
    padding: 24px;
}
.modal-card h3 { font-size: 16px; margin: 0 0 16px; }
.modal-actions {
    display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px;
}
.btn-ghost {
    padding: 9px 16px; border-radius: 10px;
    border: 0.5px solid var(--border); background: transparent;
    color: var(--text-muted); font-size: 13px; cursor: pointer;
}
.btn-ghost:hover { background: var(--hover); color: var(--text-main); }

/* ===== PAGINATION ===== */
.pagination-wrap { margin-top: 16px; }
.pagination-wrap nav { display: flex; justify-content: center; }

/* ===== FILTER ROW ===== */
.filter-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filter-select {
    padding: 9px 12px; background: var(--bg-panel);
    border: 0.5px solid var(--border); border-radius: 10px;
    color: var(--text-main); font-size: 13px; outline: none; cursor: pointer;
}

/* ===== MENU THUMBNAIL ===== */
.menu-thumb {
    width: 42px; height: 42px; border-radius: 9px;
    object-fit: cover; display: block;
}
.menu-thumb-empty {
    display: flex; align-items: center; justify-content: center;
    background: var(--hover); color: var(--text-faint); font-size: 18px;
}

/* ===== BADGE ===== */
.badge-c {
    display: inline-block; padding: 3px 10px;
    border-radius: 20px; font-size: 11px; font-weight: 500;
}
.badge-green { background: rgba(29,158,117,.15); color: #1D9E75; }
.badge-red { background: rgba(226,75,74,.15); color: #e24b4a; }
.badge-amber { background: rgba(239,159,39,.15); color: #EF9F27; }
.badge-toggle {
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all .15s;
}
.badge-toggle:hover { filter: brightness(1.15); transform: translateY(-1px); }

/* ===== FORM HELPERS ===== */
.lbl { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.inp {
    width: 100%; padding: 11px 13px;
    background: var(--hover); border: 0.5px solid var(--border);
    border-radius: 10px; color: var(--text-main); font-size: 14px; outline: none;
}
.inp:focus { border-color: rgba(29,158,117,.6); }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ===== FOTO UPLOAD ===== */
.foto-upload { display: flex; gap: 14px; align-items: center; }
.foto-preview {
    width: 72px; height: 72px; border-radius: 12px; flex-shrink: 0;
    background: var(--hover); border: 0.5px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden; color: var(--text-faint); font-size: 24px;
}
.foto-preview img { width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 575px) {
    .toolbar .filter-row { width: 100%; flex-direction: column; align-items: stretch; }
    .filter-row .search-box, .filter-select { width: 100%; }
    .form-grid-2 { grid-template-columns: 1fr; }
}

/* ===== TRANSAKSI FILTER ===== */
.trx-filter {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr auto;
    gap: 12px;
    align-items: end;
}
.trx-filter-actions { display: flex; gap: 8px; }

/* ===== DETAIL MODAL ===== */
.detail-meta {
    background: var(--hover); border-radius: 10px; padding: 12px; margin-bottom: 14px;
}
.detail-meta div {
    display: flex; justify-content: space-between; font-size: 13px; padding: 3px 0;
}
.detail-meta span:first-child { color: var(--text-faint); }
.detail-items {
    max-height: 240px; overflow-y: auto; margin-bottom: 14px;
}
.detail-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 0; border-bottom: 0.5px solid var(--border);
}
.detail-item:last-child { border-bottom: none; }
.detail-summary { border-top: 0.5px solid var(--border); padding-top: 10px; }

@media (max-width: 767px) {
    .trx-filter { grid-template-columns: 1fr; }
    .trx-filter-actions { flex-direction: row; }
    .trx-filter-actions .btn-primary-c, .trx-filter-actions .btn-ghost { flex: 1; justify-content: center; }
}

/* ===== STAT CARDS ===== */
.stats-grid {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 12px; margin-bottom: 20px;
}
.stats-grid-2 {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
}
.stat-card {
    background: var(--bg-panel); border: 0.5px solid var(--border);
    border-radius: 14px; padding: 16px;
}
.stat-card.accent {
    border-color: rgba(29,158,117,.3);
    background: linear-gradient(135deg, rgba(29,158,117,.08), rgba(15,110,86,.04));
}
.stat-icon { font-size: 24px; margin-bottom: 8px; color: var(--accent); }
.stat-label { font-size: 11px; color: var(--text-faint); margin-bottom: 8px; }
.stat-val { font-size: 20px; font-weight: 700; color: var(--text-main); }

/* ===== DASHBOARD LAYOUT ===== */
.dash-row {
    display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; align-items: start;
}
.top-menu-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 0; border-bottom: 0.5px solid var(--border);
}
.top-menu-item:last-child { border-bottom: none; }
.top-rank {
    width: 26px; height: 26px; border-radius: 8px; flex-shrink: 0;
    background: rgba(29,158,117,.15); color: var(--accent);
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700;
}

@media (max-width: 991px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .dash-row { grid-template-columns: 1fr; }
}
@media (max-width: 575px) {
    .stats-grid-2 { grid-template-columns: 1fr; }
}

/* ===== LAPORAN ===== */
.laporan-filter {
    display: flex; gap: 12px; align-items: end; flex-wrap: wrap;
}
.laporan-filter > div { min-width: 150px; }
.laporan-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; margin-bottom: 16px; flex-wrap: wrap;
}

@media (max-width: 767px) {
    .laporan-filter { flex-direction: column; align-items: stretch; }
    .laporan-filter > div { min-width: 0; }
    .laporan-head { flex-direction: column; align-items: stretch; }
    .laporan-head > div:last-child { display: flex; }
    .laporan-head > div:last-child form, .laporan-head > div:last-child a { flex: 1; }
}

/* ===== PASSWORD FIELD ===== */
.pw-wrap { position: relative; display: flex; align-items: center; }
.pw-wrap .inp { padding-right: 76px; }
.pw-icon {
    position: absolute; width: 32px; height: 32px;
    border: none; background: transparent; color: var(--text-muted);
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    font-size: 17px; border-radius: 8px;
}
.pw-icon:hover { color: var(--accent); background: var(--hover); }
.pw-wrap .pw-icon:nth-last-child(2) { right: 40px; }
.pw-wrap .pw-icon:last-child { right: 6px; }

.pw-strength { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.pw-bar { flex: 1; height: 5px; background: var(--hover); border-radius: 3px; overflow: hidden; }
.pw-bar-fill { height: 100%; transition: all .25s; border-radius: 3px; }
.pw-strength-label { font-size: 11px; font-weight: 600; min-width: 42px; }

.pw-weak { background-color: #e24b4a; color: #e24b4a; }
.pw-fair { background-color: #EF9F27; color: #EF9F27; }
.pw-good { background-color: #378ADD; color: #378ADD; }
.pw-strong { background-color: #1D9E75; color: #1D9E75; }

.pw-hint {
    font-size: 11px; color: var(--text-muted); margin: 8px 0 0;
    display: flex; align-items: center; gap: 5px; flex-wrap: wrap;
}
.pw-copy {
    border: none; background: var(--accent); color: #fff;
    font-size: 11px; padding: 2px 8px; border-radius: 6px; cursor: pointer;
}
