/* ==========================================================================
   Baki Hishab — App Shell Stylesheet
   Glassmorphism + emerald accent matching LandingPage.
   ========================================================================== */

:root {
  --primary:       #10B981;
  --primary-dark:  #059669;
  --primary-light: #6EE7B7;
  --secondary:     #FF6B6B;
  --accent:        #FFB088;
  --text-primary:  #064E3B;
  --text-secondary:#6B7280;
  --text-hint:     #9CA3AF;
  --white:         #FFFFFF;
  --glass:         rgba(255, 255, 255, 0.65);
  --glass-soft:    rgba(255, 255, 255, 0.45);
  --glass-border:  rgba(255, 255, 255, 0.8);
  --shadow:        0 14px 40px rgba(6, 78, 59, 0.12);
  --shadow-card:   0 8px 24px rgba(6, 78, 59, 0.08);
  --grad-top:      #D1FAE5;
  --grad-mid:      #ECFDF5;
  --grad-bottom:   #FFFFFF;
  --radius-sm:     12px;
  --radius-md:     16px;
  --radius-lg:     20px;
  --radius-xl:     24px;
  --radius-xxl:    32px;

  --emerald-100:   #D1FAE5;
  --emerald-50:    #ECFDF5;

  --due-red:       #B91C1C;
  --due-red-100:   rgba(255, 107, 107, 0.18);
  --warn-amber:    #B8791E;
  --warn-amber-100:rgba(255, 176, 136, 0.22);

  --font-display:  'Roboto', system-ui, -apple-system, sans-serif;
  --font-body:     'Hind Siliguri', 'Roboto', sans-serif;
  --font-mono:     ui-monospace, SFMono-Regular, Menlo, monospace;
}

[data-theme="dark"] {
  --grad-top:    #0B2A1F;
  --grad-mid:    #071A13;
  --grad-bottom: #051610;
  --glass:       rgba(6, 78, 59, 0.4);
  --glass-soft:  rgba(6, 78, 59, 0.25);
  --glass-border:rgba(16, 185, 129, 0.2);
  --text-primary:#ECFDF5;
  --text-secondary:#9CA3AF;
  --text-hint:   #6B7280;
  --shadow:      0 14px 40px rgba(0, 0, 0, 0.5);
  --shadow-card: 0 8px 24px rgba(0, 0, 0, 0.4);
  --emerald-100: #0B3F2C;
  --emerald-50:  #071F16;
  --due-red-100: rgba(255, 107, 107, 0.18);
  --warn-amber-100: rgba(255, 176, 136, 0.18);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  color: var(--text-primary);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(16, 185, 129, 0.18), transparent 60%),
    radial-gradient(900px 500px at 100% 10%, rgba(255, 176, 136, 0.22), transparent 60%),
    linear-gradient(180deg, var(--grad-top) 0%, var(--grad-mid) 35%, var(--grad-bottom) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  margin: 0 0 .4em;
  line-height: 1.2;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  font-weight: 800;
}
p { margin: 0 0 1em; color: var(--text-secondary); line-height: 1.6; }
a { color: var(--primary-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }
:focus-visible { outline: 2.5px solid var(--primary); outline-offset: 2px; border-radius: 6px; }

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ================= APP SHELL ================= */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 260px; flex: none;
  background: var(--glass);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-right: 1px solid var(--glass-border);
  padding: 22px 14px;
  display: flex; flex-direction: column; gap: 4px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  z-index: 20;
}
.sidebar .brand {
  padding: 6px 10px 22px;
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 17px;
  color: var(--text-primary);
}
.sidebar .brand-logo {
  width: 36px; height: 36px; border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 18px;
  box-shadow: 0 6px 14px rgba(16, 185, 129, 0.35);
}
.sidebar .brand b { font-family: var(--font-display); font-size: 18px; }
.sidebar .brand small { display: block; font-size: 11px; color: var(--text-secondary); font-weight: 500; }

.side-link {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 14.5px; font-weight: 600;
  position: relative;
  transition: background 0.15s, color 0.15s;
}
.side-link:hover { background: rgba(16, 185, 129, 0.10); color: var(--text-primary); text-decoration: none; }
.side-link.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.30);
}
.side-link.active .ic { color: #fff; }
.side-link .ic { font-size: 17px; width: 20px; text-align: center; }

.side-group-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-hint); padding: 18px 14px 6px;
  font-weight: 800;
}
.sidebar-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--glass-border); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 26px;
  background: var(--glass);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--glass-border);
  position: sticky; top: 0;
  z-index: 20;
}
.topbar-search {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill, 999px);
  padding: 9px 16px;
  width: 320px; max-width: 44vw;
}
.topbar-search input {
  border: none; background: none; outline: none;
  width: 100%; font-size: 14px; color: var(--text-primary);
  font-weight: 600;
}
.topbar-actions { display: flex; align-items: center; gap: 10px; }

.icon-btn {
  width: 38px; height: 38px; border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.6);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: var(--text-secondary);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.icon-btn:hover {
  border-color: var(--primary); color: var(--primary-dark);
  background: rgba(255, 255, 255, 0.85);
}

.page { padding: 26px; max-width: 1160px; width: 100%; margin: 0 auto; }
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin-bottom: 22px; flex-wrap: wrap;
}
.page-head h1 { font-size: 26px; margin-bottom: 4px; }
.page-head p { margin: 0; font-size: 14px; color: var(--text-secondary); }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ================= CARDS ================= */
.card {
  background: var(--glass);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  box-shadow: var(--shadow-card);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}
.stat-card {
  background: var(--glass);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 18px 18px 16px;
  position: relative; overflow: hidden;
  box-shadow: var(--shadow-card);
}
.stat-card::before {
  content: ""; position: absolute; left: 0; top: 14px; bottom: 14px;
  width: 3px; border-radius: 3px; background: var(--primary);
}
.stat-card.due::before { background: var(--due-red); }
.stat-card.warn::before { background: var(--warn-amber); }
.stat-card.neutral::before { background: var(--text-hint); }
.stat-label { font-size: 12.5px; color: var(--text-secondary); margin-bottom: 8px; font-weight: 600; }
.stat-value { font-family: var(--font-mono); font-size: 23px; font-weight: 700; color: var(--text-primary); }
.stat-value.due { color: var(--due-red); }
.stat-value.profit { color: var(--primary-dark); }
.stat-sub { font-size: 12px; color: var(--text-hint); margin-top: 4px; }

.quick-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin-bottom: 26px;
}
.quick-btn {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  text-align: center;
  background: var(--glass);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 18px 8px;
  font-size: 13px; font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
  box-shadow: var(--shadow-card);
  transition: transform 0.15s, border-color 0.15s, background 0.15s;
}
.quick-btn .ic { font-size: 22px; }
.quick-btn:hover {
  border-color: var(--primary);
  background: rgba(16, 185, 129, 0.10);
  transform: translateY(-2px);
}

.section-title {
  font-size: 16px; margin: 30px 0 14px;
  display: flex; align-items: center; justify-content: space-between;
  font-weight: 800;
}
.section-title small { font-size: 12.5px; font-weight: 500; color: var(--text-hint); }

/* ================= ENTITY ROWS ================= */
.entity-list { display: flex; flex-direction: column; gap: 10px; }
.entity-row {
  display: flex; align-items: center; gap: 14px;
  background: var(--glass);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-card);
  transition: border-color 0.15s, background 0.15s;
}
.entity-row:hover { border-color: var(--primary); }
.avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: rgba(16, 185, 129, 0.18);
  color: var(--primary-dark);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 15px; flex: none;
}
.entity-main { flex: 1; min-width: 0; }
.entity-main b { font-size: 14.5px; color: var(--text-primary); }
.entity-main .sub { font-size: 12.5px; color: var(--text-hint); }
.entity-amt { text-align: right; }
.entity-amt b { font-family: var(--font-mono); font-size: 15.5px; }
.entity-amt .lbl { font-size: 11px; color: var(--text-hint); }

.badge {
  font-size: 11px; font-weight: 700; padding: 3px 9px;
  border-radius: 999px; display: inline-block;
  letter-spacing: 0.3px;
}
.badge.green { background: rgba(16, 185, 129, 0.18); color: var(--primary-dark); }
.badge.red { background: rgba(255, 107, 107, 0.18); color: var(--due-red); }
.badge.amber { background: var(--warn-amber-100); color: var(--warn-amber); }
.badge.gray { background: rgba(107, 114, 128, 0.18); color: var(--text-secondary); }

/* ================= PRODUCT CARDS ================= */
.product-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.product-card {
  background: var(--glass);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-card);
}
.product-card h4 { font-size: 15px; margin-bottom: 2px; color: var(--text-primary); }
.product-card .cat { font-size: 12px; color: var(--text-hint); margin-bottom: 12px; }
.product-row {
  display: flex; justify-content: space-between;
  font-size: 13px; padding: 5px 0;
  border-top: 1px dashed var(--glass-border);
}
.product-row:first-of-type { border-top: none; }
.product-row span:last-child { font-family: var(--font-mono); font-weight: 700; }

/* ================= TABLES ================= */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  background: var(--glass);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-card);
}
table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 520px; }
thead th {
  text-align: left; font-size: 12px; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--text-hint);
  padding: 12px 14px; border-bottom: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.4);
  font-weight: 800;
}
tbody td { padding: 12px 14px; border-bottom: 1px solid var(--glass-border); }
tbody tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; font-family: var(--font-mono); }

/* ================= TRANSACTIONS ================= */
.txn-row {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 16px; border-bottom: 1px solid var(--glass-border);
}
.txn-row:last-child { border-bottom: none; }
.txn-ic {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; flex: none;
  border-left: 3px solid transparent;
}
.txn-ic.sale            { background: rgba(16, 185, 129, 0.12); border-color: var(--primary); }
.txn-ic.purchase        { background: var(--warn-amber-100); border-color: var(--warn-amber); }
.txn-ic.payment_in      { background: rgba(16, 185, 129, 0.12); border-color: var(--primary); }
.txn-ic.payment_out     { background: rgba(255, 107, 107, 0.18); border-color: var(--due-red); }
.txn-ic.baki            { background: rgba(255, 176, 136, 0.22); border-color: var(--accent); }
.txn-ic.expense         { background: rgba(255, 107, 107, 0.18); border-color: var(--due-red); }
.txn-ic.stock_adjustment{ background: rgba(107, 114, 128, 0.15); border-color: var(--text-hint); }
.txn-main { flex: 1; min-width: 0; }
.txn-main b { font-size: 14px; display: block; color: var(--text-primary); }
.txn-main .sub { font-size: 12px; color: var(--text-hint); }
.txn-amt { font-family: var(--font-mono); font-weight: 700; font-size: 14.5px; }
.txn-amt.pos { color: var(--primary-dark); }
.txn-amt.neg { color: var(--due-red); }

/* ================= FORMS ================= */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label {
  font-size: 13px; font-weight: 700; color: var(--text-primary);
  text-transform: none;
}
.field input, .field select, .field textarea {
  padding: 11px 13px;
  border: 1.5px solid var(--glass-border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.85);
  color: var(--text-primary);
  font-size: 14.5px;
  font-weight: 600;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.20);
}
.field .hint { font-size: 12px; color: var(--text-hint); }
.seg {
  display: flex;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.4);
}
.seg button {
  flex: 1; padding: 10px;
  background: transparent; border: none;
  font-size: 13.5px; font-weight: 700;
  color: var(--text-secondary);
  border-right: 1px solid var(--glass-border);
  cursor: pointer;
}
.seg button:last-child { border-right: none; }
.seg button.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
}
.item-row {
  display: flex; gap: 8px; align-items: flex-end; margin-bottom: 8px;
}
.item-row .field { margin-bottom: 0; flex: 1; }
.item-row .field.qty { max-width: 90px; }
.item-row .field.price { max-width: 120px; }
.remove-item {
  background: rgba(255, 107, 107, 0.18);
  color: var(--due-red); border: none;
  width: 36px; height: 42px; border-radius: 8px;
  font-size: 16px; cursor: pointer;
}
.total-box {
  background: rgba(16, 185, 129, 0.10);
  border-radius: var(--radius-md);
  padding: 16px; margin-top: 14px;
  border: 1px solid var(--glass-border);
}
.total-row {
  display: flex; justify-content: space-between;
  font-size: 14px; padding: 4px 0;
}
.total-row.grand {
  font-size: 19px; font-weight: 800;
  font-family: var(--font-mono);
  border-top: 1px dashed var(--glass-border);
  margin-top: 6px; padding-top: 10px;
  color: var(--primary-dark);
}

/* ================= MODAL ================= */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(6, 78, 59, 0.55);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  z-index: 1000;
  opacity: 0; pointer-events: none;
  transition: opacity 0.18s;
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }
.modal {
  position: relative;
  background: var(--white);
  border-radius: var(--radius-xxl);
  max-width: 560px; width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  padding: 32px 28px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.25);
  transform: translateY(8px);
  transition: transform 0.18s;
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.modal-head h3 {
  font-size: 1.5rem; font-weight: 800;
  color: var(--text-primary);
  margin: 0;
  padding-right: 40px;
}
.modal-close {
  position: absolute; top: 14px; right: 14px;
  width: 36px; height: 36px; border-radius: 50%;
  border: none;
  background: rgba(6, 78, 59, 0.06);
  color: var(--text-primary);
  font-size: 22px; line-height: 1;
  cursor: pointer;
  transition: background 0.15s;
  z-index: 2;
}
.modal-close:hover { background: rgba(6, 78, 59, 0.12); }
.modal-body p { font-size: 14px; color: var(--text-secondary); line-height: 1.6; margin: 0 0 8px; }
.modal-foot {
  display: flex; gap: 10px; margin-top: 18px;
}
.modal-foot .btn { flex: 1; }

/* ================= LOCKED PAGE ================= */
.locked-wrap {
  min-height: 70vh;
  display: flex; align-items: center; justify-content: center;
  padding: 40px 20px;
}
.locked-card {
  background: var(--glass);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xxl);
  padding: 48px 36px;
  max-width: 540px; width: 100%;
  text-align: center;
  box-shadow: var(--shadow);
}
.locked-icon {
  font-size: 56px; line-height: 1; margin-bottom: 16px;
  display: inline-block;
}
.locked-eyebrow {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 107, 107, 0.18);
  color: var(--due-red);
  font-size: 12px; font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.locked-card h1 {
  font-size: clamp(24px, 4vw, 30px);
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 12px;
  line-height: 1.2;
}
.locked-lead {
  font-size: 15px;
  color: var(--text-secondary);
  max-width: 420px;
  margin: 0 auto 24px;
}
.locked-actions {
  display: flex; gap: 10px; justify-content: center;
  flex-wrap: wrap; margin-bottom: 18px;
}
.locked-recheck {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}
.locked-recheck a {
  color: var(--primary-dark);
  font-weight: 700;
}
.locked-foot {
  font-size: 13px;
  color: var(--text-hint);
  margin-top: 14px;
}

/* ================= TOAST ================= */
.toast-wrap {
  position: fixed; bottom: 88px; left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex; flex-direction: column; gap: 8px;
  align-items: center;
  width: 100%; padding: 0 16px;
  pointer-events: none;
}
.toast {
  background: var(--text-primary);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.25);
  display: flex; align-items: center; gap: 10px;
  animation: toastIn 0.2s ease;
  max-width: 420px;
  font-weight: 600;
}
.toast.success { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); }
.toast.error { background: var(--secondary); }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ================= EMPTY STATE ================= */
.empty-state { text-align: center; padding: 56px 20px; }
.empty-state .ic { font-size: 40px; margin-bottom: 14px; }
.empty-state h3 { font-size: 16.5px; margin-bottom: 6px; }
.empty-state p { font-size: 13.5px; max-width: 340px; margin: 0 auto 18px; }

/* ================= CONFIRM ================= */
.confirm-icon {
  width: 48px; height: 48px;
  border-radius: 14px;
  background: rgba(255, 107, 107, 0.18);
  color: var(--due-red);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  margin-bottom: 14px;
}

/* ================= ALERTS ================= */
.alert-card {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 14px;
  border-radius: var(--radius-sm);
  background: var(--warn-amber-100);
  margin-bottom: 8px;
}
.alert-card .ic { font-size: 18px; }
.alert-card b { font-size: 13.5px; }
.alert-card span { font-size: 12px; color: var(--text-secondary); }

/* ================= FAB / BOTTOM NAV ================= */
.fab {
  position: fixed; right: 20px; bottom: 78px;
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  display: none; align-items: center; justify-content: center;
  font-size: 26px;
  box-shadow: 0 14px 30px rgba(16, 185, 129, 0.45);
  z-index: 60;
  border: none;
}
.bottom-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  height: 64px;
  background: var(--glass);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--glass-border);
  z-index: 60;
  align-items: center; justify-content: space-around;
}
.bottom-nav a {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 10.5px; color: var(--text-hint); font-weight: 700;
}
.bottom-nav a.active { color: var(--primary-dark); }
.bottom-nav a .ic { font-size: 19px; }

/* ================= CHART ================= */
.chart-bars { display: flex; align-items: flex-end; gap: 8px; height: 150px; }
.chart-bars .bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.chart-bars .bar {
  width: 100%; border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, var(--primary-light), var(--primary));
  min-height: 3px;
}
.chart-bars .bar.neg { background: linear-gradient(180deg, #FFB088, var(--secondary)); }
.chart-bars .bar-lbl { font-size: 10.5px; color: var(--text-hint); }

.data-banner {
  display: flex; align-items: center; gap: 10px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.30);
  border-radius: var(--radius-sm);
  padding: 12px 14px; font-size: 13px;
  margin-bottom: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

/* ================= SETTINGS — Subscription card ================= */
.subscription-card {
  background: var(--glass);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 22px;
  position: relative; overflow: hidden;
  box-shadow: var(--shadow-card);
}
.subscription-card::before {
  content: ""; position: absolute;
  left: 0; top: 14px; bottom: 14px;
  width: 4px; border-radius: 3px;
  background: linear-gradient(180deg, var(--primary), var(--primary-dark));
}
.subscription-status {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.subscription-status.active  { background: rgba(16, 185, 129, 0.18); color: var(--primary-dark); }
.subscription-status.inactive{ background: rgba(255, 107, 107, 0.18); color: var(--due-red); }
.subscription-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 18px;
  margin-top: 14px;
}
.subscription-meta .meta-item { min-width: 0; }
.subscription-meta .lbl {
  font-size: 11.5px; font-weight: 700;
  color: var(--text-hint);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.subscription-meta .val {
  font-size: 14px; font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-mono);
  margin-top: 4px;
  word-break: break-word;
}

/* ================= RESPONSIVE ================= */
@media (max-width: 1080px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .quick-grid { grid-template-columns: repeat(3, 1fr); }
  .product-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .sidebar { display: none; }
  .fab { display: flex; }
  .bottom-nav { display: flex; }
  .page { padding: 16px; padding-bottom: 88px; }
  .topbar { padding: 14px 16px; }
  .topbar-search { width: auto; flex: 1; }
  .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .stat-grid, .quick-grid, .product-grid { grid-template-columns: 1fr 1fr; }
  .entity-amt { font-size: 13px; }
  .modal { padding: 24px 18px 20px; max-height: 92vh; border-radius: var(--radius-xl); }
  .modal-head h3 { font-size: 1.25rem; }
  .locked-card { padding: 36px 24px; }
}

/* ================= PRINT ================= */
@media print {
  .sidebar, .topbar, .bottom-nav, .fab, .page-actions, .no-print { display: none !important; }
  .page { padding: 0; }
  body { background: #fff; }
}