:root {
  --red: #0b2a5b;
  --side: #0b2552;
  --side-dark: #071b3d;
  --side-sub: #0e3470;
  --teal: #0fa3a3;
  --teal-dark: #0b8484;
  --blue: #1565c0;
  --bg: #ecf0f5;
  --accent: #0fa3a3;
}
html, body { height: 100%; }
body {
  font-family: 'Roboto', 'Noto Sans Bengali', sans-serif;
  background: var(--bg);
  color: #333;
  font-size: 15px;
}
.topbar {
  position: fixed; top: 0; left: 0; right: 0; height: 56px; z-index: 1030;
  background: var(--red); color: #fff; display: flex; align-items: center; padding: 0 14px;
}
.topbar .brand { width: 230px; font-weight: 700; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-link { color: #fff; text-decoration: none; font-size: 14px; }
.top-link:hover { color: #ffd; }
.sidebar {
  position: fixed; top: 56px; bottom: 0; left: 0; width: 230px; background: var(--side);
  overflow-y: auto; z-index: 1020; transition: margin .2s;
}
.nav-list, .sub { list-style: none; margin: 0; padding: 0; }
.nav-list > li > a {
  display: flex; align-items: center; gap: 10px; padding: 13px 18px; color: #c3d2ea;
  text-decoration: none; border-left: 3px solid transparent;
}
.nav-list > li > a i:first-child { width: 18px; text-align: center; color: #2fd0d0; }
.nav-list > li > a:hover { color: #fff; background: var(--side-dark); }
.nav-list > li.active > a { background: var(--side-dark); color: #fff; border-left-color: #14c4c4; }
.nav-list .chev { margin-left: auto; font-size: 11px; transition: transform .2s; }
.has-sub.open > a .chev { transform: rotate(180deg); }
.sub { display: none; background: #061a3a; }
.has-sub.open > .sub { display: block; }
.sub li a { display: block; padding: 9px 18px 9px 46px; color: #9db4d6; text-decoration: none; font-size: 14px; }
.sub li a:hover, .sub li.active a { color: #fff; }
.content { margin-left: 230px; padding: 76px 20px 0; min-height: 100vh; transition: margin .2s; position: relative; padding-bottom: 60px; }
body.sidebar-collapsed .sidebar { margin-left: -230px; }
body.sidebar-collapsed .content { margin-left: 0; }
.page-title { font-size: 28px; font-weight: 400; margin: 0 0 18px; }
.site-footer { position: absolute; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid #d2d6de; padding: 14px 20px; display: flex; justify-content: space-between; font-size: 14px; }

.box { background: #fff; border-top: 3px solid var(--accent); box-shadow: 0 1px 2px rgba(0,0,0,.1); margin-bottom: 20px; border-radius: 3px; }
.box-head { padding: 12px 16px; border-bottom: 1px solid #f0f0f0; font-size: 18px; text-transform: uppercase; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.box-body { padding: 16px; }

.stat { border-radius: 6px; color: #fff; padding: 18px 16px; position: relative; overflow: hidden; height: 100%; }
.stat .v { font-size: 34px; font-weight: 700; line-height: 1.1; word-break: break-word; }
.stat .l { text-transform: uppercase; margin-top: 14px; font-size: 15px; }
.stat i.bg { position: absolute; right: 10px; top: 10px; font-size: 64px; opacity: .22; }
.g1 { background: linear-gradient(135deg, #0b2a5b, #1565c0); }
.g2 { background: linear-gradient(135deg, #0b8484, #19c0b8); }
.g3 { background: linear-gradient(135deg, #1565c0, #0fa3a3); }
.g4 { background: linear-gradient(135deg, #071b3d, #0b57a8); }
.info { display: flex; background: #fff; border-radius: 4px; box-shadow: 0 1px 2px rgba(0,0,0,.1); overflow: hidden; height: 100%; }
.info .ico { width: 90px; background: linear-gradient(135deg, #0b2a5b, #0fa3a3); color: #fff; font-size: 38px; display: flex; align-items: center; justify-content: center; }
.info .txt { padding: 10px 16px; }
.info .txt .n { font-size: 26px; line-height: 1.2; }
.info .txt .t { font-weight: 700; font-size: 18px; text-transform: uppercase; }

.period .btn { border-radius: 0; background: #0fa3a3; color: #fff; border: 0; border-right: 1px solid #0b8484; }
.period .btn.active { background: #0b2a5b; font-weight: 700; }

table.tbl { width: 100%; font-size: 14px; }
table.tbl th { background: #e6eefa; padding: 10px 8px; border-bottom: 2px solid #ddd; white-space: nowrap; }
table.tbl td { padding: 8px; border-bottom: 1px solid #eee; vertical-align: middle; }
table.tbl.plain th { background: transparent; }
.table-responsive-sm { overflow-x: auto; }

/* POS screen */
.pos-wrap { display: flex; gap: 14px; height: calc(100vh - 150px); min-height: 520px; }
.pos-left { flex: 1 1 58%; display: flex; flex-direction: column; min-width: 0; }
.pos-right { flex: 1 1 42%; max-width: 560px; display: flex; flex-direction: column; background: #fff; border-radius: 4px; box-shadow: 0 1px 2px rgba(0,0,0,.15); }
.pos-grid { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; align-content: start; padding: 2px; }
.pcard { background: #fff; border: 1px solid #e3e6ea; border-radius: 6px; padding: 10px; cursor: pointer; text-align: left; transition: box-shadow .15s, transform .05s; }
.pcard:hover { box-shadow: 0 2px 8px rgba(0,0,0,.18); }
.pcard:active { transform: scale(.98); }
.pcard .pn { font-weight: 500; font-size: 14px; min-height: 38px; line-height: 1.3; }
.pcard .pp { color: var(--red); font-weight: 700; }
.pcard .ps { font-size: 12px; color: #777; }
.pcard.out { opacity: .5; }
.cart-list { flex: 1; overflow-y: auto; min-height: 120px; }
.pos-right { overflow-y: auto; }
.cart-row { display: grid; grid-template-columns: 1fr 78px 92px 30px; gap: 6px; align-items: center; padding: 8px 10px; border-bottom: 1px solid #f0f0f0; font-size: 14px; }
.cart-row input { padding: 2px 6px; height: 32px; }
.cart-foot { padding: 10px 12px; border-top: 2px solid #eee; background: #fafafa; }
.cart-foot .line { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.cart-foot .grand { font-size: 22px; font-weight: 700; }

/* login */
.login-box { max-width: 380px; margin: 9vh auto 0; background: #fff; padding: 28px; border-radius: 6px; box-shadow: 0 2px 12px rgba(0,0,0,.15); border-top: 4px solid var(--red); }
.login-box h1 { font-size: 22px; text-align: center; margin-bottom: 20px; }

/* invoice */
.invoice-paper { max-width: 780px; margin: 0 auto; background: #fff; padding: 28px; box-shadow: 0 1px 6px rgba(0,0,0,.15); }
@media print {
  .topbar, .sidebar, .site-footer, .no-print, .alert { display: none !important; }
  .content { margin: 0 !important; padding: 0 !important; }
  .page-title { display: none; }
  body { background: #fff; }
  .invoice-paper { box-shadow: none; padding: 0; max-width: 100%; }
}
@media (max-width: 900px) {
  .sidebar { margin-left: -230px; }
  .content { margin-left: 0; }
  body.sidebar-collapsed .sidebar { margin-left: 0; }
  .topbar .brand { width: auto; margin-right: 10px; }
  .pos-wrap { flex-direction: column; height: auto; }
  .pos-right { max-width: none; }
  .pos-grid { max-height: 360px; }
}

.brand-logo { max-height: 38px; max-width: 60px; background: #fff; border-radius: 4px; padding: 2px; vertical-align: middle; }

/* theme: Sorif navy + teal */
:root { --bs-primary: #1565c0; --bs-primary-rgb: 21,101,192; --bs-link-color: #0b57a8; --bs-link-hover-color: #0b2a5b; --bs-link-color-rgb: 11,87,168; }
.btn-primary { --bs-btn-bg: #0b57a8; --bs-btn-border-color: #0b57a8; --bs-btn-hover-bg: #0b2a5b; --bs-btn-hover-border-color: #0b2a5b; --bs-btn-active-bg: #081f45; --bs-btn-active-border-color: #081f45; --bs-btn-disabled-bg: #0b57a8; --bs-btn-disabled-border-color: #0b57a8; }
.btn-outline-primary { --bs-btn-color: #0b57a8; --bs-btn-border-color: #0b57a8; --bs-btn-hover-bg: #0b57a8; --bs-btn-hover-border-color: #0b57a8; --bs-btn-active-bg: #0b2a5b; --bs-btn-active-border-color: #0b2a5b; }
.btn-success { --bs-btn-bg: #0fa3a3; --bs-btn-border-color: #0fa3a3; --bs-btn-hover-bg: #0b8484; --bs-btn-hover-border-color: #0b8484; --bs-btn-active-bg: #097070; --bs-btn-active-border-color: #097070; --bs-btn-disabled-bg: #0fa3a3; --bs-btn-disabled-border-color: #0fa3a3; }
.btn-outline-success { --bs-btn-color: #0b8484; --bs-btn-border-color: #0fa3a3; --bs-btn-hover-bg: #0fa3a3; --bs-btn-hover-border-color: #0fa3a3; --bs-btn-active-bg: #0b8484; --bs-btn-active-border-color: #0b8484; }
.btn-danger { --bs-btn-bg: #d63a4a; --bs-btn-border-color: #d63a4a; }
.badge.bg-success { background-color: #0fa3a3 !important; }
.form-check-input:checked { background-color: #0b57a8; border-color: #0b57a8; }
.form-control:focus, .form-select:focus { border-color: #1565c0; box-shadow: 0 0 0 .2rem rgba(21,101,192,.18); }
.topbar { background: linear-gradient(90deg, #0b2a5b, #0b57a8); border-bottom: 3px solid #0fa3a3; }
.top-link:hover { color: #9ff0f0; }
.site-footer .text-success { color: #0b8484 !important; }
