@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,600;0,9..144,700;1,9..144,500&family=Inter:wght@400;500;600;700;800&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root{
  --mint-25:#F5FCF7;
  --mint-50:#E9F8EE;
  --mint-100:#D7F0DF;
  --sage-200:#BEE6CC;
  --sage-300:#9FDCB8;
  --green-500:#4FA97C;
  --green-600:#3C9268;
  --green-700:#2E7D57;
  --forest-800:#1D4232;
  --forest-900:#12291F;
  --ink:#122A20;
  --ink-soft:#3E5A4C;
  --muted:#6C8A7B;
  --line:#CFE9D8;
  --white:#FFFFFF;
  --amber:#E3A73B;
  --red:#D9695F;
  --blue:#4C87C9;
  --radius-lg:20px;
  --radius-md:14px;
  --shadow-soft:0 10px 30px -12px rgba(18,66,50,0.18);
  --shadow-card:0 4px 16px -6px rgba(18,66,50,0.12);
}
*{box-sizing:border-box; margin:0; padding:0;}
body{font-family:'Inter',sans-serif; color:var(--ink); background:var(--mint-25); -webkit-font-smoothing:antialiased;}
h1,h2,h3{font-family:'Fraunces',serif;}
.mono{font-family:'IBM Plex Mono',monospace;}
a{color:inherit;}

.stitch-divider{display:flex; align-items:center; gap:6px; height:14px; margin:6px 0 18px 0; opacity:0.9;}
.stitch-divider .seg{width:10px; height:2px; background:var(--sage-300); border-radius:2px;}
.stitch-divider .leaf{width:12px; height:12px; flex:none;}
.stitch-divider .leaf svg{width:100%; height:100%; display:block;}

/* ---------- LOGIN ---------- */
.login-page{min-height:100vh; position:relative; overflow:hidden; display:flex; align-items:center; justify-content:center;
  background:radial-gradient(circle at 12% 18%, rgba(159,220,184,0.55), transparent 45%),
             radial-gradient(circle at 88% 82%, rgba(79,169,124,0.35), transparent 50%),
             linear-gradient(160deg, var(--mint-25) 0%, var(--mint-100) 45%, var(--sage-200) 100%);
  padding:32px;}
.login-blob{position:absolute; border-radius:50%; opacity:0.5;}
.blob1{width:340px; height:340px; background:radial-gradient(circle, var(--sage-300), transparent 70%); top:-90px; left:-90px;}
.blob2{width:260px; height:260px; background:radial-gradient(circle, var(--green-500), transparent 70%); bottom:-60px; right:-40px; opacity:0.28;}
.login-shell{position:relative; z-index:2; width:100%; max-width:920px; display:grid; grid-template-columns:1.05fr 1fr;
  background:rgba(255,255,255,0.72); backdrop-filter:blur(14px); border:1px solid rgba(255,255,255,0.6);
  border-radius:26px; box-shadow:var(--shadow-soft); overflow:hidden;}
.login-art{background:linear-gradient(155deg, var(--forest-800), var(--green-700) 70%, var(--green-500)); padding:44px 38px;
  color:var(--mint-50); position:relative; overflow:hidden; display:flex; flex-direction:column; justify-content:space-between;}
.login-art::before{content:""; position:absolute; inset:0; background:radial-gradient(circle at 80% 20%, rgba(255,255,255,0.14), transparent 55%);}
.brand-mark{display:flex; align-items:center; gap:10px; position:relative; z-index:1;}
.brand-mark span{font-family:'Fraunces',serif; font-weight:700; font-size:19px;}
.login-art h2{font-size:29px; line-height:1.25; font-weight:600; margin-bottom:10px; position:relative; z-index:1;}
.login-art p{font-size:13.5px; color:#CFEBDA; max-width:280px; line-height:1.6; position:relative; z-index:1;}
.stitch-row{display:flex; gap:5px; margin:18px 0; position:relative; z-index:1;}
.stitch-row .seg{width:9px; height:2px; background:rgba(255,255,255,0.5); border-radius:2px;}
.leaf-scatter{position:relative; z-index:1; display:flex; gap:14px; opacity:0.85;}
.leaf-scatter svg{width:20px; height:20px;}
.login-form-side{padding:46px 42px; display:flex; flex-direction:column; justify-content:center;}
.login-form-side .eyebrow{font-size:11.5px; font-weight:700; letter-spacing:1.4px; text-transform:uppercase; color:var(--green-600); margin-bottom:8px;}
.login-form-side h1{font-size:27px; font-weight:600; color:var(--forest-900); margin-bottom:6px;}
.login-form-side .sub{font-size:13.5px; color:var(--muted); margin-bottom:22px;}
.field{margin-bottom:16px;}
.field label{display:block; font-size:12.5px; font-weight:600; color:var(--ink-soft); margin-bottom:7px;}
.field input{width:100%; padding:13px 14px; border-radius:12px; border:1.5px solid var(--line); background:var(--white);
  font-family:'Inter',sans-serif; font-size:13.5px; color:var(--ink); outline:none; transition:.15s;}
.field input:focus{border-color:var(--green-500); box-shadow:0 0 0 4px rgba(79,169,124,0.14);}
.field-error{color:var(--red); font-size:11.5px; margin-top:6px;}
.row-between{display:flex; align-items:center; justify-content:space-between; font-size:12.5px; margin:4px 0 22px 0;}
.row-between label{display:flex; align-items:center; gap:7px; color:var(--ink-soft); font-weight:500;}
.btn-primary{width:100%; padding:13.5px; border:none; border-radius:12px; cursor:pointer;
  background:linear-gradient(135deg, var(--green-500), var(--green-700)); color:#fff; font-weight:700; font-size:14px;
  box-shadow:0 10px 22px -8px rgba(46,125,87,0.55); transition:.15s;}
.btn-primary:hover{transform:translateY(-1px);}
.alert-banner{background:#FBEAE8; color:var(--red); border:1px solid #F3C9C3; padding:11px 14px; border-radius:11px; font-size:12.5px; margin-bottom:16px;}
.alert-banner.success{background:#E4F5E9; color:var(--green-700); border-color:var(--sage-300);}

/* ---------- APP SHELL ---------- */
.app-shell{display:grid; grid-template-columns:242px 1fr; min-height:100vh;}
.sidebar{background:linear-gradient(190deg, var(--forest-900), var(--forest-800) 85%); color:#CFE9D8; padding:22px 16px; display:flex; flex-direction:column;}
.sidebar .brand-mark{color:#fff; margin-bottom:26px; padding:0 6px;}
.nav-label{font-size:10px; text-transform:uppercase; letter-spacing:1.3px; color:#6E9682; font-weight:700; padding:10px 10px 8px;}
.nav-item{display:flex; align-items:center; gap:11px; padding:10px 12px; border-radius:11px; font-size:13.5px; font-weight:500;
  color:#B9D9C7; cursor:pointer; margin-bottom:2px; transition:.15s; text-decoration:none;}
.nav-item svg{width:17px; height:17px; flex:none; opacity:0.85;}
.nav-item:hover{background:rgba(255,255,255,0.06); color:#fff;}
.nav-item.active{background:var(--sage-300); color:var(--forest-900); font-weight:700;}
.sidebar-footer{margin-top:auto; padding:14px 10px 4px; border-top:1px solid rgba(255,255,255,0.1);}
.plan-card{background:rgba(255,255,255,0.06); border-radius:13px; padding:13px; font-size:11.5px; color:#B9D9C7; line-height:1.5;}
.plan-card b{color:#fff; display:block; font-size:12.5px; margin-bottom:3px;}

.main-col{display:flex; flex-direction:column; min-height:100vh; background:var(--mint-25);}
.topbar{display:flex; align-items:center; gap:16px; padding:16px 28px; border-bottom:1px solid var(--line); background:var(--white); position:sticky; top:0; z-index:5;}
.search-box{flex:1; max-width:380px; display:flex; align-items:center; gap:9px; background:var(--mint-50); border:1px solid var(--line); border-radius:11px; padding:9px 13px;}
.search-box svg{width:15px; height:15px; color:var(--muted);}
.search-box input{border:none; background:transparent; outline:none; font-size:13px; width:100%; font-family:'Inter',sans-serif;}
.topbar .spacer{flex:1;}
.btn-accent{display:flex; align-items:center; gap:7px; padding:10px 17px; border:none; border-radius:11px; cursor:pointer;
  background:linear-gradient(135deg, var(--green-500), var(--green-700)); color:#fff; font-weight:700; font-size:12.8px;
  box-shadow:0 8px 18px -8px rgba(46,125,87,0.55);}
.btn-accent svg{width:15px; height:15px;}
.user-chip{display:flex; align-items:center; gap:9px; padding-left:8px;}
.avatar{width:34px; height:34px; border-radius:10px; background:linear-gradient(135deg, var(--sage-300), var(--green-600)); display:flex; align-items:center; justify-content:center; color:#fff; font-weight:700; font-size:13px;}
.user-chip .who{line-height:1.2;}
.user-chip .who b{font-size:12.8px; display:block; color:var(--ink);}
.user-chip .who span{font-size:11px; color:var(--muted);}
.logout-btn{border:1px solid var(--line); background:var(--white); border-radius:10px; padding:8px 12px; font-size:12px; font-weight:600; color:var(--ink-soft); cursor:pointer;}

.content{padding:26px 28px 40px; flex:1;}
.content-head{display:flex; align-items:flex-end; justify-content:space-between; margin-bottom:4px;}
.content-head h1{font-size:22px; font-weight:600; color:var(--forest-900);}
.content-head p{font-size:12.8px; color:var(--muted); margin-top:3px;}

.pill-row{display:flex; gap:8px; margin-bottom:18px; flex-wrap:wrap;}
.pill{padding:8px 15px; border-radius:999px; font-size:12.5px; font-weight:600; background:var(--white); border:1px solid var(--line); color:var(--ink-soft); cursor:pointer; text-decoration:none;}
.pill.active{background:var(--forest-900); color:#fff; border-color:var(--forest-900);}

/* ---------- KASIR ---------- */
.kasir-grid{display:grid; grid-template-columns:1fr 340px; gap:20px; align-items:start;}
.product-grid{display:grid; grid-template-columns:repeat(3, 1fr); gap:14px;}
.product-card{background:var(--white); border:1px solid var(--line); border-radius:var(--radius-md); padding:12px; position:relative; transition:.15s;}
.product-card:hover{box-shadow:var(--shadow-card); transform:translateY(-2px); border-color:var(--sage-300);}
.product-thumb{height:88px; border-radius:11px; margin-bottom:10px; position:relative; display:flex; align-items:center; justify-content:center;}
.product-thumb svg{width:46px; height:46px; opacity:0.9; color:var(--green-700);}
.stock-badge{position:absolute; top:8px; left:8px; font-size:10px; font-weight:700; padding:3px 8px; border-radius:999px; background:var(--amber); color:#4A3200;}
.stock-badge.low{background:var(--red); color:#fff;}
.product-card .name{font-size:12.8px; font-weight:600; color:var(--ink); line-height:1.3; margin-bottom:6px; min-height:33px;}
.price{font-family:'IBM Plex Mono',monospace; font-weight:600; font-size:13px; color:var(--green-700);}
.add-btn{margin-top:9px; width:100%; padding:8px; border-radius:9px; border:1px solid var(--sage-300); background:var(--mint-50); color:var(--green-700);
  font-weight:700; font-size:11.8px; cursor:pointer; display:flex; align-items:center; justify-content:center; gap:5px;}
.add-btn:hover{background:var(--sage-300); color:var(--forest-900);}
.add-btn:disabled{opacity:0.45; cursor:not-allowed;}

.order-panel{background:var(--white); border:1px solid var(--line); border-radius:var(--radius-lg); padding:20px; position:sticky; top:88px;}
.order-panel .head{display:flex; align-items:center; justify-content:space-between; margin-bottom:6px;}
.order-panel h3{font-size:16px; font-weight:600; color:var(--forest-900);}
.order-id{font-size:11px; color:var(--muted);}
.status-chip{font-size:10.5px; font-weight:700; background:var(--mint-100); color:var(--green-700); padding:3px 9px; border-radius:999px;}
.order-item{display:flex; align-items:center; gap:10px; padding:10px 0; border-bottom:1px dashed var(--line);}
.order-item .thumb{width:38px; height:38px; border-radius:9px; background:var(--mint-100); display:flex; align-items:center; justify-content:center; color:var(--green-600); flex:none;}
.order-item .thumb svg{width:19px; height:19px;}
.order-item .meta{flex:1;}
.order-item .meta b{font-size:12.5px; font-weight:600; display:block;}
.order-item .meta span{font-size:11px; color:var(--muted);}
.order-item .amt{font-family:'IBM Plex Mono',monospace; font-size:12.5px; font-weight:600;}
.qty-ctrl{display:flex; align-items:center; gap:6px;}
.qty-ctrl button{width:20px; height:20px; border-radius:6px; border:1px solid var(--line); background:var(--white); cursor:pointer; font-size:12px; line-height:1;}
.empty-cart{text-align:center; padding:24px 8px; color:var(--muted); font-size:12.5px;}
.sum-row{display:flex; justify-content:space-between; font-size:12.8px; color:var(--ink-soft); padding:5px 0;}
.sum-row.total{font-size:15px; font-weight:700; color:var(--forest-900); border-top:1.5px solid var(--line); margin-top:8px; padding-top:12px;}
.pay-methods{display:flex; gap:8px; margin:14px 0;}
.pay-methods button{flex:1; padding:9px 6px; border-radius:10px; border:1.5px solid var(--line); background:var(--white); font-size:11px; font-weight:600; color:var(--ink-soft); cursor:pointer;}
.pay-methods button.sel{border-color:var(--green-500); background:var(--mint-50); color:var(--green-700);}
.order-actions{display:flex; gap:9px; margin-top:6px;}
.btn-cancel{flex:1; padding:12px; border-radius:11px; border:1.5px solid var(--line); background:var(--white); color:var(--ink-soft); font-weight:700; font-size:12.5px; cursor:pointer;}
.btn-confirm{flex:1.4; padding:12px; border-radius:11px; border:none; background:linear-gradient(135deg, var(--green-500), var(--green-700)); color:#fff; font-weight:700; font-size:12.5px; cursor:pointer;}
.btn-confirm:disabled{opacity:0.5; cursor:not-allowed;}
.discount-row{display:flex; align-items:center; justify-content:space-between; font-size:12px; color:var(--ink-soft); margin-top:10px;}
.discount-row input{width:60px; padding:5px 7px; border:1px solid var(--line); border-radius:8px; font-size:12px; text-align:right;}

/* ---------- KPI / TABLE (Inventory + Report) ---------- */
.kpi-row{display:grid; grid-template-columns:repeat(4,1fr); gap:14px; margin-bottom:22px;}
.kpi-card{background:var(--white); border:1px solid var(--line); border-radius:var(--radius-md); padding:16px;}
.kpi-card .top{display:flex; align-items:center; justify-content:space-between; margin-bottom:10px;}
.kpi-icon{width:36px; height:36px; border-radius:10px; background:var(--mint-100); display:flex; align-items:center; justify-content:center;}
.kpi-icon svg{width:18px; height:18px; color:var(--green-700);}
.kpi-card .val{font-size:22px; font-weight:700; font-family:'Fraunces',serif; color:var(--forest-900);}
.kpi-card .lbl{font-size:11.8px; color:var(--muted); margin-top:2px;}
.kpi-trend{font-size:11px; font-weight:700; padding:3px 8px; border-radius:999px; background:#E4F5E9; color:var(--green-700);}

.table-card{background:var(--white); border:1px solid var(--line); border-radius:var(--radius-lg); overflow:hidden;}
.table-toolbar{display:flex; align-items:center; justify-content:space-between; gap:10px; padding:16px 18px; border-bottom:1px solid var(--line); flex-wrap:wrap;}
.table-toolbar form{display:flex; gap:8px; flex-wrap:wrap;}
.table-toolbar select, .table-toolbar input[type=text]{padding:8px 11px; border:1px solid var(--line); border-radius:9px; font-size:12.5px; font-family:'Inter',sans-serif;}
table{width:100%; border-collapse:collapse;}
thead th{text-align:left; font-size:10.8px; text-transform:uppercase; letter-spacing:0.6px; color:var(--muted); padding:12px 18px; border-bottom:1px solid var(--line); background:var(--mint-25); font-weight:700;}
tbody td{padding:13px 18px; font-size:12.8px; border-bottom:1px solid var(--line); color:var(--ink-soft);}
tbody tr:last-child td{border-bottom:none;}
tbody tr:hover{background:var(--mint-25);}
.prod-cell{display:flex; align-items:center; gap:10px;}
.prod-cell .sw{width:34px; height:34px; border-radius:9px; flex:none;}
.prod-cell b{font-size:12.8px; color:var(--ink); display:block;}
.prod-cell span{font-size:11px; color:var(--muted);}
.tag{font-size:10.8px; font-weight:700; padding:4px 10px; border-radius:999px;}
.tag.good{background:#E4F5E9; color:var(--green-700);}
.tag.low{background:#FDF3E2; color:#95651A;}
.tag.out{background:#FBEAE8; color:var(--red);}
.stock-bar{width:70px; height:6px; border-radius:4px; background:var(--mint-100); overflow:hidden; margin-top:5px;}
.stock-bar i{display:block; height:100%; background:var(--green-500); border-radius:4px;}
.row-actions{display:flex; gap:6px;}
.row-actions button, .row-actions a{width:28px; height:28px; border-radius:8px; border:1px solid var(--line); background:var(--white); cursor:pointer; display:flex; align-items:center; justify-content:center;}
.row-actions svg{width:13px; height:13px; color:var(--ink-soft);}
.pagination-wrap{padding:14px 18px; border-top:1px solid var(--line);}

/* ---------- REPORT ---------- */
.report-grid{display:grid; grid-template-columns:1.6fr 1fr; gap:18px; margin-bottom:18px;}
.panel{background:var(--white); border:1px solid var(--line); border-radius:var(--radius-lg); padding:20px;}
.panel .phead{display:flex; align-items:center; justify-content:space-between; margin-bottom:16px;}
.panel h3{font-size:15px; font-weight:600; color:var(--forest-900);}
.range-tag{font-size:11.5px; font-weight:600; color:var(--muted); background:var(--mint-50); padding:5px 11px; border-radius:999px; border:1px solid var(--line);}
.bar-chart{display:flex; align-items:flex-end; gap:14px; height:190px; padding-top:10px;}
.bar-col{flex:1; display:flex; flex-direction:column; align-items:center; gap:8px; height:100%; justify-content:flex-end;}
.bar-col .bar{width:100%; max-width:30px; border-radius:7px 7px 3px 3px; background:linear-gradient(180deg, var(--sage-300), var(--green-600));}
.bar-col .day{font-size:10.8px; color:var(--muted); font-weight:600;}
.top-prod{display:flex; align-items:center; gap:12px; padding:11px 0; border-bottom:1px solid var(--line);}
.top-prod:last-child{border-bottom:none;}
.top-prod .rank{width:24px; height:24px; border-radius:8px; background:var(--mint-100); color:var(--green-700); font-weight:700; font-size:11.5px; display:flex; align-items:center; justify-content:center; flex:none;}
.top-prod .info{flex:1;}
.top-prod .info b{font-size:12.5px; display:block; color:var(--ink);}
.top-prod .info .bar-bg{height:5px; border-radius:4px; background:var(--mint-100); margin-top:6px; overflow:hidden;}
.top-prod .info .bar-bg i{display:block; height:100%; background:var(--green-500);}
.top-prod .amt{font-family:'IBM Plex Mono',monospace; font-size:12px; font-weight:600; color:var(--green-700);}
.trend-svg{width:100%; height:150px;}
.empty-state{text-align:center; padding:30px; color:var(--muted); font-size:12.5px;}

/* ---------- MODAL (Alpine) ---------- */
.modal-backdrop{position:fixed; inset:0; background:rgba(18,41,31,0.45); z-index:50; display:flex; align-items:center; justify-content:center; padding:20px;}
.modal-box{background:var(--white); border-radius:18px; width:100%; max-width:480px; padding:24px; box-shadow:var(--shadow-soft);}
.modal-box h3{font-size:17px; margin-bottom:16px; color:var(--forest-900);}
.modal-box .field{margin-bottom:13px;}
.modal-actions{display:flex; gap:10px; margin-top:6px;}

.mobile-sidebar-backdrop{display:none;}
@media (max-width:980px){
  .login-shell{grid-template-columns:1fr;}
  .login-art{display:none;}
  .app-shell{grid-template-columns:1fr;}
  .sidebar{
    position:fixed; top:0; left:0; bottom:0; width:242px; z-index:55;
    transform:translateX(-100%); transition:transform .2s ease; overflow-y:auto;
  }
  .app-shell:not(.sidebar-hidden) .sidebar{transform:translateX(0);}
  .mobile-sidebar-backdrop{display:block; position:fixed; inset:0; background:rgba(18,41,31,0.45); z-index:54;}
  .kasir-grid{grid-template-columns:1fr;}
  .product-grid{grid-template-columns:repeat(2,1fr);}
  .kpi-row{grid-template-columns:repeat(2,1fr);}
  .report-grid{grid-template-columns:1fr;}
}
