* { margin:0; padding:0; box-sizing:border-box; }
svg { max-width:100%; }
body { font-family:'Segoe UI', system-ui, -apple-system, sans-serif; background:#f2f7fe; color:#0f172a; }
a { color:#006cf3; text-decoration:none; }
h1,h2,h3 { font-weight:600; }

/* ============ TOPBAR ============ */
.topbar { position:fixed; top:0; left:0; right:0; height:52px; background:#05172c; z-index:50;
  display:flex; align-items:center; gap:20px; padding:0 20px; }
.brand { display:flex; align-items:center; gap:10px; color:#fff; font-weight:700; font-size:16px; white-space:nowrap; }
.brand-mark { width:28px; height:28px; border-radius:8px; background:#0aa867; color:#fff; display:flex;
  align-items:center; justify-content:center; font-size:14px; font-weight:800; }
.top-search { flex:1; max-width:560px; margin:0 10px; }
.top-search input { width:100%; background:#2a425d; border:1px solid #3a5578; color:#eaf2ff; border-radius:18px;
  padding:8px 16px; font-size:13px; outline:none; }
.top-search input::placeholder { color:#8fa5c0; }
.top-right { margin-left:auto; display:flex; align-items:center; gap:14px; }
.top-date { color:#8fa5c0; font-size:12.5px; white-space:nowrap; }

/* ============ LAYOUT ============ */
.layout { display:flex; min-height:100vh; padding-top:52px; }
.sidebar { width:232px; background:#05182d; color:#cbd5e1; display:flex; flex-direction:column;
  position:fixed; top:52px; bottom:0; left:0; }
.sidebar nav { flex:1; padding:14px 10px; overflow-y:auto; }
.sidebar nav a { display:flex; align-items:center; gap:10px; padding:10px 13px; color:#7c8ba1;
  border-radius:9px; font-size:13.5px; font-weight:500; margin-bottom:2px; }
.sidebar nav a:hover { background:rgba(255,255,255,.06); color:#e2e8f0; }
.sidebar nav a.active { background:#006cf3; color:#fff; }
.sidebar nav a .dot { width:7px; height:7px; border-radius:50%; background:currentColor; opacity:.55; flex-shrink:0; }
.sidebar-foot { padding:14px; border-top:1px solid #122a44; }
.user-chip { display:flex; gap:10px; align-items:center; margin-bottom:10px; }
.avatar { width:32px; height:32px; border-radius:50%; background:#006cf3; color:#fff; display:flex;
  align-items:center; justify-content:center; font-weight:700; font-size:13px; flex-shrink:0; }
.u-name { color:#e2e8f0; font-size:13px; font-weight:600; }
.u-role { color:#5c6f8a; font-size:11px; text-transform:capitalize; }
.logout { color:#f87171; font-size:13px; font-weight:600; }

.content { flex:1; margin-left:232px; padding:22px 26px; min-width:0; }
.page-head { margin-bottom:18px; }
.page-head h1 { font-size:21px; color:#13223a; }

/* ============ GRID + CARDS ============ */
.grid { display:grid; gap:16px; }
.grid.cols-4 { grid-template-columns:repeat(4,1fr); }
.grid.cols-3 { grid-template-columns:repeat(3,1fr); }
.grid.cols-2 { grid-template-columns:repeat(2,1fr); }
.card { background:#fff; border:1px solid #e3ecf7; border-radius:14px; padding:18px;
  box-shadow:0 1px 3px rgba(13,42,77,.05); }
.card h3 { font-size:14.5px; margin-bottom:13px; color:#13223a; }
.chart-wrap { position:relative; height:250px; }

/* ============ KPI CARDS (sample ke mutabiq) ============ */
.kpi { border-radius:14px; padding:18px 20px; color:#fff; position:relative; overflow:hidden;
  min-height:110px; display:flex; flex-direction:column; justify-content:center; }
.kpi .kpi-label { font-size:12.5px; font-weight:600; opacity:.85; letter-spacing:.02em; }
.kpi .kpi-value { font-size:25px; font-weight:800; margin-top:7px; }
.kpi .kpi-sub { font-size:11.5px; opacity:.8; margin-top:5px; }
.kpi .kpi-icon { position:absolute; top:14px; right:14px; width:34px; height:34px; border-radius:9px;
  background:rgba(255,255,255,.18); display:flex; align-items:center; justify-content:center; }
.kpi.blue   { background:#006cf3; }
.kpi.green  { background:#0aa867; }
.kpi.orange { background:#f99818; }
.kpi.purple { background:#6c57ea; }

/* white stat cards (other pages) */
.stat .s-label { color:#5c6f8a; font-size:13px; font-weight:600; }
.stat .s-value { font-size:24px; font-weight:800; margin-top:6px; color:#13223a; }
.stat .s-sub { color:#94a3b8; font-size:12px; margin-top:4px; }

/* ============ TABLES ============ */
.tbl { width:100%; border-collapse:collapse; font-size:13.5px; }
.tbl th { text-align:left; color:#5c6f8a; font-weight:600; padding:9px 10px;
  border-bottom:1px solid #e3ecf7; white-space:nowrap; font-size:12.5px; }
.tbl td { padding:10px; border-bottom:1px solid #eef4fb; color:#26374f; }
.tbl tr:hover td { background:#f6faff; }
.tbl .num { text-align:right; }

.badge { display:inline-flex; align-items:center; gap:5px; padding:3px 10px; border-radius:20px;
  font-size:11px; font-weight:600; }
.badge::before { content:''; width:6px; height:6px; border-radius:50%; background:currentColor; }
.badge.green { background:#e1f8ec; color:#0a9b58; }
.badge.red { background:#fee9e9; color:#e0001c; }
.badge.blue { background:#e3f0ff; color:#006cf3; }
.badge.gray { background:#eef4fb; color:#5c6f8a; }
.badge.orange { background:#fef3df; color:#d97b06; }

/* ============ FORMS ============ */
label { display:block; font-size:12.5px; font-weight:600; color:#42566f; margin:11px 0 5px; }
input, select, textarea { width:100%; padding:9px 12px; border:1px solid #d3e0ee; border-radius:9px;
  font-size:14px; background:#fff; color:#13223a; }
input:focus, select:focus, textarea:focus { outline:2px solid #bcdcff; border-color:#006cf3; }
button, .btn { background:#006cf3; color:#fff; border:none; padding:10px 18px; border-radius:9px;
  font-size:14px; font-weight:600; cursor:pointer; display:inline-block; }
button:hover, .btn:hover { background:#0058c7; }
.btn-sm { padding:5px 12px; font-size:12px; border-radius:7px; }
.btn-danger { background:#e0001c; } .btn-danger:hover { background:#c00018; }
.btn-gray { background:#5c6f8a; } .btn-gray:hover { background:#4a5b73; }
.btn-green { background:#0aa867; } .btn-green:hover { background:#08915a; }
.form-row { display:flex; gap:14px; } .form-row > div { flex:1; }

.alert { padding:12px 14px; border-radius:10px; margin-bottom:14px; font-size:13.5px; }
.alert.error { background:#fee9e9; color:#a30014; }
.alert.success { background:#e1f8ec; color:#0a7b45; line-height:1.7; }

.toolbar { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:16px; flex-wrap:wrap; }
.toolbar .filters { display:flex; gap:8px; align-items:center; }
.toolbar input, .toolbar select { width:auto; }

/* ============ POS ============ */
.pos-wrap { display:grid; grid-template-columns: 1fr 380px; gap:16px; align-items:start; }
.pos-search { margin-bottom:14px; }
.product-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:12px;
  max-height:calc(100vh - 250px); overflow-y:auto; }
.p-card { background:#fff; border:1px solid #e3ecf7; border-radius:12px; padding:14px; cursor:pointer;
  transition:.15s; box-shadow:0 1px 3px rgba(13,42,77,.05); }
.p-card:hover { border-color:#006cf3; box-shadow:0 5px 14px rgba(0,108,243,.16); transform:translateY(-1px); }
.p-card .p-name { font-size:13.5px; font-weight:600; min-height:36px; color:#13223a; }
.p-card .p-price { color:#006cf3; font-weight:700; margin-top:6px; }
.p-card .p-stock { font-size:11.5px; color:#94a3b8; margin-top:3px; }
.p-card.out { opacity:.45; cursor:not-allowed; }
.cart-card { background:#fff; border:1px solid #e3ecf7; border-radius:14px; padding:18px;
  box-shadow:0 1px 3px rgba(13,42,77,.05); }
.cart-items { max-height:300px; overflow-y:auto; margin:10px 0; }
.cart-line { display:flex; align-items:center; gap:8px; padding:8px 0; border-bottom:1px solid #eef4fb; font-size:13.5px; }
.cart-line .cl-name { flex:1; font-weight:600; }
.qty-btn { width:24px; height:24px; border-radius:7px; border:1px solid #d3e0ee; background:#fff;
  cursor:pointer; font-weight:700; }
.cart-totals { border-top:1px solid #e3ecf7; margin-top:10px; padding-top:10px; }
.cart-totals .row { display:flex; justify-content:space-between; padding:4px 0; font-size:14px; color:#26374f; }
.cart-totals .row.grand { font-size:18px; font-weight:800; color:#13223a; }

/* ============ LOGIN ============ */
.login-body { display:flex; align-items:center; justify-content:center; min-height:100vh;
  background:radial-gradient(900px 500px at 15% 10%, #0d2b4d, #05172c); }
.login-card { background:#fff; border-radius:16px; padding:34px 30px; width:360px;
  box-shadow:0 18px 50px rgba(3,15,31,.45); }
.login-brand { display:flex; align-items:center; gap:10px; font-size:18px; font-weight:700; margin-bottom:18px; color:#13223a; }
.login-card button { width:100%; margin-top:18px; }
.login-hint { text-align:center; font-size:12px; color:#94a3b8; margin-top:14px; }

/* ============ INVOICE / PRINT ============ */
@media print {
  body { background:#fff; }
  .topbar, .sidebar { display:none !important; }
  .layout { padding-top:0; }
  .no-print { display:none !important; }
  .print-area { box-shadow:none !important; border:none !important; }
  .content { margin-left:0; padding:0; }
}
.invoice-box { background:#fff; border:1px solid #e3ecf7; border-radius:14px; padding:30px; max-width:560px; margin:0 auto; }
.invoice-box table { width:100%; border-collapse:collapse; font-size:13.5px; margin-top:14px; }
.invoice-box th { text-align:left; border-bottom:2px solid #13223a; padding:7px 6px; }
.invoice-box td { border-bottom:1px solid #e3ecf7; padding:7px 6px; }

@media (max-width: 900px) {
  .grid.cols-4, .grid.cols-3 { grid-template-columns:repeat(2,1fr); }
  .pos-wrap { grid-template-columns:1fr; }
  .sidebar { display:none; }
  .content { margin-left:0; }
  .top-search { display:none; }
}


/* ============ TOPBAR v2 ============ */
.topbar { justify-content:flex-start; }
.topbar-left { display:flex; align-items:center; gap:14px; }
.hamburger { width:30px; height:30px; border-radius:8px; background:rgba(255,255,255,.06); display:flex;
  align-items:center; justify-content:center; cursor:pointer; color:#9db3cf; border:none; }
.hamburger:hover { background:rgba(255,255,255,.12); }
.top-search { position:relative; }
.top-search input { padding-left:34px; }
.top-search .si { position:absolute; left:12px; top:50%; transform:translateY(-50%); color:#8fa5c0; }
.top-search .kbd { position:absolute; right:10px; top:50%; transform:translateY(-50%); font-size:10.5px;
  color:#7c93b3; background:rgba(255,255,255,.07); border:1px solid rgba(255,255,255,.12); border-radius:5px; padding:1px 6px; }
.branch-pill { display:flex; align-items:center; gap:7px; color:#cfe0f7; font-size:12.5px; font-weight:600;
  background:rgba(255,255,255,.06); border-radius:9px; padding:6px 12px; white-space:nowrap; }
.bell-wrap { position:relative; width:34px; height:34px; border-radius:9px; background:rgba(255,255,255,.06);
  display:flex; align-items:center; justify-content:center; color:#cfe0f7; }
.bell-badge { position:absolute; top:2px; right:2px; background:#e0001c; color:#fff; font-size:9.5px; font-weight:700;
  border-radius:50%; width:15px; height:15px; display:flex; align-items:center; justify-content:center; }
.top-user { display:flex; align-items:center; gap:9px; }
.top-user .u-name { color:#eaf2ff; font-size:12.5px; font-weight:700; line-height:1.2; }
.top-user .u-role { color:#7c93b3; font-size:10.5px; line-height:1.2; }

/* ============ SIDEBAR v2 ============ */
.sidebar nav a svg { width:16px; height:16px; flex-shrink:0; stroke:currentColor; }
.admin-group { margin-top:6px; }
.admin-head { display:flex; align-items:center; justify-content:space-between; padding:9px 13px;
  color:#5c7295; font-size:11px; font-weight:700; letter-spacing:.05em; text-transform:uppercase; cursor:pointer; }
.admin-head svg { width:13px; height:13px; transition:transform .15s; }
.admin-sub { display:flex; flex-direction:column; }
.admin-sub a { padding-left:30px; font-size:13px; }
.sidebar-version { color:#3f5776; font-size:11px; text-align:center; padding:8px 0 2px; }

/* ============ WELCOME HEAD ============ */
.welcome-head { display:flex; align-items:center; gap:8px; color:#5c6f8a; font-size:13px; margin-bottom:2px; }
.welcome-head svg { width:14px; height:14px; }
.welcome-sub { color:#5c6f8a; font-size:13.5px; margin-top:2px; }

/* ============ KPI v2 ============ */
.kpi-delta { display:inline-flex; align-items:center; gap:3px; font-size:11px; font-weight:700;
  background:rgba(255,255,255,.2); border-radius:5px; padding:1px 6px; margin-left:6px; }

/* ============ DASHBOARD ROW LAYOUTS ============ */
.dash-row2 { display:grid; grid-template-columns:2fr 1fr; gap:16px; align-items:start; }
.dash-charts { display:grid; grid-template-columns:1.3fr 1fr; gap:16px; }
.side-stack { display:flex; flex-direction:column; gap:16px; }
.dash-row4 { display:grid; grid-template-columns:2fr 1fr; gap:16px; }

/* Category legend list */
.legend-list { list-style:none; margin-top:10px; }
.legend-list li { display:flex; align-items:center; gap:8px; padding:5px 0; font-size:12.5px; color:#3a4c66; }
.legend-list .dot { width:9px; height:9px; border-radius:50%; flex-shrink:0; }
.legend-list .pct { margin-left:auto; font-weight:700; color:#13223a; }
.donut-center { position:absolute; top:50%; left:50%; transform:translate(-50%,-50%); text-align:center; pointer-events:none; }
.donut-center .dc-val { font-size:15px; font-weight:800; color:#13223a; }
.donut-center .dc-lbl { font-size:10.5px; color:#5c6f8a; margin-top:1px; }
.chart-wrap.rel { position:relative; }

/* Quick actions grid */
.qa-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.qa-btn { display:flex; flex-direction:column; align-items:center; gap:7px; padding:14px 6px; border-radius:11px;
  background:#f6faff; border:1px solid #e3ecf7; cursor:pointer; text-align:center; }
.qa-btn:hover { background:#eef5ff; }
.qa-btn .qa-icon { width:32px; height:32px; border-radius:9px; display:flex; align-items:center; justify-content:center; color:#fff; }
.qa-btn span.qa-label { font-size:11.5px; font-weight:600; color:#26374f; }

/* Mini donut (inventory status) */
.mini-donut-wrap { display:flex; align-items:center; gap:16px; }
.mini-legend { flex:1; display:flex; flex-direction:column; gap:7px; font-size:12px; color:#3a4c66; }
.mini-legend .row { display:flex; align-items:center; gap:7px; }
.mini-legend .dot { width:8px; height:8px; border-radius:50%; }
.mini-legend .val { margin-left:auto; font-weight:700; color:#13223a; }

/* Activity feed */
.activity-feed { display:flex; flex-direction:column; gap:14px; }
.activity-item { display:flex; gap:11px; align-items:flex-start; }
.activity-icon { width:30px; height:30px; border-radius:8px; display:flex; align-items:center; justify-content:center;
  color:#fff; flex-shrink:0; }
.activity-text { font-size:13px; color:#26374f; font-weight:600; }
.activity-meta { font-size:11.5px; color:#94a3b8; margin-top:2px; }
.view-all { font-size:12px; font-weight:700; color:#006cf3; }
.card-head { display:flex; justify-content:space-between; align-items:center; margin-bottom:13px; }
.card-head h3 { margin-bottom:0; }

@media (max-width: 1100px) {
  .dash-row2, .dash-charts, .dash-row4 { grid-template-columns:1fr; }
}
