/* ============================================================
   POS Web App - Light Theme (PHP Native)
   Clean, tablet-friendly, print-safe
   ============================================================ */

:root{
  --bg:#f9fafb;
  --surface:#ffffff;
  --surface-2:#f3f4f6;
  --text:#1e1e1e;
  --muted:#6b7280;
  --brand:#16a34a;          /* hijau utama */
  --brand-hover:#15803d;
  --ok:#16a34a;
  --warn:#f59e0b;
  --danger:#dc2626;
  --radius:12px;
  --shadow:0 2px 6px rgba(0,0,0,.08);
  --shadow-lg:0 4px 14px rgba(0,0,0,.12);
}

/* ====== Base ====== */
*{box-sizing:border-box;}
html,body{height:100%;}
body{
  margin:0;
  font:15px/1.55 'Segoe UI',system-ui,Arial;
  color:var(--text);
  background:var(--bg);
  -webkit-font-smoothing:antialiased;
}

a{text-decoration:none; color:var(--text);}
a:hover{color:var(--brand-hover);}

/* ====== TOPBAR ====== */
.topbar{
  position:sticky; top:0; z-index:100;
  display:flex; align-items:center; justify-content:space-between;
  flex-wrap:wrap;
  background:#ffffff;
  border-bottom:3px solid var(--brand);
  box-shadow:0 2px 8px rgba(0,0,0,.05);
  padding:10px 18px;
}

.topbar-left{
  display:flex; align-items:center; gap:10px;
}
.logo{
  width:36px; height:36px; object-fit:contain;
}
.app-title{
  font-weight:700; color:var(--brand);
  font-size:18px; letter-spacing:.3px;
}
.app-title small{
  color:#6b7280; font-size:12px; margin-left:3px;
}

.topbar-right{
  display:flex; align-items:center; gap:12px;
  flex-wrap:wrap;
}
.nav-item{
  color:var(--text);
  padding:6px 10px;
  border-radius:8px;
  font-weight:500;
}
.nav-item:hover{
  background:var(--surface-2);
  color:var(--brand-hover);
}

.user-info{
  color:var(--muted);
  font-size:14px;
}

.btn.logout{
  background:var(--danger);
  color:#fff;
  border:none;
  padding:8px 14px;
  border-radius:8px;
  font-weight:600;
  transition:background .2s;
}
.btn.logout:hover{
  background:#b91c1c;
}


/* ====== Inputs & Buttons ====== */
.input{
  width:100%; padding:10px 12px;
  border:1px solid #d1d5db;
  border-radius:10px;
  background:var(--surface-2);
  color:var(--text);
  min-height:42px;
  transition:border .2s, box-shadow .2s;
}
.input:focus{
  border-color:var(--brand);
  box-shadow:0 0 0 3px rgba(22,163,74,.2);
  outline:none;
}
select.input{
  appearance:none;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23555555' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat:no-repeat;
  background-position:right 12px center;
  padding-right:34px;
}

.actions{display:flex; gap:10px; flex-wrap:wrap; align-items:center;}

.btn{
  display:inline-flex; align-items:center; justify-content:center;
  min-height:42px;
  padding:8px 14px;
  border-radius:10px;
  border:1px solid #d1d5db;
  background:var(--surface-2);
  color:var(--text);
  font-weight:500;
  cursor:pointer;
  transition:all .2s ease;
}
.btn:hover{
  background:#e5e7eb;
}
.btn.primary{
  background:var(--brand); color:#fff; border-color:var(--brand);
}
.btn.primary:hover{
  background:var(--brand-hover);
}
.btn.secondary{
  background:var(--surface); border-color:#d1d5db;
}
.btn.success{
  background:var(--ok); color:#fff; border:none;
}
.btn.danger{
  background:var(--danger); color:#fff; border:none;
}

/* ====== Tables ====== */
.table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  margin:10px 0;
  border:1px solid #e5e7eb;
  border-radius:10px;
  overflow:hidden;
  background:var(--surface);
}
.table th{
  background:#f3f4f6;
  text-align:left;
  padding:12px;
  border-bottom:1px solid #e5e7eb;
  font-weight:600;
}
.table td{
  padding:12px;
  border-bottom:1px solid #f1f3f5;
}
.table tbody tr:nth-child(odd){
  background:#fafafa;
}
.table tbody tr:hover{
  background:#dcfce7; /* highlight hijau lembut */
}

/* ====== Alerts ====== */
.alert{
  padding:12px;
  border-radius:8px;
  background:#fff7ed;
  border:1px solid #fed7aa;
  color:#92400e;
}

/* ====== POS Layout ====== */
.pos-layout{display:grid; gap:16px;}
@media (min-width:768px){
  .pos-layout{grid-template-columns:1.1fr .9fr;}
  .pos-cart-sticky{position:sticky; top:80px;}
}

/* ====== Images (produk & tabel) ====== */
.table img{
  border-radius:8px;
  width:60px; height:60px;
  object-fit:cover;
  transition:transform .2s, box-shadow .2s;
}
.table img:hover{
  transform:scale(1.3);
  box-shadow:var(--shadow-lg);
  z-index:10;
}

/* ====== Badges ====== */
.badge{
  display:inline-block;
  padding:4px 8px;
  border-radius:999px;
  font-size:12px;
  background:#f3f4f6;
  color:#374151;
  border:1px solid #e5e7eb;
}
.badge.ok{background:#dcfce7; border-color:#bbf7d0; color:#065f46;}
.badge.warn{background:#fef9c3; border-color:#fde68a; color:#78350f;}

/* ====== Footer ====== */
.footer{
  text-align:center;
  padding:14px;
  font-size:13px;
  color:#6b7280;
}

/* ===== DASHBOARD ===== */
.dashboard-header{margin-bottom:16px;}
.dashboard-header h2{margin:0;font-size:22px;color:var(--brand);}
.dashboard-header .muted{color:var(--muted);font-size:14px;}

.summary-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  gap:14px;
  margin-bottom:18px;
}
.summary-card{
  display:flex;align-items:center;gap:12px;
  background:var(--surface);
  border:1px solid #e5e7eb;
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:14px 16px;
  transition:transform .15s ease;
}
.summary-card:hover{transform:translateY(-3px);box-shadow:var(--shadow-lg);}
.summary-icon{
  width:42px;height:42px;
  border-radius:10px;
  display:flex;align-items:center;justify-content:center;
  font-size:22px;background:#dcfce7;color:#166534;
}
.summary-info{display:flex;flex-direction:column;}
.summary-title{font-size:14px;color:var(--muted);}
.summary-value{font-size:17px;font-weight:600;color:var(--text);}

.chart-card{
  margin-bottom:20px;
}
.card-title{
  font-size:16px;font-weight:600;margin-bottom:10px;color:var(--text);
}

.quick-links{
  display:flex;flex-wrap:wrap;gap:10px;margin-top:6px;
}
.qlink{
  background:var(--brand);
  color:#fff;font-weight:600;
  padding:10px 16px;border-radius:10px;
  box-shadow:var(--shadow);
  transition:background .2s,transform .1s;
}
.qlink:hover{
  background:var(--brand-hover);
  transform:translateY(-2px);
}

/* Responsif */
@media (max-width:700px){
  .summary-card{padding:10px;}
  .summary-icon{width:36px;height:36px;font-size:20px;}
  .summary-value{font-size:15px;}
  .qlink{flex:1 1 100%;text-align:center;}
}


/* ====== Chart (Dashboard) ====== */
canvas{max-width:100%;height:auto;}

/* ====== Utilities ====== */
.text-right{text-align:right;}
.text-center{text-align:center;}
.mr-auto{margin-right:auto;}
.small{font-size:13px;color:var(--muted);}
.hidden{display:none!important;}

/* ====== Receipt (preview-friendly) ====== */
.receipt-wrap{
  width:80mm; max-width:80mm;
  margin:0 auto;
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:8px;
  padding:8px 8px 12px;
}
.receipt-head{text-align:center;margin-bottom:8px;}
.receipt-head h2{margin:4px 0;font-size:18px;}
.receipt-head .muted{color:#6b7280;font-size:12px;}
.receipt-meta{font-size:12px;margin:8px 0;}
.rcpt-table{width:100%;border-collapse:collapse;font-size:12px;}
.rcpt-table th,.rcpt-table td{padding:4px 0;}
.rcpt-table thead th{border-bottom:1px dashed #9ca3af;text-align:left;}
.rcpt-right{text-align:right;}
.rcpt-hr{border-top:1px dashed #9ca3af;margin:4px 0;}
.no-print{margin-top:10px;display:flex;gap:8px;}

/* ====== Print Rules ====== */
@media print {
  body{background:#fff;margin:0!important;}
  header.topbar,.footer,.no-print{display:none!important;}
  .container{padding:0!important;margin:0!important;}
  #receipt{
    border:none!important;border-radius:0!important;
    box-shadow:none!important;
    width:80mm!important;max-width:80mm!important;
    margin:0!important;padding:4mm 3mm!important;
  }
  #receipt,#receipt *{page-break-inside:avoid!important;break-inside:avoid!important;}
  @page { size:80mm auto; margin:0; }
}

/* ====== Responsive ====== */
@media (max-width:600px){
  body{font-size:14px;}
  .container{padding:12px;}
  .table th,.table td{padding:10px;}
}
@media (min-width:700px) and (max-width:1100px){
  body{font-size:16px;}
  .card{padding:18px;}
  .input,.btn{font-size:16px;}
  .table th,.table td{padding:14px;}
}

.btn.small {
  font-size:13px;
  padding:4px 8px;
  min-height:30px;
  line-height:1.2;
}

