/* =====================================================================
   TokoApp — Stylesheet
   Tema: putih bersih, aksen hijau segar. Responsif: HP, tablet, laptop.
   ===================================================================== */

:root {
    /* Palet */
    --green-700: #15803d;
    --green-600: #16a34a;
    --green-500: #22c55e;
    --green-50:  #f0fdf4;
    --green-100: #dcfce7;

    --ink-900: #0f172a;
    --ink-700: #334155;
    --ink-500: #64748b;
    --ink-400: #94a3b8;

    --line:    #e8edf2;
    --bg:      #f7f9fb;
    --card:    #ffffff;

    --red-600:   #dc2626;
    --red-50:    #fef2f2;
    --amber-500: #f59e0b;
    --amber-50:  #fffbeb;
    --blue-600:  #2563eb;
    --blue-50:   #eff6ff;

    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 2px rgba(15,23,42,.04), 0 4px 12px rgba(15,23,42,.05);
    --shadow-lg: 0 8px 28px rgba(15,23,42,.10);
}

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

html { -webkit-text-size-adjust: 100%; }

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

/* ---------- Navbar ---------- */
.navbar {
    background: var(--card);
    border-bottom: 1px solid var(--line);
    padding: 0 clamp(16px, 4vw, 28px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 62px;
    position: sticky;
    top: 0;
    z-index: 50;
}
.navbar .brand {
    font-weight: 800;
    font-size: 19px;
    letter-spacing: -.02em;
    color: var(--ink-900);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}
.navbar .brand .dot { color: var(--green-600); }

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
}
.nav-links a {
    color: var(--ink-700);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    transition: background .15s, color .15s;
}
.nav-links a:hover { background: var(--green-50); color: var(--green-700); }

/* Hamburger (mobile) */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    font-size: 22px;
    color: var(--ink-700);
}

/* ---------- Container ---------- */
.container {
    max-width: 1120px;
    margin: clamp(18px, 4vw, 32px) auto;
    padding: 0 clamp(16px, 4vw, 28px);
}

/* ---------- Headings ---------- */
h1 { font-size: clamp(21px, 4vw, 26px); font-weight: 800; letter-spacing: -.02em; margin-bottom: 18px; }
h2 { font-size: 17px; font-weight: 700; margin-bottom: 12px; letter-spacing: -.01em; }

.page-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}
.page-head h1 { margin-bottom: 0; }

/* ---------- Cards ---------- */
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: clamp(16px, 3vw, 22px);
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    line-height: 1;
    transition: transform .05s, background .15s, box-shadow .15s, border-color .15s;
    white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--green-600); color: #fff; }
.btn-primary:hover { background: var(--green-700); box-shadow: 0 4px 14px rgba(22,163,74,.25); }
.btn-light { background: #fff; color: var(--ink-700); border-color: var(--line); }
.btn-light:hover { background: var(--green-50); color: var(--green-700); border-color: var(--green-100); }
.btn-danger { background: var(--red-600); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-sm { padding: 7px 11px; font-size: 13px; }
.btn-block { width: 100%; }

/* ---------- Alerts ---------- */
.alert {
    padding: 13px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 14px;
    border: 1px solid transparent;
}
.alert-success { background: var(--green-50); color: var(--green-700); border-color: var(--green-100); }
.alert-error   { background: var(--red-50);   color: #991b1b;        border-color: #fecaca; }

/* ---------- Tables ---------- */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); }
th { background: #fbfdfe; font-weight: 600; color: var(--ink-500); font-size: 12.5px; text-transform: uppercase; letter-spacing: .03em; }
tr:last-child td { border-bottom: none; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: #fafdfb; }

/* ---------- Forms ---------- */
label { display: block; font-size: 13px; color: var(--ink-700); margin-bottom: 6px; font-weight: 600; }
input, select, textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    margin-bottom: 14px;
    background: #fff;
    color: var(--ink-900);
    transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--green-500);
    box-shadow: 0 0 0 3px rgba(34,197,94,.12);
}
input:disabled { background: #f1f5f9; color: var(--ink-400); cursor: not-allowed; }

/* ---------- Grid rows ---------- */
.row { display: flex; gap: 16px; flex-wrap: wrap; }
.col { flex: 1; min-width: 180px; }

/* ---------- Helpers ---------- */
.text-right { text-align: right; }
.muted { color: var(--ink-500); font-size: 13px; }
.stack-sm > * + * { margin-top: 8px; }

/* ---------- Stat cards ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 8px; }
.stat {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow);
}
.stat .label { color: var(--ink-500); font-size: 13px; font-weight: 500; }
.stat .value { font-size: 28px; font-weight: 800; letter-spacing: -.02em; margin-top: 4px; }
.stat.accent { background: var(--green-50); border-color: var(--green-100); }
.stat.accent .value { color: var(--green-700); }

/* ---------- Badges ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .9; }
.badge-lunas    { background: var(--green-50);  color: var(--green-700); }
.badge-belum    { background: var(--red-50);    color: var(--red-600); }
.badge-kirim    { background: var(--blue-50);   color: var(--blue-600); }
.badge-proses   { background: var(--amber-50);  color: var(--amber-500); }
.badge-belumkirim { background: #f1f5f9;        color: var(--ink-500); }
.badge-group { display: inline-flex; gap: 6px; flex-wrap: wrap; }

/* ---------- Section title with count ---------- */
.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 24px 0 12px;
}
.section-title h2 { margin: 0; }
.count-pill {
    background: var(--green-100);
    color: var(--green-700);
    font-size: 12px;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: 999px;
}

/* ---------- Empty state ---------- */
.empty {
    text-align: center;
    padding: 32px 16px;
    color: var(--ink-400);
    font-size: 14px;
}

/* ---------- Product grid (home) ---------- */
.product-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.product-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    transition: transform .15s, box-shadow .15s;
}
.product-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.product-card .price { color: var(--green-700); font-weight: 800; font-size: 18px; margin-top: 10px; }

/* ---------- Auth card ---------- */
.auth-wrap { max-width: 410px; margin: clamp(24px, 6vw, 56px) auto; }

/* =====================================================================
   RESPONSIVE — mobile & tablet
   ===================================================================== */
@media (max-width: 720px) {
    .nav-toggle { display: block; }
    .nav-links {
        display: none;
        position: absolute;
        top: 62px;
        left: 0;
        right: 0;
        background: #fff;
        border-bottom: 1px solid var(--line);
        flex-direction: column;
        align-items: stretch;
        padding: 8px;
        gap: 2px;
        box-shadow: var(--shadow-lg);
    }
    .nav-links.open { display: flex; }
    .nav-links a { padding: 12px 14px; }
    .nav-links form { width: 100%; }
    .nav-links .btn { width: 100%; }

    .page-head { align-items: flex-start; }
    .col { min-width: 100%; }
    th, td { padding: 10px 10px; }
    .btn { padding: 11px 15px; }     /* target sentuh lebih besar di HP */
}

/* Hormati preferensi reduce-motion */
@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}

/* =====================================================================
   TAMBAHKAN baris di bawah ini ke BAGIAN PALING BAWAH file:
   public/css/app.css
   ===================================================================== */

/* Nomor invoice berkedip hitam-kuning (status Proses) — pelan & halus */
.blink-proses {
    font-weight: 700;
    text-decoration: none;
    padding: 2px 8px;
    border-radius: 6px;
    animation: blinkProses 1.8s ease-in-out infinite;
}
@keyframes blinkProses {
    0%, 100% { background: #1a1a1a; color: #facc15; }   /* hitam, teks kuning */
    50%      { background: #facc15; color: #1a1a1a; }   /* kuning, teks hitam */
}

/* Hormati pengguna yang mematikan animasi: tampilkan statis, tetap terbaca */
@media (prefers-reduced-motion: reduce) {
    .blink-proses {
        animation: none;
        background: #facc15;
        color: #1a1a1a;
    }
}

/* =====================================================================
   KATALOG PUBLIK — Kategori, Item, Frame
   Tema: fancy, unisex — netral emas/charcoal, judul pakai serif Playfair.
   ===================================================================== */
:root {
    --gold-600: #a8791a;
    --gold-500: #c9971f;
    --gold-100: #faf3e3;
}

.katalog-hero {
    background: linear-gradient(135deg, var(--ink-900), #1e2536);
    color: #fff;
    border-radius: var(--radius);
    padding: clamp(24px, 5vw, 40px);
    margin-bottom: 22px;
    border-bottom: 3px solid var(--frame-color, var(--gold-500));
}
.katalog-hero-eyebrow {
    text-transform: uppercase;
    letter-spacing: .12em;
    font-size: 12px;
    font-weight: 700;
    color: var(--frame-color, var(--gold-500));
    margin-bottom: 8px;
}
.katalog-hero h1 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(26px, 5vw, 38px);
    margin-bottom: 8px;
    color: #fff;
}
.katalog-hero p { color: #cbd5e1; max-width: 640px; margin: 0; }

/* ---- Layout: sidebar kategori + grid (ala etalase Tokopedia) ---- */
.katalog-layout {
    display: grid;
    grid-template-columns: 230px 1fr;
    gap: 20px;
    align-items: start;
}
.katalog-sidebar {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 10px;
    position: sticky;
    top: 78px;
}
.katalog-sidebar-head {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--ink-500);
    padding: 10px 12px 6px;
}
.katalog-sidebar-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--ink-700);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}
.katalog-sidebar-link:hover { background: var(--gold-100); color: var(--gold-600); }
.katalog-sidebar-link.active { background: var(--ink-900); color: #fff; }
.katalog-sidebar-link .count {
    font-size: 11px;
    font-weight: 700;
    background: rgba(0,0,0,.08);
    padding: 1px 7px;
    border-radius: 999px;
}
.katalog-sidebar-link.active .count { background: rgba(255,255,255,.18); }

/* ---- Grid produk ---- */
.katalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 16px;
}
.katalog-grid-scroll {
    grid-auto-flow: column;
    grid-auto-columns: minmax(210px, 240px);
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 22px;
    scroll-snap-type: x proximity;
}
.katalog-grid-scroll .item-card { scroll-snap-align: start; }

.item-card {
    display: block;
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow);
    border: 1px solid var(--line);
    transition: transform .15s, box-shadow .15s;
}
.item-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

/* Frame = gaya border kartu produk (di-setting admin per kategori/index) */
.item-card.frame-solid  { border: 2px solid var(--frame-color, var(--gold-500)); }
.item-card.frame-double { border: 4px double var(--frame-color, var(--gold-500)); }
.item-card.frame-dashed { border: 2px dashed var(--frame-color, var(--gold-500)); }
.item-card.frame-groove { border: 5px groove var(--frame-color, var(--gold-500)); }

.item-card-img { position: relative; aspect-ratio: 1 / 1; background: var(--bg); }
.item-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.item-card-img-empty {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    color: var(--ink-400); font-size: 12px;
}
.item-card-badges {
    position: absolute; top: 8px; left: 8px;
    display: flex; flex-direction: column; gap: 4px; align-items: flex-start;
}
.badge-promo, .badge-hot, .badge-preorder {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
}
.badge-promo { background: var(--red-600); }
.badge-hot { background: linear-gradient(90deg, #f97316, #ef4444); }
.badge-preorder { background: var(--blue-600); }

.item-card-body { padding: 14px; }
.item-card-title {
    font-family: 'Playfair Display', serif;
    font-size: 16px;
    margin-bottom: 4px;
    line-height: 1.3;
}
.item-card-desc { color: var(--ink-500); font-size: 12.5px; margin-bottom: 8px; }
.item-card-price { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.price-old { color: var(--ink-400); text-decoration: line-through; font-size: 13px; }
.price-now { color: var(--gold-600); font-weight: 800; font-size: 18px; }
.item-card-tiers { list-style: none; font-size: 12px; color: var(--ink-500); margin-bottom: 8px; }
.item-card-tiers li { padding: 2px 0; border-top: 1px dashed var(--line); }
.item-card-tiers li:first-child { border-top: none; }
.item-card-preorder { font-size: 12px; color: var(--blue-600); font-weight: 600; margin-bottom: 8px; }
.item-card-cta {
    display: block;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    color: var(--green-700);
    padding-top: 8px;
    border-top: 1px solid var(--line);
}

@media (max-width: 720px) {
    .katalog-layout { grid-template-columns: 1fr; }
    .katalog-sidebar { position: static; display: flex; overflow-x: auto; gap: 4px; padding: 8px; }
    .katalog-sidebar-head { display: none; }
    .katalog-sidebar-link { white-space: nowrap; }
}

/* ---------- Admin Katalog: tabs, swatch warna, baris edit inline ---------- */
.katalog-admin-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 18px;
}
.katalog-admin-tabs a {
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--ink-500);
    text-decoration: none;
    border-bottom: 2px solid transparent;
}
.katalog-admin-tabs a:hover { color: var(--ink-900); }
.katalog-admin-tabs a.active { color: var(--green-700); border-bottom-color: var(--green-600); }

.color-swatch {
    display: inline-block;
    width: 14px; height: 14px;
    border-radius: 4px;
    vertical-align: middle;
    margin-right: 6px;
    border: 1px solid var(--line);
}
.checkbox-inline {
    display: flex !important;
    align-items: center;
    gap: 6px;
    font-weight: 500 !important;
}
.checkbox-inline input[type="checkbox"] { width: auto; margin: 0; }

.edit-row { display: none; background: #fbfdfe; }
.edit-row.open { display: table-row; }
.edit-row .row { margin: 6px 0; }

.katalog-preview-frame {
    width: 100%;
    height: 82vh;
    border: 0;
    display: block;
}

/* ---------- Utility spacing (dipakai juga oleh form nota) ---------- */
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
