:root {
  --green: #0f9d58;
  --green-dark: #0b7a44;
  --green-soft: #eef8f0;
  --blue: #2b4a8b;
  --blue-soft: #eef3fc;
  --bg: #f2f4f7;
  --card: #ffffff;
  --text: #1c2431;
  --muted: #6b7583;
  --line: #e3e7ee;
  --danger: #d64545;
  --danger-soft: #fde8e8;
  --warn: #a3651a;
  --warn-soft: #fff5ec;
  --shadow: 0 2px 10px rgba(20, 30, 50, .08);
  --radius: 14px;
  --sidebar: 236px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg); color: var(--text);
  font-family: "Noto Sans Bengali", "SolaimanLipi", "Nirmala UI", "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); }
button, input, select, textarea { font-family: inherit; }

/* ---------- App bar ---------- */
.appbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 8px;
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  color: #fff;
  padding: 10px 14px;
  padding-top: calc(10px + env(safe-area-inset-top));
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.app-logo { width: 38px; height: 38px; flex: none; display: block; }
.appbar-title { font-size: 18px; margin: 0; font-weight: 700; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.appbar-actions { display: flex; align-items: center; gap: 8px; }
.iconbtn {
  background: rgba(255,255,255,.15); border: none; color: #fff;
  width: 40px; height: 40px; border-radius: 10px;
  font-size: 19px; cursor: pointer; display: grid; place-items: center; flex: none;
}
.iconbtn:active { background: rgba(255,255,255,.3); }
.sync-dot { width: 11px; height: 11px; border-radius: 50%; background: #cfd8e3; display: inline-block; }
.sync-dot.local { background: #f0ad4e; }
.sync-dot.cloud { background: #7ef08a; box-shadow: 0 0 6px #7ef08a; }

.offline-bar {
  background: #b45309; color: #fff; text-align: center;
  font-size: 12.5px; font-weight: 600; padding: 7px 12px;
}

/* ---------- Shell: sidebar (PC) + bottom nav (mobile) ---------- */
.shell { display: flex; align-items: flex-start; }
.sidebar { display: none; }
main { flex: 1; min-width: 0; padding: 14px 12px; padding-bottom: calc(96px + env(safe-area-inset-bottom)); max-width: 1100px; margin: 0 auto; }
main.narrow { max-width: 780px; }

.bottomnav {
  position: fixed; left: 0; right: 0; bottom: var(--strip-h, 0px); z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--card); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -2px 10px rgba(20,30,50,.06);
}
.bn-item {
  border: none; background: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 2px 7px; color: var(--muted); font-size: 11.5px; font-weight: 600;
}
.bn-item .ic { font-size: 20px; line-height: 1; }
.bn-item.on { color: var(--green-dark); }
.bn-item.add .ic {
  width: 46px; height: 46px; margin-top: -20px; border-radius: 50%;
  background: var(--green); color: #fff; display: grid; place-items: center; font-size: 28px;
  box-shadow: 0 6px 16px rgba(15,157,88,.4);
}

@media (min-width: 960px) {
  .bottomnav { display: none; }
  .sidebar {
    display: flex; flex-direction: column; gap: 2px;
    position: sticky; top: 60px; height: calc(100vh - 60px);
    width: var(--sidebar); flex: none; overflow-y: auto;
    background: var(--card); border-right: 1px solid var(--line);
    padding: 14px 10px;
  }
  /* কম্পিউটারে পুরো জায়গা ব্যবহার (খুব চওড়া স্ক্রিনে মাঝখানে) */
  main { padding: 24px 32px 40px; max-width: 1500px; }
  main.narrow { max-width: 880px; }
}

/* ---------- ড্যাশবোর্ড লেআউট ----------
   মোবাইল/ছোট স্ক্রিন: এক কলাম, ব্লকগুলো order দিয়ে সাজানো
   কম্পিউটার: বামে মূল হিসাব, ডানে পাওনা ও পরের ডেলিভারি */
.dash { display: flex; flex-direction: column; }
.dash-main, .dash-side { display: contents; }
.b1 { order: 1; } .b2 { order: 2; } .b3 { order: 3; } .b4 { order: 4; }
.b5 { order: 5; } .b6 { order: 6; } .b7 { order: 7; } .b8 { order: 8; }
.only-desk { display: none; }
@media (min-width: 1100px) {
  .dash { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 0 24px; align-items: start; }
  .dash-main, .dash-side { display: block; }
  .only-desk { display: block; }
  .only-mob { display: none; }
  .dash .kpi .value { font-size: 28px; }
}
@media (min-width: 1400px) {
  .list.two { grid-template-columns: 1fr 1fr 1fr; }
}
.side-item {
  display: flex; align-items: center; gap: 12px;
  border: none; background: none; cursor: pointer; text-align: left;
  padding: 11px 14px; border-radius: 10px;
  font-size: 15px; font-weight: 600; color: var(--text);
}
.side-item .ic { width: 22px; text-align: center; font-size: 18px; }
.side-item:hover { background: #f4f6f9; }
.side-item.on, .side-item.on:hover { background: var(--green); color: #fff; box-shadow: 0 3px 10px rgba(15,157,88,.28); }
.side-foot { margin-top: auto; padding: 12px 6px 4px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.side-foot b { color: var(--text); display: block; font-size: 14px; }

/* ---------- Common blocks ---------- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 2px 0 14px; }
.page-head h2 { margin: 0; font-size: 20px; }
.page-head .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.section-title { font-size: 13px; color: var(--muted); margin: 18px 4px 8px; font-weight: 700; letter-spacing: .2px; }
.card { background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-bottom: 14px; }
.card > h3 { margin: 0 0 12px; font-size: 16px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card > h3 .act { font-size: 13px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.danger-text { color: var(--danger); }
.ok-text { color: var(--green-dark); }
.right { text-align: right; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; }
.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.hr { height: 1px; background: var(--line); margin: 12px 0; border: 0; }

.empty { text-align: center; color: var(--muted); padding: 40px 20px; }
.empty .big-emoji { font-size: 44px; display: block; margin-bottom: 6px; }

/* ---------- Buttons ---------- */
.btn {
  border: none; border-radius: 11px; padding: 11px 16px;
  font-size: 15px; font-weight: 700; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px; justify-content: center;
  text-decoration: none; color: var(--text); background: #eef1f6;
  min-height: 44px; white-space: nowrap;
}
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--green); color: #fff; }
.btn.primary:active { background: var(--green-dark); }
.btn.blue { background: var(--blue); color: #fff; }
.btn.ghost { background: #eef1f6; color: var(--text); }
.btn.outline { background: var(--card); border: 1.5px solid var(--line); }
.btn.danger { background: var(--danger-soft); color: var(--danger); }
.btn.warn { background: #fde7cf; color: var(--warn); }
.btn.block { width: 100%; }
.btn.sm { padding: 7px 12px; font-size: 13px; min-height: 34px; border-radius: 9px; }
.btn.lg { padding: 15px 18px; font-size: 16.5px; min-height: 54px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-row .btn { flex: 1; }
.linkbtn { border: none; background: none; color: var(--blue); font-weight: 700; cursor: pointer; padding: 4px; font-size: 13.5px; }

.callbtn {
  flex: none; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; text-decoration: none;
  background: var(--green-soft); color: var(--green-dark); font-size: 17px; border: none; cursor: pointer;
}
.callbtn.wa { background: #e7f8ee; }

/* ---------- Dashboard ---------- */
.hello { margin: 0 0 14px; }
.hello h2 { margin: 0; font-size: 19px; color: var(--green-dark); }
.hello p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }

.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.quick .btn { min-height: 58px; font-size: 15px; border-radius: 13px; background: var(--card); box-shadow: var(--shadow); justify-content: flex-start; padding: 12px 14px; }
.quick .btn .qi { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 18px; flex: none; }
.quick .btn.main { grid-column: 1 / -1; background: var(--green); color: #fff; justify-content: center; font-size: 17px; min-height: 60px; }
.quick .btn.main .qi { background: rgba(255,255,255,.2); }
@media (min-width: 700px) {
  .quick { grid-template-columns: repeat(5, 1fr); }
  .quick .btn.main { grid-column: auto; }
  .quick .btn { flex-direction: column; justify-content: center; text-align: center; min-height: 92px; }
}
.qi.c1 { background: #e7f0fd; } .qi.c2 { background: #e5f6ec; } .qi.c3 { background: #fdeee0; } .qi.c4 { background: #efeafd; }

.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (min-width: 700px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi {
  background: var(--card); border-radius: var(--radius); padding: 13px 15px; box-shadow: var(--shadow);
  cursor: pointer; border: none; text-align: left; color: var(--text);
  display: flex; flex-direction: column; gap: 3px; min-height: 84px;
}
.kpi:active { transform: scale(.985); }
.kpi .label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.kpi .value { font-size: 25px; font-weight: 800; line-height: 1.15; }
.kpi .hint { font-size: 11px; color: var(--muted); }
.kpi.hl { background: linear-gradient(135deg, var(--blue), #35509c); color: #fff; }
.kpi.hl .label, .kpi.hl .hint { color: #d7e2ff; }
.kpi.money .value { color: var(--green-dark); }
.kpi.due .value { color: var(--danger); }
.kpi.wide2 { grid-column: span 2; }

.flow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.flow-step { position: relative; background: #f6f8fb; border-radius: 12px; padding: 10px 6px; text-align: center; cursor: pointer; border: none; color: var(--text); }
.flow-step .n { font-size: 22px; font-weight: 800; }
.flow-step .t { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.flow-step:not(:last-child)::after { content: "›"; position: absolute; right: -7px; top: 50%; transform: translateY(-50%); color: #b8c0cc; font-size: 18px; z-index: 1; }

.money-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (min-width: 700px) { .money-grid { grid-template-columns: repeat(4, 1fr); } }
.mg { background: #f6f8fb; border-radius: 11px; padding: 10px 12px; }
.mg .l { font-size: 12px; color: var(--muted); }
.mg .v { font-size: 17px; font-weight: 800; }

.alert { display: flex; align-items: center; gap: 10px; border-radius: 12px; padding: 11px 14px; margin-bottom: 12px; font-size: 14px; font-weight: 600; cursor: pointer; border: 1px solid; }
.alert.warn { background: var(--warn-soft); border-color: #f6dcc2; color: var(--warn); }
.alert.red { background: #fdeef1; border-color: #f4d2d9; color: #b23a3a; }

/* ---------- মেনুর ভাগ ---------- */
/* মূল মেনু (ভাগ) — চাপলে ভেতরের মেনু খোলে */
.side-group-btn {
  display: flex; align-items: center; gap: 12px; width: 100%;
  border: none; background: none; cursor: pointer; text-align: left;
  padding: 11px 14px; border-radius: 10px; font-size: 15px; font-weight: 700; color: var(--text);
}
.side-group-btn .ic { width: 22px; text-align: center; font-size: 18px; }
.side-group-btn .caret { color: var(--muted); font-size: 18px; transition: transform .15s ease; }
.side-group-btn:hover { background: #f4f6f9; }
.side-group-btn.open .caret { transform: rotate(90deg); }
.side-group-btn.has-on { color: var(--green-dark); }
.side-group-btn.has-on:not(.open) { background: var(--green-soft); }
.side-sub { display: none; margin: 2px 0 6px 25px; padding-left: 8px; border-left: 2px solid #e3e9e5; }
.side-sub.open { display: block; }
.side-sub .side-item { padding: 8px 12px; font-size: 14.5px; font-weight: 600; width: 100%; }
.menu-group { font-size: 12.5px; font-weight: 800; color: var(--muted); margin: 14px 2px 6px; }

/* ---------- জব কার্ড ---------- */
.jc-info { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 0; }
@media (max-width: 640px) { .jc-info { grid-template-columns: 1fr 1fr; } }
.jc-info > div { border: 1px solid #dfe5ec; border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; }
.jc-info span { font-size: 11.5px; color: #777; }
.jc-info b { font-size: 15px; }
.jc-info small { color: #555; }
.jc-big { font-size: 16px; font-weight: 800; }
.jc-extra { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 5px; }
.jc-extra span { background: #f3f5f8; border: 1px solid #e3e7ee; border-radius: 6px; padding: 2px 8px; font-size: 13px; }
.jc-block { margin-top: 12px; font-size: 14px; }
.jc-warn { background: #fff5ec; border: 1px solid #f6dcc2; border-radius: 8px; padding: 8px 10px; }
.jc-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; margin-top: 12px; }
.jc-photos img { width: 100%; height: 170px; object-fit: contain; border: 1px solid #e3e7ee; border-radius: 6px; background: #fafbfc; }
.jc-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px 12px; margin-top: 6px; font-size: 14.5px; }
@media (max-width: 640px) { .jc-steps { grid-template-columns: 1fr 1fr; } }
.jc-lines { height: 70px; background: repeating-linear-gradient(transparent 0 22px, #cfd6df 22px 23px); margin-top: 4px; }

/* ---------- হাজিরা ---------- */
.att-btns { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 10px; }
.att-b { border: 1.5px solid var(--line); background: #fff; border-radius: 10px; padding: 10px 4px; font-weight: 700; font-size: 13.5px; cursor: pointer; color: var(--text); }
.att-b.on.green { background: var(--green); border-color: var(--green); color: #fff; }
.att-b.on.amber { background: #e0913a; border-color: #e0913a; color: #fff; }
.att-b.on.red { background: var(--danger); border-color: var(--danger); color: #fff; }
.att-b.on.gray { background: #6b7583; border-color: #6b7583; color: #fff; }
@media (min-width: 760px) {
  .att-row { display: flex; align-items: center; gap: 14px; }
  .att-row > .row { flex: 1; }
  .att-row .att-btns { margin-top: 0; width: 440px; }
}
.att-grid th, .att-grid td { padding: 6px 5px; }
.att-grid .c { text-align: center; }
.dot-green { color: var(--green-dark); font-weight: 800; }
.dot-amber { color: #b4590f; font-weight: 800; }
.dot-red { color: var(--danger); font-weight: 800; }
.dot-gray { color: var(--muted); font-weight: 800; }
.audit-high { border-left: 4px solid var(--danger); }
.audit-mid { border-left: 4px solid #e0913a; }
.audit-info { border-left: 4px solid #9fb2cf; }

/* ---------- বাকি / পাওনা ---------- */
.due-hero { background: linear-gradient(135deg, #b23a3a, #d64545); color: #fff; border-radius: var(--radius); padding: 16px 18px; margin-bottom: 14px; box-shadow: 0 6px 18px rgba(178,58,58,.25); }
.due-hero .l { font-size: 13.5px; opacity: .9; font-weight: 700; }
.due-hero .v { font-size: 32px; font-weight: 800; line-height: 1.2; }
.due-hero-row { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; opacity: .92; margin-top: 4px; }
.due-more { background: rgba(255,255,255,.2); border-radius: 20px; padding: 6px 12px; font-size: 13px; font-weight: 700; white-space: nowrap; }
/* লাল প্যানেলের ভেতরের কাস্টমার তালিকা — সাদা বক্সে, যাতে আলাদা করে চোখে পড়ে */
.due-top { margin-top: 12px; background: #fff; color: var(--text); border-radius: 11px; padding: 2px 12px; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.due-top-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #f3dede; font-size: 14px; font-weight: 700; }
.due-top-row:last-child { border-bottom: none; }
.due-top-row small { color: var(--muted); font-weight: 500; margin-left: 4px; }
.due-top-row b { color: var(--danger); font-weight: 800; }
.due-card { background: var(--card); border-radius: 13px; padding: 12px 14px; box-shadow: var(--shadow); cursor: pointer; border-left: 4px solid var(--danger); }
.due-card .title { font-weight: 700; font-size: 15px; }
.due-card .sub { font-size: 12.5px; color: var(--muted); }
.due-card .amt { font-weight: 800; font-size: 18px; color: var(--danger); }

/* ---------- Search / filters ---------- */
.searchbox {
  width: 100%; background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px 12px 40px; font-size: 15.5px; outline: none; box-shadow: var(--shadow);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%236b7583' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 13px center;
}
.searchbox:focus { border-color: var(--green); }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.toolbar .searchbox { flex: 1; min-width: 200px; }

.chips { display: flex; gap: 7px; overflow-x: auto; padding: 2px 2px 10px; margin-bottom: 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.fchip {
  flex: none; border: 1.5px solid var(--line); background: var(--card); color: var(--text);
  border-radius: 20px; padding: 7px 13px; font-size: 13.5px; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.fchip .c { color: var(--muted); font-weight: 600; margin-left: 3px; }
.fchip.on { background: var(--green); border-color: var(--green); color: #fff; }
.fchip.on .c { color: #d9f5e4; }

.tabs { display: flex; background: #e8ecf2; border-radius: 12px; padding: 4px; margin-bottom: 14px; gap: 4px; }
.tab { flex: 1; border: none; background: none; padding: 10px 8px; border-radius: 9px; font-size: 14.5px; font-weight: 700; color: var(--muted); cursor: pointer; }
.tab.on { background: var(--card); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.08); }

/* ---------- Status chip ---------- */
.st { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 800; padding: 3px 10px; border-radius: 20px; white-space: nowrap; border: none; cursor: default; }
button.st { cursor: pointer; }
.st-new { background: #fef6d8; color: #9a6b00; }
.st-started { background: #e3edfd; color: #2457b5; }
.st-working { background: #fdeadb; color: #b4590f; }
.st-finishing { background: #efe6fd; color: #6b3fb8; }
.st-done { background: #dff5e3; color: #0b7a44; }
.st-delivered { background: #dcefea; color: #136155; }
.st-cancelled { background: #f3d9d9; color: #b23a3a; }
.tag { display: inline-block; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 20px; }
.tag.red { background: #fde3e3; color: #b23a3a; }
.tag.amber { background: #fdeede; color: #b5721a; }
.tag.green { background: #dff5e3; color: #0b7a44; }
.tag.gray { background: #eef1f6; color: var(--muted); }

/* ---------- Lists ---------- */
.list { display: grid; grid-template-columns: 1fr; gap: 9px; }
@media (min-width: 760px) { .list.two { grid-template-columns: 1fr 1fr; } }
.item {
  background: var(--card); border-radius: 13px; padding: 12px 14px; box-shadow: var(--shadow);
  display: flex; gap: 12px; align-items: center; cursor: pointer; border: none; text-align: left; color: var(--text); width: 100%;
}
.item:active { transform: scale(.99); }
.item .main { flex: 1; min-width: 0; }
.item .title { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .sub { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.item .end { text-align: right; flex: none; }
.item .amt { font-weight: 800; font-size: 15px; }
.item .cap { font-size: 11px; color: var(--muted); }
.avatar {
  width: 42px; height: 42px; flex: none; border-radius: 12px;
  background: linear-gradient(135deg, var(--green), var(--blue));
  color: #fff; font-weight: 800; font-size: 17px; display: grid; place-items: center;
}

.ocard { background: var(--card); border-radius: 14px; padding: 13px 14px; box-shadow: var(--shadow); cursor: pointer; }
.ocard:active { transform: scale(.995); }
.ocard .top { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.ocard .no { font-weight: 800; color: var(--blue); font-size: 14px; }
.ocard .cust { font-weight: 700; font-size: 15.5px; }
.ocard .work { font-size: 13px; color: var(--muted); margin-top: 1px; }
.ocard .bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 9px; padding-top: 9px; border-top: 1px dashed var(--line); font-size: 13px; }
.ocard .bottom b { font-weight: 800; }
.late { color: var(--danger); font-weight: 800; }

/* একশন বাটনের সারি — ছোট আইকন বাটন, মাউস রাখলে নাম দেখায় */
.acts { display: flex; gap: 5px; flex-wrap: wrap; flex: none; align-items: center; }
.ab {
  position: relative; width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line);
  background: #fff; cursor: pointer; display: grid; place-items: center; font-size: 15px; padding: 0;
  box-shadow: 0 1px 3px rgba(20,30,50,.06); transition: transform .08s ease, box-shadow .12s ease;
}
.ab:hover { box-shadow: 0 3px 10px rgba(20,30,50,.14); transform: translateY(-1px); }
.ab.pay { background: #3f8f69; border-color: #3f8f69; }
.ab.del { background: #c8625f; border-color: #c8625f; }
.ab.go { background: #2b4a8b; border-color: #2b4a8b; }
.ab[data-tip]:hover::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: #1c2431; color: #fff; font-size: 12px; font-weight: 600; white-space: nowrap;
  padding: 4px 9px; border-radius: 6px; z-index: 20; pointer-events: none;
}
/* শেষের দুটি বাটনের নাম ডান দিকে মিলিয়ে — স্ক্রিনের বাইরে যাবে না */
.acts .ab:nth-last-child(-n+2)[data-tip]:hover::after { left: auto; right: 0; transform: none; }
.ab[data-tip]:hover { z-index: 25; }
@media (hover: none) { .ab[data-tip]:hover::after { display: none; } }

/* কাস্টমারের সব অর্ডার এক কার্ডে */
/* overflow: hidden দেওয়া যাবে না — তাহলে বাটনের নাম (tooltip) কেটে যায় */
.ccard { background: var(--card); border-radius: 14px; box-shadow: var(--shadow); }
.ccard-head { border-radius: 14px 14px 0 0; }
.corow:last-child { border-radius: 0 0 14px 14px; }
.ccard-sum { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 14px; font-size: 13.5px; }
.ccard.collapsed .ccard-orders { display: none; }
.ccard.collapsed .ccard-head { border-bottom: none; }
/* মোট বিল · জমা · অবস্থাগুলো — সব এক লাইনে (জায়গা না হলে পাশে সরানো যায়) */
.ccard-mini { display: flex; flex-wrap: nowrap; gap: 8px; align-items: center; padding: 0 14px 10px; font-size: 12px; color: var(--muted); background: #fafbfc; white-space: nowrap; overflow-x: auto; scrollbar-width: none; }
.ccard-mini::-webkit-scrollbar { display: none; }
.ccard-mini > * { flex: none; }
.ccard-mini b { color: var(--text); font-size: 13px; }
.ccard-mini .tag { font-size: 10.5px; padding: 1px 7px; }
.ccard.collapsed .ccard-sum { border-top: 1px solid var(--line); }
.list > .ccard { align-self: start; }   /* গ্রিডে সমান উঁচু না করে নিজের মাপে */
.ccard.late-card { box-shadow: var(--shadow), inset 4px 0 0 var(--danger); }
.ccard-head { display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; background: #fafbfc; border-bottom: 1px solid var(--line); }
.ccard-head:hover { background: #f4f6f9; }
.ccard-head .cust { font-weight: 800; font-size: 16px; }
.ccard-head .amt { font-weight: 800; font-size: 16px; }
.ccard-head .cap { font-size: 11px; color: var(--muted); }
.corow { display: flex; align-items: center; gap: 10px; padding: 11px 14px; cursor: pointer; border-bottom: 1px dashed var(--line); }
.corow:last-child { border-bottom: none; }
.corow:hover { background: #f8faf9; }
.corow .no { font-weight: 800; color: var(--blue); font-size: 13.5px; flex: none; }
.corow .w { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.corow .grow { min-width: 0; }
.corow .amtcol { flex: none; font-size: 13.5px; }
.corow .chev { font-size: 18px; flex: none; }
.corow .st-ic { display: none; }
a.ab { text-decoration: none; color: inherit; }
.ccard-head .acts { margin-left: 4px; }
/* সাধারণ তালিকার লাইনেও একই নিয়ম */
.list .item { container-type: inline-size; flex-wrap: wrap; }
@container (max-width: 600px) { .item .acts { width: 100%; justify-content: flex-end; } }

/* কার্ড সরু হলে (ফোন) বাটনগুলো নিচের লাইনে ডানে */
.ccard { container-type: inline-size; }
.corow, .ccard-head { flex-wrap: wrap; }
@container (max-width: 860px) { .corow .acts { width: 100%; justify-content: flex-end; } }
@container (max-width: 560px) { .ccard-head .acts { width: 100%; justify-content: flex-end; } }
@media (max-width: 520px) { .corow .st { display: none; } .corow .st-ic { display: inline; } }

.pbar { height: 8px; background: #edf0f4; border-radius: 6px; overflow: hidden; margin-top: 8px; }
.pbar > i { display: block; height: 100%; background: linear-gradient(90deg, #f0a64a, var(--green)); border-radius: 6px; }
.pbar.big { height: 12px; }

.more-btn { width: 100%; margin-top: 10px; border: 1px dashed #c9d2df; background: none; color: var(--muted); }

/* ---------- Order detail ---------- */
.ohead { display: flex; gap: 12px; align-items: flex-start; }
.ohead .no { font-size: 13px; font-weight: 800; color: var(--blue); }
.ohead h2 { margin: 2px 0 2px; font-size: 20px; }
.kv { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid #f0f2f5; font-size: 14.5px; }
.kv:last-child { border-bottom: none; }
.kv .k { color: var(--muted); }
.kv .v { font-weight: 700; text-align: right; }
.kv.total .v { font-size: 17px; }
.kv.due .v { color: var(--danger); font-size: 19px; }
.kv.paid .v { color: var(--green-dark); }

.steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
@media (max-width: 520px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.stepbtn {
  border: 2px solid var(--line); background: var(--card); border-radius: 12px;
  padding: 10px 4px; font-size: 12.5px; font-weight: 700; cursor: pointer; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 64px; justify-content: center;
}
.stepbtn .e { font-size: 18px; }
.stepbtn.past { border-color: #cfe9d8; color: var(--green-dark); background: #f6fbf8; }
.stepbtn.cur { border-color: var(--green); background: var(--green); color: #fff; }

.items-view .wi { padding: 10px 0; border-bottom: 1px dashed var(--line); }
.items-view .wi:last-child { border-bottom: none; }
.wi .wt { font-weight: 800; font-size: 15px; }
.wi .wm { font-size: 14px; margin-top: 3px; }
.wi .wx { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.wi .wx span { background: #f3f5f8; border-radius: 8px; padding: 3px 9px; font-size: 12.5px; }
.prewrap { white-space: pre-wrap; font-size: 14.5px; line-height: 1.55; }

.notes { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.note { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.note .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--green); margin-top: 6px; flex: none; }
.note .meta { font-size: 11.5px; color: var(--muted); }
.note .x { margin-left: auto; border: none; background: none; color: var(--muted); cursor: pointer; font-size: 14px; }
.quick-notes { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.qn { border: 1px dashed #c9d2df; background: #fafbfc; border-radius: 16px; padding: 5px 11px; font-size: 12.5px; cursor: pointer; color: var(--text); }

.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.ph { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: #eef1f6; display: block; }
.ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph .pdf { width: 100%; height: 100%; display: grid; place-items: center; font-size: 30px; text-decoration: none; }
.ph .lbl { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.55); color: #fff; font-size: 10.5px; padding: 3px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph .del { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: none; background: rgba(0,0,0,.55); color: #fff; cursor: pointer; font-size: 12px; }
.addph { border: 2px dashed #c9d2df; border-radius: 10px; aspect-ratio: 1; display: grid; place-items: center; text-align: center; color: var(--muted); font-size: 12.5px; font-weight: 700; cursor: pointer; background: #fafbfc; }
.addph span { font-size: 26px; display: block; }

.lines .ln { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #f0f2f5; font-size: 14px; }
.lines .ln:last-child { border-bottom: none; }
.ln .x { border: none; background: var(--danger-soft); color: var(--danger); width: 28px; height: 28px; border-radius: 8px; cursor: pointer; flex: none; }

.two-col { display: grid; grid-template-columns: 1fr; gap: 0 14px; }
@media (min-width: 900px) { .two-col { grid-template-columns: 1.15fr 1fr; align-items: start; } }

/* ---------- Forms ---------- */
.field { margin-bottom: 12px; }
.field > label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 5px; font-weight: 600; }
.field input, .field select, .field textarea, .inp {
  width: 100%; border: 1.5px solid var(--line); border-radius: 11px; background: #fff;
  padding: 12px; font-size: 15.5px; outline: none; color: var(--text); min-height: 46px;
}
.field textarea { resize: vertical; line-height: 1.5; min-height: 70px; }
.field input:focus, .field select:focus, .field textarea:focus, .inp:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(15,157,88,.12); }
.field .help { font-size: 12px; color: var(--muted); margin-top: 4px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field-row.three { grid-template-columns: 1fr 1fr 1fr; }
.field-row.four { grid-template-columns: 1fr 1fr 1fr 1fr; }
@media (max-width: 520px) { .field-row.four { grid-template-columns: 1fr 1fr; } }
.req { color: var(--danger); }
.big-input { font-size: 22px !important; font-weight: 800; }

.form-card { background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-bottom: 14px; }
.form-card > h3 { margin: 0 0 12px; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.form-card > h3 .n { width: 24px; height: 24px; border-radius: 50%; background: var(--green); color: #fff; font-size: 13px; display: grid; place-items: center; flex: none; }

.pick { display: flex; flex-wrap: wrap; gap: 7px; }
.pick button {
  border: 1.5px solid var(--line); background: #fff; border-radius: 10px; padding: 9px 12px;
  font-size: 14px; font-weight: 700; cursor: pointer; color: var(--text); min-height: 42px;
}
.pick button.on { background: var(--green); border-color: var(--green); color: #fff; }

.suggest { position: relative; }
.suggest-list { position: absolute; left: 0; right: 0; top: 100%; z-index: 15; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 26px rgba(20,30,50,.16); margin-top: 4px; max-height: 300px; overflow-y: auto; }
.sg { display: flex; gap: 10px; align-items: center; padding: 11px 14px; cursor: pointer; border-bottom: 1px solid #f0f2f5; }
.sg:last-child { border-bottom: none; }
.sg:hover, .sg.on { background: var(--green-soft); }
.sg .s1 { font-weight: 700; font-size: 14.5px; }
.sg .s2 { font-size: 12.5px; color: var(--muted); }
.sg .s1 .st { font-size: 11px; padding: 2px 8px; margin-left: 4px; vertical-align: middle; }
.sg-money { flex: none; white-space: nowrap; }
.sg-money .s2 b { color: var(--text); }
.chosen { display: flex; align-items: center; gap: 12px; background: var(--green-soft); border: 1.5px solid #cdeccf; border-radius: 12px; padding: 11px 13px; }
.chosen .main { flex: 1; min-width: 0; }
.chosen .t1 { font-weight: 800; }
.chosen .t2 { font-size: 13px; color: var(--muted); }
.newcust { background: #fafbfc; border: 1.5px dashed #c9d2df; border-radius: 12px; padding: 12px 12px 2px; margin-top: 10px; }
.newcust .lbl { font-size: 12.5px; font-weight: 800; color: var(--blue); margin-bottom: 8px; }

.witem { border: 1.5px solid var(--line); border-radius: 13px; padding: 12px; margin-bottom: 10px; background: #fcfdfe; }
.witem .wh { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.witem .wh b { font-size: 14px; color: var(--blue); }
.witem .wh .rm { margin-left: auto; border: none; background: var(--danger-soft); color: var(--danger); border-radius: 8px; padding: 5px 10px; cursor: pointer; font-weight: 700; font-size: 12.5px; }
.xrow { display: grid; grid-template-columns: 1fr 1fr 36px; gap: 8px; margin-bottom: 8px; }
.xrow .x { border: none; background: var(--danger-soft); color: var(--danger); border-radius: 9px; cursor: pointer; }
.xsug { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.xsug button { border: 1px dashed #b9c3d1; background: #fff; border-radius: 14px; padding: 4px 10px; font-size: 12.5px; cursor: pointer; color: var(--text); }
.area { font-size: 12.5px; color: var(--green-dark); font-weight: 700; margin-top: -4px; margin-bottom: 6px; }

.calc { background: #f6f8fb; border-radius: 12px; padding: 4px 14px; margin-top: 4px; }
.calc .kv { font-size: 14px; }

.savebar {
  position: sticky; bottom: calc(64px + env(safe-area-inset-bottom)); z-index: 12;
  background: rgba(242,244,247,.92); backdrop-filter: blur(6px); padding: 10px 0; display: flex; gap: 10px;
}
@media (min-width: 960px) { .savebar { bottom: 0; } }
.savebar .btn { flex: 1; }

/* ---------- Modal (bottom sheet on mobile) ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(15,22,34,.5); display: flex; align-items: flex-end; justify-content: center; }
.modal {
  background: var(--card); width: 100%; max-width: 540px;
  border-radius: 20px 20px 0 0;
  padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
  max-height: 92vh; overflow-y: auto; animation: slideUp .2s ease;
}
@media (min-width: 600px) {
  .modal-backdrop { align-items: center; }
  .modal { border-radius: 20px; max-height: 88vh; padding-bottom: 18px; }
}
@keyframes slideUp { from { transform: translateY(30px); opacity: .6; } to { transform: translateY(0); opacity: 1; } }
.modal h3 { margin: 0 0 4px; font-size: 18px; }
.modal .msub { color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.modal-actions { display: flex; gap: 10px; margin-top: 10px; }
.modal-actions .btn { flex: 1; }
.sheet-list { display: flex; flex-direction: column; gap: 6px; }
.sheet-item { display: flex; align-items: center; gap: 12px; border: none; background: #f6f8fb; border-radius: 12px; padding: 13px 14px; font-size: 15px; font-weight: 700; cursor: pointer; text-align: left; color: var(--text); }
.sheet-item .ic { font-size: 20px; width: 26px; text-align: center; }
.sheet-item.on { background: var(--green-soft); color: var(--green-dark); }
.menu-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.menu-grid button { border: none; background: #f6f8fb; border-radius: 14px; padding: 16px 6px; display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; font-size: 13.5px; font-weight: 700; color: var(--text); }
.menu-grid .ic { font-size: 24px; }

/* ---------- Tables / reports ---------- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl { border-collapse: collapse; width: 100%; font-size: 13.5px; }
.tbl th, .tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.tbl th { background: #f6f8fb; font-size: 12.5px; color: var(--muted); font-weight: 800; }
.tbl td.num, .tbl th.num { text-align: right; }
.tbl tfoot td { font-weight: 800; background: var(--green-soft); border-top: 2px solid var(--green); }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: #fafbfc; }
.rep-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin-bottom: 14px; }
.print-head { display: none; }

/* ---------- Gate (login/setup) ---------- */
.gate { min-height: 78vh; display: grid; place-items: center; padding: 20px 4px; }
.gate-card { background: var(--card); border-radius: 20px; padding: 28px 22px; box-shadow: var(--shadow); max-width: 400px; width: 100%; }
.gate-logo { width: 96px; height: 96px; display: block; margin: 0 auto 6px; }
.gate-card h2 { margin: 6px 0 4px; font-size: 21px; text-align: center; }
.gate-card > p { color: var(--muted); font-size: 14px; margin: 0 0 18px; text-align: center; }
.gate-err { color: var(--danger); font-size: 13.5px; min-height: 18px; margin-top: 8px; text-align: center; font-weight: 600; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: calc(86px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%);
  background: #1c2431; color: #fff; padding: 11px 20px; border-radius: 24px;
  font-size: 14.5px; z-index: 70; box-shadow: 0 4px 14px rgba(0,0,0,.3); max-width: 92vw; text-align: center;
}
.toast.err { background: #b23a3a; }

.loading { display: grid; place-items: center; min-height: 60vh; color: var(--muted); font-weight: 600; }
.spinner { width: 34px; height: 34px; border: 4px solid #dfe5ec; border-top-color: var(--green); border-radius: 50%; animation: spin .8s linear infinite; margin: 0 auto 10px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Invoice ---------- */
.inv-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.inv-bar .btn { flex: 1; min-width: 140px; }
.paper { background: #fff; box-shadow: var(--shadow); border-radius: 6px; padding: 30px 32px; max-width: 800px; margin: 0 auto; color: #111; }
.inv-top { display: flex; justify-content: space-between; gap: 16px; border-bottom: 3px solid var(--green); padding-bottom: 14px; }
.inv-shop h1 { margin: 0; font-size: 24px; color: var(--green-dark); }
.inv-shop p { margin: 2px 0; font-size: 13px; color: #444; }
.inv-meta { text-align: right; font-size: 13px; }
.inv-meta .big { font-size: 20px; font-weight: 800; color: #111; letter-spacing: 1px; }
.inv-to { display: flex; justify-content: space-between; gap: 16px; margin: 16px 0; font-size: 14px; }
.inv-to .lbl { font-size: 11.5px; color: #777; font-weight: 700; text-transform: uppercase; }
.inv-tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.inv-tbl th { background: #f1f5f2; text-align: left; padding: 8px 10px; font-size: 12.5px; border-bottom: 2px solid #cfdcd3; }
.inv-tbl td { padding: 9px 10px; border-bottom: 1px solid #e6e9ee; vertical-align: top; }
.inv-tbl .num { text-align: right; }
.inv-bottom { display: flex; justify-content: space-between; gap: 20px; margin-top: 16px; }
.inv-totals { min-width: 260px; }
.inv-totals .kv { font-size: 14.5px; padding: 6px 0; }
.inv-totals .kv.due .v { font-size: 18px; }
.inv-note { font-size: 13px; color: #333; flex: 1; }
.inv-sign { display: flex; justify-content: space-between; margin-top: 54px; font-size: 13px; color: #444; }
.inv-sign div { border-top: 1px solid #999; padding-top: 4px; width: 180px; text-align: center; }
.inv-foot { text-align: center; font-size: 12px; color: #777; margin-top: 18px; }
.stamp { display: inline-block; border: 2px solid var(--green); color: var(--green-dark); font-weight: 800; padding: 2px 10px; border-radius: 6px; transform: rotate(-4deg); font-size: 13px; }
.stamp.due { border-color: var(--danger); color: var(--danger); }

.receipt { max-width: 300px; margin: 0 auto; background: #fff; padding: 14px 12px; font-size: 12.5px; color: #000; box-shadow: var(--shadow); font-family: "Noto Sans Bengali", "Nirmala UI", monospace; }
.receipt h1 { font-size: 16px; text-align: center; margin: 0; }
.receipt .c { text-align: center; }
.receipt .dash { border-top: 1px dashed #000; margin: 7px 0; }
.receipt .r { display: flex; justify-content: space-between; gap: 6px; }
.receipt .r b { font-weight: 800; }

/* ---------- Print ---------- */
@media print {
  .appbar, .bottomnav, .sidebar, .no-print, .offline-bar, .toast, .modal-backdrop, .savebar { display: none !important; }
  html, body { background: #fff !important; }
  main { padding: 0 !important; max-width: none !important; }
  .card, .paper, .receipt { box-shadow: none !important; border-radius: 0; }
  .paper { padding: 0; max-width: none; }
  .print-head { display: block; text-align: center; margin-bottom: 10px; }
  .print-head h2 { margin: 0; font-size: 18px; }
  .tbl { font-size: 11.5px; }
  .tbl th, .tbl td { padding: 5px 7px; }
  .inv-tbl th, .tbl th, .tbl tfoot td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body.print-receipt .receipt { max-width: none; width: 100%; padding: 0; }
}
