/* =====================================================================
   Warung Kasir — Tema Modern Dark (terinspirasi mockup "modern-neon")
   ===================================================================== */

:root {
    --bg: #0e1210;
    --bg-soft: #12716b0d;
    --surface: #161b18;
    --surface-2: #1c2220;
    --surface-hover: #212824;
    --border: #262e2a;
    --border-soft: #1e2422;
    --text: #eef3f0;
    --text-dim: #9aa8a1;
    --text-faint: #6b786f;
    --accent: #7fe6c2;
    --accent-strong: #4fd8ac;
    --accent-glow: rgba(127, 230, 194, 0.35);
    --amber: #e0a458;
    --danger: #e58a8a;
    --danger-strong: #d96b6b;
    --radius-lg: 18px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
}

:root[data-theme="light"] {
    --bg: #f5f7f6;
    --bg-soft: #eaf5f1;
    --surface: #ffffff;
    --surface-2: #f1f4f3;
    --surface-hover: #e7ebe9;
    --border: #dfe4e2;
    --border-soft: #e6eae8;
    --text: #16201c;
    --text-dim: #4b5750;
    --text-faint: #838e88;
    --accent: #1f9d76;
    --accent-strong: #17805f;
    --accent-glow: rgba(31, 157, 118, 0.2);
    --amber: #b9762c;
    --danger: #c8504f;
    --danger-strong: #b23f3f;
    --shadow-card: 0 1px 2px rgba(16, 24, 21, 0.05), 0 8px 24px -12px rgba(16, 24, 21, 0.12);
}

* { box-sizing: border-box; }

body {
    background: radial-gradient(1200px 600px at 15% -10%, rgba(127,230,194,0.06), transparent),
                var(--bg);
    color: var(--text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-height: 100vh;
}

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

::selection { background: var(--accent-glow); }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #333d38; }

/* ---------------------------------------------------------------------
   Layout: sidebar + topbar
   --------------------------------------------------------------------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: 240px;
    flex-shrink: 0;
    background: var(--surface);
    border-right: 1px solid var(--border-soft);
    padding: 22px 16px;
    position: fixed;
    top: 0; bottom: 0; left: 0;
    overflow-y: auto;
    z-index: 40;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 8px 22px 8px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--border-soft);
}

.logo-dot {
    width: 34px; height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent), #3a9d82);
    display: flex; align-items: center; justify-content: center;
    color: #05231b;
    font-weight: 700;
    font-size: 15px;
    box-shadow: 0 0 0 1px rgba(127,230,194,0.25), 0 6px 16px -6px var(--accent-glow);
}

.sidebar-brand .brand-name { font-weight: 600; font-size: 15px; line-height: 1.2; }
.sidebar-brand .brand-sub { font-size: 11.5px; color: var(--text-faint); }

.nav-section-label {
    font-size: 10.5px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin: 18px 10px 8px;
}

.nav-link-app {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-dim);
    font-size: 13.5px;
    font-weight: 500;
    margin-bottom: 2px;
    transition: background .15s ease, color .15s ease;
}

.nav-link-app svg { width: 18px; height: 18px; flex-shrink: 0; opacity: .85; }

.nav-link-app:hover { background: var(--surface-2); color: var(--text); }

.nav-link-app.active {
    background: linear-gradient(180deg, rgba(127,230,194,0.14), rgba(127,230,194,0.05));
    color: var(--accent);
    box-shadow: inset 0 0 0 1px rgba(127,230,194,0.18);
}

.sidebar-user {
    margin-top: 18px;
    padding: 12px;
    border-radius: var(--radius-md);
    background: var(--surface-2);
    border: 1px solid var(--border-soft);
    display: flex;
    align-items: center;
    gap: 10px;
}

.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    margin: 6px 0 4px;
    border-radius: var(--radius-md);
    background: var(--surface-2);
    border: 1px solid var(--border-soft);
}

.theme-toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    color: var(--text-dim);
    font-weight: 600;
}

.theme-toggle-label .icon { font-size: 14px; line-height: 1; }

.theme-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    flex-shrink: 0;
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.theme-switch .slider {
    position: absolute;
    inset: 0;
    cursor: pointer;
    background: var(--border);
    border-radius: 999px;
    transition: background .2s ease;
}

.theme-switch .slider::before {
    content: "";
    position: absolute;
    left: 3px;
    top: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,.35);
    transition: transform .2s ease;
}

.theme-switch input:checked + .slider { background: var(--accent); }
.theme-switch input:checked + .slider::before { transform: translateX(18px); }
.theme-switch input:focus-visible + .slider { box-shadow: 0 0 0 3px var(--accent-glow); }

.avatar-circle {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    font-size: 12.5px; font-weight: 600; color: var(--accent);
}

.main-content { margin-left: 240px; flex: 1; min-width: 0; padding: 24px 28px 40px; }

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
    gap: 16px;
    flex-wrap: wrap;
}

.topbar h1 { font-size: 20px; font-weight: 600; margin: 0; }
.topbar .sub { color: var(--text-dim); font-size: 13px; margin-top: 2px; }

/* ---------------------------------------------------------------------
   Cards
   --------------------------------------------------------------------- */
.card-app {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
}

.card-app .card-app-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-soft);
    display: flex; align-items: center; justify-content: space-between;
}

.card-app .card-app-body { padding: 20px; }

.label-caps {
    font-size: 11px;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--amber);
    font-weight: 600;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    box-shadow: var(--shadow-card);
}

.stat-card .stat-value {
    font-size: 26px;
    font-weight: 600;
    color: var(--accent);
    margin: 6px 0 4px;
    letter-spacing: -0.01em;
}

.stat-card .stat-label { font-size: 12.5px; color: var(--text-dim); }

.stat-trend { font-size: 12px; font-weight: 600; }
.stat-trend.up { color: var(--accent); }
.stat-trend.down { color: var(--danger); }

/* ---------------------------------------------------------------------
   Table
   --------------------------------------------------------------------- */
.table-app { width: 100%; border-collapse: collapse; font-size: 13.5px; }

.table-app thead th {
    text-align: left;
    font-size: 11px;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--text-faint);
    font-weight: 600;
    padding: 0 12px 10px;
    border-bottom: 1px solid var(--border-soft);
}

.table-app tbody td {
    padding: 12px;
    border-bottom: 1px solid var(--border-soft);
    color: var(--text);
    vertical-align: middle;
}

.table-app tbody tr:last-child td { border-bottom: none; }
.table-app tbody tr:hover { background: var(--surface-2); }

.badge-app {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 11.5px;
    font-weight: 600;
    border: 1px solid transparent;
}

.badge-qris { background: rgba(127,230,194,0.12); color: var(--accent); border-color: rgba(127,230,194,0.25); }
.badge-tunai { background: rgba(224,164,88,0.12); color: var(--amber); border-color: rgba(224,164,88,0.25); }
.badge-lunas { background: rgba(127,230,194,0.12); color: var(--accent); }
.badge-pending { background: rgba(224,164,88,0.14); color: var(--amber); }
.badge-batal { background: rgba(217,107,107,0.14); color: var(--danger); }

/* ---------------------------------------------------------------------
   Buttons & Forms
   --------------------------------------------------------------------- */
.btn-app {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-weight: 600;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    cursor: pointer;
    transition: all .15s ease;
}

.btn-app:hover { background: var(--surface-hover); color: var(--text); }

.btn-primary-app {
    background: linear-gradient(180deg, var(--accent), var(--accent-strong));
    color: #062017;
    border-color: transparent;
    box-shadow: 0 6px 20px -8px var(--accent-glow);
}

.btn-primary-app:hover { filter: brightness(1.06); color: #062017; }

.btn-danger-app {
    background: rgba(217,107,107,0.12);
    color: var(--danger);
    border-color: rgba(217,107,107,0.3);
}

.btn-danger-app:hover { background: rgba(217,107,107,0.2); color: var(--danger); }

.btn-sm-app { padding: 6px 12px; font-size: 12.5px; }

.form-control-app, .form-select-app {
    width: 100%;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: var(--radius-sm);
    padding: 10px 13px;
    font-size: 13.5px;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.form-control-app::placeholder { color: var(--text-faint); }

.form-control-app:focus, .form-select-app:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(127,230,194,0.15);
}

.form-label-app {
    font-size: 12.5px;
    color: var(--text-dim);
    font-weight: 600;
    margin-bottom: 6px;
    display: block;
}

/* ---------------------------------------------------------------------
   Login page
   --------------------------------------------------------------------- */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: radial-gradient(900px 500px at 50% 0%, rgba(127,230,194,0.08), transparent), var(--bg);
}

.login-shell {
    width: 100%;
    max-width: 920px;
    min-height: 560px;
    display: flex;
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.login-card {
    flex: 1 1 50%;
    width: 100%;
    max-width: 420px;
    padding: 40px 38px;
    margin: auto;
}

/* ---- Panel ilustrasi ---- */
.login-visual {
    position: relative;
    flex: 1 1 52%;
    overflow: hidden;
    padding: 40px 38px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #eafff4;
    background: linear-gradient(160deg, #123128 0%, #0d201a 55%, #0a1712 100%);
}

.visual-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: .55;
    pointer-events: none;
}
.visual-blob.blob-1 { width: 260px; height: 260px; background: var(--accent); top: -70px; right: -70px; }
.visual-blob.blob-2 { width: 220px; height: 220px; background: #3a9d82; bottom: -80px; left: -50px; opacity: .4; }

.visual-grid {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255,255,255,.10) 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: .5;
    pointer-events: none;
}

.visual-content { position: relative; z-index: 2; }

.visual-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .02em;
    color: var(--accent);
    background: rgba(127,230,194,0.12);
    border: 1px solid rgba(127,230,194,0.25);
    padding: 5px 12px;
    border-radius: 999px;
    margin-bottom: 18px;
}

.visual-content h2 {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 10px;
}

.visual-content p {
    font-size: 13.5px;
    color: rgba(234,255,244,0.7);
    margin: 0 0 20px;
    max-width: 320px;
}

.visual-features { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.visual-features li { display: flex; align-items: center; gap: 10px; font-size: 13px; color: rgba(234,255,244,0.9); }
.visual-features .chk {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px; height: 20px;
    border-radius: 50%;
    background: rgba(127,230,194,0.18);
    color: var(--accent);
    font-size: 11px;
    flex-shrink: 0;
}

/* ---- Ilustrasi mock UI ---- */
.visual-illustration { position: relative; z-index: 2; height: 190px; margin-top: 18px; }

.mock-card {
    position: absolute;
    left: 6%;
    bottom: 0;
    width: 220px;
    background: rgba(255,255,255,.07);
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 14px;
    padding: 14px;
    backdrop-filter: blur(6px);
    box-shadow: 0 20px 40px -18px rgba(0,0,0,.5);
    animation: float-bob 5s ease-in-out infinite;
}

.mock-card-head { display: flex; gap: 5px; margin-bottom: 12px; }
.mock-dot { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.25); }
.mock-dot:first-child { background: var(--accent); }

.mock-chart { display: flex; align-items: flex-end; gap: 5px; height: 56px; margin-bottom: 12px; }
.mock-chart span {
    flex: 1;
    height: var(--h, 40%);
    border-radius: 4px 4px 1px 1px;
    background: linear-gradient(180deg, var(--accent), var(--accent-strong));
    opacity: .9;
}

.mock-row { display: flex; flex-direction: column; gap: 6px; }
.mock-line { height: 6px; border-radius: 3px; background: rgba(255,255,255,.16); }

.float-badge {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.16);
    color: #eafff4;
    padding: 7px 12px;
    border-radius: 999px;
    backdrop-filter: blur(6px);
    box-shadow: 0 10px 24px -12px rgba(0,0,0,.5);
}
.float-badge.badge-trend { top: 6px; right: 10%; color: var(--accent); animation: float-bob 4.2s ease-in-out infinite; }
.float-badge.badge-receipt { bottom: 34%; right: 0; animation: float-bob 4.8s ease-in-out infinite .4s; }

.float-coin {
    position: absolute;
    width: 34px; height: 34px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 10.5px;
    font-weight: 700;
    color: #4a3410;
    background: linear-gradient(160deg, #f3cf82, var(--amber));
    box-shadow: 0 10px 20px -8px rgba(0,0,0,.5);
}
.float-coin.coin-1 { top: 20px; left: 32%; animation: float-bob 3.6s ease-in-out infinite .2s; }
.float-coin.coin-2 { bottom: 8px; right: 22%; width: 26px; height: 26px; font-size: 9px; animation: float-bob 4.4s ease-in-out infinite .8s; }

@keyframes float-bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@media (max-width: 860px) {
    .login-visual { display: none; }
    .login-shell { min-height: 0; }
    .login-card { max-width: 420px; margin: 0; }
}

/* ---------------------------------------------------------------------
   Kasir (POS) screen
   --------------------------------------------------------------------- */
.pos-shell { display: flex; gap: 18px; align-items: flex-start; }
.pos-products { flex: 1; min-width: 0; }
.pos-cart { width: 380px; flex-shrink: 0; position: sticky; top: 24px; }

.category-tab {
    padding: 7px 15px;
    border-radius: 100px;
    font-size: 12.5px;
    font-weight: 600;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text-dim);
    cursor: pointer;
    white-space: nowrap;
}

.category-tab.active {
    background: rgba(127,230,194,0.14);
    color: var(--accent);
    border-color: rgba(127,230,194,0.35);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}

.product-card {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    padding: 14px;
    cursor: pointer;
    transition: border-color .15s ease, transform .1s ease;
    text-align: left;
}

.product-card:hover { border-color: rgba(127,230,194,0.4); transform: translateY(-1px); }
.product-card:disabled, .product-card.out-of-stock { opacity: .4; cursor: not-allowed; }

.product-card .cat-label {
    font-size: 10px;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--amber);
    font-weight: 700;
}

.product-card .prod-name { font-size: 13.5px; font-weight: 600; margin: 6px 0 4px; color: var(--text); }
.product-card .prod-price { font-size: 13px; color: var(--accent); font-weight: 600; }
.product-card .prod-stock { font-size: 11px; color: var(--text-faint); margin-top: 2px; }

.cart-item { padding: 12px 0; border-bottom: 1px solid var(--border-soft); }
.cart-item:last-child { border-bottom: none; }

.qty-control {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 100px;
    padding: 3px 4px;
}

.qty-control button {
    width: 22px; height: 22px;
    border-radius: 50%;
    border: none;
    background: var(--surface-hover);
    color: var(--text);
    font-weight: 700;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    line-height: 1;
}

.qty-control button:hover { background: var(--accent); color: #062017; }

.pay-method-btn {
    flex: 1;
    padding: 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text-dim);
    font-weight: 600;
    font-size: 13.5px;
    cursor: pointer;
    text-align: center;
}

.pay-method-btn.active {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(127,230,194,0.1);
    box-shadow: 0 0 0 1px rgba(127,230,194,0.25);
}

.qris-box {
    border: 1px solid rgba(127,230,194,0.3);
    border-radius: var(--radius-md);
    padding: 18px;
    background: rgba(127,230,194,0.05);
    text-align: center;
}

.qris-code-placeholder {
    width: 160px; height: 160px;
    margin: 12px auto;
    background: #fff;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: #333;
    font-size: 11px;
    padding: 10px;
    text-align: center;
}

/* ---------------------------------------------------------------------
   Modal (native dialog-style, no framework needed)
   --------------------------------------------------------------------- */
.modal-app-backdrop {
    position: fixed; inset: 0;
    background: rgba(3, 6, 5, 0.65);
    backdrop-filter: blur(2px);
    display: none;
    align-items: center; justify-content: center;
    z-index: 100;
    padding: 20px;
}

.modal-app-backdrop.show { display: flex; }

.modal-app {
    width: 100%; max-width: 480px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px -20px rgba(0,0,0,.7);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-app-header {
    padding: 18px 22px;
    border-bottom: 1px solid var(--border-soft);
    display: flex; align-items: center; justify-content: space-between;
}

.modal-app-body { padding: 22px; }
.modal-app-footer { padding: 16px 22px; border-top: 1px solid var(--border-soft); display: flex; justify-content: flex-end; gap: 10px; }

/* ---------------------------------------------------------------------
   Misc
   --------------------------------------------------------------------- */
.divider-soft { border-top: 1px solid var(--border-soft); margin: 16px 0; }

.empty-state { text-align: center; padding: 40px 20px; color: var(--text-faint); }

.alert-app {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    margin-bottom: 16px;
    border: 1px solid transparent;
}

.alert-success-app { background: rgba(127,230,194,0.1); color: var(--accent); border-color: rgba(127,230,194,0.25); }
.alert-error-app { background: rgba(217,107,107,0.1); color: var(--danger); border-color: rgba(217,107,107,0.3); }

.text-dim { color: var(--text-dim); }
.text-faint { color: var(--text-faint); }
.text-accent { color: var(--accent); }
.text-amber { color: var(--amber); }

@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; padding: 18px; }
    .pos-shell { flex-direction: column; }
    .pos-cart { width: 100%; position: static; }
}
