:root {
  --green: #0f9d74; --green-dark: #0a7a5a; --green-soft: #e6f6f0;
  --ink: #17262b; --muted: #6b7c85; --line: #e3eaed; --bg: #f4f8f7; --card: #fff;
  --red: #d64545; --orange: #e8862a; --yellow: #d6a800; --radius: 12px;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "Segoe UI", system-ui, sans-serif; color: var(--ink); background: var(--bg); font-size: 14px; }
h1 { font-size: 1.3rem; margin: 0; }
h2 { font-size: .95rem; margin: 0 0 .5rem; }
a { color: var(--green-dark); text-decoration: none; }
.muted { color: var(--muted); }
.right { text-align: right; }

.shell { display: flex; min-height: 100vh; }
.sidebar { width: 230px; background: #fff; border-right: 1px solid var(--line); padding: 1rem .75rem; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { font-weight: 800; font-size: 1.2rem; color: var(--green-dark); padding: .25rem .5rem 1rem; display: flex; align-items: center; gap: .5rem; }
.brand-mark { background: var(--green); color: #fff; width: 28px; height: 28px; border-radius: 8px; display: inline-grid; place-items: center; font-weight: 900; }
.brand-logo { display: block; padding: .15rem .35rem .9rem; }
.brand-logo img { display: block; width: 100%; max-width: 190px; height: auto; }
.topbar-logo img { height: 36px; width: auto; display: block; }
.auth-logo { text-align: center; margin-bottom: 1rem; }
.auth-logo img { width: 230px; max-width: 80%; height: auto; }
.brand-big { font-size: 1.6rem; justify-content: center; }
.nav-title { font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 1rem .5rem .25rem; }
.nav-link { display: flex; align-items: center; gap: .6rem; padding: .55rem .6rem; border-radius: 10px; color: var(--ink); }
.nav-link:hover { background: var(--green-soft); }
.nav-link.active { background: var(--green); color: #fff; font-weight: 600; }
.nav-icon { width: 20px; height: 20px; display: inline-grid; place-items: center; flex: none; }
.nav-icon svg { display: block; }
.nav-link { font-size: .9rem; }
.nav-group { margin: .1rem 0; }
.nav-summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: .6rem; padding: .55rem .6rem; border-radius: 10px; font-size: .9rem; color: var(--ink); }
.nav-summary::-webkit-details-marker { display: none; }
.nav-summary:hover { background: var(--green-soft); }
.nav-chevron { margin-left: auto; display: inline-grid; transition: transform .15s; color: var(--muted); }
.nav-group[open] > .nav-summary .nav-chevron { transform: rotate(180deg); }
.nav-group[open] > .nav-summary { font-weight: 600; }
.nav-sub { margin: .1rem 0 .2rem .9rem; padding-left: .5rem; border-left: 2px solid var(--line); }
.nav-sub .nav-link { padding: .4rem .5rem; font-size: .86rem; }
.logout-btn { display: inline-flex; align-items: center; gap: .3rem; }
.sidebar-foot { margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.sidebar-foot form { margin: 0; }

.content { flex: 1; padding: 1rem 1.5rem; min-width: 0; }
.topbar { display: none; }
/* Bagian atas setiap menu: judul + tombol, deretan kartu angka kecil, bar cari/filter */
.page-head { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: .6rem; }
.page-head p { margin: .1rem 0 0; font-size: .8rem; }
.page-head .btn, .page-head button { padding: .3rem .65rem; font-size: .8rem; }
.page-head form { margin: 0; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }

/* Beranda: banner jam & tanggal */
.hero { position: relative; overflow: hidden; display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .6rem; padding: 1rem 1.5rem; border-radius: 20px; color: #fff; background: linear-gradient(120deg, #0a7a5a 0%, #0f9d74 55%, #2bc8a0 100%); box-shadow: 0 12px 30px rgba(15, 157, 116, .28); }
.hero::before, .hero::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .09); pointer-events: none; }
.hero::before { width: 260px; height: 260px; right: -60px; top: -110px; }
.hero::after { width: 180px; height: 180px; left: 38%; bottom: -110px; }
.hero > * { position: relative; z-index: 1; }
.hero-hello { font-size: 1.35rem; font-weight: 800; }
.hero-sub { opacity: .9; margin: .15rem 0 .6rem; font-size: .85rem; }
.btn-white { background: #fff; color: var(--green-dark); }
.btn-white:hover { background: var(--green-soft); }
.hero-clock { text-align: right; }
.clock-time { font-size: 2.8rem; font-weight: 800; line-height: 1; letter-spacing: .02em; font-variant-numeric: tabular-nums; text-shadow: 0 2px 12px rgba(0, 0, 0, .15); }
.clock-sec { font-size: 1.5rem; font-weight: 600; margin-left: .35rem; opacity: .75; animation: pulse 1s ease-in-out infinite; }
.clock-day { font-size: 1.25rem; font-weight: 700; margin-top: .35rem; text-transform: capitalize; }
.clock-date { opacity: .92; }
.clock-zone { display: inline-block; margin-top: .45rem; padding: .1rem .6rem; border-radius: 999px; background: rgba(255, 255, 255, .2); font-size: .75rem; font-weight: 700; letter-spacing: .1em; }
@keyframes pulse { 0%, 100% { opacity: .75; } 50% { opacity: .3; } }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem 1rem; margin-bottom: .6rem; }
.grid { display: grid; gap: .6rem; }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .7rem; margin-bottom: .8rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
/* .stat = kartu angka kecil (sama seperti .mini di Katalog) */
.stat { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: .85rem 1.1rem; min-width: 0; color: var(--ink); }
.stat .label { color: var(--muted); font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .value { font-size: 1.6rem; font-weight: 700; line-height: 1.25; margin-top: .2rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .value small { font-size: .85rem; font-weight: 400; }
.stat small { display: block; font-size: .78rem; margin-top: .15rem; }
.stat.accent { background: var(--green); color: #fff; border-color: var(--green); }
.stat.accent .label { color: #d5f3e9; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .4rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
td.num, th.num { text-align: right; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }

.btn { display: inline-block; border: 0; border-radius: 10px; padding: .4rem .85rem; font-size: .88rem; font-weight: 600; cursor: pointer; background: var(--green); color: #fff; font-family: inherit; }
.btn:hover { background: var(--green-dark); }
.btn-light { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn-light:hover { background: var(--green-soft); }
.btn-danger { background: var(--red); }
.btn-primary { background: var(--green); }
.btn-sm { padding: .25rem .6rem; font-size: .8rem; }
.btn-block { width: 100%; padding: .75rem; font-size: 1rem; }

input, select, textarea { font: inherit; border: 1px solid var(--line); border-radius: 10px; padding: .4rem .65rem; background: #fff; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--green); border-color: var(--green); }
label { display: block; font-size: .85rem; color: var(--muted); font-weight: 600; }
label input, label select, label textarea { margin-top: .25rem; color: var(--ink); font-weight: 400; }
.stack { display: grid; gap: .9rem; }
.form-grid { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.search { display: flex; gap: .5rem; width: 100%; max-width: none; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: .4rem .6rem; margin-bottom: .6rem; }
.toolbar .search, .search-row .search { background: none; border: 0; padding: 0; margin: 0; }
.search input { padding: .35rem .65rem; }
.period { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: .4rem .6rem; margin-bottom: .6rem; }
.period input { padding: .3rem .5rem; }
.toolbar .period { border: 0; padding: 0; margin: 0; }
.search-row .search { flex: 1 1 0; min-width: 220px; width: auto; }
.search input { flex: 1; min-width: 0; }
.search .btn { flex: none; width: auto; }
.search-wide { max-width: none; margin-top: 1rem; }
.stat-link { display: block; color: inherit; transition: transform .12s, box-shadow .12s; }
.stat-link:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(15, 157, 116, .15); }
.stat small { display: block; margin-top: .2rem; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip { padding: .35rem .8rem; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--ink); font-size: .88rem; }
.chip b { margin-left: .3rem; color: var(--green-dark); }
.chip:hover { border-color: var(--green); background: var(--green-soft); }
.chip.on { background: var(--green); border-color: var(--green); color: #fff; }
.chip.on b { color: #fff; }
/* Katalog: tampilan padat supaya daftar barang naik ke atas */
.page-head.compact { margin-bottom: .6rem; align-items: center; }
.page-head.compact h1 { font-size: 1.3rem; margin: 0; }
.mini-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .7rem; margin-bottom: .8rem; }
.mini { display: block; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: .85rem 1.1rem; color: var(--ink); min-width: 0; }
.mini span { display: block; font-size: .85rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini b { display: block; font-size: 1.6rem; line-height: 1.25; margin-top: .2rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
a.mini:hover { border-color: var(--green); background: var(--green-soft); }
.mini.accent { background: var(--green); border-color: var(--green); color: #fff; }
.mini.accent span { color: #d5f3e9; }
.mini.on { border-color: var(--green); box-shadow: 0 0 0 2px var(--green-soft); }
.toolbar { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: .45rem .6rem; margin-bottom: .6rem; }
.toolbar .search { flex: 1 1 280px; width: auto; }
.toolbar .search input { padding: .35rem .65rem; }
.chips-sm { gap: .3rem; }
.chips-sm .chip { padding: .15rem .6rem; font-size: .8rem; }
.table-info { display: flex; justify-content: space-between; align-items: center; gap: 1rem; font-size: .85rem; margin-bottom: .3rem; }
.pager-inline { display: inline-flex; align-items: center; gap: .5rem; }
.card.dense { padding: .6rem .9rem; }
.dense th, .dense td { padding: .35rem .5rem; vertical-align: middle; }
.dense td:first-child { min-width: 260px; }
.dense td.num { white-space: nowrap; }
.dense td .barcode { display: block; font-size: .72rem; line-height: 1.1; }
.dense td .barcode:empty { display: none; }
.pager { display: flex; justify-content: center; align-items: center; gap: 1rem; margin-top: 1rem; }
.period { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.period input { width: auto; }

.alert { padding: .7rem 1rem; border-radius: 10px; margin-bottom: 1rem; }
.alert-ok { background: var(--green-soft); color: var(--green-dark); }
.alert-error { background: #fde8e8; color: #9b2c2c; }

.badge { display: inline-block; padding: .15rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 600; }
.badge-green { background: var(--green-soft); color: var(--green-dark); }
.badge-red { background: #fde8e8; color: #9b2c2c; }
.badge-orange { background: #fdf0e2; color: #a85a0f; }
.badge-yellow { background: #fbf4d6; color: #7a6200; }
.badge-gray { background: #eef2f4; color: var(--muted); }

.auth-body { display: grid; place-items: center; min-height: 100vh; padding: 1rem; }
.auth-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 2rem; width: 100%; max-width: 400px; box-shadow: 0 8px 30px rgba(15,157,116,.08); }
.auth-card h1 { margin-bottom: .25rem; }
.auth-card .muted { margin: 0 0 1rem; }

/* Kasir: dua kolom */
.pos { display: grid; grid-template-columns: 1.2fr 1fr; gap: 1rem; align-items: start; }
.pos-products { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .6rem; margin-top: .75rem; }
.pos-products form { margin: 0; }
.product-tile { width: 100%; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: .7rem; cursor: pointer; font: inherit; color: var(--ink); }
.product-tile:hover { border-color: var(--green); background: var(--green-soft); }
.product-tile .name { font-weight: 600; font-size: .9rem; line-height: 1.25; min-height: 2.3em; }
.product-tile .price { color: var(--green-dark); font-weight: 700; margin-top: .3rem; }
.product-tile .stock { font-size: .78rem; color: var(--muted); }
.product-tile.empty { opacity: .55; }
.search-row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.view-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.view-switch button { border: 0; background: #fff; padding: .55rem .8rem; font: inherit; font-size: .9rem; cursor: pointer; color: var(--muted); }
.view-switch button.on { background: var(--green); color: #fff; font-weight: 600; }
/* Tampilan baris */
.pos-products.list { grid-template-columns: 1fr; gap: .35rem; }
.pos-products.list .product-tile { display: grid; grid-template-columns: 1fr auto auto; gap: .25rem 1rem; align-items: center; padding: .55rem .8rem; }
.pos-products.list .product-tile .name { min-height: 0; font-size: .92rem; }
.pos-products.list .product-tile .price { margin: 0; text-align: right; min-width: 90px; }
.pos-products.list .product-tile .stock { text-align: right; min-width: 90px; }
/* Kasir: panel kiri & kanan sama lebar, sama tinggi, gaya kartu sama */
.pos { grid-template-columns: 1fr 1fr !important; align-items: stretch !important; }
.pos-panel { display: flex; flex-direction: column; min-height: 72vh; margin-bottom: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .4rem; }
.panel-head h2 { margin: 0; }
.pos-panel .pos-products { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.cart-meta { margin-bottom: .4rem; }
.cart-list { flex: 1; min-height: 120px; overflow-y: auto; }
.pay-box { margin-top: .5rem; }
.cart { position: sticky; top: 1rem; }
.cart-item { display: grid; grid-template-columns: 1fr auto; gap: .25rem .5rem; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.cart-item .qty { display: flex; gap: .3rem; align-items: center; }
.cart-item .qty input { width: 64px; text-align: center; padding: .3rem; }
.cart-item form { margin: 0; }
.total-box { background: var(--green-soft); border-radius: 12px; padding: .9rem 1rem; margin: .75rem 0; }
.total-box .big { font-size: 1.9rem; font-weight: 800; color: var(--green-dark); }
.row-split { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .2rem 0; }

.receipt { max-width: 380px; margin: 0 auto; font-family: "Consolas", monospace; font-size: .9rem; }
.receipt h2 { text-align: center; }
.receipt hr { border: 0; border-top: 1px dashed #999; }

.items-table input, .items-table select { padding: .4rem .5rem; }

@media (max-width: 900px) {
  .sidebar { position: fixed; left: -260px; z-index: 20; width: 240px; transition: left .2s; box-shadow: 4px 0 20px rgba(0,0,0,.1); }
  .sidebar.open { left: 0; }
  .topbar { display: flex; align-items: center; gap: .75rem; margin: -.5rem 0 1rem; }
  .menu-btn { background: #fff; border: 1px solid var(--line); border-radius: 10px; font-size: 1.2rem; padding: .3rem .7rem; }
  .topbar-brand { font-weight: 800; color: var(--green-dark); }
  .content { padding: 1rem; }
  .hero { padding: 1.2rem 1.25rem; }
  .hero-clock { text-align: left; }
  .clock-time { font-size: 2.8rem; }
  .pos { grid-template-columns: 1fr; }
  .cart { position: static; }
}
@media print {
  .sidebar, .topbar, .no-print, .alert { display: none !important; }
  body { background: #fff; }
  .content { padding: 0; }
  .card { border: 0; }
}

/* ===== Gaya halaman ala Farmacare (menimpa gaya sebelumnya) ===== */
.page-head { margin-bottom: 1rem; }
.page-head h1 { font-size: 2rem; font-weight: 800; letter-spacing: -.01em; }
.page-head p { font-size: .88rem; margin-top: .2rem; }
.page-head .btn, .page-head button { padding: .5rem 1.1rem; font-size: .92rem; }

/* Blok angka: tanpa kotak, 3 kolom, angka besar */
.grid-4, .mini-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.4rem 2.5rem; margin: 0 0 1.4rem; }
.stat, .mini { background: none !important; border: 0 !important; border-radius: 0; padding: 0 !important; color: var(--ink) !important; box-shadow: none !important; min-width: 0; }
.stat .label, .mini span { color: var(--ink) !important; font-size: .95rem; font-weight: 700; }
.stat .value, .mini b { font-size: 2rem; font-weight: 400; line-height: 1.2; margin-top: .15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.stat small, .mini small { font-size: .92rem; color: var(--ink); opacity: .85; display: block; margin-top: .1rem; }
.stat small.muted { color: var(--muted); }
a.stat::after, a.mini::after { content: "Lihat detail →"; display: block; color: var(--green-dark); font-size: .82rem; font-weight: 700; margin-top: .25rem; }
a.stat:hover, a.mini:hover { transform: none; }
.mini.on b, .stat.on .value { color: var(--green-dark); }
@media (max-width: 1100px) { .grid-4, .mini-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem 1.5rem; } }
@media (max-width: 600px) { .grid-4, .mini-stats { grid-template-columns: minmax(0, 1fr); } .stat .value, .mini b { font-size: 1.7rem; } }

/* Bar pencarian: kotak dengan ikon kaca pembesar + tombol Cari menyatu */
.search { display: flex; align-items: stretch; gap: 0; width: 100%; max-width: 440px; padding: 0 !important; margin: 0 !important; background: #fff; border: 1px solid var(--green-dark) !important; border-radius: 8px; overflow: hidden; }
.search input[type=search], .search input[type=text] { border: 0 !important; border-radius: 0; flex: 1; min-width: 0; padding: .55rem .7rem .55rem 2.3rem !important; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%230a7a5a' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") no-repeat .7rem center; outline: none; }
.search .btn { border-radius: 0 !important; background: #fff !important; color: var(--ink) !important; border: 0; border-left: 1px solid var(--green-dark); padding: 0 1.1rem; font-size: .92rem; }
.search .btn:hover { background: var(--green-soft) !important; }
.search .btn-light { border-left: 1px solid var(--green-dark); }
.search-row .search, .toolbar .search { max-width: none; }

/* Baris filter: pencarian + "Filter" + tombol menu tersambung + aksi di kanan */
.filterbar { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; margin: 0 0 1rem; }
.filterbar .flabel { font-weight: 700; }
.filterbar .fright { margin-left: auto; display: flex; gap: .5rem; }
.seg { display: inline-flex; border: 1px solid var(--green-dark); border-radius: 8px; background: #fff; }
.seg > details { position: relative; border-left: 1px solid var(--green-dark); }
.seg > details:first-child { border-left: 0; }
.seg summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: .45rem; padding: .55rem .95rem; font-weight: 700; font-size: .92rem; color: var(--green-dark); white-space: nowrap; }
.seg summary::-webkit-details-marker { display: none; }
.seg summary:hover, .seg details[open] > summary { background: var(--green-soft); }
.seg summary.on { background: var(--green-soft); }
.seg summary .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.seg .menu { position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; min-width: 190px; max-height: 320px; overflow-y: auto; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 28px rgba(0, 0, 0, .12); padding: .3rem; }
.seg .menu a { display: block; padding: .45rem .7rem; border-radius: 8px; color: var(--ink); font-size: .9rem; }
.seg .menu a:hover { background: var(--green-soft); }
.seg .menu a.sel { font-weight: 700; color: var(--green-dark); background: var(--green-soft); }
.btn-outline { background: #fff !important; color: var(--green-dark) !important; border: 1px solid var(--green-dark); display: inline-flex; align-items: center; gap: .4rem; }
.btn-outline:hover { background: var(--green-soft) !important; }

/* Tabel: judul kolom lebih tegas */
th { color: var(--ink); font-size: .8rem; }

/* Komponen tanggal seragam: [<] [kalender 2026 Okt 1 – 31] [>] */
.datenav { display: inline-flex; align-items: stretch; border: 1px solid var(--green-dark); border-radius: 8px; background: #fff; }
.datenav .dn-btn { display: grid; place-items: center; width: 44px; color: var(--green-dark); }
.datenav a.dn-btn:hover { background: var(--green-soft); }
.datenav .dn-btn.off { color: #b9c4c9; cursor: not-allowed; }
.datenav .dn-mid { position: relative; border-left: 1px solid var(--green-dark); border-right: 1px solid var(--green-dark); }
.datenav .dn-mid summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: .5rem; padding: .55rem 1rem; color: var(--green-dark); font-weight: 600; white-space: nowrap; }
.datenav .dn-mid summary::-webkit-details-marker { display: none; }
.datenav .dn-mid[open] summary, .datenav .dn-mid summary:hover { background: var(--green-soft); }
.datenav .menu { position: absolute; z-index: 40; top: calc(100% + 4px); right: 0; min-width: 230px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 28px rgba(0, 0, 0, .12); padding: .3rem; }
.datenav .menu > a { display: block; padding: .45rem .7rem; border-radius: 8px; color: var(--ink); font-size: .9rem; }
.datenav .menu > a:hover { background: var(--green-soft); }
.datenav .menu > a.sel { font-weight: 700; color: var(--green-dark); background: var(--green-soft); }
.datenav .menu hr { border: 0; border-top: 1px solid var(--line); margin: .4rem 0; }
.datenav .menu form { padding: .3rem .5rem .5rem; }
.filterbar .fright { margin-left: auto; }

/* Hub Laporan ala Farmacare */
.rsec { display: flex; align-items: center; gap: .8rem; margin: 1.6rem 0 .9rem; font-size: 1.25rem; font-weight: 700; }
.rsec::after { content: ""; flex: 1; border-top: 1px solid #c9d3d8; }
.rgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.1rem; }
.rcard { display: flex; gap: 1rem; align-items: flex-start; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 1.1rem 1.2rem; color: var(--ink); min-height: 112px; }
.rcard:hover { border-color: var(--green); box-shadow: 0 4px 14px rgba(15, 157, 116, .12); }
.rcard .ricon { flex: none; width: 46px; height: 46px; border-radius: 10px; background: var(--green-soft); color: var(--green-dark); display: grid; place-items: center; }
.rcard h3 { margin: 0 0 .25rem; font-size: 1rem; color: var(--green-dark); }
.rcard p { margin: 0; font-size: .92rem; line-height: 1.45; color: var(--ink); }
@media (max-width: 1100px) { .rgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .rgrid { grid-template-columns: minmax(0, 1fr); } }

.shift-card { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.inline-form { display: flex; gap: .5rem; align-items: center; margin: 0; }
.inline-form input { width: 210px; }

/* Kasir: tampilan Baris = satu barang per baris (nama | stok | harga), menimpa aturan kolom */
.pos-panel .pos-products.list { grid-template-columns: minmax(0, 1fr); gap: .3rem; align-content: start; }
.pos-panel .pos-products.list .product-tile { display: grid; grid-template-columns: minmax(0, 1fr) 105px 105px; align-items: center; gap: .75rem; width: 100%; padding: .5rem .85rem; min-height: 0; text-align: left; }
.pos-panel .pos-products.list .product-tile .name { min-height: 0; font-size: .92rem; line-height: 1.3; }
.pos-panel .pos-products.list .product-tile .stock { order: 2; text-align: right; font-size: .82rem; white-space: nowrap; }
.pos-panel .pos-products.list .product-tile .price { order: 3; text-align: right; margin: 0; white-space: nowrap; }

/* ===== Beranda: sorotan angka, grafik, peringatan ===== */
.hero { padding: 1.1rem 1.6rem; margin-bottom: 1rem; }
.hero-hello { font-size: 2.1rem; font-weight: 800; letter-spacing: -.01em; }
.hero-text { display: flex; align-items: center; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.kpi { position: relative; overflow: hidden; border-radius: 16px; padding: 1.1rem 1.25rem 1rem; color: #fff; box-shadow: 0 8px 22px rgba(20, 40, 60, .14); }
.kpi::after { content: ""; position: absolute; right: -30px; top: -30px; width: 120px; height: 120px; border-radius: 50%; background: rgba(255, 255, 255, .14); }
.kpi-green { background: linear-gradient(135deg, #0a7a5a, #1fc08f); }
.kpi-blue { background: linear-gradient(135deg, #1d5bb8, #4a96f5); }
.kpi-purple { background: linear-gradient(135deg, #5b3fb3, #9b7ef0); }
.kpi-orange { background: linear-gradient(135deg, #d9701a, #f7a84a); }
.kpi-icon { width: 38px; height: 38px; border-radius: 10px; background: rgba(255, 255, 255, .22); display: grid; place-items: center; margin-bottom: .6rem; position: relative; z-index: 1; }
.kpi-label { font-size: .9rem; font-weight: 600; opacity: .92; position: relative; z-index: 1; }
.kpi-value { font-size: 2rem; font-weight: 800; line-height: 1.15; margin: .1rem 0 .5rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; position: relative; z-index: 1; }
.kpi-foot { position: relative; z-index: 1; }
.chip-delta { display: inline-block; padding: .15rem .65rem; border-radius: 999px; background: rgba(255, 255, 255, .22); font-size: .78rem; font-weight: 700; }
.chip-delta.up { background: rgba(255, 255, 255, .95); color: #0a7a5a; }
.chip-delta.down { background: rgba(255, 255, 255, .95); color: #c0392b; }

.dash-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.dash-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dash-grid .card { margin-bottom: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .6rem; }
.card-head h2 { margin: 0; font-size: 1.05rem; }

.bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: .6rem; align-items: end; height: 220px; }
.bar-col { display: flex; flex-direction: column; align-items: center; height: 100%; min-width: 0; }
.bar-val { font-size: .7rem; font-weight: 700; color: var(--green-dark); height: 1.1rem; white-space: nowrap; }
.bar-track { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; background: repeating-linear-gradient(to top, transparent 0, transparent 39px, #eef3f2 39px, #eef3f2 40px); border-radius: 8px; }
.bar-fill { width: 62%; min-height: 0; border-radius: 8px 8px 3px 3px; background: linear-gradient(to top, #9adbc4, #1fc08f); transition: height .4s; }
.bar-col.today .bar-fill { background: linear-gradient(to top, #0a7a5a, #1fc08f); box-shadow: 0 4px 12px rgba(15, 157, 116, .4); }
.bar-day { font-size: .78rem; font-weight: 700; text-align: center; margin-top: .3rem; line-height: 1.15; }
.bar-day small { font-weight: 400; color: var(--muted); }
.bar-col.today .bar-day { color: var(--green-dark); }

.alert-row { display: flex; align-items: center; gap: .7rem; padding: .55rem .5rem; border-radius: 10px; color: var(--ink); border-bottom: 1px dashed var(--line); }
.alert-row:last-child { border-bottom: 0; }
.alert-row:hover { background: var(--green-soft); }
.alert-row .a-text { flex: 1; font-size: .9rem; }
.alert-row b { font-size: .9rem; white-space: nowrap; }
.alert-row.hot { background: #fdecec; }
.alert-row.hot b { color: #c0392b; }
.a-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.a-dot.red { background: #d64545; } .a-dot.orange { background: #e8862a; } .a-dot.blue { background: #3f8cf0; } .a-dot.green { background: #1fc08f; }

.rank { display: flex; align-items: center; gap: .7rem; margin: .5rem 0; }
.rank-no { width: 26px; height: 26px; border-radius: 50%; background: var(--green-soft); color: var(--green-dark); display: grid; place-items: center; font-weight: 800; font-size: .8rem; flex: none; }
.rank:first-of-type .rank-no { background: #f7c948; color: #6b4d00; }
.rank-body { flex: 1; min-width: 0; }
.rank-name { font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-bar { height: 7px; border-radius: 999px; background: #edf2f1; margin-top: .25rem; }
.rank-bar span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #1fc08f, #0a7a5a); }

@media (max-width: 1000px) { .dash-grid, .dash-grid.three { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .hero-hello { font-size: 1.6rem; } .bars { height: 170px; } }

/* Surat pesanan: pilihan Order Otomatis / Manual */
.mode-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.mode-tab { position: relative; display: flex; flex-direction: column; gap: .15rem; padding: .9rem 1.1rem; border: 2px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); }
.mode-tab strong { font-size: 1.05rem; }
.mode-tab span { font-size: .85rem; color: var(--muted); }
.mode-tab em { position: absolute; top: .6rem; right: .8rem; font-style: normal; font-size: .72rem; font-weight: 700; padding: .1rem .55rem; border-radius: 999px; background: var(--green); color: #fff; }
.mode-tab:hover { border-color: var(--green); }
.mode-tab.on { border-color: var(--green-dark); background: var(--green-soft); box-shadow: 0 0 0 3px rgba(15, 157, 116, .15); }
.auto-params { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: .8rem; align-items: end; }
.budget-bar { height: 10px; border-radius: 999px; background: #e6eeec; margin: .2rem 0 .8rem; overflow: hidden; }
.budget-bar span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #1fc08f, #0a7a5a); transition: width .25s; }
.budget-bar span.over { background: linear-gradient(90deg, #f7a84a, #d64545); }
#auto-table tr.skipped td { opacity: .55; }
#auto-table tr.skipped td:nth-last-child(2) { opacity: 1; }
@media (max-width: 640px) { .mode-tabs { grid-template-columns: minmax(0, 1fr); } }

/* ===== Beranda ringkas: semua muat dalam satu layar ===== */
.content:has(.hero) { padding-top: .7rem; padding-bottom: .5rem; }
.hero { padding: .55rem 1.3rem !important; margin-bottom: .6rem !important; border-radius: 14px; }
.hero-hello { font-size: 1.6rem !important; }
.hero-clock { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: flex-end; gap: 0 .7rem; text-align: right; }
.clock-time { font-size: 1.9rem !important; }
.clock-sec { font-size: 1rem !important; }
.clock-day { font-size: .95rem !important; margin: 0 !important; }
.clock-date { font-size: .85rem !important; }
.clock-zone { margin: 0 !important; font-size: .68rem !important; padding: 0 .5rem !important; }

.kpis { gap: .6rem; margin-bottom: .6rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.kpi { padding: .55rem .85rem .5rem; border-radius: 12px; box-shadow: 0 4px 12px rgba(20, 40, 60, .12); }
.kpi::after { width: 80px; height: 80px; right: -22px; top: -26px; }
.kpi-icon { position: absolute; right: .7rem; top: .55rem; width: 30px; height: 30px; margin: 0; border-radius: 8px; }
.kpi-icon svg { width: 17px; height: 17px; }
.kpi-label { font-size: .8rem; }
.kpi-value { font-size: 1.5rem; margin: 0 0 .25rem; }
.chip-delta { font-size: .7rem; padding: .05rem .5rem; }

.dash-grid { gap: .6rem; margin-bottom: .6rem; }
.dash-grid .card { padding: .55rem .85rem; }
.card-head { margin-bottom: .3rem; }
.card-head h2 { font-size: .92rem; }
.bars { height: 150px; gap: .4rem; }
.bar-val { font-size: .64rem; height: .9rem; }
.bar-day { font-size: .7rem; margin-top: .15rem; }
.alert-row { padding: .3rem .4rem; gap: .5rem; }
.alert-row .a-text, .alert-row b { font-size: .8rem; }
.rank { margin: .3rem 0; gap: .5rem; }
.rank-no { width: 22px; height: 22px; font-size: .72rem; }
.rank-name { font-size: .78rem; }
.dash-grid.three td { padding: .25rem .4rem; font-size: .8rem; }
.dash-grid.three p.muted { margin: .3rem 0; font-size: .85rem; }

/* Kartu sorotan Beranda bisa diklik */
a.kpi { display: block; color: #fff; text-decoration: none; cursor: pointer; transition: transform .15s, box-shadow .15s; }
a.kpi:hover { transform: translateY(-3px); box-shadow: 0 10px 22px rgba(20, 40, 60, .22); }
a.kpi:active { transform: translateY(-1px); }
a.kpi:focus-visible { outline: 3px solid #fff; outline-offset: -5px; }
a.kpi .kpi-label::after { content: " →"; opacity: 0; transition: opacity .15s; }
a.kpi:hover .kpi-label::after { opacity: 1; }

/* ===== Layar Kasir gaya Toko Salwa (p2-*) ===== */
[hidden] { display: none !important; }
.p2-keys { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; font-size: .78rem; color: var(--muted); }
.p2-keys kbd { border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 0 .35rem; background: #fff; font: 600 .72rem inherit; color: var(--ink); margin-right: .15rem; }
.p2-tabs { display: flex; gap: .3rem; border-bottom: 1px solid var(--line); margin-bottom: .8rem; }
.p2-tab { display: inline-flex; align-items: center; gap: .45rem; padding: .6rem 1rem; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.p2-tab:hover { color: var(--green-dark); }
.p2-tab.on { color: var(--green-dark); border-bottom-color: var(--green); }
.p2-pill { font-style: normal; font-size: .72rem; font-weight: 700; background: var(--green-soft); color: var(--green-dark); border-radius: 999px; padding: .1rem .55rem; }
.pos2 { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 1rem; align-items: start; }
.p2-left, .p2-right { padding: 1rem; }
.p2-right { position: sticky; top: .5rem; }
.p2-searchrow { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.p2-search { flex: 1; min-width: 220px; margin: 0; }
.p2-search input { width: 100%; padding: .65rem .9rem; border: 1px solid var(--line); border-radius: 12px; font-size: .95rem; }
.p2-search input:focus { outline: 2px solid var(--green); border-color: var(--green); }
.view-switch a { padding: .45rem .8rem; border: 0; background: transparent; color: var(--ink); font-weight: 600; font-size: .85rem; text-decoration: none; }
.view-switch a.on { background: var(--green); color: #fff; }
.p2-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: .7rem 0; }
.p2-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: .6rem; }
.p2-cell { margin: 0; display: flex; }
.p2-tile { flex: 1; display: flex; flex-direction: column; gap: .2rem; text-align: left; padding: .7rem .8rem; background: #fff; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; color: var(--ink); transition: border-color .12s, box-shadow .12s, transform .12s; }
.p2-tile:hover { border-color: var(--green); box-shadow: 0 4px 12px rgba(15, 157, 116, .15); transform: translateY(-1px); }
.p2-tile .name { font-weight: 700; font-size: .85rem; line-height: 1.25; }
.p2-tile .price { color: var(--green-dark); font-weight: 700; margin-top: auto; }
.p2-tile .stock { font-size: .75rem; color: var(--muted); }
.p2-tile.empty { opacity: .55; }
.p2-grid.list { grid-template-columns: 1fr; gap: .35rem; }
.p2-grid.list .p2-tile { flex-direction: row; align-items: center; gap: .8rem; padding: .5rem .8rem; }
.p2-grid.list .p2-tile .name { flex: 1; }
.p2-grid.list .p2-tile .price { margin: 0; min-width: 90px; text-align: right; }
.p2-grid.list .p2-tile .stock { min-width: 90px; text-align: right; }
.p2-empty { text-align: center; padding: 1.2rem 0; }
.p2-sub-h { margin: 1rem 0 .5rem; font-size: .95rem; }
.p2-cart-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .5rem; }
.p2-cart-head h2 { margin: 0; }
.p2-clear { border: 1px solid #f1b9b9; color: var(--red); background: #fff; border-radius: 10px; padding: .3rem .8rem; font-weight: 600; cursor: pointer; }
.p2-clear:hover { background: #fdeeee; }
.p2-meta { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-bottom: .5rem; }
.p2-meta select { width: 100%; padding: .4rem .5rem; border: 1px solid var(--line); border-radius: 10px; font-size: .82rem; }
.p2-cart { border: 1px solid var(--line); border-radius: 12px; min-height: 120px; max-height: 32vh; overflow: auto; padding: .3rem .6rem; }
.p2-cart-empty { text-align: center; margin: 2rem 0; }
.p2-item { display: grid; grid-template-columns: 1fr auto auto auto; gap: .5rem; align-items: center; padding: .5rem 0; border-bottom: 1px solid var(--line); }
.p2-item:last-child { border-bottom: 0; }
.p2-iname { display: flex; flex-direction: column; min-width: 0; font-size: .85rem; }
.p2-iname small { color: var(--muted); }
.p2-qty { display: flex; align-items: center; gap: .15rem; }
.qf { margin: 0; }
.qbtn, .xbtn { border: 1px solid var(--line); background: #fff; border-radius: 8px; width: 28px; height: 28px; cursor: pointer; font-weight: 700; color: var(--ink); line-height: 1; padding: 0; }
.qbtn:hover { border-color: var(--green); color: var(--green-dark); }
.xbtn { border-color: transparent; color: var(--red); }
.xbtn:hover { background: #fdeeee; }
.qinput { width: 48px; text-align: center; padding: .3rem .1rem; border: 1px solid var(--line); border-radius: 8px; }
.p2-isub { min-width: 78px; text-align: right; font-size: .85rem; }
.p2-pay { margin-top: .7rem; display: flex; flex-direction: column; gap: .5rem; }
.p2-row { display: flex; justify-content: space-between; align-items: center; gap: .6rem; color: var(--muted); font-size: .88rem; }
.p2-row b { color: var(--ink); }
.p2-disc { display: flex; align-items: center; }
.p2-disc button { border: 1px solid var(--line); background: #fff; padding: .35rem .75rem; font-weight: 700; cursor: pointer; }
.p2-disc button:first-child { border-radius: 10px 0 0 10px; }
.p2-disc button.on { background: var(--green); border-color: var(--green); color: #fff; }
.p2-disc input, .p2-ship { width: 120px; text-align: right; padding: .35rem .6rem; border: 1px solid var(--line); border-radius: 10px; margin-left: .4rem; }
.p2-total { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid var(--line); padding-top: .6rem; font-weight: 700; }
.p2-total b { font-size: 1.7rem; color: var(--green-dark); }
.p2-methods { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: .5rem; }
.pm input { position: absolute; opacity: 0; pointer-events: none; }
.pm span { display: block; text-align: center; padding: .6rem .3rem; border: 1px solid var(--line); border-radius: 12px; background: #fff; font-weight: 700; cursor: pointer; }
.pm input:checked + span { background: var(--green-soft); border-color: var(--green); color: var(--green-dark); }
.pm input:focus-visible + span { outline: 2px solid var(--green); }
.p2-cash { display: flex; justify-content: space-between; align-items: center; gap: .6rem; margin-bottom: .5rem; }
.p2-cash label { font-weight: 800; font-size: 1.05rem; }
.p2-cash input { width: 190px; text-align: right; font-size: 1.3rem; padding: .5rem .8rem; border: 2px solid var(--green); border-radius: 12px; }
.p2-quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.p2-quick button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: .55rem .2rem; font-weight: 700; cursor: pointer; }
.p2-quick button:hover { border-color: var(--green); color: var(--green-dark); background: var(--green-soft); }
.p2-change { display: flex; justify-content: space-between; align-items: center; margin-top: .5rem; padding: .6rem .8rem; border: 1px solid var(--line); border-radius: 12px; background: #f7fbf9; font-weight: 600; }
.p2-change b { color: #1b8a3c; font-size: 1.3rem; }
.p2-bayar { width: 100%; padding: .9rem; border: 0; border-radius: 12px; background: var(--green); color: #fff; font-size: 1.05rem; font-weight: 800; cursor: pointer; }
.p2-bayar:hover:not(:disabled) { background: var(--green-dark); }
.p2-bayar:disabled { background: #9bd2c1; cursor: not-allowed; }
.p2-cancel { border: 0; background: transparent; color: var(--muted); font-size: .8rem; cursor: pointer; text-decoration: underline; }
@media (max-width: 1050px) { .pos2 { grid-template-columns: 1fr; } .p2-right { position: static; } }
