@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:wght@400;500;600;700;800&family=Noto+Sans+Arabic:wght@400;700;900&display=swap');

:root{
  --maroon:#183153;
  --maroon-dark:#11223a;
  --pink-bg:#eff1f3;
  --pink-line:#97a2b2;
  --paper:#fffdfb;
  --ink:#1c1c1c;
  --panel-bg:#f4f1ee;
  --green:#25D366;
}
*{box-sizing:border-box;}
body{
  margin:0;
  font-family:'Bricolage Grotesque', sans-serif;
  background:var(--panel-bg);
  color:var(--ink);
}

/* ===== App Shell ===== */
.app-shell{display:flex; min-height:100vh;}
.sidenav{
  width:210px;
  background:var(--maroon);
  color:#fff;
  display:flex;
  flex-direction:column;
  padding:20px 0;
  flex-shrink:0;
}
.sidenav .brand{
  font-size:20px; font-weight:800; padding:0 20px 20px; letter-spacing:0.5px;
  border-bottom:1px solid rgba(255,255,255,0.15); margin-bottom:10px;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.sidenav a{
  color:#f2d9e4; text-decoration:none; padding:12px 20px; font-size:14px; font-weight:600;
}
.sidenav a:hover, .sidenav a.active{ background:rgba(255,255,255,0.12); color:#fff; }
.sidenav a.logout{ margin-top:auto; }
.nav-badge{
  background:#fff; color:var(--maroon); font-size:10.5px; font-weight:800;
  padding:1px 7px; border-radius:10px; margin-left:4px;
}
.sidenav-search{ padding:0 20px 14px; }
.sidenav-search input{
  width:100%; padding:8px 12px; border:none; border-radius:6px;
  background:rgba(255,255,255,0.15); color:#fff; font-size:13px; font-family:inherit;
}
.sidenav-search input::placeholder{ color:rgba(255,255,255,0.7); }
.sidenav-search input:focus{ outline:2px solid rgba(255,255,255,0.4); background:rgba(255,255,255,0.22); }
.main-content{ flex:1; padding:28px 34px; max-width:1100px; }

/* ===== Mobile top bar + drawer overlay (hidden on desktop) ===== */
.mobile-topbar{ display:none; }

.impersonation-banner{
  background:#F4B942; color:#3a2a00; padding:9px 20px; font-size:13px; font-weight:700;
  display:flex; justify-content:center; align-items:center; gap:16px; flex-wrap:wrap;
  position:sticky; top:0; z-index:300;
}
.impersonation-banner a{ color:#3a2a00; text-decoration:underline; }
.drawer-overlay{ display:none; }

/* ===== Dashboard greeting ===== */
.dash-greeting{ display:flex; justify-content:space-between; align-items:baseline; flex-wrap:wrap; gap:6px; margin-bottom:14px; }
.dash-greeting-text{ font-size:16px; font-weight:700; color:var(--maroon-dark); }
.dash-datetime{ font-size:12.5px; color:#888; }

/* ===== Dashboard: % change badges, two-column layout, top clients ===== */
.stat-top-row{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.change-badge{ font-size:10.5px; font-weight:700; padding:2px 7px; border-radius:10px; }
.change-up{ background:#e2f7e6; color:#1a7a34; }
.change-down{ background:#fde2e2; color:#a11; }
.change-neutral{ background:#f0f0f0; color:#888; }

.dash-two-col{ display:grid; grid-template-columns:1.3fr 1fr; gap:20px; align-items:start; }
.invoice-panels-row{ display:grid; grid-template-columns:1fr 1fr; gap:20px; align-items:start; margin-bottom:24px; }

.top-clients-list{ display:flex; flex-direction:column; }
.top-client-row{
  display:grid; grid-template-columns:1fr auto auto; align-items:center; gap:10px;
  padding:10px 0; border-bottom:1px solid #f0f0f0; font-size:13px;
}
.top-client-row:last-child{ border-bottom:none; }
.top-client-name{ font-weight:600; color:var(--ink); }
.top-client-meta{ color:#999; font-size:11.5px; }
.top-client-total{ font-weight:700; color:var(--maroon-dark); }

.profit-row{ display:grid; grid-template-columns:repeat(3, 1fr); gap:16px; text-align:center; }
.profit-item{ padding:8px; }
.profit-label{ font-size:11px; text-transform:uppercase; color:#999; font-weight:700; letter-spacing:0.4px; margin-bottom:6px; }
.profit-value{ font-size:20px; font-weight:800; }

/* ===== Floating quick-action button ===== */
.fab{
  position:fixed; bottom:24px; right:24px; width:56px; height:56px; border-radius:50%;
  background:var(--maroon); color:#fff; display:flex; align-items:center; justify-content:center;
  font-size:28px; font-weight:400; box-shadow:0 4px 16px rgba(0,0,0,0.25); text-decoration:none; z-index:40;
  line-height:1;
}
.fab:hover{ background:var(--maroon-dark); }

/* ===== Bottom tab bar (mobile only — hidden on desktop) ===== */
.bottom-nav{ display:none; }

/* ===== Password toggle (login) ===== */
.password-field{ position:relative; }
.password-field input{ padding-right:40px; }
.password-toggle{
  position:absolute; right:10px; top:50%; transform:translateY(-50%);
  background:none; border:none; cursor:pointer; font-size:14px; color:#888; padding:4px;
}
.pin-input{
  width:100%; text-align:center; font-size:28px; letter-spacing:14px; padding:12px 10px 12px 20px;
  border:1px solid #ddd; border-radius:8px; font-family:inherit;
}

/* ===== Common ===== */
.page-head{ display:flex; justify-content:space-between; align-items:center; margin-bottom:18px; flex-wrap:wrap; gap:10px; }
.page-head h1{ margin:0; font-size:22px; color:var(--maroon-dark); }
.action-bar{ display:flex; gap:8px; align-items:center; flex-wrap:wrap; }

.share-dropdown{ position:relative; }
.share-menu{
  display:none;
  position:absolute; top:calc(100% + 6px); right:0; left:auto;
  background:#fff; border:1px solid #eee; border-radius:8px;
  box-shadow:0 8px 24px rgba(0,0,0,0.12);
  width:max-content; min-width:190px; max-width:calc(100vw - 32px); padding:6px; z-index:20;
}
.share-menu.open{ display:flex; flex-direction:column; }
.share-menu button{
  background:none; border:none; text-align:left; padding:9px 10px; font-size:13px;
  font-family:inherit; color:var(--ink); border-radius:5px; cursor:pointer; white-space:normal;
}
.share-menu a{
  background:none; border:none; text-align:left; padding:9px 10px; font-size:13px;
  font-family:inherit; color:var(--ink); border-radius:5px; cursor:pointer; white-space:normal;
  text-decoration:none; display:block;
}
.share-menu button:hover{ background:var(--pink-bg); }
.share-menu a:hover{ background:var(--pink-bg); }

.void-link{ margin-left:auto; }
.void-link button{
  background:none; border:none; color:#b06; font-size:12px; font-weight:600;
  text-decoration:underline; cursor:pointer; padding:6px 4px; font-family:inherit; opacity:0.75;
}
.void-link button:hover{ opacity:1; }

.btn{ border:none; border-radius:6px; font-weight:700; cursor:pointer; padding:10px 16px; font-size:13.5px; text-decoration:none; display:inline-block; }
.btn-primary{ background:var(--maroon); color:#fff; }
.btn-outline{ background:#fff; border:1.5px solid var(--maroon); color:var(--maroon); }
.btn-whatsapp{ background:var(--green); color:#fff; }
.btn-sm{ padding:8px 12px; font-size:12.5px; }

.alert{ background:#fde2e2; color:#a11; padding:10px 14px; border-radius:6px; margin-bottom:14px; font-size:13px; }
.alert-success{ background:#e2f7e6; color:#1a7a34; }

.panel{ background:#fff; border-radius:10px; padding:20px; box-shadow:0 2px 12px rgba(0,0,0,0.06); margin-bottom:20px; }
.panel h2{ margin:0 0 14px; font-size:15px; color:var(--maroon-dark); }

.field{ margin-bottom:12px; }
.field label{ display:block; font-size:12px; font-weight:600; color:#555; margin-bottom:4px; }
.field input, .field select, .field textarea{
  width:100%; padding:9px 11px; border:1px solid #ddd; border-radius:6px; font-size:13.5px; font-family:inherit;
}

/* ===== Stats ===== */
.stat-grid{ display:grid; grid-template-columns:repeat(4,1fr); gap:14px; margin-bottom:20px; }
.stat-card{
  background:#fff; border-radius:10px; padding:18px; box-shadow:0 2px 12px rgba(0,0,0,0.06);
  display:block; text-decoration:none; transition:transform 0.15s ease, box-shadow 0.15s ease; cursor:pointer;
}
.stat-card:hover{ transform:translateY(-2px); box-shadow:0 6px 18px rgba(0,0,0,0.1); }
.stat-card.highlight{ background:var(--pink-bg); border:1px solid var(--pink-line); }
.stat-num{ font-size:26px; font-weight:800; color:var(--maroon-dark); }
.stat-label{ font-size:12px; color:#777; margin-top:2px; }

/* ===== Tables ===== */
.data-table{ width:100%; border-collapse:collapse; }
.data-table th{ text-align:left; font-size:11.5px; color:#888; text-transform:uppercase; padding:8px; border-bottom:2px solid #eee; }
.data-table td{ padding:10px 8px; font-size:13.5px; border-bottom:1px solid #f0f0f0; }
.data-table .empty{ text-align:center; color:#aaa; padding:24px; }
.data-table a{ color:var(--maroon); text-decoration:none; font-weight:600; }

.tag-pill{ background:var(--pink-bg); color:var(--maroon-dark); font-size:11px; font-weight:700; padding:3px 9px; border-radius:10px; }
.status{ font-size:11px; font-weight:700; padding:3px 9px; border-radius:10px; }
.status-unpaid{ background:#fde2e2; color:#a11; }
.status-paid{ background:#e2f7e6; color:#1a7a34; }
.status-partial{ background:#fff3d6; color:#a67c00; }
.status-quotation{ background:#e8eaf0; color:#555; }
.status-active{ background:#e2f7e6; color:#1a7a34; }
.status-inactive{ background:#fde2e2; color:#a11; }

.search-bar{ display:flex; gap:8px; margin-bottom:14px; }
.search-bar input{ flex:1; padding:9px 12px; border:1px solid #ddd; border-radius:6px; }
.filter-bar{ display:flex; gap:8px; margin-bottom:16px; flex-wrap:wrap; }

.bulk-action-bar{
  display:flex; align-items:center; gap:14px; background:var(--pink-bg); border:1px solid var(--pink-line);
  border-radius:8px; padding:10px 14px; margin-bottom:12px; font-size:13px; font-weight:600; color:var(--maroon-dark);
  flex-wrap:wrap;
}
.chip{ padding:6px 14px; border-radius:16px; background:#fff; border:1px solid #ddd; color:#666; font-size:12.5px; font-weight:600; text-decoration:none; }
.chip.active{ background:var(--maroon); border-color:var(--maroon); color:#fff; }

.info-panel div{ margin-bottom:8px; font-size:13.5px; }

.payment-summary{ display:flex; gap:24px; flex-wrap:wrap; }
.payment-summary div{ display:flex; flex-direction:column; gap:2px; }
.payment-summary span{ font-size:11px; color:#888; text-transform:uppercase; }
.payment-summary strong{ font-size:18px; }

/* ===== Modal ===== */
.modal-overlay{ display:none; position:fixed; inset:0; background:rgba(0,0,0,0.4); align-items:center; justify-content:center; z-index:50; }
.modal-box{ background:#fff; border-radius:10px; padding:24px; width:90%; max-width:380px; max-height:88vh; overflow-y:auto; box-sizing:border-box; }
.modal-box h2{ margin:0 0 14px; color:var(--maroon-dark); }
.modal-actions{ display:flex; justify-content:flex-end; gap:8px; margin-top:16px; }

/* ===== Login ===== */
.login-body{ display:flex; align-items:center; justify-content:center; min-height:100vh; background:linear-gradient(135deg, var(--maroon), var(--maroon-dark)); }
.login-box{ background:#fff; padding:34px 30px; border-radius:12px; width:320px; box-shadow:0 20px 60px rgba(0,0,0,0.3); }
.login-box h1{ margin:0; text-align:center; color:var(--maroon); font-size:30px; }
.login-clock{ text-align:center; font-size:11.5px; color:#999; margin-top:4px; }
.login-box .sub{ text-align:center; color:#888; font-size:12.5px; margin:4px 0 20px; }

/* ===== Invoice form ===== */
.form-row{ display:flex; gap:16px; flex-wrap:wrap; }
.form-row .field{ flex:1; min-width:200px; }
.type-group{ display:flex; gap:8px; flex-wrap:wrap; }
.type-chip{
  display:flex; align-items:center; gap:5px; padding:6px 12px; border:1.5px solid var(--pink-line);
  border-radius:16px; font-size:12.5px; font-weight:600; color:#666; cursor:pointer;
}
.type-chip input{ width:auto; }
#itemsBox .item-row{ display:grid; grid-template-columns:1fr 70px 100px 30px; gap:8px; margin-bottom:8px; align-items:start; }
#itemsBox .item-row textarea{ resize:vertical; min-height:38px; font-family:inherit; }
.add-row-btn{ width:100%; padding:8px; background:var(--pink-bg); border:1px dashed var(--pink-line); color:var(--maroon-dark); border-radius:6px; font-weight:600; cursor:pointer; }
#quickAddSelect{ width:100%; padding:9px 11px; border:1px solid var(--pink-line); border-radius:6px; font-size:13px; font-family:inherit; background:#fff; color:var(--maroon-dark); }
.rm-btn{ background:#f3d9e2; color:var(--maroon-dark); border:none; border-radius:4px; cursor:pointer; font-weight:700; }
.total-preview{ text-align:right; font-size:15px; margin:14px 0; }
.total-preview strong{ color:var(--maroon); font-size:19px; }

.hint{ font-size:11px; color:#888; margin-top:10px; line-height:1.5; }

/* ===== Invoice Sheet ===== */
.sheet-wrap{ max-width:850px; }
.sheet{ width:850px; max-width:100%; background:var(--paper); border-radius:4px; box-shadow:0 10px 40px rgba(0,0,0,0.15); padding:36px 40px 28px; position:relative; }
.sheet::before{ content:""; position:absolute; top:0; left:0; right:0; height:14px; background:var(--pink-bg); border-bottom:1px solid var(--pink-line); }
.top{ display:flex; justify-content:space-between; align-items:flex-start; padding-top:14px; gap:16px; }
.brand-en h1{ margin:0; font-size:34px; font-weight:800; color:var(--maroon); letter-spacing:1px; }
.brand-en .addr{ font-size:11.5px; color:#444; line-height:1.5; margin-top:8px; }
.logo-circle{ width:66px; height:66px; border-radius:50%; background:var(--maroon); color:#fff; display:flex; align-items:center; justify-content:center; font-size:16px; font-weight:800; text-align:center; margin:4px auto 0; border:3px solid var(--pink-line); flex-shrink:0; }
.logo-circle-wrap{ flex-shrink:0; }
.logo-img{ width:66px; height:66px; border-radius:50%; object-fit:cover; margin:4px auto 0; display:block; border:3px solid var(--pink-line); }
.brand-ar{ text-align:right; direction:rtl; font-family:'Noto Sans Arabic',sans-serif; }
.brand-ar h2{ margin:0; font-size:26px; font-weight:900; color:var(--maroon); }
.brand-ar .addr{ font-size:12px; color:#333; line-height:1.7; margin-top:4px; }

.meta-row{ display:flex; justify-content:space-between; align-items:center; margin-top:18px; border-top:1px dashed var(--pink-line); border-bottom:1px dashed var(--pink-line); padding:10px 4px; flex-wrap:wrap; gap:8px; }
.invoice-no{ font-size:15px; font-weight:600; }
.invoice-no span{ display:inline-block; min-width:70px; border:1px solid var(--maroon); border-radius:3px; padding:2px 10px; margin-left:6px; color:var(--maroon); font-weight:700; background:#fff; }
.type-badge-new{ background:var(--maroon); color:#fff; font-size:11px; font-weight:700; padding:6px 16px; border-radius:14px; letter-spacing:0.3px; }
.date{ font-size:14px; font-weight:600; display:flex; align-items:center; gap:8px; }
.date .val{ border-bottom:1px solid #999; min-width:110px; display:inline-block; padding:0 4px; color:var(--maroon); font-weight:700; }

.status-badge{ font-size:11px; font-weight:700; padding:5px 14px; border-radius:12px; }
.status-badge-unpaid{ background:#fde2e2; color:#a11; }
.status-badge-paid{ background:#e2f7e6; color:#1a7a34; }
.status-badge-partial{ background:#fff3d6; color:#a67c00; }

.bill-to-box{ margin-top:16px; background:var(--pink-bg); border-radius:8px; padding:12px 16px; }
.bill-to-label-new{ font-size:10px; text-transform:uppercase; letter-spacing:0.5px; color:#888; font-weight:700; }
.bill-to-label-new .ar{ font-family:'Noto Sans Arabic',sans-serif; text-transform:none; }
.bill-to-name-new{ font-size:15px; font-weight:700; color:var(--maroon-dark); margin-top:2px; }

table.items{ width:100%; border-collapse:collapse; margin-top:18px; border:2px solid var(--maroon); border-radius:6px; overflow:hidden; }
table.items thead th{ background:var(--pink-bg); color:var(--maroon-dark); font-size:11.5px; font-weight:700; padding:8px 6px; border:1px solid var(--pink-line); text-align:center; line-height:1.4; }
table.items tbody td{ border:1px solid var(--pink-line); padding:10px 8px; font-size:13.5px; vertical-align:top; }
.ref-line{ font-size:12px; color:#888; margin-top:8px; margin-bottom:12px; }
.col-desc{ width:46%; } .col-qty{ width:10%; text-align:center; } .col-unit{ width:20%; text-align:right; } .col-total{ width:24%; text-align:right; }
.foot-row td{ background:var(--pink-bg); font-weight:700; font-size:13.5px; }
.foot-row .total-label{ display:flex; justify-content:space-between; align-items:center; }
.foot-row .total-label .ar{ font-family:'Noto Sans Arabic',sans-serif; }

.terms-box{ margin-top:20px; padding-top:12px; border-top:1px solid var(--pink-line); }
.terms-label{ font-size:10px; text-transform:uppercase; letter-spacing:0.5px; color:var(--maroon-dark); font-weight:700; margin-bottom:4px; }
.terms-text{ font-size:10.5px; color:#666; line-height:1.6; }
.thankyou-line{ text-align:center; font-size:11.5px; color:#999; margin-top:22px; }

.sign-row{ display:flex; justify-content:space-between; margin-top:40px; font-size:13px; font-weight:600; gap:20px; }
.sign-row .box{ width:46%; border-top:1px solid #999; padding-top:6px; }

/* ===== Reports: simple bar chart (no external chart library needed) ===== */
.bar-chart{ display:flex; flex-direction:column; gap:10px; }
.bar-row{ display:grid; grid-template-columns:90px 1fr 140px; align-items:center; gap:12px; }
.bar-label{ font-size:12.5px; color:#666; font-weight:600; }
.bar-track{ background:var(--panel-bg); border-radius:6px; height:22px; overflow:hidden; }
.bar-fill{ background:var(--maroon); height:100%; border-radius:6px; min-width:3px; transition:width 0.3s; }
.bar-value{ font-size:13px; font-weight:700; color:var(--maroon-dark); text-align:right; }
.bar-count{ font-weight:400; color:#999; font-size:11.5px; }

/* ===== Superadmin: tenant management ===== */
.tenant-actions{ display:flex; gap:6px; flex-wrap:wrap; }
.expiry-warn{ color:#a67c00; font-weight:700; }
.expiry-over{ color:#a11; font-weight:700; }

/* Lets wide tables scroll horizontally on narrow screens instead of
   squeezing/breaking the whole page layout. */
.table-scroll{ overflow-x:auto; -webkit-overflow-scrolling:touch; }
.table-scroll .data-table{ min-width:600px; }

/* ===== Force-desktop mode for PDF/Image export =====
   html2canvas's windowWidth option is unreliable on real mobile browsers
   (viewport meta tag interference). Instead, JS adds this class to <body>
   right before capture, which overrides every mobile rule with !important —
   guaranteeing the exported file always looks like the full side-by-side
   desktop invoice, regardless of what device generated it. */
body.pdf-export-mode .sheet{ padding:36px 40px 28px !important; width:850px !important; }
body.pdf-export-mode, body.pdf-export-mode html{ overflow-x:visible !important; max-width:none !important; }
body.pdf-export-mode .app-shell{ flex-direction:row !important; }
body.pdf-export-mode .main-content{ max-width:none !important; overflow-x:visible !important; padding:28px 34px !important; }
body.pdf-export-mode .sheet-wrap{ max-width:none !important; width:850px !important; overflow:visible !important; }
body.pdf-export-mode .top{ flex-direction:row !important; align-items:flex-start !important; text-align:left !important; gap:16px !important; }
body.pdf-export-mode .brand-en{ text-align:left !important; }
body.pdf-export-mode .brand-ar{ text-align:right !important; }
body.pdf-export-mode .meta-row{ flex-direction:row !important; align-items:center !important; flex-wrap:nowrap !important; }
body.pdf-export-mode .sign-row{ flex-direction:row !important; gap:0 !important; }
body.pdf-export-mode .sign-row .box{ width:46% !important; }
body.pdf-export-mode table.items{ font-size:13.5px !important; }
body.pdf-export-mode table.items thead th{ font-size:11.5px !important; padding:8px 6px !important; }
body.pdf-export-mode table.items tbody td{ padding:10px 8px !important; font-size:13.5px !important; }

@media print{
  .ref-line{ color:#000 !important; font-weight:800 !important; font-size:13.5px !important; }
  .no-print, .sidenav{ display:none !important; }
  .main-content{ padding:0; max-width:none; }
  body{ background:#fff; }
}

@media (max-width:900px){
  html, body{ overflow-x:hidden; max-width:100%; }

  /* Banner sits above the fixed mobile top bar instead of stacking with it */
  .impersonation-banner{ position:static; }

  /* ---- Mobile top bar (hamburger + brand + search) ---- */
  .mobile-topbar{
    display:flex; align-items:center; justify-content:space-between; gap:10px;
    position:fixed; top:0; left:0; right:0; height:54px; padding:0 14px;
    background:var(--maroon); color:#fff; z-index:200;
  }
  .hamburger-btn{
    background:none; border:none; color:#fff; font-size:22px; cursor:pointer; padding:6px; line-height:1;
  }
  .mobile-topbar-brand{
    flex:1; text-align:center; font-weight:700; font-size:15px;
    white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  }
  .mobile-topbar-search{ color:#fff; text-decoration:none; font-size:18px; padding:4px; }

  /* ---- Slide-out drawer ---- */
  .app-shell{ flex-direction:column; padding-top:54px; }
  .sidenav{
    position:fixed; top:0; left:0; height:100vh; width:78%; max-width:280px;
    flex-direction:column; overflow-y:auto; padding:20px 0;
    transform:translateX(-100%); transition:transform 0.25s ease; z-index:220;
    box-shadow:4px 0 24px rgba(0,0,0,0.25);
  }
  .sidenav.open{ transform:translateX(0); }
  .sidenav .brand{ display:block; }
  .sidenav a{ white-space:normal; }

  .drawer-overlay{
    display:block; position:fixed; inset:0; background:rgba(0,0,0,0.45);
    z-index:210; opacity:0; pointer-events:none; transition:opacity 0.25s ease;
  }
  .drawer-overlay.open{ opacity:1; pointer-events:auto; }

  .main-content{ padding:14px; max-width:100%; }
  .stat-grid{ grid-template-columns:repeat(2,1fr); }
  .form-row{ flex-direction:column; gap:0; }
  #itemsBox .item-row{ grid-template-columns:1fr 50px 70px 24px; }

  /* Login / locked screens */
  .login-box{ width:calc(100% - 40px); max-width:340px; padding:28px 22px; }

  /* Invoice sheet: stack the 3-column header, shrink padding/type, wrap meta row */
  .sheet{ padding:20px 16px; }
  .top{ flex-direction:column; align-items:center; text-align:center; gap:10px; }
  .brand-en{ text-align:center; }
  .brand-ar{ text-align:center; direction:rtl; }
  .meta-row{ flex-direction:column; align-items:flex-start; gap:10px; }
  table.items{ font-size:11px; }
  table.items thead th{ font-size:9px; padding:6px 3px; }
  table.items tbody td{ padding:6px 4px; font-size:11px; }
  .sign-row{ flex-direction:column; gap:20px; }
  .sign-row .box{ width:100%; }

  /* Dashboard / list pages */
  .page-head{ flex-direction:column; align-items:flex-start; }
  .action-bar{ width:100%; }
  .action-bar .btn, .action-bar select{ flex:1; text-align:center; }

  .bar-row{ grid-template-columns:1fr; gap:4px; }
  .bar-value{ text-align:left; }

  .dash-greeting{ flex-direction:column; align-items:flex-start; }
  .dash-two-col{ grid-template-columns:1fr; }
  .invoice-panels-row{ grid-template-columns:1fr; }
  .profit-row{ grid-template-columns:1fr; gap:14px; text-align:left; }
  .profit-row .profit-item{ display:flex; justify-content:space-between; align-items:center; padding:4px 0; }
  .profit-row .profit-label{ margin-bottom:0; }
  .fab{ display:none; } /* replaced by the bottom nav's + tab on mobile */

  /* ---- Bottom tab bar ---- */
  .app-shell{ padding-bottom:64px; }
  .bottom-nav{
    display:flex; align-items:center; justify-content:space-around;
    position:fixed; bottom:0; left:0; right:0; height:64px;
    background:#fff; border-top:1px solid #eee; box-shadow:0 -2px 12px rgba(0,0,0,0.06);
    z-index:150; padding:0 4px;
  }
  .bottom-nav a, .bottom-nav button{
    flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px;
    text-decoration:none; color:#999; background:none; border:none; font-family:inherit;
    font-size:10px; font-weight:600; padding:6px 2px; cursor:pointer; height:100%;
  }
  .bottom-nav .bn-icon{ font-size:19px; line-height:1; }
  .bottom-nav a.active{ color:var(--maroon); }
  .bottom-nav .bn-add{
    flex:0 0 46px; width:46px; height:46px; border-radius:50%; background:var(--maroon); color:#fff;
    display:flex; align-items:center; justify-content:center; font-size:26px; margin-top:-18px;
    box-shadow:0 4px 12px rgba(0,0,0,0.25);
  }
  .bottom-nav .nav-badge{
    background:#a11; color:#fff; font-size:9px; padding:0 5px; border-radius:8px; margin-left:2px;
    position:relative; top:-1px;
  }
}

@media (max-width:420px){
  .login-box h1{ font-size:24px; }
  .type-group{ gap:6px; }
  .type-chip{ padding:5px 9px; font-size:11.5px; }
}

/* Download PDF / print-style capture: hide Unit Price column, dark Reference line */
body.print-view .ref-line{ color:#000 !important; font-weight:800 !important; font-size:13.5px !important; }
