/*
 * App styles (plain CSS, no framework)
 * Author: RaKiBuL HaSaN - CEO & Founder, The One Stop BD (theonestopbd.com)
 * Developer Phone: +8801752986368 | Developer Email: rhs.rakibul@gmail.com
 *
 * Sections: Variables, Base, Layout, Sidebar, Top bar, Cards & stats, Tables, Forms, Buttons,
 *           Badges, Alerts, Pills & toolbar, Misc components, Login, Print, Media queries
 */

/* ---------- Variables ---------- */
:root {
  --brand: #1f4e9c;                 /* replaced per company in the page header */
  --brand-soft: rgba(31, 78, 156, .10);
  --bg: #f4f6fb;
  --card: #ffffff;
  --text: #1b2333;
  --muted: #6b7488;
  --line: #e6e9f0;
  --danger: #c0392b;
  --ok: #15803d;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 4px 14px rgba(16, 24, 40, .05);
  --side: #0f172a;
}
@supports (background: color-mix(in srgb, red 10%, white)) {
  :root { --brand-soft: color-mix(in srgb, var(--brand) 12%, white); }
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 14px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; color: var(--text); background: var(--bg); }
h1 { font-size: 24px; font-weight: 700; letter-spacing: -.01em; margin: 0 0 18px; }
h2 { font-size: 16px; font-weight: 650; margin: 22px 0 12px; }
.card h2 { margin-top: 0; }
a { color: var(--brand); text-decoration-color: transparent; transition: text-decoration-color .15s; }
a:hover { text-decoration-color: currentColor; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
code { background: #eef1f6; padding: 1px 6px; border-radius: 5px; font-size: 12.5px; }
.ic { vertical-align: -3px; flex-shrink: 0; }

/* ---------- Layout ---------- */
.shell { display: flex; min-height: 100vh; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.content { padding: 26px 28px; flex: 1; max-width: 1400px; width: 100%; }
.foot { padding: 16px 20px; text-align: center; font-size: 12px; color: var(--muted); }
.foot a { color: inherit; text-decoration: none; }
.backdrop { display: none; }

/* ---------- Sidebar ---------- */
.side { width: 248px; background: var(--side); color: #cbd5e1; flex-shrink: 0; position: sticky; top: 0; height: 100vh; overflow-y: auto; padding-bottom: 20px; }
.side-brand { display: flex; align-items: center; gap: 11px; padding: 18px 18px 16px; border-bottom: 1px solid rgba(255, 255, 255, .07); }
.logo-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: var(--brand); color: #fff; font-weight: 800; letter-spacing: .02em; box-shadow: 0 4px 12px rgba(0, 0, 0, .3); }
.brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.brand-text b { color: #fff; font-size: 15px; }
.brand-text small { color: #94a3b8; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side nav { padding: 8px 10px; }
.nav-title { padding: 16px 10px 6px; font-size: 10.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: #64748b; }
.side nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; margin: 1px 0; border-radius: 9px; color: #cbd5e1; text-decoration: none; font-weight: 500; transition: background .15s, color .15s; }
.side nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.side nav a.on { background: var(--brand); color: #fff; box-shadow: 0 4px 12px rgba(0, 0, 0, .25); }
.side nav a .ic { opacity: .9; }

/* ---------- Top bar ---------- */
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 14px; padding: 10px 28px; background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: var(--brand); opacity: .9; }
.burger { display: none; background: none; border: 0; padding: 6px; border-radius: 8px; color: var(--text); cursor: pointer; }
.switcher { display: flex; align-items: center; gap: 8px; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 3px 6px 3px 12px; }
.switcher .dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.switcher select { border: 0; background: transparent; font-weight: 650; padding: 5px 4px; width: auto; cursor: pointer; outline: none; color: var(--text); }
.who { margin-left: auto; display: flex; align-items: center; gap: 11px; }
.avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 700; font-size: 13px; }
.who-text { display: flex; flex-direction: column; line-height: 1.25; }
.who-text small { color: var(--muted); text-transform: capitalize; font-size: 11.5px; }
.icon-btn { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; color: var(--muted); border: 1px solid var(--line); background: #fff; text-decoration: none; transition: background .15s, color .15s; }
.icon-btn:hover { background: var(--brand-soft); color: var(--brand); }

/* ---------- Cards & stats ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px; box-shadow: var(--shadow); overflow-x: auto; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-bottom: 20px; }
.stat { background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--brand); border-radius: var(--radius); padding: 16px 18px 15px 18px; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; }
.stat:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(16, 24, 40, .09); }
.stat b { display: block; font-size: 27px; line-height: 1.2; font-weight: 750; letter-spacing: -.01em; }
.stat span { color: var(--muted); font-size: 13px; }
.stat span a { color: var(--muted); }
.two-col { display: grid; gap: 18px; grid-template-columns: 1fr 1fr; align-items: start; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; padding: 0; }
table { width: 100%; border-collapse: collapse; background: transparent; }
th, td { text-align: left; padding: 11px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #f8fafc; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); white-space: nowrap; }
tbody tr:last-child td, tr:last-child > td { border-bottom: 0; }
tr:hover > td { background: #fafbfe; }
td .btn.sm + .btn.sm, td .btn.sm + a.btn.sm { margin-left: 4px; }
.num { text-align: right; white-space: nowrap; }
.late-row td { background: #fff7ed; }
.due-soon { color: var(--danger); font-weight: 600; }
.warn-soon { color: #b45309; font-weight: 600; }
table table td, table table th { padding: 8px 10px; }

/* ---------- Forms ---------- */
label { display: block; font-weight: 600; font-size: 13px; margin: 14px 0 5px; color: #344054; }
input[type=text], input[type=password], input[type=email], input[type=date], input[type=number], input[type=tel], input[type=url],
input[type=month], input[type=datetime-local], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #d5dae3; border-radius: 10px; font: inherit; background: #fff; color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: #bcc3d0; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; accent-color: var(--brand); vertical-align: -3px; margin-right: 4px; }
.form-grid { display: grid; gap: 0 18px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.checks label { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; margin-right: 18px; }
.inline { display: inline; }
td input[type=number], td input[type=text], td input[type=datetime-local], td select { padding: 6px 9px; border-radius: 8px; }
.other-wrap { display: block; }
.other-wrap .other-input { margin-top: 6px; }
.other-wrap .other-input[hidden] { display: none; }
.toolbar .other-wrap, td .other-wrap { min-width: 130px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 16px; }
.toolbar > div { min-width: 150px; }
.toolbar label { margin-top: 0; }
form.toolbar.card { padding: 16px 20px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 18px; border: 0; border-radius: 10px; background: var(--brand); color: #fff; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; box-shadow: 0 1px 2px rgba(16, 24, 40, .12); transition: filter .15s, transform .05s, box-shadow .15s; }
.btn:hover { filter: brightness(1.08); box-shadow: 0 4px 12px rgba(16, 24, 40, .18); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid var(--brand-soft); outline-offset: 1px; }
.btn.light { background: #fff; color: var(--text); border: 1px solid #d5dae3; box-shadow: none; }
.btn.light:hover { background: #f4f6fb; filter: none; box-shadow: none; }
.btn.sm { padding: 5px 11px; font-size: 12.5px; border-radius: 8px; }

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #e8ebf1; color: #475467; white-space: nowrap; }
.badge.approved, .badge.paid, .badge.present, .badge.done, .badge.tk-done, .badge.rq-done, .badge.mail-sent,
.badge.st-interested, .badge.st-booked, .badge.st-visa_success, .badge.tv-approved, .badge.tv-delivered, .badge.tv-issued { background: #dcfce7; color: var(--ok); }
.badge.pending, .badge.unpaid, .badge.late, .badge.mail-pending { background: #fef3c7; color: #92400e; }
.badge.rejected, .badge.absent, .badge.missed, .badge.cancelled, .badge.mail-failed, .badge.pr-urgent, .badge.rq-rejected,
.badge.st-not_interested, .badge.st-lost, .badge.tv-rejected, .badge.tv-cancelled { background: #fee2e2; color: var(--danger); }
.badge.leave, .badge.booked, .badge.st-appointment, .badge.st-consulted, .badge.tv-submitted, .badge.tv-processing, .badge.tv-booked,
.badge.rq-in_progress, .badge.rq-review, .badge.tk-doing { background: #dbeafe; color: #1e40af; }
.badge.st-new, .badge.tv-documents, .badge.tv-quoted, .badge.rq-new { background: #e0e7ff; color: #3730a3; }
.badge.pr-high { background: #ffedd5; color: #9a3412; }
.badge.pr-low, .badge.mail-skipped { background: #f1f3f7; color: var(--muted); }
.tag { background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 1px 10px; font-size: 12px; text-transform: capitalize; }

/* ---------- Alerts ---------- */
.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; border: 1px solid transparent; }
.alert.ok { background: #ecfdf3; color: #146c3b; border-color: #c4ecd3; }
.alert.err { background: #fef3f2; color: #a8281c; border-color: #fbd0cb; }

/* ---------- Pills & misc components ---------- */
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.pills a { padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); text-decoration: none; color: var(--text); font-size: 13px; font-weight: 500; transition: background .15s, border-color .15s; }
.pills a:hover { border-color: var(--brand); color: var(--brand); }
.pills a.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 8px 0 10px 18px; border-left: 2px solid var(--line); margin-left: 5px; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 13px; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); border: 2px solid #fff; }
.timeline small { color: var(--muted); display: block; }
.comment { border-left: 3px solid var(--brand-soft); padding: 4px 0 4px 12px; margin: 12px 0; }
.actions a { margin-right: 6px; }

/* ---------- Task list on the dashboard ---------- */
.task-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.task-row { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; background: #fff; }
.task-row.running { border-color: #22c55e; box-shadow: 0 0 0 3px #dcfce7; }
.task-row.new { border-left: 5px solid #6366f1; }
.task-top { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.task-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; align-items: flex-start; }
details.mini > summary { list-style: none; cursor: pointer; display: inline-flex; }
details.mini > summary::-webkit-details-marker { display: none; }
details.mini[open] { flex-basis: 100%; }
details.mini[open] > form { margin-top: 8px; max-width: 520px; }
details.mini textarea { margin-bottom: 6px; }

/* ---------- Notifications: bell, list and popups ---------- */
.notify { position: relative; margin-left: auto; }
.notify + .who { margin-left: 0; }
.bell { position: relative; cursor: pointer; }
.bell-count { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: #dc2626; color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.bell-count[hidden] { display: none; }
.notify-panel { position: absolute; right: 0; top: 44px; width: 360px; max-width: calc(100vw - 24px); max-height: 70vh; overflow-y: auto; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 40px rgba(16, 24, 40, .18); z-index: 40; }
.notify-panel[hidden] { display: none; }
.np-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.np-head a { font-size: 12.5px; }
.np-row { display: block; padding: 10px 14px; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; }
.np-row:hover { background: var(--bg); }
.np-row.unread { background: #f0f6ff; border-left: 4px solid var(--brand); }
.np-row b, .np-row span, .np-row small { display: block; }
.np-row span { color: var(--muted); font-size: 12.5px; }
.np-row small { color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.np-more, .np-empty { display: block; padding: 12px 14px; text-align: center; color: var(--muted); }
.toasts { position: fixed; top: 74px; right: 16px; z-index: 60; display: flex; flex-direction: column; gap: 10px; width: 340px; max-width: calc(100vw - 32px); pointer-events: none; }
.toast { pointer-events: auto; cursor: pointer; background: #fff; border: 1px solid var(--line); border-left: 5px solid var(--brand); border-radius: 12px; padding: 12px 14px; box-shadow: 0 12px 32px rgba(16, 24, 40, .22); animation: toastIn .25s ease; }
.toast:hover { transform: translateY(-1px); box-shadow: 0 16px 38px rgba(16, 24, 40, .28); }
.toast-asset { border-left-color: #0f766e; } .toast-tech { border-left-color: #7c3aed; } .toast-approval { border-left-color: #b45309; }
.toast-booking { border-left-color: #22c55e; } .toast-task { border-left-color: #1f4e9c; } .toast-answer { border-left-color: #6366f1; }
.toast-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.toast-x { border: 0; background: none; font-size: 20px; line-height: 1; color: var(--muted); cursor: pointer; padding: 0 2px; }
.toast-x:hover { color: var(--text); }
.toast-body { color: var(--text); margin-top: 4px; font-size: 13px; }
.toast-time { color: var(--muted); font-size: 11.5px; margin-top: 6px; }
@keyframes toastIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
@media (max-width: 520px) { .toasts { top: 64px; right: 8px; left: 8px; width: auto; max-width: none; } .notify-panel { position: fixed; left: 8px; right: 8px; top: 60px; width: auto; max-width: none; } }
@media print { .notify, .toasts { display: none !important; } }

/* ---------- A request opened from a notification is highlighted ---------- */
.focus-card { box-shadow: 0 0 0 3px #fde68a, var(--shadow) !important; animation: focusFade 4s ease 1; }
@keyframes focusFade { 0% { background: #fffbeb; } 100% { background: #fff; } }

/* ---------- Login ---------- */
.login-box { max-width: 380px; margin: 11vh auto 0; background: rgba(255, 255, 255, .97); border-radius: 18px; padding: 32px 30px 26px; box-shadow: 0 24px 60px rgba(0, 0, 0, .3); }
.login-box .logo-mark { width: 56px; height: 56px; border-radius: 16px; margin: -62px auto 14px; font-size: 20px; border: 4px solid #fff; background: #1f4e9c; }
.login-box h1 { text-align: center; font-size: 21px; margin-bottom: 4px; }
.login-box .sub { text-align: center; color: var(--muted); margin-bottom: 14px; font-size: 13px; }
.login-box .btn { width: 100%; padding: 11px; font-size: 15px; }

/* ---------- Print (reports) ---------- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.print-only { display: none; }
@media print {
  .side, .top, .foot, .toolbar, .btn, .burger, .backdrop, .pills, .page-head, .no-print, form.card, .adm-cal, .notify-toasts, #toasts { display: none !important; }
  table form, table details, table .btn { display: none !important; }
  .print-only { display: block; margin-bottom: 10px; font-size: 15px; }
  .main { display: block; margin: 0; }
  .content { padding: 0; max-width: none; }
  body { background: #fff; color: #000; font-size: 12px; }
  a { color: #000 !important; text-decoration: none !important; }
  .card, .stat { break-inside: avoid; box-shadow: none; border: 0; }
  .table-wrap { overflow: visible; }
  table { width: 100%; border-collapse: collapse; }
  th, td { border: 1px solid #999; padding: 4px 6px; }
  tr { break-inside: avoid; }
  .adm-layout { display: block; }
}

/* ---------- Media queries ---------- */
@media (max-width: 900px) {
  .content { padding: 18px 14px; }
  .top { padding: 10px 14px; gap: 10px; }
  .side { position: fixed; z-index: 30; left: 0; top: 0; bottom: 0; transform: translateX(-100%); transition: transform .22s ease; box-shadow: none; }
  .nav-open .side { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .4); }
  .nav-open .backdrop { display: block; position: fixed; inset: 0; z-index: 20; background: rgba(15, 23, 42, .5); }
  .burger { display: block; }
  .who-text { display: none; }
  .two-col { grid-template-columns: 1fr; }
  h1 { font-size: 21px; }
}
@media (max-width: 520px) {
  .switcher { min-width: 0; flex: 1 1 auto; }
  .switcher select { max-width: 100%; min-width: 0; text-overflow: ellipsis; }
  .who { gap: 6px; }
  .avatar { display: none; }
  .top { gap: 6px; padding: 8px 10px; }
  .grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat b { font-size: 22px; }
  .toolbar > div { min-width: 120px; flex: 1 1 140px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* Global search box in the top bar */
.top-search { flex: 1 1 200px; max-width: 360px; margin-left: auto; }
.top-search input { width: 100%; padding: 8px 12px; border-radius: 999px; }
@media (max-width: 700px) { .top-search { flex-basis: 100%; order: 9; max-width: none; } }


/* Lead stage buttons (like Explorex) */
.stages { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.stg { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 8px; color: #fff !important; font-weight: 600; font-size: 13.5px; text-decoration: none; opacity: .88; border: 2px solid transparent; }
.stg span { background: rgba(255,255,255,.28); border-radius: 999px; padding: 0 8px; font-size: 12px; }
.stg:hover { opacity: 1; }
.stg.on { opacity: 1; box-shadow: 0 0 0 3px rgba(31,78,156,.25); border-color: #fff; }
.stg-blue { background: #2563eb; } .stg-green1 { background: #16a34a; } .stg-red { background: #dc2626; } .stg-green2 { background: #0d9488; }
.stg-yellow1 { background: #ca8a04; } .stg-green3 { background: #15803d; } .stg-orange { background: #ea580c; } .stg-yellow2 { background: #d97706; }
.stg-green { background: #059669; } .stg-gray { background: #64748b; }
summary.btn.danger { background: #dc2626; color: #fff; }
details.stage-act { display: inline-block; vertical-align: top; margin: 0 4px 4px 0; }
details.stage-act summary { list-style: none; }
details.stage-act form { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px; box-shadow: var(--shadow); position: absolute; z-index: 5; }
.badge.st-visit_not_interested, .badge.st-indecision { background: #fef3c7; color: #92400e; }
.badge.st-visit_missing { background: #ffedd5; color: #9a3412; }
@media print { .stages, details.stage-act { display: none !important; } }
details.stage-act summary, details.walkin.stage-act summary { color: #fff; font-size: 13px; }
details.stage-act form { min-width: 240px; }

.btn.danger, summary.btn.danger { background: #dc2626; color: #fff; border-color: #dc2626; }

/* ---------- Appointment room: the day bar, the tiles and one card per appointment ---------- */
.day-bar { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px; box-shadow: var(--shadow); }
.day-nav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.day-title { display: flex; flex-direction: column; line-height: 1.2; min-width: 170px; text-align: center; }
.day-title b { font-size: 20px; } .day-title span { align-self: center; margin-top: 2px; }
.day-go { margin-left: auto; display: flex; gap: 6px; } .day-go input { width: 160px; }
.day-strip { display: flex; gap: 6px; overflow-x: auto; padding: 10px 0 2px; }
.day-strip a { flex: 0 0 auto; width: 54px; text-align: center; border: 1px solid var(--line); border-radius: 10px; padding: 5px 0 4px; color: var(--text); text-decoration: none; background: #f8fafc; }
.day-strip a small { display: block; color: var(--muted); font-size: 11px; } .day-strip a b { display: block; font-size: 17px; line-height: 1.1; }
.day-strip a span { display: block; min-height: 14px; font-size: 11px; font-weight: 700; color: #1d4ed8; }
.day-strip a.on { background: var(--brand); color: #fff; border-color: var(--brand); } .day-strip a.on small, .day-strip a.on span { color: #dbeafe; }
.tiles { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 14px; }
.tile { background: #fff; border: 1px solid var(--line); border-top: 4px solid #94a3b8; border-radius: var(--radius); padding: 10px 14px; text-decoration: none; color: var(--text); box-shadow: var(--shadow); }
.tile b { display: block; font-size: 26px; line-height: 1.1; } .tile span { color: var(--muted); font-size: 13px; }
.tile.t-wait { border-top-color: #f59e0b; } .tile.t-done { border-top-color: #16a34a; } .tile.t-miss { border-top-color: #dc2626; } .tile.t-paid { border-top-color: #2563eb; }
.tile.on { outline: 3px solid rgba(31, 78, 156, .25); }
.rm-list { display: flex; flex-direction: column; gap: 10px; }
.rm-card { display: grid; grid-template-columns: 74px minmax(0, 1fr) auto auto; gap: 14px; align-items: center; background: #fff; border: 1px solid var(--line); border-left: 6px solid #f59e0b; border-radius: var(--radius); padding: 12px 16px; box-shadow: var(--shadow); }
.rm-card.rm-done { border-left-color: #16a34a; } .rm-card.rm-miss { border-left-color: #dc2626; background: #fffafa; }
.rm-time { text-align: center; } .rm-time b { display: block; font-size: 24px; line-height: 1; } .rm-time span { color: var(--muted); font-size: 12px; font-weight: 700; }
.rm-name { font-size: 17px; font-weight: 700; text-decoration: none; }
.rm-sub { color: var(--muted); font-size: 13px; margin-top: 1px; }
.rm-contact { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 4px; font-size: 13px; } .rm-contact span { color: var(--muted); }
.rm-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 13px; }
.rm-act { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; max-width: 330px; align-items: flex-start; }
.rm-act details.stage-act { margin: 0; } .rm-act form.inline { display: inline; }
@media (max-width: 1100px) { .rm-card { grid-template-columns: 74px minmax(0, 1fr); } .rm-meta { grid-column: 2; flex-direction: row; flex-wrap: wrap; align-items: center; } .rm-act { grid-column: 1 / -1; justify-content: flex-start; max-width: none; } }
@media (max-width: 700px) { .tiles { grid-template-columns: repeat(3, 1fr); } .day-title { min-width: 0; flex: 1; } .day-go { margin-left: 0; width: 100%; } .day-go input { flex: 1; } }
.act-cell { min-width: 220px; }
@media print { .day-strip, .tiles, .rm-act, .day-go { display: none !important; } .rm-card { box-shadow: none; break-inside: avoid; } }
/* Printing is always on A4 (the page orientation is chosen by app.js: wide tables print landscape) */
@page { size: A4; margin: 12mm; }
@media print { .content table { font-size: 11px; } .content th, .content td { padding: 3px 5px; } .print-foot { display: block !important; } }
.print-foot { display: none; text-align: center; font-size: 11px; color: #555; margin-top: 14px; }

.export-bar { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 10px; }

details.stage-act summary.light { color: var(--brand); background: #fff; border: 1px solid var(--line); }

/* Messages between the client and the team */
.chat { display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow-y: auto; padding: 2px 2px 6px; }
.bub { max-width: 82%; padding: 9px 13px; border-radius: 14px; line-height: 1.45; word-break: break-word; }
.bub small { display: block; margin-top: 4px; font-size: 11.5px; opacity: .7; }
.bub.me { align-self: flex-end; background: #1f4e9c; color: #fff; border-bottom-right-radius: 4px; }
.bub.them { align-self: flex-start; background: #eef2f7; color: #111827; border-bottom-left-radius: 4px; }
.bub.new { box-shadow: 0 0 0 2px #fde68a; }
/* Bangla pages: fonts that carry the Bangla letters well, a little more line height */
.bn { font-family: 'Noto Sans Bengali', 'Nirmala UI', 'Vrinda', 'SolaimanLipi', 'Kalpurush', var(--font, system-ui), sans-serif; line-height: 1.75; }
.bn h2, .bn h3 { line-height: 1.5; }

/* Dashboard tasks, Explorex style: assign row, task table with note / timer / done */
.task-assign { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.task-assign select { flex: 0 0 220px; max-width: 100%; }
.task-assign input { flex: 1 1 240px; min-width: 0; }
.task-table td { vertical-align: middle; }
.task-tag { display: inline-block; background: #6b7280; color: #fff; font-size: 11px; padding: 1px 8px; border-radius: 4px; margin-top: 3px; }
.task-tag.by { background: #0ea5e9; }
.note-edit { background: none; border: 0; cursor: pointer; color: #6b7280; font-size: 15px; }
.note-form { display: flex; gap: 6px; }
.note-form[hidden] { display: none; }
.note-form input { min-width: 160px; }
.task-act { white-space: nowrap; }
.task-act form.inline { display: inline; }
.tk-btn, .tk-done, .tk-del { border: 0; color: #fff; padding: 6px 12px; border-radius: 6px; cursor: pointer; font-size: 14px; }
.tk-btn { background: #2563eb; }
.tk-btn.on { background: #f59e0b; }
.tk-done { background: #16a34a; }
.tk-del { background: #dc2626; }
@media (max-width: 640px) { .task-act { white-space: normal; } .task-assign select { flex-basis: 100%; } }
.fu-note { display: inline-block; font-size: 12px; color: #555; background: #f3f4f6; border-radius: 4px; padding: 1px 6px; margin-top: 2px; }

/* Search bars: the search box takes the free width, the buttons wrap under it on a phone */
.toolbar .tb-search { flex: 1 1 260px; min-width: 0; }
.toolbar .tb-search input { width: 100%; }
.lead-tools .tb-ex { display: flex; gap: 8px; flex-wrap: wrap; }
details.stage-act summary.light { min-width: 34px; text-align: center; }
@media (max-width: 700px) {
  .toolbar .tb-search { flex: 1 1 100%; }
  .toolbar .tb-go, .lead-tools .tb-add { flex: 1 1 calc(50% - 8px); min-width: 0; display: flex; gap: 8px; }
  .toolbar .tb-go .btn, .lead-tools .tb-add .btn { flex: 1; text-align: center; }
  .lead-tools .tb-ex { flex: 1 1 100%; }
  .lead-tools .tb-ex .btn { flex: 1 1 auto; text-align: center; }
  .lead-tools > div[class=""], .lead-tools > div:not([class]) { flex: 1 1 100%; }
  details.stage-act form { position: fixed; left: 12px; right: 12px; bottom: 12px; top: auto; min-width: 0; z-index: 60; max-height: 80vh; overflow: auto; }
}
@media (max-width: 700px) {
  details.stage-act form { box-sizing: border-box; padding: 12px; }
  details.stage-act form input, details.stage-act form select, details.stage-act form textarea, details.stage-act form button { box-sizing: border-box; max-width: 100%; width: 100%; }
}
@media (max-width: 700px) { details.stage-act form { width: calc(100vw - 24px) !important; } }

/* Payments waiting, due money and proof pictures (pop animation) */
@keyframes popIn { 0% { transform: scale(.96); opacity: 0; } 60% { transform: scale(1.015); opacity: 1; } 100% { transform: scale(1); } }
@keyframes glowPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, .55); } 50% { box-shadow: 0 0 0 7px rgba(245, 158, 11, 0); } }
@keyframes dueBeat { 0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(220, 38, 38, .5); } 50% { transform: scale(1.06); box-shadow: 0 0 0 6px rgba(220, 38, 38, 0); } }
.pay-pop { animation: popIn .5s ease-out both; }
.pay-pop td { background: #fffbeb; }
.pay-pop td:first-child { box-shadow: inset 4px 0 0 #f59e0b; }
.pay-wait-badge { display: inline-block; padding: 2px 9px; border-radius: 999px; background: #f59e0b; color: #fff; font-weight: 700; font-size: 12px; animation: glowPulse 1.6s infinite; }
.due-red { display: inline-block; padding: 2px 9px; border-radius: 999px; background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; font-weight: 700; animation: dueBeat 1.6s infinite; }
.full-paid { display: inline-block; padding: 2px 9px; border-radius: 999px; background: #dcfce7; color: #166534; border: 1px solid #86efac; font-weight: 700; }
.proof-thumb { width: 74px; height: 74px; object-fit: cover; border-radius: 8px; border: 2px solid #e5e7eb; cursor: zoom-in; transition: transform .15s; background: #f3f4f6; }
.proof-thumb:hover { transform: scale(1.06); border-color: #f59e0b; }
.lb-shade { position: fixed; inset: 0; background: rgba(15, 23, 42, .82); display: flex; align-items: center; justify-content: center; z-index: 9999; cursor: zoom-out; animation: popIn .25s ease-out both; }
.lb-shade img { max-width: 92vw; max-height: 90vh; border-radius: 10px; background: #fff; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
@media (prefers-reduced-motion: reduce) { .pay-pop, .pay-wait-badge, .due-red, .lb-shade { animation: none; } }

/* "Taka + Date" popup (assets/js/paydate.js) */
.pd-shade { position: fixed; inset: 0; background: rgba(15, 23, 42, .55); z-index: 9000; display: flex; align-items: flex-start; justify-content: center; overflow-y: auto; padding: 24px 12px; animation: popIn .2s ease-out both; }
.pd-box { background: #fff; border-radius: 14px; width: 100%; max-width: 640px; padding: 18px 20px; box-shadow: 0 24px 70px rgba(0, 0, 0, .35); }
.pd-head { display: flex; align-items: center; gap: 10px; font-size: 18px; margin-bottom: 10px; }
.pd-x { margin-left: auto; border: 0; background: none; font-size: 26px; line-height: 1; cursor: pointer; color: #6b7280; }
.pd-sum { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 10px 12px; background: #f8fafc; border: 1px solid #e5e7eb; border-radius: 10px; font-size: 14px; }
.pd-sum span b { display: block; font-size: 15px; }
.pd-due { color: #b91c1c; }
.pd-step { margin-top: 14px; padding: 12px; border: 1px solid #e5e7eb; border-radius: 10px; }
.pd-step h4 { margin: 0 0 8px; font-size: 15px; }
.pd-step h4 i { display: inline-block; width: 22px; height: 22px; line-height: 22px; text-align: center; border-radius: 50%; background: #1f4e9c; color: #fff; font-style: normal; font-size: 13px; margin-right: 6px; }
.pd-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.pd-hint { margin: 8px 0 0; }
.pd-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.pd-nav button { border: 1px solid #d1d5db; background: #fff; border-radius: 8px; padding: 4px 12px; cursor: pointer; }
.pd-nav button:disabled { opacity: .35; cursor: default; }
.pd-grid7 { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.pd-dow { text-align: center; font-size: 12px; color: #6b7280; }
.pd-day { border: 1px solid #e5e7eb; background: #f3f4f6; color: #9ca3af; border-radius: 8px; height: 36px; font-size: 14px; }
.pd-day.free { background: #dcfce7; border-color: #86efac; color: #14532d; cursor: pointer; font-weight: 700; }
.pd-day.sel { background: #16a34a; color: #fff; border-color: #15803d; }
.pd-times { margin-top: 4px; }
.pd-time { border: 1px solid #1f4e9c; background: #fff; color: #1f4e9c; border-radius: 8px; padding: 6px 12px; margin: 0 6px 6px 0; cursor: pointer; font-weight: 600; }
.pd-time.on { background: #1f4e9c; color: #fff; }
.pd-ov { margin-top: 10px; padding: 8px; border: 1px dashed #f59e0b; border-radius: 8px; background: #fffbeb; }
.pd-msg { margin-top: 12px; padding: 9px 12px; border-radius: 8px; background: #ecfdf5; border: 1px solid #86efac; }
.pd-msg.bad { background: #fef2f2; border-color: #fca5a5; color: #991b1b; font-weight: 600; }
.pd-bad { color: #b91c1c; font-weight: 600; }
.pd-foot { margin-top: 14px; display: flex; justify-content: flex-end; gap: 8px; }
.pd-shake { animation: pdShake .5s; border-color: #dc2626 !important; }
@keyframes pdShake { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
#pdSummary { margin-top: 8px; font-size: 14px; }

/* Booking room table: fewer columns, the actions stack so nothing is cut off */
.bk-table td { vertical-align: top; }
.bk-client { min-width: 190px; }
.bk-email { word-break: break-all; font-size: 12px; }
.bk-appt { white-space: nowrap; }
.bk-money { white-space: nowrap; line-height: 1.7; }
.bk-act { min-width: 110px; }
.bk-act .btn { display: block; margin: 0 0 5px; text-align: center; }
.bk-wrap { overflow-x: auto; }
@media (max-width: 760px) { .bk-table .bk-email { display: none; } .bk-table th:nth-child(6), .bk-table td:nth-child(6) { display: none; } }

/* page size + page links of the long lists */
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 14px 0; font-size: 14px; color: #4b5563; }
.pager a { padding: 4px 10px; border: 1px solid #d1d5db; border-radius: 8px; background: #fff; color: #1f2937; text-decoration: none; }
.pager a.on { background: #1f4e9c; border-color: #1f4e9c; color: #fff; font-weight: 700; }
.pager .pg-info { margin: 0 6px; font-weight: 600; color: #111827; }

/* Lead rooms: fewer columns (client = name + ID + phone + email), the search bar and download buttons wrap on small screens */
.ls-client { min-width: 190px; }
.lead-tools .tb-ex { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
@media (max-width: 1250px) { .lead-tools .tb-ex { flex: 1 1 100%; margin-left: 0; } }
@media (max-width: 760px) { .lead-tools > div { flex: 1 1 100%; } .lead-tools .tb-go, .lead-tools .tb-add { flex: 1 1 calc(50% - 8px); } .lead-tools .tb-ex .btn, .lead-tools .tb-ex a { flex: 1 1 calc(50% - 8px); text-align: center; } .ls-client .bk-email { display: none; } }

/* Search bars: compact, no Search / Clear buttons (the list refreshes by itself), drop-downs beside the search box */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
.toolbar .tb-search { flex: 0 1 300px; }
.toolbar input[type=search], .lead-tools select, .lead-tools input[type=date], form.toolbar > div > select { height: 38px; padding: 6px 10px; font-size: 14px; border-radius: 8px; }
.toolbar input[type=search] { border: 1px solid var(--line, #d1d5db); background: #fff; width: 100%; }
.lead-tools .tb-pay { flex: 0 0 200px; min-width: 0; }
.lead-tools .tb-add { margin-left: auto; }
.lead-tools .tb-ex { margin-left: 0; flex: 1 1 100%; justify-content: flex-end; }
@media (max-width: 760px) { .toolbar .tb-search, .lead-tools .tb-pay { flex: 1 1 100%; } }

/* Lead lists: search, Money, dates, Add lead and the downloads sit on ONE line on a wide screen */
.lead-tools .tb-ex { flex: 0 0 auto; margin-left: 0; display: flex; flex-wrap: nowrap; gap: 6px; }
.lead-tools .tb-ex .btn, .lead-tools .tb-ex a { padding: 8px 12px; font-size: 13px; white-space: nowrap; }
.lead-tools .tb-add .btn, .lead-tools .tb-add a { white-space: nowrap; }
.lead-tools .tb-pay { flex: 0 0 170px; }
.lead-tools > div { min-width: 0; }
@media (min-width: 1100px) {
  .lead-tools { flex-wrap: nowrap; align-items: flex-end; }
  .lead-tools .tb-search { flex: 1 1 200px; min-width: 150px; }
  .lead-tools input[type=date] { width: 138px; }
  .lead-tools .tb-add { margin-left: auto; flex: 0 0 auto; }
}
@media (max-width: 1099px) { .lead-tools .tb-ex { flex: 1 1 100%; flex-wrap: wrap; } }
@media (min-width: 1100px) {
  .lead-tools { gap: 8px; }
  .lead-tools .tb-ex .btn, .lead-tools .tb-ex a { padding: 7px 9px; font-size: 12.5px; }
  .lead-tools .tb-pay { flex: 0 0 150px; }
  .lead-tools input[type=date] { width: 124px; padding-left: 6px; padding-right: 4px; }
  .lead-tools .tb-add .btn, .lead-tools > div > a.btn { padding: 8px 10px; font-size: 13px; white-space: nowrap; }
}

/* Slot Calendar: boxes that open on a click */
details.slot-box > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
details.slot-box > summary::-webkit-details-marker { display: none; }
details.slot-box .slot-change { margin-left: auto; padding: 4px 12px; border: 1px solid var(--line, #d1d5db); border-radius: 8px; background: #fff; color: var(--brand, #1f4e9c); font-size: 13px; font-weight: 600; }
details.slot-box[open] > summary .slot-change::after { content: ' (close)'; }
details.slot-box[open] > summary { padding-bottom: 6px; border-bottom: 1px solid var(--line, #e5e7eb); }
.slot-link input { border-radius: 8px; }

.pd-time { line-height: 1.15; }
.pd-time .pd-loc { display: block; font-size: 11px; font-weight: 500; opacity: .8; }
.pd-time.on .pd-loc { opacity: 1; }

.pd-other { margin-top: 8px; padding: 8px; border: 1px dashed #f59e0b; border-radius: 8px; background: #fffbeb; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pd-other input[type=time] { height: 34px; }

.pd-day.full { background: #fecaca; border-color: #fca5a5; color: #7f1d1d; cursor: pointer; font-weight: 700; }
.pd-time.used { background: #fee2e2; border-color: #fca5a5; color: #991b1b; cursor: not-allowed; }
.pd-time.off { background: #f3f4f6; border-style: dashed; border-color: #9ca3af; color: #4b5563; }
.pd-day.sel.full { background: #dc2626; color: #fff; }

/* small Edit / Change link beside a detail */
.edit-link{font-size:12px;font-weight:600;margin-left:6px;padding:1px 8px;border:1px solid var(--line,#d1d5db);border-radius:999px;text-decoration:none;white-space:nowrap}
.edit-link:hover{background:#eef2ff}

/* pop-up (an Edit / Change page shown in a frame on the running page) */
.ab-modal{position:fixed;inset:0;background:rgba(15,23,42,.55);z-index:1000;display:flex;align-items:flex-start;justify-content:center;padding:4vh 12px;overflow:auto}
.ab-modal-box{position:relative;background:#fff;width:min(760px,100%);height:88vh;border-radius:14px;box-shadow:0 20px 60px rgba(0,0,0,.35);overflow:hidden}
.ab-modal-box iframe{width:100%;height:100%;border:0;display:block}
.ab-modal-x{position:absolute;top:6px;right:10px;z-index:2;border:0;background:#eef2f7;width:32px;height:32px;border-radius:50%;font-size:22px;line-height:1;cursor:pointer}
body.embed .side,body.embed .top,body.embed .foot,body.embed .backdrop,body.embed .print-foot,body.embed .page-head .btn{display:none!important}
body.embed .content{padding:16px 18px;max-width:none}
body.embed .page-head h1{font-size:18px;margin:0 36px 6px 0}
