/*
 * WARKOP DEPAN RUMAH
 * Stylesheet utama - Laravel 12 + Livewire
 *
 * Dirapikan berdasarkan kelompok komponen.
 * Class asli dipertahankan; pagination custom ditambahkan.
 */


/* ==========================================================
   01. VARIABEL WARNA DAN TEMA
   ========================================================== */

:root {
    --ink: #2e261f;
    --coffee: #65462d;
    --dark: #392c23;
    --sand: #fcf9f4;
    --line: #e8e0d4;
    --muted: #7f756b;
    --white: #fff;
    --accent: #99663f;
    --green: #206b42;
    --red: #a34034;
    --shadow: 0 5px 22px rgba(48,34,20,.05);
}


/* ==========================================================
   02. RESET DAN TIPOGRAFI DASAR
   ========================================================== */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #f7f5f1;
    color: var(--ink);
    font: 14px/1.5 system-ui,-apple-system,Segoe UI,Roboto,sans-serif;
}

h1,
h2,
h3 {
    margin: 0;
}

h1 {
    font-size: 28px;
    line-height: 1.2;
}

h2 {
    font-size: 18px;
}

.muted {
    color: var(--muted);
}

.fine-print {
    font-size: 12px;
    color: var(--muted);
}

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

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}


/* ==========================================================
   03. LAYOUT UTAMA
   ========================================================== */

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


/* ==========================================================
   04. SIDEBAR DAN NAVIGASI
   ========================================================== */

.sidebar {
    width: 252px;
    flex-shrink: 0;
    background: var(--dark);
    color: #fff;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 25px 16px;
    position: sticky;
    top: 0;
    height: 100vh;
}

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

.brand strong {
    display: block;
    font-size: 14px;
    line-height: 1.3;
}

.brand small {
    display: block;
    color: #cfc2b3;
    font-size: 11px;
}

.brand-icon {
    height: 42px;
    width: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: #bf9463;
    color: #fff;
    font: 700 24px Georgia,serif;
    flex-shrink: 0;
}

.side-label {
    font-size: 10px;
    letter-spacing: 1.6px;
    color: #b4a291;
    margin: 16px 10px 0;
}

.nav {
    display: grid;
    gap: 5px;
}

.nav a {
    display: block;
    color: #e2d7ca;
    padding: 11px 14px;
    border-radius: 10px;
    font-weight: 550;
}

.nav a:hover,
.nav a.active {
    background: #6e523b;
    color: #fff;
}

.sidebar-bottom {
    margin-top: auto;
    border-top: 1px solid #655141;
    padding-top: 16px;
}

.user-name {
    font-weight: 700;
    margin-bottom: 6px;
}

.main {
    min-width: 0;
    flex: 1;
}


/* ==========================================================
   05. TOPBAR DAN AREA HALAMAN
   ========================================================== */

.topbar {
    background: #fff;
    padding: 17px 30px;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
}

.topbar-title {
    font-weight: 700;
}

.topbar-date {
    color: var(--muted);
}

.page {
    padding: 28px;
    max-width: 1540px;
    margin: auto;
}

.space {
    display: grid;
    gap: 20px;
}

.page-header {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
}

.page-header p {
    margin: 7px 0 0;
    color: var(--muted);
}


/* ==========================================================
   06. STATISTIK DASHBOARD
   ========================================================== */

.stats {
    display: grid;
    grid-template-columns: repeat(4,minmax(0,1fr));
    gap: 16px;
}

.stats-two {
    grid-template-columns: repeat(2,minmax(0,1fr));
}

.stat {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 20px;
    box-shadow: var(--shadow);
}

.stat span {
    display: block;
    color: var(--muted);
    margin-bottom: 10px;
}

.stat strong {
    font-size: 25px;
}


/* ==========================================================
   07. PANEL DAN GRID KONTEN
   ========================================================== */

.panel {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 21px;
    min-width: 0;
    box-shadow: var(--shadow);
}

.panel h2 {
    margin: 0 0 15px;
}

.two-col {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 18px;
}

.workspace-grid {
    display: grid;
    grid-template-columns: minmax(270px,.8fr) minmax(0,1.8fr);
    gap: 18px;
    align-items: start;
}

.pos-grid {
    display: grid;
    grid-template-columns: minmax(0,1.65fr) minmax(320px,.85fr);
    gap: 18px;
    align-items: start;
}


/* ==========================================================
   08. HEADER KONTEN
   ========================================================== */

.section-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
}

.section-header h2 {
    margin: 0;
}


/* ==========================================================
   09. FORM, INPUT, DAN FILTER
   ========================================================== */

.form-stack {
    display: grid;
    gap: 14px;
    margin-top: 17px;
}

.form-stack label,
.filter-bar label {
    display: grid;
    gap: 7px;
    font-weight: 650;
    font-size: 13px;
}

.form-stack input:not([type=checkbox]),
.form-stack select,
.filter-bar input,
.search {
    width: 100%;
    border: 1px solid #dcd2c7;
    border-radius: 9px;
    padding: 11px 12px;
    background: #fff;
    color: var(--ink);
    outline-color: #a77c56;
}

.form-stack label.check {
    display: flex;
    align-items: center;
    gap: 9px;
    font-weight: 500;
}

.form-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}


/* ==========================================================
   10. TOMBOL
   ========================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    gap: 6px;
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: 10px 14px;
    background: #fff;
    color: var(--ink);
    font-weight: 650;
    line-height: 1.2;
    cursor: pointer;
}

.btn:hover {
    filter: brightness(.95);
}

.btn:disabled {
    opacity: .5;
    cursor: wait;
}

.btn-primary {
    background: var(--coffee);
    border-color: var(--coffee);
    color: #fff;
}

.btn-outline {
    background: #fff;
    color: var(--coffee);
    border-color: #b9a18c;
}

.btn-ghost {
    background: transparent;
    color: inherit;
}

.btn-danger {
    color: var(--red);
    border-color: #ead1ca;
}

.btn-small {
    padding: 6px 10px;
    font-size: 12px;
}

.full {
    width: 100%;
    margin-top: 12px;
}

.search {
    max-width: 250px;
}


/* ==========================================================
   11. TABEL PRODUK DAN DATA
   ========================================================== */

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

table {
    border-collapse: collapse;
    width: 100%;
    white-space: nowrap;
}

th {
    text-align: left;
    background: #faf8f5;
    color: #776b60;
    font-size: 12px;
    font-weight: 700;
}

th,
td {
    padding: 12px 10px;
    border-bottom: 1px solid #f0eae4;
}

tbody tr:hover {
    background: #fcfaf7;
}

.actions {
    display: flex;
    gap: 6px;
}


/* ==========================================================
   12. LABEL, STATUS, DAN NOTIFIKASI
   ========================================================== */

.pill {
    display: inline-flex;
    padding: 4px 9px;
    border-radius: 40px;
    background: #eee8df;
    color: #70513a;
    font-size: 11px;
    font-weight: 750;
}

.pill-danger {
    background: #fde9e5;
    color: #a33c2a;
}

.pill-green {
    background: #e5f5eb;
    color: #23663e;
}

.alert {
    padding: 12px 15px;
    border-radius: 9px;
    border: 1px solid #bee2c9;
}

.alert-success {
    background: #e8f7ed;
    color: #1a653a;
}

.alert-error {
    background: #fff0eb;
    border-color: #f1bdad;
    color: #9e3b26;
}

.error {
    color: var(--red);
    font-weight: 500;
}

.empty {
    padding: 24px;
    text-align: center;
    color: var(--muted);
}

.table-note {
    font-size: 12px;
    color: var(--muted);
}

.subline {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 400;
}


/* ==========================================================
   13. DASHBOARD DAN GRAFIK
   ========================================================== */

.mini-row {
    display: flex;
    gap: 15px;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f0eae4;
}

.chart {
    height: 230px;
    display: flex;
    gap: 15px;
    padding: 20px 4px 0;
    align-items: end;
}

.chart-col {
    flex: 1;
    min-width: 0;
    text-align: center;
}

.chart-col small {
    font-size: 11px;
    color: var(--muted);
}

.chart-rail {
    height: 185px;
    display: flex;
    align-items: flex-end;
    border-bottom: 1px solid var(--line);
}

.chart-bar {
    width: 100%;
    background: linear-gradient(#c59a6b,#65462d);
    border-radius: 6px 6px 0 0;
    min-height: 4px;
}


/* ==========================================================
   14. PRODUK KASIR (POS)
   ========================================================== */

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

.product-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    text-align: left;
    padding: 15px;
    border-radius: 12px;
    border: 1px solid #e6ddd2;
    background: #fff;
    min-width: 0;
}

.product-card:hover {
    border-color: #9c764f;
    background: #fffcf8;
}

.product-card strong {
    font-size: 14px;
}

.product-card small,
.stock-label {
    color: var(--muted);
    font-size: 11px;
}

.product-card b {
    color: var(--coffee);
}

.product-symbol {
    width: 40px;
    height: 40px;
    background: #efe7dd;
    color: var(--coffee);
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-weight: 800;
    margin-bottom: 6px;
}


/* ==========================================================
   15. KERANJANG DAN TOTAL PEMBAYARAN
   ========================================================== */

.cart-list {
    display: grid;
    gap: 2px;
    margin: 12px 0;
}

.cart-item {
    border-bottom: 1px solid var(--line);
    padding: 13px 0;
    display: grid;
    grid-template-columns: minmax(0,1fr) auto;
    gap: 7px;
}

.cart-item b {
    grid-column: 1/-1;
    text-align: right;
}

.qty-control {
    display: flex;
    align-items: center;
    gap: 9px;
}

.qty-control button {
    width: 28px;
    height: 28px;
    border: 1px solid #d6caba;
    background: #fff;
    border-radius: 7px;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f2ece4;
    border-radius: 10px;
    padding: 16px;
    margin: 18px 0;
}

.cart-total strong {
    font-size: 20px;
}


/* ==========================================================
   16. FILTER LAPORAN
   ========================================================== */

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 14px;
}

.filter-bar label {
    min-width: 170px;
}


/* ==========================================================
   17. HALAMAN LOGIN
   ========================================================== */

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: linear-gradient(120deg,#e9dfd0,#faf6ef);
}

.login-card {
    background: #fff;
    padding: 34px;
    border-radius: 17px;
    max-width: 420px;
    width: calc(100% - 30px);
    box-shadow: 0 20px 80px rgba(58,38,20,.12);
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 13px;
}

.login-brand h1 {
    font-size: 23px;
}

.login-card .form-stack {
    margin: 28px 0;
}


/* ==========================================================
   18. HALAMAN NOTA
   ========================================================== */

.receipt-body {
    background: #f7f5f1;
}

/* ==========================================================
   19. PAGINATION KUSTOM
   Info hasil di kiri, tombol navigasi di kanan.
   Digunakan bersama .pagination-container pada Blade.
   ========================================================== */

.pagination-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.pagination-info {
    color: var(--muted);
    font-size: 13px;
}

.pagination-buttons {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 6px;
    margin-left: auto;
}

.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--white);
    color: var(--ink);
    font-size: 13px;
    font-weight: 650;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease;
}

.page-btn:hover:not(:disabled) {
    background: var(--sand);
    border-color: var(--coffee);
}

.page-btn.active {
    background: var(--coffee);
    border-color: var(--coffee);
    color: var(--white);
}

.page-btn:disabled {
    opacity: .4;
    cursor: not-allowed;
}

.page-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ==========================================================
   20. RESPONSIF - TABLET DAN MOBILE
   ========================================================== */

@media(max-width:1100px) {
    .product-grid {
        grid-template-columns: repeat(2,minmax(0,1fr));
    }

    .stats {
        grid-template-columns: repeat(2,minmax(0,1fr));
    }

    .workspace-grid,
    .two-col,
    .pos-grid {
        grid-template-columns: 1fr;
    }
}

@media(max-width:700px) {
    .shell {
        display: block;
    }

    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        padding: 14px;
    }

    .side-label,
    .sidebar-bottom {
        display: none;
    }

    .brand {
        margin-bottom: 4px;
    }

    .nav {
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
    }

    .nav a {
        padding: 7px 11px;
        font-size: 12px;
    }

    .topbar {
        padding: 12px 15px;
    }

    .topbar-date {
        display: none;
    }

    .page {
        padding: 15px;
    }

    .page-header {
        align-items: flex-start;
        flex-direction: column;
    }

    h1 {
        font-size: 23px;
    }

    .stats {
        gap: 10px;
    }

    .stat {
        padding: 14px;
    }

    .stat strong {
        font-size: 19px;
    }

    .panel {
        padding: 15px;
    }

    .product-grid {
        grid-template-columns: repeat(2,minmax(0,1fr));
    }

    .search {
        max-width: none;
    }

    .section-header {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Penyelarasan pagination pada layar kecil */
@media (max-width: 700px) {
    .pagination-container {
        align-items: stretch;
        gap: 12px;
    }

    .pagination-buttons {
        margin-left: auto;
    }
}


/* =========================================
   FILTER KATEGORI PRODUK POS
========================================= */

.category-tabs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

.category-btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;

    padding: 9px 16px;

    border: 1px solid var(--line);
    border-radius: 9px;

    background: var(--white);
    color: var(--ink);

    font-size: 13px;
    font-weight: 650;

    cursor: pointer;
    transition: all 0.2s ease;
}

.category-btn:hover {
    background: var(--sand);
    border-color: var(--coffee);
    color: var(--coffee);
}

.category-btn.active {
    background: var(--coffee);
    border-color: var(--coffee);
    color: var(--white);
}

.category-btn.active:hover {
    background: var(--dark);
    color: var(--white);
}

@media (max-width: 700px) {
    .category-tabs {
        gap: 6px;
    }

    .category-btn {
        padding: 8px 12px;
        font-size: 12px;
    }
}


/* ==========================================================
   METODE PEMBAYARAN - CASH & QRIS
   Warkop Depan Rumah
   ========================================================== */


/* ----------------------------------------------------------
   1. CONTAINER METODE PEMBAYARAN
   ---------------------------------------------------------- */

.payment-group {
    display: grid;
    gap: 10px;
    width: 100%;
}

.payment-label {
    font-size: 13px;
    font-weight: 650;
    color: var(--ink);
}


/* ----------------------------------------------------------
   2. PILIHAN CASH DAN QRIS
   ---------------------------------------------------------- */

.payment-method-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
}

.form-stack .payment-method-option {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    min-height: 48px;
    padding: 12px 15px;

    border: 1px solid var(--line);
    border-radius: 10px;

    background: var(--white);
    color: var(--ink);

    font-size: 13px;
    font-weight: 650;
    text-align: center;

    cursor: pointer;
    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}


/* ----------------------------------------------------------
   3. HOVER DAN STATUS AKTIF
   ---------------------------------------------------------- */

.form-stack .payment-method-option:hover {
    background: var(--sand);
    border-color: var(--coffee);
}

.form-stack .payment-method-option.selected,
.form-stack .payment-method-option:has(input:checked) {
    background: #f4ebe1;
    border-color: var(--coffee);
    color: var(--coffee);

    box-shadow: 0 0 0 1px var(--coffee);
}

.form-stack .payment-method-option:focus-within {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}


/* ----------------------------------------------------------
   4. RADIO BUTTON
   ---------------------------------------------------------- */

.payment-method-option input[type="radio"] {
    width: 16px;
    height: 16px;
    margin: 0;

    accent-color: var(--coffee);
    cursor: pointer;
    flex-shrink: 0;
}


/* ----------------------------------------------------------
   5. BOX PEMBAYARAN QRIS
   ---------------------------------------------------------- */

.qris-payment-box {
    display: grid;
    gap: 14px;

    width: 100%;
    padding: 18px;

    background: var(--sand);
    border: 1px solid var(--line);
    border-radius: 12px;
}

.qris-payment-box p {
    margin: 0;
    color: var(--ink);
    font-size: 13px;
    line-height: 1.6;
}


/* ----------------------------------------------------------
   6. GAMBAR QRIS MERCHANT
   ---------------------------------------------------------- */

.qris-merchant-image {
    display: block;

    width: 100%;
    max-width: 220px;
    height: auto;

    margin: 0 auto;
    padding: 10px;

    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 10px;

    object-fit: contain;
}


/* ----------------------------------------------------------
   7. KONFIRMASI PEMBAYARAN QRIS
   ---------------------------------------------------------- */

.form-stack .qris-confirm-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;

    font-size: 13px;
    font-weight: 500;
    line-height: 1.5;
    color: var(--ink);

    cursor: pointer;
}

.qris-confirm-check input[type="checkbox"] {
    width: 17px;
    height: 17px;
    margin: 2px 0 0;

    accent-color: var(--coffee);
    cursor: pointer;
    flex-shrink: 0;
}


/* ----------------------------------------------------------
   8. RESPONSIVE - MOBILE
   ---------------------------------------------------------- */

@media (max-width: 480px) {

    .payment-method-options {
        grid-template-columns: 1fr;
    }

    .form-stack .payment-method-option {
        min-height: 46px;
        padding: 11px 12px;
    }

    .qris-payment-box {
        padding: 14px;
    }

    .qris-merchant-image {
        max-width: 190px;
    }
}
