:root {
  --brand: #0e7490; --brand-dark: #0a566b; --brand-soft: #e3f3f8;
  --ink: #13202b; --body: #3d4a58; --muted: #6b7a8a;
  --line: #e3e9ef; --bg: #f4f7f9; --card: #fff;
  --green: #15803d; --amber: #b45309; --red: #b91c1c; --blue: #1d4ed8;
  --radius: 14px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.55 'Inter', -apple-system, 'Segoe UI', Roboto, sans-serif; color: var(--body); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { color: var(--ink); margin: 0; line-height: 1.25; }
h2 { font-size: 16px; font-weight: 700; }
h3 { font-size: 14px; font-weight: 700; }
small, .muted { color: var(--muted); }

/* layout */
.app { display: flex; min-height: 100vh; }
.side { width: 240px; flex: 0 0 240px; background: #0f1f2a; color: #cfe0e8; padding: 22px 16px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: 18px; padding: 0 8px 22px; }
.brand:hover { text-decoration: none; }
.brand small { font-weight: 600; font-size: 11px; letter-spacing: .1em; color: #7fc4d8; background: rgba(127,196,216,.14); padding: 2px 8px; border-radius: 99px; }
.brand-dot { width: 12px; height: 12px; border-radius: 50%; background: linear-gradient(135deg, #5fb4cc, #0e7490); }
.side nav { display: flex; flex-direction: column; gap: 4px; }
.side nav a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 10px; color: #b7ccd6; font-weight: 500; }
.side nav a:hover { background: rgba(255,255,255,.06); text-decoration: none; color: #fff; }
.side nav a.on { background: rgba(14,116,144,.35); color: #fff; }
.side-foot { margin-top: auto; padding: 14px 8px 0; border-top: 1px solid rgba(255,255,255,.08); display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.side-foot a { color: #8fb0be; }
.who { display: flex; flex-direction: column; margin-bottom: 4px; }
.who strong { color: #fff; font-size: 14px; }
.who span { color: #7fa2b1; font-size: 12px; }
.main { flex: 1; min-width: 0; }
.top { display: flex; align-items: center; gap: 12px; padding: 18px 28px 4px; }
.top h1 { font-size: 24px; font-weight: 700; letter-spacing: -.01em; }
.menu-btn { display: none; background: #fff; border: 1px solid var(--line); border-radius: 10px; width: 42px; height: 42px; align-items: center; justify-content: center; color: var(--ink); cursor: pointer; }
.content { padding: 14px 28px 48px; }

/* cards & grids */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: 0 1px 2px rgba(15,25,35,.03); }
.card + .card { margin-top: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.grid { display: grid; gap: 18px; }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
.stat { display: block; color: inherit; }
.stat:hover { text-decoration: none; border-color: #c8d6df; }
.stat .n { font-size: 30px; font-weight: 700; color: var(--ink); line-height: 1.1; }
.stat .l { color: var(--muted); font-size: 13px; margin-top: 4px; }
.stat.hot .n { color: var(--brand); }

/* tables */
.table-wrap { overflow-x: auto; margin: 0 -4px; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; padding: 10px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fafcfd; }
td.nowrap, .nowrap { white-space: nowrap; }
.empty { text-align: center; color: var(--muted); padding: 34px 10px; }

/* badges */
.badge { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; }
.badge-new { background: #dbeafe; color: var(--blue); }
.badge-confirmed { background: #fef3c7; color: var(--amber); }
.badge-completed { background: #dcfce7; color: var(--green); }
.badge-cancelled { background: #fee2e2; color: var(--red); }
.tag { display: inline-block; padding: 2px 9px; border-radius: 6px; font-size: 12px; font-weight: 600; background: var(--brand-soft); color: var(--brand-dark); }
.tag-gray { background: #eef2f5; color: var(--muted); }

/* forms */
label { display: block; font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=date], input[type=search], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: #fff; border: 1px solid #d5dee6; border-radius: 10px; padding: 10px 12px; outline: none;
}
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(14,116,144,.14); }
.field { margin-bottom: 14px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row > * { flex: 1 1 150px; min-width: 0; }
.row > .auto { flex: 0 0 auto; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer; font: inherit; font-weight: 600; padding: 10px 18px; border-radius: 10px; background: var(--brand); color: #fff; }
.btn:hover { background: var(--brand-dark); text-decoration: none; }
.btn-ghost { background: #fff; color: var(--ink); border: 1px solid #d5dee6; }
.btn-ghost:hover { background: #f4f7f9; }
.btn-danger { background: #fff; color: var(--red); border: 1px solid #f3c4c4; }
.btn-danger:hover { background: #fef2f2; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-wa { background: #1fa855; }
.btn-wa:hover { background: #198f48; }

.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-weight: 500; }
.flash-ok { background: #dcfce7; color: #14532d; }
.flash-err { background: #fee2e2; color: #7f1d1d; }

/* tabs / pager */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs a { padding: 7px 14px; border-radius: 99px; background: #fff; border: 1px solid var(--line); color: var(--body); font-weight: 600; font-size: 13px; }
.tabs a.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.tabs a:hover { text-decoration: none; }
.pager { display: flex; gap: 6px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.pager a { padding: 6px 12px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--body); }
.pager a.cur { background: var(--brand); border-color: var(--brand); color: #fff; }

/* detail */
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 10px 16px; }
.kv dt { color: var(--muted); font-size: 13px; }
.kv dd { margin: 0; color: var(--ink); word-break: break-word; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 0 0 16px 22px; position: relative; border-left: 2px solid var(--line); margin-left: 6px; }
.timeline li:last-child { padding-bottom: 0; border-left-color: transparent; }
.timeline li::before { content: ''; position: absolute; left: -7px; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid var(--brand); }
.timeline .t { font-size: 12px; color: var(--muted); }
.timeline .m { color: var(--ink); white-space: pre-wrap; word-break: break-word; }

/* mini bar chart */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 120px; }
.bars div { flex: 1; background: linear-gradient(180deg, #5fb4cc, #0e7490); border-radius: 6px 6px 2px 2px; min-height: 3px; position: relative; }
.bars div span { position: absolute; top: -18px; left: 0; right: 0; text-align: center; font-size: 11px; color: var(--muted); }
.bar-labels { display: flex; gap: 6px; margin-top: 6px; }
.bar-labels span { flex: 1; text-align: center; font-size: 10px; color: var(--muted); }
.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list li { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); }
.mini-list li:last-child { border-bottom: 0; }

/* login / setup */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: radial-gradient(1000px 500px at 20% -10%, #d9eef5, transparent), var(--bg); }
.auth-card { width: 100%; max-width: 400px; background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 32px; box-shadow: 0 30px 60px -30px rgba(15,25,35,.25); }
.auth-card h1 { font-size: 22px; margin: 14px 0 4px; }
.auth-card .brand { color: var(--ink); padding: 0; }
.auth-card .btn { width: 100%; margin-top: 6px; padding: 12px; }

@media (max-width: 960px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-main, .g2 { grid-template-columns: 1fr; }
}
/* mobile sidebar overlay */
.side-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 49;
  background: rgba(15,25,35,.5);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
@media (max-width: 820px) {
  .side {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 50;
    transform: translateX(-110%);
    /* mobile: only transition transform, not width/flex-basis */
    transition: transform .22s cubic-bezier(.4,0,.2,1);
    width: 82vw; max-width: 280px;
    overflow-y: auto; overflow-x: hidden;
  }
  .side.open { transform: translateX(0); }
  .side-overlay.open { display: block; }
  body.side-open { overflow: hidden; }   /* prevent scroll-through */
  .menu-btn { display: inline-flex; }
  .top { padding: 14px 16px 2px; }
  .top h1 { font-size: 20px; }
  .content { padding: 12px 16px 40px; }
  .kv { grid-template-columns: 110px 1fr; }
}
@media (max-width: 520px) {
  .card { padding: 16px; }
  .stat .n { font-size: 24px; }
}

/* collapsible sidebar (desktop only) */
.menu-btn { display: inline-flex; }
@media (min-width: 821px) {
  .side { transition: width .18s ease, flex-basis .18s ease, padding .18s ease; overflow: hidden; }
  .collapsed .side { width: 74px; flex-basis: 74px; padding-left: 12px; padding-right: 12px; }
  .collapsed .side .lbl { display: none; }
  .collapsed .brand { justify-content: center; padding-left: 0; padding-right: 0; }
  .collapsed .side nav a { justify-content: center; padding: 12px 0; }
  .collapsed .side-foot { display: none; }
}

/* address under the customer name: clamp to two lines, full text on hover */
.addr { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 260px; line-height: 1.35; margin-top: 2px; }

/* statuses: Pending / Confirmed / Cancelled */
.badge-pending { background: #fef3c7; color: var(--amber); }
.badge-confirmed { background: #dcfce7; color: var(--green); }
.status-form { margin: 0; display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.status-select, .emp-select { width: auto; min-width: 118px; padding: 6px 28px 6px 12px; font-weight: 600; border-radius: 99px; cursor: pointer; }
.status-select.st-pending { background-color: #fef3c7; border-color: #f6dc8b; color: var(--amber); }
.status-select.st-confirmed { background-color: #dcfce7; border-color: #a7e3bd; color: var(--green); }
.status-select.st-cancelled { background-color: #fee2e2; border-color: #f3b4b4; color: var(--red); }
.badge-old { background: #e5e7eb; color: #4b5563; }
.status-select.st-old { background-color: #eef0f3; border-color: #d1d5db; color: #4b5563; }
.emp-select { border-radius: 10px; font-weight: 500; min-width: 150px; }
.emp-select.emp-none { color: var(--muted); background: #f8fafb; }

/* order status colours */
.status-select.os-pending { background-color: #fef3c7; border-color: #f6dc8b; color: var(--amber); }
.status-select.os-in_progress { background-color: #dbeafe; border-color: #a9c4f5; color: var(--blue); }
.status-select.os-completed { background-color: #dcfce7; border-color: #a7e3bd; color: var(--green); }
.status-select.os-cancelled { background-color: #fee2e2; border-color: #f3b4b4; color: var(--red); }

/* dashboard charts */
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.chart h2 { margin-bottom: 2px; }
.chart > small { display: block; margin-bottom: 14px; }
.card + .card.chart, .g3 > .card { margin-top: 0; }
.donut-wrap { display: flex; flex-direction: column; align-items: center; gap: 18px; margin-top: 14px; }
.donut { position: relative; width: 168px; height: 168px; border-radius: 50%; flex: 0 0 auto; }
.donut-hole { position: absolute; inset: 26px; border-radius: 50%; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; box-shadow: inset 0 0 0 1px var(--line); }
.donut-hole b { font-size: 26px; color: var(--ink); }
.donut-hole span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-top: 3px; }
.legend { list-style: none; margin: 0; padding: 0; width: 100%; }
.legend li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.legend li:last-child { border-bottom: 0; }
.legend .dot { width: 10px; height: 10px; border-radius: 3px; flex: 0 0 auto; }
.legend .lg { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.legend strong { color: var(--ink); }
.legend em { font-style: normal; color: var(--muted); width: 46px; text-align: right; }
@media (max-width: 1180px) { .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .g3 { grid-template-columns: 1fr; } }

/* date range picker */
.rp { position: relative; display: inline-block; min-width: 0; }
.rp-btn { display: inline-flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-width: 190px; padding: 10px 12px; font: inherit; color: var(--ink); background: #fff; border: 1px solid #d5dee6; border-radius: 10px; cursor: pointer; text-align: left; }
.rp-btn:hover { border-color: #b9c8d3; }
.rp-btn svg { color: var(--muted); flex: 0 0 auto; }
.rp-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.rp-menu { position: absolute; z-index: 40; top: calc(100% + 6px); right: 0; width: 230px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 18px 40px -12px rgba(15,25,35,.28); overflow: hidden; }
.rp-menu[hidden], .rp-custom[hidden] { display: none; }
.rp-group + .rp-group { border-top: 1px solid var(--line); }
.rp-item { display: block; width: 100%; padding: 10px 16px; font: inherit; font-size: 14px; color: var(--ink); background: #fff; border: 0; text-align: left; cursor: pointer; }
.rp-item:hover { background: var(--brand); color: #fff; }
.rp-item.on { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }
.rp-item.on:hover { background: var(--brand); color: #fff; }
.rp-custom { padding: 12px 14px; border-top: 1px solid var(--line); background: #fafcfd; display: flex; flex-direction: column; gap: 8px; }
.rp-custom label { margin: 0; font-size: 12px; }
.rp-custom input { margin-top: 4px; }
@media (max-width: 520px) { .rp-menu { right: auto; left: 0; } }

/* embedded pages (vendor portal) */
.embed-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0 2px 8px; font-size: 13px; flex-wrap: wrap; }
.embed-wrap { height: calc(100vh - 150px); min-height: 480px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.embed-wrap iframe { display: block; width: 100%; height: 100%; border: 0; }

/* nearby employee suggestions */
.nearby { background: #f0f8fb; border: 1px solid #cfe6ee; border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; }
.nearby-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--brand-dark); margin-bottom: 8px; }
.nearby-rec { margin: 0 0 10px; font-size: 13.5px; color: var(--ink); line-height: 1.5; }
.nearby-rec.warn { color: #92400e; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; font: inherit; cursor: pointer; padding: 8px 12px; background: #fff; border: 1.5px solid #cfe6ee; border-radius: 10px; color: var(--ink); }
.chip:hover { border-color: var(--brand); background: var(--brand-soft); }
.chip.on { border-color: var(--brand); background: var(--brand-soft); }
.chip small { font-size: 11.5px; color: var(--muted); }
.chip.has-conflict { border-color: #f6dc8b; }
.chip small.warn { color: #b45309; font-weight: 600; }

/* dispatch board */
.fill { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 99px; font-size: 12px; font-weight: 700; }
.fill.f-0 { background: #eef2f5; color: var(--muted); }
.fill.f-part { background: #fef3c7; color: var(--amber); }
.fill.f-full { background: #fee2e2; color: var(--red); }
.row-leave td { background: #fbf4f4; }
.row-leave td strong { color: var(--muted); }
.slot { display: block; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: #fff; line-height: 1.5; }
.slot:hover { border-color: var(--brand); background: var(--brand-soft); text-decoration: none; }
.slot-empty { display: block; padding: 14px 10px; border: 1px dashed #c8d6df; border-radius: 10px; color: var(--muted); text-align: center; font-size: 13px; }
.slot-empty:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }
#boardTable td { vertical-align: top; }

/* editable customer name on the Orders page */
.name-form { margin: 0; }
.name-input { font-weight: 600; padding: 7px 10px; border-radius: 8px; border-color: transparent; background: #f4f7f9; }
.name-input:hover { border-color: #d5dee6; background: #fff; }
.name-input:focus { background: #fff; }
.ref-link { display: inline-block; margin-top: 4px; font-size: 12px; font-weight: 600; }

/* staff: Visits (visit cards with check in / check out) */
.badge-in_progress { background: #dbeafe; color: var(--blue); }
.visits { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); align-items: start; }
.visit { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.visit.st-in_progress { border-color: #a9c4f5; box-shadow: 0 0 0 3px #e8f0fe; }
.visit.st-completed { background: #fbfdfb; }
.visit-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.visit-when strong { display: block; color: var(--ink); font-size: 18px; line-height: 1.2; }
.visit-when small { font-size: 12.5px; }
.visit h3 { font-size: 16px; }
.visit-line { font-size: 14px; color: var(--body); word-break: break-word; }
.visit-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.visit-meta { font-size: 13px; background: #f4f7f9; border-radius: 10px; padding: 8px 10px; color: var(--ink); }
.visit-hint { margin: 0; font-size: 13px; color: var(--muted); }
.late { color: var(--red); font-weight: 600; }
.btn-block { width: 100%; padding: 12px; font-size: 15px; }
.btn:disabled { opacity: .6; cursor: wait; }
.geo-status { display: block; margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 500; font-size: 13.5px; margin: 0 0 10px; }
.check input { margin-top: 3px; }
.checkout-form { border-top: 1px solid var(--line); padding-top: 12px; }
.checkout-form .field { margin-bottom: 12px; }
.checkout-form input[type=number] { width: 100%; font: inherit; color: var(--ink); background: #fff; border: 1px solid #d5dee6; border-radius: 10px; padding: 10px 12px; outline: none; }
.checkout-form input[type=file] { width: 100%; font-size: 13px; margin-bottom: 6px; }
.photo-inputs input[hidden] { display: none; }
.seg { display: flex; gap: 8px; }
.seg label { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; margin: 0; padding: 10px 6px; border: 1px solid #d5dee6; border-radius: 10px; font-weight: 600; cursor: pointer; }
.seg label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); }
.seg input { margin: 0; }
@media (max-width: 520px) { .visits { grid-template-columns: 1fr; } }

/* admin: Visits list */
.visit-table td { vertical-align: top; }
.visit-table .addr { max-width: 220px; }
.flagnote { color: var(--amber); font-weight: 600; }
.thumbs { display: flex; gap: 4px; flex-wrap: wrap; max-width: 150px; }
.thumb { display: block; width: 44px; height: 44px; object-fit: cover; border-radius: 6px; border: 2px solid var(--line); background: #f4f7f9; }
.thumb-pay { border-color: #86d19f; }

/* payroll and payslips */
.month-nav { display: flex; align-items: center; gap: 8px; }
.month-nav input[type=month] { font: inherit; color: var(--ink); padding: 6px 10px; border: 1px solid #d5dee6; border-radius: 10px; background: #fff; }
.salary-form { display: flex; align-items: center; gap: 4px; margin: 0; }
.salary-form input { width: 120px; padding: 6px 10px; }
.rupee { color: var(--muted); }
.payslip-form input:disabled { background: #f4f7f9; color: var(--muted); }
.pay-totals li.net strong { font-size: 20px; color: var(--ink); }
.payslip { position: relative; max-width: 860px; background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px 36px; box-shadow: 0 12px 32px -20px rgba(15, 25, 35, .3); -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.payslip.is-draft::before { content: 'DRAFT'; position: absolute; top: 48%; left: 50%; transform: translate(-50%, -50%) rotate(-20deg); font-size: 110px; font-weight: 800; color: rgba(185, 28, 28, .07); pointer-events: none; }
.ps-head { display: flex; align-items: center; gap: 18px; padding-bottom: 16px; border-bottom: 3px solid var(--brand); }
.ps-logo { width: 88px; height: auto; flex: 0 0 auto; }
.ps-org { flex: 1; min-width: 0; }
.ps-company { font-size: 23px; font-weight: 800; letter-spacing: -.01em; }
.ps-address, .ps-contact { font-size: 12.5px; color: var(--body); margin-top: 2px; }
.ps-title { text-align: right; flex: 0 0 auto; }
.ps-title span { display: block; font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--brand); }
.ps-title strong { display: block; font-size: 20px; margin-top: 2px; }
.ps-details { width: 100%; margin: 20px 0; border-collapse: collapse; border: 1px solid #d3dee6; font-size: 13.5px; }
.ps-details th, .ps-details td { padding: 8px 12px; border: 1px solid #e1e8ee; text-align: left; vertical-align: middle; }
.ps-details th { width: 19%; background: #f5f9fb; color: var(--muted); font-size: 12.5px; font-weight: 600; text-transform: none; letter-spacing: 0; white-space: nowrap; }
.ps-details td { width: 31%; font-weight: 600; }
.ps-scroll { overflow-x: auto; }
.ps-stack { display: none; }
.ps-pay { width: 100%; min-width: 520px; border-collapse: collapse; border: 1px solid #c9d8e1; font-size: 14px; }
.ps-pay th, .ps-pay td { padding: 9px 12px; }
.ps-pay thead th { background: var(--brand); color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; border: 0; }
.ps-pay tbody td { border-bottom: 1px solid #edf2f5; }
.ps-pay tbody tr:hover td { background: none; }
.ps-pay .amt { width: 17%; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ps-pay .zero { color: #a3b0bc; }
.ps-pay .split { border-left: 2px solid #c9d8e1; }
.ps-pay tfoot th { background: #eaf4f7; color: var(--ink); font-size: 13.5px; font-weight: 700; text-transform: none; letter-spacing: 0; border-top: 2px solid #c9d8e1; }
.ps-net { margin-top: 18px; padding: 14px 18px; border: 2px solid var(--brand); border-radius: 10px; background: #f3fafc; }
.ps-net-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.ps-net-row span { font-size: 15px; font-weight: 700; }
.ps-net-row small { font-size: 12px; font-weight: 500; color: var(--muted); }
.ps-net-row strong { font-size: 27px; font-weight: 800; }
.ps-words { margin-top: 6px; font-size: 13px; color: var(--body); }
.ps-note { margin: 16px 0 0; font-size: 13.5px; }
.ps-foot { margin-top: 28px; padding-top: 10px; border-top: 1px dashed #d5dee6; text-align: center; font-size: 12px; color: var(--muted); }
@media (max-width: 640px) {
  .payslip { padding: 18px; }
  .ps-head { flex-wrap: wrap; }
  .ps-logo { width: 64px; }
  .ps-title { text-align: left; width: 100%; }
  .ps-details th, .ps-details td { display: block; width: auto; border: 0; padding: 7px 10px; }
  .ps-details th { background: none; }
  .ps-scroll { display: none; }
  .ps-stack { display: grid; gap: 12px; }
  .ps-stack .ps-pay { min-width: 0; }
  .ps-stack .amt { width: 40%; }
  .ps-details tr { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid #e1e8ee; }
  .ps-net-row strong { font-size: 22px; }
}
@media print {
  .side, .top, .no-print, .flash { display: none !important; }
  body, .content { background: #fff; padding: 0; }
  .payslip { border: 0; border-radius: 0; box-shadow: none; max-width: none; }
}

/* expenses */
.nav-badge { display: inline-block; min-width: 20px; margin-left: 6px; padding: 0 6px; border-radius: 99px; background: #f59e0b; color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.badge-exp-pending { background: #fef3c7; color: var(--amber); }
.badge-exp-approved { background: #dcfce7; color: var(--green); }
.badge-exp-rejected { background: #fee2e2; color: var(--red); }
.btn-ok { background: #15803d; }
.btn-ok:hover { background: #116a32; }
.inline-form { display: inline; margin: 0; }
.exp-actions { display: flex; flex-wrap: wrap; gap: 4px; width: 150px; }
.exp-actions .btn { padding: 5px 10px; }
.exp-totals { display: flex; gap: 8px; flex-wrap: wrap; }
.exp-totals span { padding: 5px 12px; border-radius: 8px; font-weight: 700; font-size: 13.5px; }
.exp-approved { background: #dcfce7; color: #14532d; border: 1px solid #a7e3bd; }
.exp-pending { background: #fef3c7; color: #78350f; border: 1px solid #f6dc8b; }
.exp-table .amt { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.exp-table td { vertical-align: middle; }
.exp-table th, .exp-table td { padding-left: 7px; padding-right: 7px; }
.exp-cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.exp-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.exp-card-top { display: flex; align-items: center; gap: 8px; width: 100%; }
.exp-card-top .badge { margin-left: auto; }
.exp-card-money { color: var(--ink); }
.exp-form { max-width: 760px; }
.exp-form fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.exp-form input[readonly] { background: #f4f7f9; color: var(--muted); }
.exp-form input[type=file] { width: 100%; font-size: 13px; }
.exp-admin { margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.exp-admin h3 { margin-bottom: 10px; }
.exp-review { max-width: 760px; }
.bill-list { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.bill-item { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.bill-item .thumb { width: 64px; height: 64px; }
.bill-item .check { margin: 0; font-size: 12px; }
.bill-pdf { display: flex !important; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; color: var(--red); background: #fff5f5 !important; }
.cat-table td { padding: 6px 4px; }
.cat-form { display: grid; grid-template-columns: minmax(140px, 2fr) minmax(110px, 1fr) 70px auto auto; gap: 8px; align-items: center; margin: 0; }
.cat-form input[type=text] { padding: 7px 10px; }
@media (max-width: 640px) { .cat-form { grid-template-columns: 1fr 1fr; } }

/* orders: UpTeams-style visit columns */
.mode-tag { display: inline-block; padding: 1px 7px; border: 1px solid var(--brand); border-radius: 5px; font-size: 12px; font-weight: 600; color: var(--brand-dark); }
td.amt { text-align: right; }

/* sidebar: on short screens the menu list scrolls and the name / Change password / Sign out block stays visible */
.side nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.18) transparent; }
.side-foot { flex-shrink: 0; margin-top: 10px; }
