:root {
  --navy: #1d2c58;
  --navy-2: #273861;
  --blue: #5574d8;
  --blue-soft: #edf2ff;
  --text: #202637;
  --muted: #626979;   /* darkened from #7d8496 to meet WCAG AA 4.5:1 on white and canvas */
  --border: #e9ebf2;
  --canvas: #f6f7fb;
  --white: #fff;
  --green: #29a778;
  --orange: #f0a14a;
  --red: #e56c67;
  --shadow: 0 8px 28px rgba(34, 48, 84, .06);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "DM Sans", sans-serif;
  color: var(--text);
  background: var(--canvas);
  font-size: 14px;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 238px;
  background: var(--white);
  border-right: 1px solid var(--border);
  padding: 24px 16px 18px;
  z-index: 20;
  display: flex;
  flex-direction: column;
}
.brand {
  height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  margin-bottom: 22px;
  font-family: "Manrope", sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--navy);
}
.brand-mark {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: var(--navy);
  display: grid; place-items: center;
}
.brand-mark svg { width: 21px; fill: none; stroke: white; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  width: 100%;
  height: 44px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #747b8d;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 0 13px;
  text-align: left;
  font-weight: 500;
  transition: .18s ease;
}
.nav-item svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.nav-item:hover { background: #f7f8fc; color: var(--navy); }
.nav-item.active { background: var(--navy); color: white; box-shadow: 0 6px 14px rgba(29,44,88,.16); }
.sidebar-footer { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); }

.main { margin-left: 238px; min-height: 100vh; }
.topbar {
  height: 82px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.page-heading { margin-right: auto; }
.page-heading p { margin: 0 0 3px; color: var(--muted); font-size: 12px; }
.page-heading h1 { margin: 0; font-family: "Manrope", sans-serif; font-size: 21px; color: var(--navy); }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.icon-button {
  width: 38px; height: 38px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--white);
  color: #697188;
  display: grid; place-items: center;
}
.icon-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.notification-button { position: relative; }
.notification-dot { position: absolute; right: 8px; top: 7px; width: 7px; height: 7px; border-radius: 50%; background: #ee7b75; border: 2px solid white; }
.profile-button { height: 48px; border: 0; background: transparent; display: flex; align-items: center; gap: 9px; padding: 4px 0 4px 7px; color: var(--text); }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: #dde5fb; color: var(--navy); display: grid; place-items: center; font-weight: 700; font-size: 12px; }
.profile-copy { display: flex; flex-direction: column; text-align: left; min-width: 90px; }
.profile-copy strong { font-size: 13px; }
.profile-copy small { color: var(--muted); margin-top: 2px; }
.profile-button > svg { width: 16px; height: 16px; fill: none; stroke: var(--muted); stroke-width: 2; }
.menu-button { display: none; margin-right: 12px; }

.content { padding: 26px 32px 40px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-bottom: 22px; }
.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  min-height: 126px;
  padding: 20px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  box-shadow: 0 3px 14px rgba(42,51,82,.025);
}
.stat-card p { margin: 2px 0 9px; color: var(--muted); font-size: 13px; }
.stat-card h2 { margin: 0; font-family: "Manrope", sans-serif; font-size: 27px; color: var(--navy); }
.stat-card small { color: var(--green); font-weight: 600; display: inline-flex; align-items: center; gap: 3px; margin-top: 8px; }
.stat-icon { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue); }
.stat-icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.stat-icon.green { background: #eaf7f1; color: var(--green); }
.stat-icon.orange { background: #fff3e5; color: var(--orange); }
.stat-icon.red { background: #fdeeee; color: var(--red); }

.panel { background: var(--white); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); }
.panel-header { min-height: 68px; display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.panel-title h2 { margin: 0 0 4px; font-family: "Manrope", sans-serif; font-size: 16px; color: var(--navy); }
.panel-title p { margin: 0; color: var(--muted); font-size: 12px; }
.panel-actions { display: flex; gap: 8px; align-items: center; }
.button { height: 38px; border-radius: 8px; padding: 0 14px; border: 1px solid var(--border); background: white; color: #5c6476; display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-weight: 600; }
.button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.button.primary { border-color: var(--navy); background: var(--navy); color: white; }
.button.secondary { background: white; color: #697188; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { height: 43px; background: #fafbfc; color: #858b9b; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; text-align: left; font-weight: 700; border-bottom: 1px solid var(--border); }
th, td { padding: 0 18px; }
td { height: 68px; border-bottom: 1px solid var(--border); color: #555d70; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: .15s; }
tbody tr:hover { background: #fbfcff; }
.task-id { color: var(--navy); font-weight: 700; }
.person { display: flex; align-items: center; gap: 9px; }
.mini-avatar { width: 32px; height: 32px; border-radius: 50%; background: #eef2fb; color: var(--navy); display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.person strong { display: block; color: var(--text); font-size: 13px; }
.person small { color: var(--muted); display: block; margin-top: 2px; }
.status { display: inline-flex; align-items: center; height: 26px; border-radius: 20px; padding: 0 9px; font-size: 12px; font-weight: 600; }
.status.new { background: #edf2ff; color: #5975c7; }
.status.progress { background: #fff4de; color: #be7a27; }
.status.complete { background: #e8f7f0; color: #278d68; }
.status.hold { background: #f1f1f5; color: #777d8c; }
.status.approved { background: #e8f7f0; color: #278d68; }
.status.pending { background: #fff4de; color: #be7a27; }
.status.rejected { background: #fdeeee; color: #c85d58; }
.row-action { width: 30px; height: 30px; border: 0; background: transparent; color: #969baa; font-size: 20px; }
.table-footer { height: 58px; display: flex; align-items: center; justify-content: space-between; padding: 0 18px; color: var(--muted); font-size: 12px; border-top: 1px solid var(--border); }
.pagination { display: flex; gap: 5px; }
.page-button { width: 30px; height: 30px; border: 1px solid var(--border); border-radius: 6px; background: white; color: #777e91; }
.page-button.active { background: var(--navy); color: white; border-color: var(--navy); }

.filter-bar { display: flex; gap: 8px; margin-bottom: 14px; }
.search-box { height: 38px; width: 230px; border: 1px solid var(--border); border-radius: 8px; display: flex; align-items: center; gap: 8px; padding: 0 11px; background: white; }
.search-box svg { width: 16px; fill: none; stroke: #969baa; stroke-width: 2; }
.search-box input { border: 0; outline: 0; width: 100%; color: var(--text); }
.search-box input::placeholder { color: #a3a7b2; }
.filter-button { height: 38px; padding: 0 11px; border: 1px solid var(--border); border-radius: 8px; background: white; color: #697188; display: flex; align-items: center; gap: 7px; }
.filter-button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; }

.modal-backdrop { position: fixed; inset: 0; background: rgba(25,34,60,.38); z-index: 100; display: grid; place-items: center; padding: 20px; backdrop-filter: blur(2px); }
.modal-backdrop[hidden] { display: none; }
.modal { width: min(720px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; background: white; border-radius: 13px; box-shadow: 0 20px 60px rgba(24,34,64,.22); }
.modal-header { height: 76px; display: flex; align-items: center; justify-content: space-between; padding: 14px 22px; border-bottom: 1px solid var(--border); }
.modal-header h2 { margin: 3px 0 0; font-family: "Manrope"; color: var(--navy); font-size: 18px; }
.eyebrow { margin: 0; color: var(--blue); font-size: 10px; letter-spacing: .12em; font-weight: 700; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 20px 22px; }
.form-grid label { color: #62697a; font-size: 12px; font-weight: 600; }
.form-grid input, .form-grid select, .form-grid textarea { width: 100%; margin-top: 7px; border: 1px solid var(--border); border-radius: 8px; background: white; color: var(--text); outline: 0; }
.form-grid input, .form-grid select { height: 42px; padding: 0 11px; }
.form-grid textarea { padding: 10px 11px; resize: vertical; }
.form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus { border-color: #93a8e5; box-shadow: 0 0 0 3px #edf2ff; }
.full-width { grid-column: 1 / -1; }
.toggle-label { display: flex; align-items: center; justify-content: space-between; height: 42px; }
.toggle-label input { display: none; }
.toggle { width: 42px; height: 24px; border-radius: 20px; background: #dfe3ea; position: relative; }
.toggle::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; background: white; left: 3px; top: 3px; transition: .18s; box-shadow: 0 2px 5px rgba(0,0,0,.12); }
.toggle-label input:checked + .toggle { background: var(--navy); }
.toggle-label input:checked + .toggle::after { transform: translateX(18px); }
.modal-footer { height: 68px; display: flex; justify-content: flex-end; align-items: center; gap: 8px; padding: 0 22px; border-top: 1px solid var(--border); }
.toast { position: fixed; right: 24px; bottom: 24px; background: var(--navy); color: white; border-radius: 8px; padding: 12px 16px; box-shadow: 0 10px 30px rgba(29,44,88,.22); transform: translateY(80px); opacity: 0; transition: .25s; z-index: 200; }
.toast.show { transform: translateY(0); opacity: 1; }

.empty-state { padding: 48px 20px; text-align: center; color: var(--muted); }
.empty-state h3 { color: var(--text); margin: 12px 0 5px; }

body.dark { --canvas: #151927; --white: #1d2233; --text: #edf0f7; --muted: #999fb0; --border: #30364a; --navy: #718ae0; --navy-2: #91a2df; --blue-soft: #2b3557; }
body.dark .nav-item.active { color: white; }
body.dark .stat-icon { color: #91a2df; }
body.dark .brand { color: #e5e8f2; }
body.dark .brand-mark { background: #718ae0; }
body.dark .sidebar { background: #1d2233; }
body.dark th { background: #1a1f30; }
body.dark tbody tr:hover { background: #23293b; }
body.dark .search-box, body.dark .filter-button, body.dark .button, body.dark .icon-button, body.dark .form-grid input, body.dark .form-grid select, body.dark .form-grid textarea { background: #24293a; }

@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .sidebar { transform: translateX(-100%); transition: .22s; box-shadow: 10px 0 30px rgba(29,44,88,.12); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .menu-button { display: grid; }
  .topbar { padding: 0 16px; }
  .profile-copy { display: none; }
  .content { padding: 18px 16px 30px; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { min-height: 112px; padding: 14px; }
  .stat-card h2 { font-size: 23px; }
  .panel-header { align-items: flex-start; gap: 10px; }
  .panel-actions .button span { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .full-width { grid-column: auto; }
  .filter-bar { flex-wrap: wrap; }
  .search-box { width: 100%; }
}

/* =====================================================================
   Application additions (login, dropdown, detail view, forms, states)
   ===================================================================== */
[hidden] { display: none !important; }
a { color: inherit; }
a.nav-item, a.button { text-decoration: none; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.grow { flex: 1; }
.num { text-align: right; }
.hint { color: var(--muted); font-size: 12px; font-weight: 400; display: block; margin-top: 6px; line-height: 1.45; }

/* boot + spinner */
.boot { position: fixed; inset: 0; display: grid; place-items: center; background: var(--canvas); z-index: 300; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--navy); animation: spin .8s linear infinite; }
.spinner.small { width: 24px; height: 24px; border-width: 2px; }
.loading-row { padding: 40px; display: grid; place-items: center; }
@keyframes spin { to { transform: rotate(360deg); } }

/* login */
.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at 20% 10%, var(--blue-soft), transparent 45%), var(--canvas); }
.login-card { width: min(400px, 100%); background: var(--white); border: 1px solid var(--border); border-radius: 14px; padding: 32px 30px; box-shadow: var(--shadow); }
.login-brand { padding: 0; margin-bottom: 26px; }
.login-card h1 { margin: 0 0 6px; font-family: "Manrope", sans-serif; color: var(--navy); font-size: 22px; }
.login-card .muted { margin: 0 0 22px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack label { font-size: 12px; font-weight: 600; color: #62697a; }
.stack input { width: 100%; height: 44px; margin-top: 7px; padding: 0 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--white); color: var(--text); outline: 0; }
.stack input:focus { border-color: #93a8e5; box-shadow: 0 0 0 3px var(--blue-soft); }
.form-error { background: #fdeeee; color: #b4504b; border-radius: 8px; padding: 10px 12px; font-size: 13px; }
.button.block { width: 100%; height: 44px; }

/* buttons */
.button:disabled { opacity: .55; cursor: not-allowed; }
.button.success { background: var(--green); border-color: var(--green); color: #fff; }
.button.danger { background: var(--red); border-color: var(--red); color: #fff; }
.button.danger-ghost { color: #c85d58; border-color: #f3cfcd; }
.link-button { border: 0; background: none; padding: 4px 6px; color: var(--blue); font-weight: 600; font-size: 13px; }
.link-button:hover { text-decoration: underline; }
.danger-text { color: #c85d58 !important; }
.row-buttons { display: flex; gap: 2px; justify-content: flex-end; }
.icon-button.small { width: 32px; height: 32px; font-size: 18px; flex: none; }
.page-button:disabled { opacity: .4; cursor: default; }

/* sidebar overlay on mobile */
.sidebar-scrim { display: none; }
@media (max-width: 760px) { .sidebar-scrim.show { display: block; position: fixed; inset: 0; background: rgba(25,34,60,.3); z-index: 15; } }

/* profile dropdown */
.profile-wrap { position: relative; }
.dropdown { position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; background: var(--white); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 14px 40px rgba(24,34,64,.14); padding: 6px; z-index: 40; }
.dropdown-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; font-size: 12px; color: var(--muted); }
.dropdown button { width: 100%; text-align: left; border: 0; background: none; padding: 9px 10px; border-radius: 7px; color: var(--text); }
.dropdown button:hover { background: var(--canvas); }

/* stat grid variants */
.stat-grid.six { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.stat-card small.warn { color: var(--orange); }
.page > .panel { margin-bottom: 22px; }

/* notices */
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 10px; background: var(--blue-soft); color: var(--navy); margin-bottom: 18px; }
.notice svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; margin-top: 1px; }
.notice strong { display: block; margin-bottom: 2px; }
.notice span { font-size: 13px; opacity: .9; }
.notice.ok { background: #e8f7f0; color: #1f7556; }
.notice.warn { background: #fff4de; color: #9a5f17; }
.notice.small { padding: 10px 12px; margin-bottom: 12px; }

/* status extras */
.status.submitted { background: #eef0ff; color: #5b5fc7; }
.status.muted { background: #f1f1f5; color: #8a8f9d; }
.tag { display: inline-block; font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 5px; background: #eaf7f1; color: var(--green); margin-left: 4px; vertical-align: middle; }

/* tables */
tr.clickable { cursor: pointer; }
tr.clickable:focus { outline: 2px solid #93a8e5; outline-offset: -2px; }
table.compact td { height: 54px; }
td.wrap { white-space: normal; min-width: 220px; }
td.clip { max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
.cell-strong { color: var(--text); font-weight: 600; display: block; }
.cell-sub { color: var(--muted); display: block; margin-top: 2px; font-size: 12px; }
.row-action { display: inline-grid; place-items: center; }
.row-action svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
.thumb { width: 54px; height: 38px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); display: block; }
.group-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px 10px; border-top: 1px solid var(--border); }
.panel-header + .group-head { border-top: 0; }
.group-head .muted { font-size: 12px; }
.empty-state svg { width: 34px; height: 34px; fill: none; stroke: #b6bbc8; stroke-width: 1.6; }
.empty-state p { margin: 0; }

/* filters */
.filter-bar { flex-wrap: wrap; align-items: center; }
.filter-select { height: 38px; border: 1px solid var(--border); border-radius: 8px; background: var(--white); color: var(--text); padding: 0 10px; max-width: 190px; }
.date-field { display: flex; align-items: center; gap: 2px; height: 38px; border: 1px solid var(--border); border-radius: 8px; background: var(--white); padding: 0 4px 0 11px; font-size: 12px; color: var(--muted); font-weight: 600; }
.date-field input { border: 0; height: 36px; padding: 0 6px; background: transparent; color: var(--text); outline: 0; }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 0; }
.chip { background: var(--canvas); border: 1px solid var(--border); border-radius: 14px; padding: 3px 10px; font-size: 12px; }
.chip.off { text-decoration: line-through; opacity: .55; }

/* modal + forms */
.modal.wide { width: min(980px, 100%); }
.modal-text { padding: 20px 22px; line-height: 1.5; }
.modal-footer { height: auto; min-height: 68px; flex-wrap: wrap; }
.form-grid.one { grid-template-columns: 1fr; }
.form-grid.tight { padding: 0; gap: 12px; }
.form-grid .invalid, .stack .invalid { border-color: var(--red) !important; }
.field-error { display: block; color: #c85d58; font-size: 12px; font-weight: 500; margin-top: 5px; }
.form-grid input[type=file] { padding: 9px 11px; height: auto; }
.check { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 500; color: var(--text); white-space: nowrap; }
.form-grid .check input, .check input { width: auto; height: auto; margin: 0; }
.label-row { display: flex; justify-content: space-between; align-items: center; }
.label { color: #62697a; font-size: 12px; font-weight: 600; }
.remark-row { display: flex; gap: 10px; align-items: center; margin-top: 8px; }
.form-grid .remark-row input[name^=remark_] { flex: 1; margin-top: 0; }
.img-preview img { max-height: 180px; max-width: 100%; border-radius: 8px; border: 1px solid var(--border); }
.img-preview:empty { display: none; }
.announcement-view { padding: 20px 22px; text-align: center; }
.announcement-view img { max-width: 100%; max-height: 60vh; border-radius: 10px; }

/* task detail */
.detail { padding: 18px 22px 8px; }
.detail-status { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.detail-section { border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; margin-bottom: 14px; }
.detail-grid .detail-section { margin-bottom: 0; }
.detail-section h3, .action-card h3 { margin: 0 0 10px; font-family: "Manrope", sans-serif; font-size: 13px; color: var(--navy); text-transform: uppercase; letter-spacing: .05em; }
.kv { display: flex; justify-content: space-between; gap: 14px; padding: 6px 0; border-bottom: 1px dashed var(--border); font-size: 13px; }
.kv:last-child { border-bottom: 0; }
.kv span { color: var(--muted); }
.kv strong { font-weight: 600; text-align: right; color: var(--text); }
.remarks { margin: 0; white-space: pre-wrap; line-height: 1.5; }
.action-card { border: 1px solid #c9d5f5; background: linear-gradient(var(--blue-soft), transparent 80%); border-radius: 10px; padding: 16px; margin-bottom: 14px; }
.actions-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
#rejectForm { margin-top: 14px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 12px; padding: 8px 0; position: relative; }
.timeline li:not(:last-child)::before { content: ""; position: absolute; left: 4px; top: 22px; bottom: -8px; width: 2px; background: var(--border); }
.tl-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--navy); margin-top: 5px; flex: none; }
.tl-note { margin-top: 4px; background: var(--canvas); padding: 6px 10px; border-radius: 6px; font-size: 13px; }

.toast.error { background: #c85d58; }

body.dark .filter-select, body.dark .date-field, body.dark .stack input { background: #24293a; }
body.dark .action-card { border-color: #3a4566; }
body.dark .notice.ok { background: #1f3a31; color: #8fdcbc; }
body.dark .notice.warn { background: #3b3020; color: #f0c38a; }
body.dark .form-error { background: #3c2425; color: #f2a9a5; }
body.dark .status.muted, body.dark .status.hold { background: #2c3243; color: #aab0c0; }

@media (max-width: 1300px) { .stat-grid.six { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px) {
  .stat-grid.six { grid-template-columns: 1fr 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .filter-select, .date-field { max-width: none; flex: 1 1 45%; min-width: 0; }
  .date-field input { flex: 1; min-width: 0; }
}

/* clickable stat cards + segmented switch */
a.stat-card { text-decoration: none; color: inherit; transition: .15s; }
a.stat-card:hover { border-color: #c9d5f5; box-shadow: 0 8px 24px rgba(42,51,82,.08); transform: translateY(-1px); }
.segmented { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; height: 38px; }
.segmented a { display: grid; place-items: center; padding: 0 12px; text-decoration: none; color: #697188; font-weight: 600; font-size: 13px; }
.segmented a.active { background: var(--navy); color: #fff; }
@media (max-width: 760px) { .panel-header { flex-wrap: wrap; } }

/* =====================================================================
   Three portals: accent colour per portal + start page
   ===================================================================== */
.portal-admin:not(.dark)    { --navy: #0f6466; --navy-2: #157a7c; --blue: #138a8c; --blue-soft: #e4f4f3; }
.portal-operator:not(.dark) { --navy: #4f3a8c; --navy-2: #6049a6; --blue: #6a52c4; --blue-soft: #efebfb; }
body.dark.portal-admin      { --navy: #4fb3b0; --navy-2: #7cc9c6; --blue-soft: #1f3a3c; }
body.dark.portal-operator   { --navy: #9a86e0; --navy-2: #b3a3ea; --blue-soft: #2f2a4f; }
body.dark.portal-admin .brand-mark, body.dark.portal-operator .brand-mark { background: var(--navy); }

.portal-tag { margin-left: 4px; font-family: "DM Sans", sans-serif; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--blue); background: var(--blue-soft); border-radius: 6px; padding: 4px 8px; }
.sidebar-portal { margin: -10px 10px 16px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--blue); }
.portal-switch { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 14px; }
.portal-switch a, .form-error a { color: var(--blue); font-weight: 600; text-decoration: none; }
.portal-switch a:hover, .form-error a:hover { text-decoration: underline; }

.portal-home { max-width: 1000px; margin: 0 auto; padding: 70px 24px; }
.portal-home h1 { margin: 26px 0 6px; font-family: "Manrope", sans-serif; color: var(--navy); font-size: 28px; }
.portal-home > .muted { margin: 0 0 30px; }
.portal-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.portal-card { display: flex; flex-direction: column; gap: 10px; padding: 24px; background: #fff; border: 1px solid var(--border); border-top: 4px solid var(--navy); border-radius: 12px; text-decoration: none; color: var(--text); box-shadow: 0 3px 14px rgba(42,51,82,.04); transition: .15s; }
.portal-card:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(42,51,82,.1); }
.portal-card strong { font-family: "Manrope", sans-serif; font-size: 18px; color: var(--navy); }
.portal-card .muted { font-size: 13px; line-height: 1.5; flex: 1; }
.portal-icon { width: 46px; height: 46px; border-radius: 11px; display: grid; place-items: center; background: var(--blue-soft); color: var(--navy); }
.portal-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.portal-go { font-weight: 700; color: var(--navy); }
@media (max-width: 760px) { .portal-cards { grid-template-columns: 1fr; } .portal-home { padding: 40px 18px; } }

/* =====================================================================
   v2: notifications, charts, documents, discussion, tabs, settings, print
   ===================================================================== */
:root { --series-1: #257de0; --series-2: #f47230; --grid: #eef0f5; }
body.dark { --series-1: #338ced; --series-2: #e76624; --grid: #2a3042; }

.no-margin { margin: 0; }
.center { align-self: center; }
.center-text { text-align: center; padding: 30px 0; }
.form-ok { background: #e8f7f0; color: #1f7556; border-radius: 8px; padding: 10px 12px; font-size: 13px; }
body.dark .form-ok { background: #1f3a31; color: #8fdcbc; }
.small-btn { height: 32px; padding: 0 12px; font-size: 13px; }
.link-plain { text-decoration: none; }
.link-plain:hover { text-decoration: underline; }

/* notification bell */
.bell-count { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--white); }
.notif-panel { width: 360px; max-width: calc(100vw - 24px); padding: 0; right: -60px; }
.notif-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.notif-list { max-height: 420px; overflow-y: auto; }
.notif { width: 100%; display: flex; gap: 10px; text-align: left; border: 0; background: none; padding: 12px 14px; border-bottom: 1px solid var(--border); color: var(--text); }
.notif:hover { background: var(--canvas); }
.notif.unread { background: var(--blue-soft); }
.notif-icon { width: 32px; height: 32px; flex: none; border-radius: 8px; display: grid; place-items: center; background: var(--canvas); color: var(--navy); }
.notif-icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.notif-icon.approved { color: var(--green); } .notif-icon.rejected { color: var(--red); } .notif-icon.review { color: var(--orange); }
.notif-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.notif-text strong { font-size: 13px; }
.notif-text span { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.notif-text small { font-size: 11px; color: var(--muted); }
.notif-empty { padding: 30px 14px; text-align: center; color: var(--muted); }

/* charts */
.chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-bottom: 22px; }
.chart-grid .wide-chart { grid-column: 1 / -1; }
.chart-panel { margin-bottom: 0 !important; }
.chart-body { padding: 14px 18px 18px; }
.legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.legend strong { color: var(--text); margin-left: 4px; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.sw.s1 { background: var(--series-1); } .sw.s2 { background: var(--series-2); }
.chart-svg { width: 100%; height: auto; display: block; }
.chart-svg .s1 { fill: var(--series-1); } .chart-svg .s2 { fill: var(--series-2); }
.chart-svg .grid { stroke: var(--grid); stroke-width: 1; }
.chart-svg .baseline { stroke: var(--border); stroke-width: 1.5; }
.chart-svg .axis { fill: var(--muted); font-size: 11px; font-family: "DM Sans", sans-serif; }
.chart-svg .hit { fill: transparent; cursor: crosshair; }
.chart-svg .hit:hover { fill: var(--text); fill-opacity: .04; }
.chart-tip { position: fixed; z-index: 500; pointer-events: none; background: var(--white); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; box-shadow: 0 8px 24px rgba(24,34,64,.15); font-size: 12px; display: flex; flex-direction: column; gap: 3px; }
.chart-tip strong { font-size: 12px; }
.barlist { display: flex; flex-direction: column; gap: 4px; }
.bl-row { display: grid; grid-template-columns: 120px 1fr 40px; align-items: center; gap: 10px; padding: 6px 4px; border-radius: 6px; text-decoration: none; color: var(--text); font-size: 13px; }
a.bl-row:hover { background: var(--canvas); }
.bl-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bl-track { height: 10px; background: var(--canvas); border-radius: 0 4px 4px 0; }
.bl-bar { display: block; height: 100%; min-width: 2px; background: var(--series-1); border-radius: 0 4px 4px 0; }
.bl-value { text-align: right; font-weight: 600; }

/* tasks table: sort + select */
.sort-btn { border: 0; background: none; padding: 0; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; display: inline-flex; gap: 4px; align-items: center; cursor: pointer; }
.sort-btn:hover, .sort-btn.on { color: var(--navy); }
.sort-arrow { font-size: 9px; }
.check-col { width: 36px; padding-right: 0 !important; }
.check-col input { width: 16px; height: 16px; cursor: pointer; }

/* documents & discussion */
.detail-section h3 svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; vertical-align: -2px; }
.count-pill { display: inline-grid; place-items: center; min-width: 20px; height: 18px; padding: 0 6px; margin-left: 4px; border-radius: 9px; background: var(--canvas); color: var(--muted); font-size: 11px; letter-spacing: 0; }
.files { list-style: none; margin: 0 0 10px; padding: 0; }
.files li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.files li:last-child { border-bottom: 0; }
.file-icon svg { width: 22px; height: 22px; fill: none; stroke: var(--blue); stroke-width: 1.6; }
.file-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.file-meta strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta small { color: var(--muted); font-size: 11px; }
.file-actions { display: flex; gap: 2px; flex: none; }
.file-actions a { text-decoration: none; }
.attach-form { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; margin-top: 10px; }
.file-drop { display: block; width: 100%; border: 1.5px dashed var(--border); border-radius: 8px; padding: 12px; cursor: pointer; color: var(--muted); font-size: 13px; }
.file-drop:hover { border-color: var(--blue); color: var(--navy); }
.file-drop input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.file-drop:focus-within { outline: 2px solid #93a8e5; }
.file-drop svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; vertical-align: -2px; }
.file-drop small { display: block; font-size: 11px; margin-top: 3px; }
.comments { display: flex; flex-direction: column; gap: 12px; max-height: 320px; overflow-y: auto; margin-bottom: 10px; }
.comment { display: flex; gap: 10px; }
.comment-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.comment p { margin: 3px 0 0; white-space: pre-wrap; font-size: 13px; line-height: 1.45; }
.comment-form { display: flex; gap: 8px; align-items: flex-end; }
.comment-form textarea { flex: 1; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; resize: vertical; background: var(--white); color: var(--text); outline: 0; }
.comment-form textarea:focus { border-color: #93a8e5; box-shadow: 0 0 0 3px var(--blue-soft); }

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--navy); }
.tabs a.active { color: var(--navy); border-bottom-color: var(--navy); }
.meter { width: 90px; height: 8px; background: var(--canvas); border-radius: 4px; display: inline-block; vertical-align: middle; margin-right: 6px; overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--green); border-radius: 0 4px 4px 0; }
.table-note { padding: 0 18px 14px; }
.action-tag { font-family: ui-monospace, Consolas, monospace; font-size: 12px; background: var(--canvas); border-radius: 5px; padding: 2px 6px; }
.action-tag.bad { background: #fdeeee; color: #c85d58; }

/* settings & profile */
.settings .panel { margin-bottom: 18px; }
.sticky-save { position: sticky; bottom: 0; padding: 14px 0; background: linear-gradient(transparent, var(--canvas) 40%); display: flex; justify-content: flex-end; }
.settings .check { margin-top: 8px; }
.profile-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 18px; align-items: start; }
.profile-grid .panel { margin-bottom: 0 !important; }

body.dark .chart-tip, body.dark .comment-form textarea { background: #24293a; }
body.dark .action-tag.bad { background: #3c2425; color: #f2a9a5; }

@media (max-width: 1000px) { .chart-grid, .profile-grid { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .notif-panel { position: fixed; left: 12px; right: 12px; top: 70px; width: auto; } .bl-row { grid-template-columns: 90px 1fr 34px; } }

/* print: only the open task */
@media print {
  body * { visibility: hidden; }
  #modal, #modal * { visibility: visible; }
  #modal { position: absolute; inset: 0 auto auto 0; width: 100% !important; max-height: none; overflow: visible; box-shadow: none; }
  .modal-backdrop { background: none; backdrop-filter: none; position: absolute; }
  #modal .modal-footer, #modal #closeModal, #modal form, #modal .file-actions, #modal .action-card { display: none !important; }
  .comments { max-height: none; }
}
.wide-chart .chart-svg { max-height: 280px; }
.form-grid input::placeholder, .form-grid textarea::placeholder, .comment-form textarea::placeholder { color: #a3a7b2; font-weight: 400; }
.tabs { overflow-y: hidden; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }

/* =====================================================================
   v3: CRM (grouped nav, global search, boards, pipeline, agenda,
   calendar, customer profile, activity timeline)
   ===================================================================== */
.nav { overflow-y: auto; }
.nav-group { font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 14px 13px 4px; }
.nav-group:first-child { padding-top: 0; }
.nav-item { height: 40px; }
.sidebar-portal { margin-bottom: 10px; }

/* global search */
.global-search { position: relative; display: flex; align-items: center; gap: 8px; height: 40px; width: min(380px, 34vw); margin-right: 16px; padding: 0 10px 0 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--canvas); }
.global-search:focus-within { background: var(--white); border-color: #93a8e5; box-shadow: 0 0 0 3px var(--blue-soft); }
.global-search > svg { width: 16px; height: 16px; fill: none; stroke: var(--muted); stroke-width: 2; flex: none; }
.global-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); }
.global-search kbd { font: 600 10px "DM Sans", sans-serif; color: var(--muted); border: 1px solid var(--border); border-radius: 5px; padding: 2px 5px; background: var(--white); }
.gs-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; min-width: 320px; max-height: 70vh; overflow-y: auto; background: var(--white); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 14px 40px rgba(24,34,64,.16); padding: 6px; z-index: 60; }
.gs-group { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 8px 8px 4px; }
.gs-item { width: 100%; display: flex; gap: 10px; align-items: center; border: 0; background: none; text-align: left; padding: 8px; border-radius: 8px; color: var(--text); }
.gs-item:hover, .gs-item.active { background: var(--blue-soft); }
.gs-item svg { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--navy); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.gs-item span { display: flex; flex-direction: column; min-width: 0; }
.gs-item strong { font-size: 13px; }
.gs-item small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-empty { padding: 16px; color: var(--muted); text-align: center; }

/* small helpers */
.pad { padding: 14px 18px; }
.overdue-text { color: var(--red) !important; font-weight: 600; }
.chip-check { height: 38px; padding: 0 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--white); }
.segmented a svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; vertical-align: -2px; margin-right: 4px; }
.prio { display: inline-block; font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 5px; margin-left: 4px; vertical-align: middle; letter-spacing: .02em; }
.prio-urgent { background: #fdeeee; color: #c0433e; }
.prio-high { background: #fff3e5; color: #b8691d; }
.prio-low { background: #f1f1f5; color: #7d8496; }
.wa-link { color: #128c4a; font-weight: 600; text-decoration: none; }
.wa-link:hover { text-decoration: underline; }
.panel-title h2 svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; vertical-align: -2px; }

/* boards */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 12px; padding: 14px; overflow-x: auto; align-items: start; }
.board-col { background: var(--canvas); border-radius: 10px; min-height: 160px; display: flex; flex-direction: column; border: 2px solid transparent; transition: border-color .15s; }
.board-col.drop-ok { border-color: var(--blue); background: var(--blue-soft); }
.board-col header { display: flex; align-items: center; gap: 8px; padding: 10px 12px; flex-wrap: wrap; }
.board-col header strong { font-size: 13px; }
.board-col header .count { background: var(--white); border-radius: 9px; padding: 0 7px; font-size: 11px; font-weight: 700; color: var(--muted); }
.board-col header small { width: 100%; color: var(--muted); font-size: 11px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #9aa1b2; }
.dot.new, .dot.st-new { background: #5975c7; } .dot.progress, .dot.st-contacted { background: #e09a3c; } .dot.hold { background: #9aa1b2; }
.dot.submitted, .dot.st-interested { background: #6a5ad0; } .dot.complete, .dot.st-converted { background: var(--green); }
.dot.st-followup { background: #d9a400; } .dot.st-lost { background: var(--red); }
.board-list { display: flex; flex-direction: column; gap: 8px; padding: 0 10px 12px; max-height: 66vh; overflow-y: auto; }
.board-card { background: var(--white); border: 1px solid var(--border); border-radius: 9px; padding: 10px 11px; display: flex; flex-direction: column; gap: 3px; cursor: pointer; box-shadow: 0 1px 3px rgba(24,34,64,.05); font-size: 13px; }
.board-card[draggable="true"] { cursor: grab; }
.board-card:hover { border-color: #c9d5f5; box-shadow: 0 4px 14px rgba(24,34,64,.1); }
.board-card:focus { outline: 2px solid #93a8e5; }
.board-card.dragging { opacity: .45; }
.board-card.is-overdue { border-left: 3px solid var(--red); }
.board-card.is-returned { border-left: 3px solid var(--orange); }
.bc-top { display: flex; align-items: center; gap: 2px; font-size: 12px; }
.bc-foot { display: flex; justify-content: space-between; gap: 6px; margin-top: 4px; font-size: 12px; font-weight: 600; }
.bc-foot svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 2; vertical-align: -1px; }
.bc-flag { margin-top: 4px; font-size: 11px; color: #b8691d; background: #fff3e5; border-radius: 5px; padding: 2px 6px; align-self: flex-start; }
.bc-assignee { font-size: 11px; color: var(--muted); }
.board-empty { color: var(--muted); font-size: 12px; text-align: center; padding: 14px 0; }

/* lead stage strip & pipeline */
.stage-strip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.stage-chip { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--white); text-align: left; color: var(--text); border-top: 3px solid #9aa1b2; }
.stage-chip span { font-size: 12px; color: var(--muted); font-weight: 600; }
.stage-chip strong { font: 700 20px "Manrope", sans-serif; color: var(--navy); }
.stage-chip small { font-size: 11px; color: var(--muted); }
.stage-chip.on { background: var(--blue-soft); border-color: var(--blue); }
.st-new { border-top-color: #5975c7 !important; } .st-contacted { border-top-color: #e09a3c !important; } .st-interested { border-top-color: #6a5ad0 !important; }
.st-followup { border-top-color: #d9a400 !important; } .st-converted { border-top-color: var(--green) !important; } .st-lost { border-top-color: var(--red) !important; }
.pipeline-strip { margin-bottom: 18px; }
.pipeline { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; padding: 14px 18px 18px; }
.pipe-stage { display: flex; flex-direction: column; padding: 10px 12px; border-radius: 9px; background: var(--canvas); border-top: 3px solid #9aa1b2; text-decoration: none; color: var(--text); }
.pipe-stage:hover { background: var(--blue-soft); }
.pipe-stage span { font-size: 12px; color: var(--muted); font-weight: 600; }
.pipe-stage strong { font: 700 20px "Manrope", sans-serif; color: var(--navy); }
.pipe-stage small { font-size: 11px; color: var(--muted); }

/* agenda */
.agenda-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-bottom: 22px; }
.agenda-grid .panel { margin-bottom: 0 !important; }
.agenda-list { display: flex; flex-direction: column; padding: 6px 8px 10px; max-height: 300px; overflow-y: auto; }
.agenda-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; text-decoration: none; color: var(--text); border: 0; background: none; text-align: left; width: 100%; }
.agenda-item:hover { background: var(--canvas); }
.agenda-item > span:first-child { display: flex; flex-direction: column; min-width: 0; }
.agenda-item strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agenda-item small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agenda-right { font-size: 12px; font-weight: 600; color: var(--muted); flex: none; }
.agenda-item.warn .agenda-right { color: var(--red); }
.agenda-empty { padding: 18px 10px; margin: 0; text-align: center; }

/* activity timeline & log form */
.log-form { margin-bottom: 14px; }
.log-kinds { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.log-kinds label { cursor: pointer; }
.log-kinds input { position: absolute; opacity: 0; }
.log-kinds span { display: inline-block; padding: 4px 10px; border-radius: 14px; border: 1px solid var(--border); font-size: 12px; font-weight: 600; color: var(--muted); }
.log-kinds input:checked + span { background: var(--navy); border-color: var(--navy); color: #fff; }
.log-kinds input:focus-visible + span { outline: 2px solid #93a8e5; }
.activity { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.activity li { display: flex; gap: 10px; }
.act-icon { width: 30px; height: 30px; border-radius: 8px; flex: none; display: grid; place-items: center; background: var(--canvas); color: var(--navy); }
.act-icon svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.act-call .act-icon, .act-whatsapp .act-icon { background: #e8f7f0; color: var(--green); }
.act-status .act-icon, .act-followup .act-icon { background: #fff4de; color: #be7a27; }
.act-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.act-head strong { font-size: 13px; }
.activity p { margin: 2px 0 0; font-size: 13px; white-space: pre-wrap; line-height: 1.45; }

/* customer profile */
.profile-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; padding: 20px; margin-bottom: 18px !important; flex-wrap: wrap; }
.ph-main { display: flex; gap: 16px; align-items: flex-start; }
.ph-main h2 { margin: 0; font: 700 20px "Manrope", sans-serif; color: var(--navy); }
.ph-main p { margin: 3px 0 8px; }
.ph-contacts { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: 13px; margin-bottom: 4px; }
.ph-contacts svg { width: 14px; height: 14px; fill: none; stroke: var(--muted); stroke-width: 1.8; }
.ph-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.avatar.big { width: 56px; height: 56px; font-size: 18px; flex: none; }
.profile-cols { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.profile-cols .panel { margin-bottom: 18px; }

/* calendar */
.calendar .panel-actions { flex-wrap: wrap; }
.sw.cal-task { background: var(--series-1); } .sw.cal-lead { background: #d9a400; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-dow { padding: 8px 10px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border-bottom: 1px solid var(--border); background: #fafbfc; }
.cal-day { min-height: 112px; padding: 6px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day.other { background: var(--canvas); }
.cal-day.other .cal-num { color: #b6bbc8; }
.cal-day.today .cal-num { background: var(--navy); color: #fff; }
.cal-num { align-self: flex-start; font-size: 12px; font-weight: 700; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; }
.cal-ev { display: block; width: 100%; text-align: left; border: 0; border-left: 3px solid var(--series-1); background: var(--blue-soft); color: var(--text); border-radius: 4px; padding: 3px 6px; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.cal-ev.lead { border-left-color: #d9a400; background: #fff7e0; }
.cal-ev.overdue { border-left-color: var(--red); background: #fdeeee; }
.cal-ev.done { opacity: .55; text-decoration: line-through; }
.cal-ev:hover { filter: brightness(.96); }
.cal-more { border: 0; background: none; color: var(--blue); font-size: 11px; font-weight: 600; text-align: left; padding: 2px 4px; cursor: pointer; }
.cal-daylist { padding: 10px 14px; }
.cal-daylist .cal-ev { white-space: normal; border-radius: 8px; margin-bottom: 6px; padding: 8px 10px; font-size: 13px; }

/* import */
.steps { margin: 0; padding-left: 18px; line-height: 1.7; font-size: 13px; color: var(--text); }
.import-errors { max-height: 240px; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px; margin-top: 8px; }

body.dark .global-search, body.dark .board-col, body.dark .pipe-stage { background: #1a1f30; }
body.dark .global-search:focus-within, body.dark .board-card, body.dark .stage-chip, body.dark .chip-check, body.dark .gs-results { background: var(--white); }
body.dark .cal-dow { background: #1a1f30; }
body.dark .cal-ev { background: #2b3557; } body.dark .cal-ev.lead { background: #3b3320; } body.dark .cal-ev.overdue { background: #3c2425; }
body.dark .prio-urgent { background: #3c2425; color: #f2a9a5; } body.dark .prio-high { background: #3b3020; color: #f0c38a; } body.dark .prio-low { background: #2c3243; color: #aab0c0; }

@media (max-width: 1200px) { .agenda-grid { grid-template-columns: 1fr; } .stage-strip, .pipeline { grid-template-columns: repeat(3, 1fr); } .profile-cols { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .global-search { position: absolute; left: 16px; right: 16px; top: 88px; width: auto; display: none; }
  .stage-strip, .pipeline { grid-template-columns: repeat(2, 1fr); }
  .cal-day { min-height: 70px; } .cal-ev { font-size: 0; padding: 0; height: 6px; } .cal-ev b { display: none; }
}
.segmented a { display: inline-flex; align-items: center; gap: 4px; }
.segmented a svg { margin-right: 0; }

/* collapsible sidebar groups (dropdowns) */
.nav-section { display: flex; flex-direction: column; }
.nav-group-toggle { justify-content: flex-start; }
.nav-group-toggle span { flex: 1; }
.nav-caret { width: 15px !important; height: 15px !important; transition: transform .18s ease; color: var(--muted); }
.nav-section.open .nav-caret { transform: rotate(90deg); }
.nav-section.has-active > .nav-group-toggle { color: var(--navy); font-weight: 600; }
.nav-sub { display: none; margin-left: 22px; border-left: 1px solid var(--border); padding-left: 6px; }
.nav-section.open .nav-sub { display: flex; flex-direction: column; gap: 2px; margin: 2px 0 4px 22px; animation: navDrop .16s ease; }
@keyframes navDrop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.nav-sub .nav-item { height: 38px; font-size: 13.5px; }
.nav-sub .nav-item svg { width: 17px; height: 17px; }
@media (prefers-reduced-motion: reduce) { .nav-caret { transition: none; } .nav-section.open .nav-sub { animation: none; } }
.nav-group-toggle { gap: 11px; }
.nav-group-toggle span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* user login details in Add Operator / Add Admin */
.login-box { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px 14px; margin: 0; display: flex; flex-direction: column; gap: 10px; background: var(--canvas); }
.login-box legend { font-size: 12px; font-weight: 700; color: var(--navy); padding: 0 6px; }
.pw-wrap { display: flex; gap: 6px; align-items: center; margin-top: 7px; }
.form-grid .pw-wrap input { margin-top: 0; flex: 1; min-width: 0; }
.pw-btn { height: 42px; border: 1px solid var(--border); border-radius: 8px; background: var(--white); color: var(--navy); font-weight: 600; font-size: 12px; padding: 0 10px; flex: none; }
.pw-btn:hover { border-color: var(--blue); }
.link-button.inline { padding: 0; font-size: inherit; }
.cred-card { border: 1px dashed var(--blue); border-radius: 10px; padding: 12px 14px; background: var(--blue-soft); display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.cred-card div { display: flex; gap: 10px; }
.cred-card span { width: 80px; color: var(--muted); font-size: 13px; flex: none; }
.cred-card strong { font-family: ui-monospace, Consolas, monospace; font-size: 13px; word-break: break-all; }

/* ---- tablets (≤1024px): sidebar becomes a slide-out menu so content never scrolls sideways */
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); transition: transform .22s; box-shadow: 10px 0 30px rgba(29,44,88,.12); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .menu-button { display: grid; }
  .sidebar-scrim.show { display: block; position: fixed; inset: 0; background: rgba(25,34,60,.3); z-index: 15; }
  .topbar { padding: 0 20px; gap: 8px; }
  .content { padding: 22px 20px 32px; }
  .global-search { width: min(320px, 38vw); margin-right: 8px; }
  .global-search kbd { display: none; }
  .profile-copy { display: none; }
  .filter-select { max-width: none; }
}

/* ---- visible keyboard focus everywhere (WCAG 2.4.7) */
:where(a, button, select, input, textarea, [tabindex]):focus-visible { outline: 2px solid #4d6fd8; outline-offset: 2px; }
.nav-item:focus-visible, .button:focus-visible { outline: 2px solid #4d6fd8; outline-offset: 2px; }
body.dark :where(a, button, select, input, textarea, [tabindex]):focus-visible { outline-color: #9fb3f0; }

/* per-admin task access: operator picker */
.op-picks { display: flex; flex-direction: column; gap: 6px; }
.op-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px 14px; max-height: 180px; overflow-y: auto; padding: 4px 2px; }
.agenda-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 1200px) { .agenda-grid.two { grid-template-columns: 1fr; } }
.form-section { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); border-top: 1px solid var(--border); padding-top: 12px; margin-top: 2px; }

/* import: own Excel files */
.file-drop.big { padding: 22px; text-align: center; }
.file-drop.big strong { display: block; color: var(--navy); font-size: 14px; margin-bottom: 2px; }
.imp-file { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--canvas); }
.imp-file > svg { width: 22px; height: 22px; fill: none; stroke: var(--blue); stroke-width: 1.6; flex: none; }
.imp-file div { flex: 1; display: flex; flex-direction: column; }
.imp-file small { color: var(--muted); }
.imp-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.imp-opts label { font-size: 12px; font-weight: 600; color: #62697a; }
.imp-opts select { width: 100%; height: 40px; margin-top: 6px; border: 1px solid var(--border); border-radius: 8px; padding: 0 10px; background: var(--white); color: var(--text); }
.map-table { border: 1px solid var(--border); border-radius: 8px; margin-top: 8px; }
.map-table select { height: 34px; border: 1px solid var(--border); border-radius: 6px; padding: 0 8px; min-width: 200px; background: var(--white); color: var(--text); }
.map-table td { height: auto; padding-top: 8px; padding-bottom: 8px; vertical-align: top; }
.map-missing { background: #fdeeee; }
body.dark .map-missing { background: #3c2425; }
.req { color: var(--red); }

.tr-matrix { border: 1px solid var(--border); border-radius: 8px; max-width: 640px; }
.center-col { text-align: center; }
.tr-matrix input { width: 18px; height: 18px; cursor: pointer; }

/* sidebar "Create Task" quick action (Super Admin + Admin) */
.create-task-btn { height: 42px; margin: 0 4px 14px; width: calc(100% - 8px); gap: 8px; box-shadow: 0 6px 14px rgba(29,44,88,.16); }
.create-task-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }

/* ---------- agent payment terms + On Hold message (v6) */
.tag.pay-first { background: #fff1dc; color: #8a4d12; border: 1px solid #f3cf9c; }
body.dark .tag.pay-first { background: rgba(240, 161, 74, .16); color: #f3b56a; border-color: rgba(240, 161, 74, .35); }
.pay-terms { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px 12px; margin: 0; }
.pay-terms legend { font-weight: 600; padding: 0 4px; }
.choice-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice-card { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1.5px solid var(--border); border-radius: 10px; cursor: pointer; transition: border-color .2s, background-color .2s, transform .2s; }
.choice-card:hover { transform: translateY(-1px); border-color: var(--blue); }
.choice-card input { margin-top: 3px; accent-color: var(--navy); }
.choice-card strong { display: flex; align-items: center; gap: 6px; }
.choice-card strong svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.choice-card small { display: block; color: var(--muted); margin-top: 3px; font-weight: 400; }
.choice-card:has(input:checked) { border-color: var(--navy); background: var(--blue-soft); }
@media (max-width: 600px) { .choice-cards { grid-template-columns: 1fr; } }
.pay-check { padding: 10px 12px; border-radius: 10px; background: #fff7e8; border: 1px solid #f3cf9c; display: grid; gap: 4px; }
body.dark .pay-check { background: rgba(240, 161, 74, .1); border-color: rgba(240, 161, 74, .3); }
.hold-fields { display: grid; gap: 10px; padding: 12px; border-radius: 10px; background: var(--canvas); border: 1px dashed var(--border); }
.hold-preview .label, .var-chips .label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
.hold-preview pre { margin: 0; white-space: pre-wrap; word-break: break-word; font: inherit; font-size: 13px; line-height: 1.5; padding: 12px 14px; border-radius: 10px 10px 10px 2px;
  background: #dcf8c6; color: #1b2a1b; border: 1px solid #c4e8ab; max-height: 260px; overflow: auto; }
body.dark .hold-preview pre { background: #1f3a2b; color: #e3f5e8; border-color: #2e5a40; }
.hold-card { margin: 0 0 16px; padding: 16px 18px; border-radius: 14px; border: 1px solid #f3cf9c; background: linear-gradient(120deg, #fff6e6, var(--white) 70%); display: grid; gap: 12px; }
body.dark .hold-card { border-color: rgba(240, 161, 74, .35); background: linear-gradient(120deg, rgba(240, 161, 74, .12), var(--white) 70%); }
.hold-head { display: flex; align-items: center; gap: 14px; }
.hold-head h3 { margin: 2px 0; font-size: 17px; }
.hold-head .eyebrow { margin: 0; color: #8a4d12; }
.hold-msg { display: grid; gap: 6px; font-weight: 600; }
.hold-msg textarea { font: inherit; font-weight: 400; font-size: 13.5px; line-height: 1.5; padding: 12px 14px; border-radius: 10px; border: 1px solid #c4e8ab; background: #f3fdeb; color: var(--text); resize: vertical; }
body.dark .hold-msg textarea { background: #1f3a2b; border-color: #2e5a40; }
.button.whatsapp { background: #13803f; border-color: #13803f; color: #fff; text-decoration: none; }
.button.whatsapp:hover { background: #0e6b33; }
.button svg { flex: none; }
.button.copied { background: #29a778 !important; border-color: #29a778 !important; }
.var-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.var-chips .label { margin: 0 4px 0 0; }
.chip-btn { border: 1px solid var(--border); background: var(--white); color: var(--navy); border-radius: 14px; padding: 3px 10px; font-size: 12px; font-family: ui-monospace, Consolas, monospace; }
.chip-btn:hover { border-color: var(--navy); background: var(--blue-soft); }
.msg-cell { max-width: 460px; color: var(--muted); font-size: 13px; }
.form-grid .choice-card { display: flex; flex-direction: row; align-items: flex-start; gap: 10px; text-align: left; font-weight: 400; }
.form-grid .choice-card input[type=radio] { width: 18px; height: 18px; min-height: 0; flex: none; padding: 0; margin: 2px 0 0; border: 0; box-shadow: none; }
.form-grid .choice-card > span { flex: 1; display: block; }
.form-grid .choice-card strong { font-weight: 600; color: var(--text); }
.pay-check .check { display: flex; flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
.pay-check .check input { width: 18px; height: 18px; min-height: 0; flex: none; padding: 0; }

.mono { font-family: ui-monospace, Consolas, monospace; letter-spacing: .02em; }
.utr-note { display: flex; align-items: flex-end; padding-bottom: 10px; }
/* hold reasons: long message wraps to two lines inside its own column (never runs into "Tasks") */
td.msg-cell { white-space: normal; width: 52%; max-width: none; min-width: 260px; padding-right: 24px; }
td.msg-cell > span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.45; }

/* ---------- Agent Messages: 3-step sender */
.hold-head .grow { flex: 1; }
.sent-pill { align-self: flex-start; padding: 5px 11px; border-radius: 14px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.sent-pill.no { background: #fff1dc; color: #8a4d12; }
.sent-pill.yes { background: #e3f6ec; color: #1d6b48; }
body.dark .sent-pill.no { background: rgba(240, 161, 74, .16); color: #f3b56a; }
body.dark .sent-pill.yes { background: rgba(41, 167, 120, .16); color: #6fd3a5; }
.send-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; counter-reset: none; }
.send-step { display: flex; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--white); border: 1px solid var(--border); transition: border-color .3s, box-shadow .3s; }
.send-step .step-num { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: #fff; background: var(--navy); transition: background-color .3s, transform .3s; }
.send-step.done .step-num { background: #29a778; font-size: 0; }
.send-step.done .step-num::after { content: "✓"; font-size: 14px; }
.send-step.next { border-color: #29a778; box-shadow: 0 0 0 3px rgba(41, 167, 120, .15); }
.send-step.next .step-num { animation: stepPulse 1.4s ease-in-out infinite; }
@keyframes stepPulse { 50% { transform: scale(1.15); } }
.step-body { flex: 1; min-width: 0; display: grid; gap: 5px; }
.step-body > small { color: var(--muted); line-height: 1.45; }
.step-body textarea { font: inherit; font-size: 13.5px; line-height: 1.5; padding: 10px 12px; border-radius: 10px; border: 1px solid #c4e8ab; background: #f3fdeb; color: var(--text); resize: vertical; width: 100%; box-sizing: border-box; }
body.dark .step-body textarea { background: #1f3a2b; border-color: #2e5a40; }
.step-body .actions-row { margin: 2px 0 0; }
.hold-card.is-sent .send-step .step-num { background: #29a778; }
.queue-list { display: grid; gap: 16px; padding: 16px 18px 18px; }
.queue-item { display: grid; gap: 8px; }
.queue-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; padding: 0 4px; }
.queue-top .task-id { font-size: 14px; }
.queue-item .hold-card { margin: 0; }
.seg-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 4px; border-radius: 9px; font-size: 11px; background: rgba(0, 0, 0, .08); }
.segmented a.active .seg-count { background: rgba(255, 255, 255, .25); }
.link-notice { text-decoration: none; color: inherit; margin-bottom: 16px; }
.link-notice:hover { filter: brightness(.98); }
@media (prefers-reduced-motion: reduce) { .send-step.next .step-num { animation: none; } }
/* ---------- top-bar megaphone + announcement list */
.ann-button { position: relative; }
.ann-button.has-new svg { animation: annWiggle 2.8s ease-in-out infinite; transform-origin: 30% 50%; }
@keyframes annWiggle { 0%, 70%, 100% { transform: rotate(0); } 75%, 85% { transform: rotate(-12deg) scale(1.08); } 80%, 90% { transform: rotate(10deg) scale(1.08); } }
.ann-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; padding: 18px 22px; max-height: 62vh; overflow-y: auto; }
.ann-card { position: relative; display: flex; flex-direction: column; text-align: left; padding: 0; border: 1px solid var(--border); border-radius: 14px; background: var(--white); color: var(--text);
  overflow: hidden; cursor: pointer; transition: transform .25s var(--ease-out, ease), box-shadow .25s ease, border-color .25s; animation: fadeUp .5s var(--ease-out, ease) calc(var(--i) * .05s) both; }
.ann-card:hover, .ann-card:focus-visible { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(29, 44, 88, .16); border-color: var(--blue); }
.ann-card.unseen { border-color: #f0a14a; box-shadow: 0 0 0 3px rgba(240, 161, 74, .18); }
.ann-thumb { display: grid; place-items: center; height: 140px; background: var(--canvas); overflow: hidden; }
.ann-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.ann-card:hover .ann-thumb img { transform: scale(1.06); }
.ann-thumb .illo { width: 120px; }
.ann-card-text { display: grid; gap: 3px; padding: 11px 13px 13px; }
.ann-card-text strong { font-size: 14px; line-height: 1.35; }
.ann-card-text small { color: var(--muted); font-size: 12px; }
.ann-new { position: absolute; top: 9px; right: 9px; padding: 3px 9px; border-radius: 10px; font-size: 11px; font-weight: 700; color: #3a1a0a; background: #ffc56b; box-shadow: 0 4px 10px rgba(240, 161, 74, .4); }
@media (prefers-reduced-motion: reduce) { .ann-button.has-new svg, .ann-card { animation: none; } }
/* ---------- board: "View all" per column + the column page header */
.board-more { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 2px; padding: 10px 12px; border-radius: 10px; text-decoration: none;
  border: 1.5px dashed var(--border); color: var(--muted); font-size: 12.5px; transition: border-color .2s, background-color .2s, color .2s, transform .2s; }
.board-more strong { color: var(--navy); font-size: 13px; }
.board-more:hover, .board-more:focus-visible { border-style: solid; border-color: var(--navy); background: var(--blue-soft); color: var(--text); transform: translateY(-1px); }
.col-page-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 0 0 16px; }
.col-page-head h2 { margin: 0; font-size: 20px; }
.col-page-head h2 .muted { font-size: 14px; font-weight: 500; }
/* ---------- Incentive Rule page + operator strip */
.incentive-layout { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 1100px) { .incentive-layout { grid-template-columns: 1fr; } }
.incentive-layout .pad { padding: 18px 20px 20px; }
.inc-steps { list-style: none; margin: 0; padding: 16px 20px 20px; display: grid; gap: 12px; }
.inc-steps li { display: flex; gap: 12px; align-items: flex-start; }
.inc-steps .step-num { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 12px; color: #fff; background: var(--navy); }
.inc-steps li:last-child .step-num { background: #29a778; }
.inc-steps strong { display: block; font-weight: 600; }
.inc-steps small { color: var(--muted); }
.incentive-strip { display: flex; gap: 12px; align-items: center; padding: 12px 16px; margin-bottom: 16px; border-radius: 12px; background: linear-gradient(110deg, #e3f6ec, var(--white)); border: 1px solid #bfe7d2; }
.incentive-strip svg { width: 26px; height: 26px; flex: none; fill: none; stroke: #1d6b48; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.incentive-strip strong { display: block; color: #1d6b48; }
.incentive-strip span { color: var(--muted); font-size: 13px; }
body.dark .incentive-strip { background: linear-gradient(110deg, rgba(41, 167, 120, .14), var(--white)); border-color: rgba(41, 167, 120, .3); }
body.dark .incentive-strip strong { color: #6fd3a5; }
.earned { color: #1d6b48; font-weight: 700; }
body.dark .earned { color: #6fd3a5; }
/* ---------- returned task: ready message for the customer */
.cust-card { margin: 0 0 16px; padding: 16px 18px; border-radius: 14px; display: grid; gap: 12px; border: 1px solid #f3b8b5; background: linear-gradient(120deg, #fff0ef, var(--white) 70%); }
body.dark .cust-card { border-color: rgba(229, 108, 103, .35); background: linear-gradient(120deg, rgba(229, 108, 103, .12), var(--white) 70%); }
.cust-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cust-head > svg { width: 30px; height: 30px; flex: none; fill: none; stroke: #13803f; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cust-head .grow { flex: 1; min-width: 200px; }
.cust-head .eyebrow { margin: 0; color: #a33a35; }
.cust-head h3 { margin: 2px 0; font-size: 17px; }
.copy-big { padding: 0 18px; height: 44px; font-size: 14px; }
.cust-card textarea { font: inherit; font-size: 13.5px; line-height: 1.5; padding: 10px 12px; border-radius: 10px; border: 1px solid #c4e8ab; background: #f3fdeb; color: var(--text); resize: vertical; width: 100%; box-sizing: border-box; }
body.dark .cust-card textarea { background: #1f3a2b; border-color: #2e5a40; }
/* ---------- Incentives page */
.pay-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 14px 18px; margin-bottom: 16px; border-radius: 14px;
  background: linear-gradient(110deg, #fff4de, var(--white)); border: 1px solid #f3cf9c; }
.pay-bar > div:first-child { display: flex; gap: 12px; align-items: center; }
.pay-bar svg { width: 28px; height: 28px; flex: none; fill: none; stroke: #8a4d12; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pay-bar strong { display: block; }
.pay-bar span { color: var(--muted); font-size: 13px; }
.pay-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pay-actions input { height: 40px; padding: 0 12px; border: 1px solid var(--border); border-radius: 8px; min-width: 240px; background: var(--white); color: var(--text); }
body.dark .pay-bar { background: linear-gradient(110deg, rgba(240, 161, 74, .12), var(--white)); border-color: rgba(240, 161, 74, .3); }
.pad { padding: 14px 18px; }
table tfoot th { padding: 12px 14px; border-top: 2px solid var(--border); text-align: left; }
table tfoot th.num { text-align: right; }
/* ---------- sidebar layout: menu items never shrink or overlap; the menu scrolls when it is taller than the screen */
.sidebar { overflow: hidden; }
.nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; gap: 2px; padding-right: 2px; margin-right: -4px; scrollbar-width: thin; }
.nav > *, .nav .nav-item, .nav .nav-section, .nav-sub > * { flex-shrink: 0; }
.nav .nav-item { height: 40px; min-height: 40px; }
.nav-sub .nav-item { height: auto; min-height: 36px; padding-top: 6px; padding-bottom: 6px; line-height: 1.25; }
.sidebar-footer { flex-shrink: 0; }
.sidebar .brand, .sidebar-portal, .create-task-btn { flex-shrink: 0; }
.nav::-webkit-scrollbar { width: 6px; }
.nav::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
@media (max-height: 760px) { .nav .nav-item { height: 36px; min-height: 36px; } .sidebar .brand { height: 38px; } .create-task-btn { margin-bottom: 4px; } }