/* =====================================================================
   GLOS visual reskin — PREVIEW ONLY
   ---------------------------------------------------------------------
   Rules this file follows (checked by check-reskin.sh):
   • Only visual properties: colour, background, border colour/radius,
     box-shadow, font family/weight/size, letter-spacing, transitions.
   • NO layout properties: display, position, grid/flex, order, width,
     height, margin, top/left/right/bottom, padding, gap.
   • No content changes (no ::before/::after content, no text changes).
   • The left sidebar keeps its original colours and font.
   ===================================================================== */


/* ---------- 1. Theme tokens — DARK (the app's default) ---------- */
:root:not([data-theme="light"]) {
  --bg-0: #0a1019;
  --bg-1: #0f1824;
  --bg-2: #132030;
  --bg-3: #182737;
  --bg-4: #223246;
  --line: #1d2b3d;
  --line-soft: #162232;
  --fg: #e8eef6;
  --fg-mute: #aab8c9;
  --fg-dim: #8698ad;
  --accent: #3584bd;
  --accent-soft: rgba(91, 168, 216, 0.13);
  --accent-line: rgba(91, 168, 216, 0.32);
  --pos: #4fcb8b;
  --neg: #f4867c;
  --warn: #f0b548;
  --info: #8db0fc;
  --shadow-card: 0 0 0 1px rgba(255, 255, 255, 0.02), 0 10px 28px -14px rgba(0, 0, 0, 0.6);
  --topbar-bg: rgba(10, 16, 25, 0.8);
  --bg-input: #0b141f;
  --bg-modal: #0f1824;
  --bg-modal-header: #0f1824;
  --border-strong: #2b3d54;
  --brand-hover: #4a9bd3;
  --btn-primary-bg: #3584bd;
  --btn-primary-fg: #ffffff;
  --btn-secondary-bg: #132030;
  --btn-secondary-border: #2b3d54;
  --status-success-bg: rgba(79, 203, 139, 0.12);
  --status-warning-bg: rgba(240, 181, 72, 0.12);
  --status-danger-bg: rgba(244, 134, 124, 0.12);
  --status-info-bg: rgba(141, 176, 252, 0.12);
  --badge-owner-bg: rgba(91, 168, 216, 0.14);
  --badge-owner-fg: #8cc3e6;
  --rs-focus: 0 0 0 3px rgba(91, 168, 216, 0.28);
  --rs-scrim: rgba(3, 7, 13, 0.66);
}

/* ---------- 2. Theme tokens — LIGHT ---------- */
[data-theme="light"] {
  --bg-0: #f3f5f8;
  --bg-1: #ffffff;
  --bg-2: #f7f9fb;
  --bg-3: #eef2f6;
  --bg-4: #e2e8f0;
  --line: #e3e8ef;
  --line-soft: #edf1f5;
  --fg: #0d1726;
  --fg-mute: #46556a;
  --fg-dim: #627286;
  --accent: #1e516e;
  --accent-soft: rgba(30, 81, 110, 0.08);
  --accent-line: rgba(30, 81, 110, 0.28);
  --pos: #127a3a;
  --neg: #b42318;
  --warn: #965a07;
  --info: #2858cf;
  --shadow-card: 0 0 0 1px rgba(13, 23, 38, 0.02), 0 1px 2px rgba(13, 23, 38, 0.04), 0 6px 16px -8px rgba(13, 23, 38, 0.08);
  --topbar-bg: rgba(243, 245, 248, 0.85);
  --border-strong: #cfd8e3;
  --brand-hover: #173f57;
  --btn-primary-bg: #1e516e;
  --btn-primary-fg: #ffffff;
  --btn-secondary-bg: #ffffff;
  --btn-secondary-border: #cfd8e3;
  --bg-modal-header: #ffffff;
  --status-success-bg: #e3f4e9;
  --status-warning-bg: #fbf0db;
  --status-danger-bg: #fdeae8;
  --status-info-bg: #e8eefc;
  --badge-owner-bg: #e6eff5;
  --badge-owner-fg: #1e516e;
  --rs-focus: 0 0 0 3px rgba(30, 81, 110, 0.2);
  --rs-scrim: rgba(13, 23, 38, 0.4);
}

/* ---------- 3. Keep the sidebar exactly as it was ---------- */
.workspace-sidebar {
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}
:root:not([data-theme="light"]) .workspace-sidebar {
  --accent: #06b6d4;
  --bg-card: #0b0e13;
  --border: #232a37;
  --text-primary: #e8ebf0;
}
[data-theme="light"] .workspace-sidebar {
  --accent: #0891b2;
  --bg-card: #ffffff;
  --border: #e2e2dd;
  --text-primary: #0d1117;
}

/* ---------- 4. Typography ---------- */
body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}
.page-title, .mdb-hero-h1, .tdv2-title, .feed-page-title {
  letter-spacing: -0.02em;
}
.page-title { color: var(--text-primary); }

/* ---------- 5. Buttons ---------- */
.btn-primary {
  border-radius: 10px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.12) inset, 0 1px 2px rgba(13, 23, 38, 0.18);
  transition: background 0.15s, box-shadow 0.15s;
}
.btn-primary:hover:not(:disabled) { filter: none; background: var(--brand-hover); }
.btn-primary:focus-visible { outline: none; box-shadow: var(--rs-focus); }
.btn-secondary {
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(13, 23, 38, 0.05);
}
.btn-secondary:hover:not(:disabled) { background: var(--bg-2); }
.btn-danger {
  background: var(--neg);
  border-color: var(--neg);
  border-radius: 10px;
}
.btn-danger:hover:not(:disabled) { background: var(--neg); border-color: var(--neg); filter: brightness(0.92); }
.btn-remove {
  background: var(--status-danger-bg);
  color: var(--neg);
  border-radius: 8px;
}
.btn-remove:hover { background: var(--neg); color: #fff; }
.btn-link-sm { border-radius: 8px; transition: background 0.15s, color 0.15s; }
.btn-link-sm:hover { background: var(--accent-soft); }
.btn-link-sm.danger { color: var(--neg); }
.btn-link-sm.danger:hover { color: var(--neg); background: var(--status-danger-bg); }
.btn-link-sm.activate { color: var(--pos); }
.link-btn:hover { color: var(--brand-hover); }

/* ---------- 6. Forms ---------- */
.form-input,
.form-select-btn {
  border-radius: 10px;
  border-color: var(--border-strong);
  box-shadow: 0 1px 2px rgba(13, 23, 38, 0.04);
}
.form-input:focus,
.form-select-btn:focus,
.form-select-btn.active {
  border-color: var(--accent);
  box-shadow: var(--rs-focus);
}
.form-label { font-weight: 500; }
.form-error {
  background: var(--status-danger-bg);
  border-color: transparent;
  color: var(--neg);
  border-radius: 10px;
}

/* ---------- 7. Banners & badges ---------- */
.banner { border-radius: 12px; }
.banner-error,
[data-theme="dark"] .banner-error {
  background: var(--status-danger-bg);
  border-color: transparent;
  color: var(--neg);
}
.banner-info, .banner-success { border-color: transparent; }
.app-role-badge { letter-spacing: 0.06em; font-weight: 600; }
.app-role-badge.role-super_admin { background: var(--badge-owner-bg); color: var(--badge-owner-fg); }
.app-role-badge.role-admin { background: var(--status-warning-bg); color: var(--warn); }
.app-role-badge.role-member { background: var(--bg-3); color: var(--fg-mute); }
.status-pill { letter-spacing: 0.04em; font-weight: 600; }

/* ---------- 8. Modals ---------- */
.modal-backdrop {
  /* No backdrop blur: a backdrop-filter makes this the containing block for
     position:fixed children, which breaks the searchable dropdowns inside forms
     (they opened relative to the backdrop, scrolled it, and closed instantly). */
  background: var(--rs-scrim);
}
.modal-panel {
  border-radius: 16px;
  box-shadow: 0 0 0 1px var(--border), 0 36px 72px -20px rgba(13, 23, 38, 0.45);
}
.modal-header {
  border-radius: 16px 16px 0 0;
  border-bottom-color: var(--border);
}
.modal-header h2 {
  color: var(--text-primary);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.modal-footer {
  border-radius: 0 0 16px 16px;
  background: var(--bg-2);
}
.modal-close { border-radius: 8px; transition: background 0.15s, color 0.15s; }
.modal-close:hover { background: var(--bg-3); }

/* ---------- 9. Tables ---------- */
.entity-table-wrap {
  border-radius: 14px;
  border-color: var(--border);
  box-shadow: var(--shadow-card);
}
.entity-table th {
  background: var(--bg-2);
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.06em;
}
.entity-table td { border-bottom-color: var(--line-soft); }
.entity-table tr:hover td { background: var(--bg-2); }
.empty-state-small { border-radius: 12px; }

/* ---------- 10. My Dashboard ---------- */
.mdb-card, .mdb-hero {
  border-radius: 16px;
  border-color: var(--border);
  box-shadow: var(--shadow-card);
}
.mdb-hero-h1 { font-weight: 700; }
.mdb-card-title {
  letter-spacing: 0.08em;
  font-weight: 600;
  color: var(--text-secondary);
}
.mdb-summary-tile {
  border-radius: 12px;
  background: var(--bg-2);
  box-shadow: inset 0 0 0 1px var(--line-soft);
}
.mdb-summary-tile-icon-wrap { border-radius: 10px; }
.mdb-perf-review-row {
  border-radius: 12px;
  background: var(--bg-2);
  box-shadow: inset 0 0 0 1px var(--line-soft);
}
.mdb-perf-stage-chip { font-weight: 600; }
.mdb-perf-action-btn { border-radius: 8px; }
.mdb-perf-action-btn:hover { background: var(--accent); color: #fff; }
.mdb-chart-tab { border-radius: 8px; border-color: var(--border-strong); }
.mdb-chart-tab:hover { border-color: var(--accent); color: var(--text-primary); }
.mdb-chart-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.mdb-project-item { border-radius: 10px; border-color: var(--line-soft); }
.mdb-project-item:hover { background: var(--bg-2); border-color: var(--accent-line); }
.mdb-event-row { border-radius: 10px; }
[data-theme="light"] .mdb-event-row { background: var(--bg-2); }
.mdb-leaderboard-card {
  border-radius: 16px;
  background: linear-gradient(165deg, #143a54 0%, #0e2638 55%, #0b1c2b 100%);
  border-color: rgba(255, 255, 255, 0.06);
  box-shadow: 0 16px 36px -18px rgba(13, 23, 38, 0.55);
}
.mdb-lb-title { font-weight: 800; letter-spacing: 0.1em; }
.mdb-lb-me .mdb-lb-name { color: #9fd3f2; }
.mdb-lb-pts-r1 { color: #9fd3f2; }

/* ---------- 11. Task Detail ---------- */
.tdv2-sidebar {
  border-radius: 16px;
  box-shadow: var(--shadow-card);
}
.tdv2-header-btn { border-radius: 9px; border-color: var(--border-strong); }
.tdv2-inline-sel { border-radius: 8px; }
.tdv2-inline-sel:focus { box-shadow: var(--rs-focus); }
.task-detail-tab.active { color: var(--text-primary); }

/* ---------- 12. Chat ---------- */
.chat-sidebar { background: var(--bg-1); border-right-color: var(--border); }
.chat-conv-item { border-bottom-color: var(--line-soft); }
.chat-conv-item:hover { background: var(--bg-2); }
.chat-conv-item.active { background: var(--accent-soft); }
.chat-bubble {
  background: var(--bg-3);
  border-color: transparent;
}
[data-theme="light"] .chat-bubble { background: #eef2f6; }
.chat-input { border-radius: 12px; }
.chat-input:focus { box-shadow: var(--rs-focus); }

/* ---------- 13. Feed ---------- */
.feed-card {
  border-radius: 16px;
  border-color: var(--border);
  box-shadow: var(--shadow-card);
}
.feed-card--pinned {
  border-color: var(--warn);
  box-shadow: 0 0 0 1px var(--status-warning-bg), var(--shadow-card);
}
.feed-compose-bar { border-radius: 14px; box-shadow: var(--shadow-card); }
.feed-tabs { border-radius: 14px; box-shadow: var(--shadow-card); }
.feed-tab.active { color: var(--text-primary); border-bottom-color: var(--accent); }
.feed-compose-action-btn { border-radius: 9px; }

/* ---------- 14. Workspace header & page tabs (Home, My Organisation, …) ---------- */
.setup-tabs { border-radius: 14px; box-shadow: var(--shadow-card); }
.setup-tab:hover { color: var(--text-primary); }
.setup-tab.active { color: var(--text-primary); border-bottom-color: var(--accent); }
.wh-search-wrap { border-radius: 12px; }
.wh-search-wrap:focus-within { border-color: var(--accent); box-shadow: var(--rs-focus); }
.wh-icon-btn { border-radius: 10px; border-color: var(--border-strong); }
.wh-icon-btn:hover { border-color: var(--accent); background: var(--accent-soft); }
.wh-help-btn:hover { color: var(--text-primary); }
.mdb-hero-role { background: var(--accent-soft); color: var(--accent-text, var(--text-primary)); }

/* ---------- 15. Top header bar ---------- */
.workspace-header {
  background: var(--topbar-bg);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
}
.workspace-header::after {
  background: linear-gradient(90deg, transparent, var(--border) 8%, var(--border) 92%, transparent);
}
.wh-app-name { color: var(--text-primary); font-weight: 700; letter-spacing: -0.015em; }
.wh-search-wrap { background: var(--bg-1); border-color: var(--border); box-shadow: 0 1px 2px rgba(13, 23, 38, 0.05); }
.wh-search-kbd { background: var(--bg-2); border-color: var(--border); border-radius: 6px; }
.wh-icon-btn { background: var(--bg-1); box-shadow: 0 1px 2px rgba(13, 23, 38, 0.05); color: var(--text-secondary); }
.wh-icon-btn:hover { color: var(--text-primary); }
.wh-avatar { box-shadow: 0 0 0 2px var(--bg-0), 0 0 0 3.5px var(--border-strong); }
.wh-profile-menu { border-radius: 14px; border-color: var(--border); box-shadow: 0 0 0 1px var(--border), 0 18px 40px -16px rgba(13, 23, 38, 0.4); }

/* ---------- 16. Business Reviews buttons ---------- */
.br-btn { border-radius: 9px; font-weight: 600; }
.br-btn-primary { background: var(--accent); }
.br-btn-primary:hover { opacity: 1; background: var(--brand-hover); }
.br-btn-ghost { background: var(--bg-1); border-color: var(--border-strong); color: var(--text-primary); box-shadow: 0 1px 2px rgba(13, 23, 38, 0.05); }
.br-btn-ghost:hover { background: var(--bg-2); }
.br-btn-danger { border-color: transparent; background: var(--status-danger-bg); color: var(--neg); }
.br-btn-danger:hover { background: var(--neg); color: #fff; }
.br-btn-success { background: var(--pos); }
:root:not([data-theme="light"]) .br-btn-success { color: #04210f; }
.br-btn-sm { border-radius: 8px; }

/* ---------- 17. Detail cards (task detail, review detail, info cards) ---------- */
.info-card, .tdv2-meta-card, .tdv2-section-card, .br-daily-task-card, .br-checkin-tasks {
  border-radius: 14px;
  border-color: var(--border);
  box-shadow: var(--shadow-card);
}
.info-card h3 { color: var(--text-primary); }
.tdv2-field-label, .br-dts-label, .br-label, .br-task-modal-label { letter-spacing: 0.06em; color: var(--text-muted); }
.br-dts-item { border-right-color: var(--line-soft); }
.br-dts-value { color: var(--text-primary); }

/* ---------- 18. Daily Check-In page ---------- */
.br-workspace-title { font-weight: 700; letter-spacing: -0.015em; }
.br-daily-task-card:hover { border-color: var(--accent-line); }
.br-daily-task-row:hover { background: var(--bg-2); }
.br-tdc-time-chip { background: var(--bg-2); border-color: var(--line-soft); border-radius: 999px; }
.br-tdc-description { background: var(--bg-2); border-radius: 10px; }
.br-textarea, .br-task-comment-input { border-color: var(--border-strong); border-radius: 10px; }
.br-textarea:focus, .br-task-comment-input:focus { border-color: var(--accent); box-shadow: var(--rs-focus); outline: none; }
.btn-back { border-color: var(--border-strong); border-radius: 10px; box-shadow: 0 1px 2px rgba(13, 23, 38, 0.05); }
.btn-back:hover { color: var(--text-primary); background: var(--bg-2); }

/* ---------- 19. Sl No — one look everywhere it exists ---------- */
.br-tdr-sno,
.entity-table td.muted.small:first-child {
  color: var(--text-muted);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

/* =====================================================================
   SIZE-START — requested size changes (only this section may change
   padding / font-size / height; nothing here moves or reorders content)
   ===================================================================== */

/* Compact action buttons: New Agreement, New Task, + Invite, Save, Cancel… */
.btn-primary, .btn-secondary, .btn-danger {
  padding: 6px 13px;
  font-size: 13px;
  border-radius: 9px;
}
.br-btn { padding: 6px 13px; font-size: 13px; }
.br-btn-sm { padding: 4px 10px; font-size: 12px; }
.br-checkin-stat {
  padding: 3px 10px !important;
  border-right-color: transparent;
  border-radius: 999px;
  background: var(--bg-2);
  box-shadow: inset 0 0 0 1px var(--line-soft);
  font-weight: 500;
  color: var(--text-secondary);
}

/* One pagination style for all three pagers:
   shared <Pagination/>, Tasks/Performance (tl-*), Business Review detail (brd-*) */
div:has(> button[aria-label="Previous page"]):has(> button[aria-label="Next page"]) {
  padding: 3px;
  border-radius: 10px;
  background: var(--bg-1);
  box-shadow: 0 0 0 1px var(--border), 0 1px 2px rgba(13, 23, 38, 0.05);
}
button.btn-secondary[aria-label="Previous page"],
button.btn-secondary[aria-label="Next page"],
.tl-page-btn,
.tl-page-num,
.brd-pagination button {
  height: 30px;
  min-width: 30px;
  padding: 0 10px !important;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  box-shadow: none;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
button.btn-secondary[aria-label="Previous page"]:hover:not(:disabled),
button.btn-secondary[aria-label="Next page"]:hover:not(:disabled),
.tl-page-btn:not(:disabled):hover,
.tl-page-num:hover,
.brd-pagination button:hover:not(:disabled) {
  background: var(--bg-3);
  color: var(--text-primary);
  border-color: transparent;
}
.tl-page-num.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}
.tl-page-btns,
.brd-pagination {
  padding: 3px;
  border-radius: 10px;
  background: var(--bg-1);
  box-shadow: 0 0 0 1px var(--border), 0 1px 2px rgba(13, 23, 38, 0.05);
}
.tl-page-info, .brd-pg-info { font-size: 12.5px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.tl-pagination--top { border-bottom-color: var(--line-soft); }

/* SIZE-END */

/* ---------- 20. Top bar (no divider line, consistent controls) ---------- */
.workspace-header { background: var(--bg-page); box-shadow: none; }
.workspace-header::after { background: transparent; }
.wh-app-name { color: var(--text-primary); }
.wh-search-wrap { background: var(--bg-1); border-color: var(--border); border-radius: 12px; }
.wh-icon-btn {
  background: var(--bg-1);
  border-color: var(--border);
  border-radius: 12px;
  color: var(--text-primary);
  box-shadow: 0 1px 2px rgba(13, 23, 38, 0.05);
}
.wh-icon-btn:hover { background: var(--bg-2); border-color: var(--border-strong); }
.notif-badge {
  background: var(--neg);
  color: #fff;
  border-radius: 999px;
  box-shadow: 0 0 0 2px var(--bg-page);
  font-weight: 700;
}
.wh-avatar { box-shadow: 0 0 0 2px var(--bg-page), 0 0 0 3.5px var(--accent-line); }
.wh-profile-menu a, .wh-profile-menu button { border-radius: 8px; }

/* ---------- 21. One card style everywhere (Clients, Org, Home, Reports…) ---------- */
[class$="-card"]:not(.mdb-leaderboard-card),
[class*="-card "]:not(.mdb-leaderboard-card),
.stat-tile, .org-card {
  border-radius: 14px;
  border-color: var(--border);
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}
[class$="-card"]:not(.mdb-leaderboard-card):hover,
.stat-tile:hover { border-color: var(--border-strong); }
.stat-value { color: var(--text-primary); letter-spacing: -0.02em; }
.stat-label { letter-spacing: 0.08em; }
.stat-link:hover .stat-tile { box-shadow: 0 12px 28px -14px rgba(13, 23, 38, 0.35); border-color: var(--accent-line); }

/* ---------- 22. Chat: load previous & pinned messages ---------- */
.chat-load-more {
  background: var(--bg-1);
  border-color: var(--border-strong);
  color: var(--text-primary);
  border-radius: 999px;
  box-shadow: 0 4px 12px -6px rgba(13, 23, 38, 0.25);
}
.chat-load-more:hover { background: var(--accent-soft); border-color: var(--accent-line); color: var(--text-primary); }
.chat-pinned-banner {
  background: linear-gradient(90deg, var(--accent-soft), transparent 85%);
  border-bottom-color: var(--border);
}
.chat-pinned-label { color: var(--accent); letter-spacing: 0.08em; }
.chat-pinned-body { color: var(--text-primary); }
.chat-pinned-nav-btn { border-radius: 6px; color: var(--text-secondary); }
.chat-pinned-nav-btn:hover { background: var(--bg-3); }
.chat-pinned-unpin { border-radius: 8px; }
.chat-pinned-unpin:hover { background: var(--status-danger-bg); color: var(--neg); }
.chat-msg-row.pinned-msg .chat-bubble { outline-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ---------- 23. Plan modal ---------- */
.profile-plan-card {
  background: var(--bg-2);
  border-color: var(--border);
  border-radius: 16px;
  box-shadow: none;
}
.profile-plan-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-card); }
.profile-plan-card.is-current {
  border-color: var(--accent);
  background: linear-gradient(180deg, var(--accent-soft), var(--bg-2) 60%);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.profile-plan-name { color: var(--accent); letter-spacing: 0.06em; font-weight: 700; }
.profile-plan-price { letter-spacing: -0.02em; }
.profile-plan-total { color: var(--text-secondary); }
.profile-plan-features li { color: var(--text-secondary); }
.profile-plan-current { background: var(--accent-soft); color: var(--accent); border-radius: 10px; font-weight: 600; }
.profile-plan-card .btn-primary { border-radius: 10px; }

/* ---------- 24. Transitions ---------- */
a, button, .btn-primary, .btn-secondary, .btn-danger, .br-btn, .form-input, .form-select-btn,
.entity-table td, .chat-conv-item, .feed-tab, .setup-tab, .tdv2-header-btn, .wh-icon-btn {
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.15s ease, box-shadow 0.2s ease;
}

/* =====================================================================
   SIZE2-START — more requested size changes
   ===================================================================== */
.wh-search-wrap { height: 40px; }
.wh-icon-btn { height: 40px; min-width: 40px; font-size: 13px; font-weight: 600; }
.entity-table td { height: 52px; }
.chat-load-more { padding: 7px 16px; font-size: 12.5px; }
.profile-plan-card { padding: 22px; }
.profile-plan-current { padding: 10px; }
/* SIZE2-END */

/* =====================================================================
   MOTION-START — entrance animations (opacity/transform only)
   ===================================================================== */
@keyframes rs-pop { from { opacity: 0; transform: translateY(8px) scale(0.985); } to { opacity: 1; transform: none; } }
@keyframes rs-fade { from { opacity: 0; } to { opacity: 1; } }
/* fill-mode "backwards", not "both": once the animation ends the element must
   have NO transform left — a leftover transform (even an identity one) makes it
   the containing block for position:fixed children, which mispositioned and
   instantly closed every searchable dropdown inside a modal. */
.modal-backdrop { animation: rs-fade 0.18s ease backwards; }
.modal-panel { animation: rs-pop 0.22s cubic-bezier(0.2, 0.8, 0.2, 1) backwards; }
.wh-profile-menu, .notif-dropdown { animation: rs-pop 0.16s ease backwards; }
@media (prefers-reduced-motion: reduce) {
  .modal-backdrop, .modal-panel, .wh-profile-menu, .notif-dropdown { animation: none; }
}
/* MOTION-END */

/* =====================================================================
   CHECKIN-START — Daily Check-In layout. Only active on that page
   (the preview script sets [data-rs-checkin]). All content is kept:
   employee list (built from the existing cards) + selected employee
   panel + the same task fields laid out as one table.
   ===================================================================== */
@media (min-width: 1000px) {
  .br-page[data-rs-checkin] { display: grid; grid-template-columns: 280px minmax(0, 1fr); column-gap: 20px; align-items: start; }
  .br-page[data-rs-checkin] > * { grid-column: 1 / -1; }
  .br-page[data-rs-checkin] > .rs-ci-nav { grid-column: 1; }
  .br-page[data-rs-checkin] > .br-stack { grid-column: 2; }
}
.rs-ci-nav {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow-card); padding: 16px 12px 12px; position: sticky; top: 12px;
  display: flex; flex-direction: column; max-height: calc(100vh - 170px); min-height: 320px; box-sizing: border-box;
}
.rs-ci-nav-h { font-size: 14px; font-weight: 700; color: var(--text-primary); padding: 0 6px 12px; }
.rs-ci-nav-h span { color: var(--text-muted); font-weight: 500; }
.rs-ci-search { position: relative; margin: 0 2px 10px; }
.rs-ci-search input {
  width: 100%; box-sizing: border-box; height: 36px; padding: 0 12px 0 36px !important; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg-input); color: var(--text-primary); font: inherit; font-size: 13px; outline: none;
}
.rs-ci-search input:focus { border-color: var(--accent); box-shadow: var(--rs-focus); }
.rs-ci-search svg { position: absolute; left: 11px; top: 10px; width: 16px; height: 16px; color: var(--text-muted); }
.rs-ci-list { display: flex; flex-direction: column; gap: 2px; flex: 1; min-height: 0; overflow-y: auto; padding-right: 4px; margin-right: -4px; scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
.rs-ci-list::-webkit-scrollbar { width: 6px; }
.rs-ci-list::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; }
.rs-ci-nav-h, .rs-ci-search { flex-shrink: 0; }
[data-rs-checkin] .br-checkin-toggle-arrow { display: none; }
[data-rs-checkin] .br-checkin-header--clickable { cursor: default; }
.rs-ci-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 10px;
  background: transparent; color: var(--text-primary); font: inherit; font-size: 14px; font-weight: 500; text-align: left; cursor: pointer;
}
.rs-ci-item:hover { background: var(--bg-2); }
.rs-ci-item.is-on { background: var(--accent-soft); color: var(--text-primary); font-weight: 600; }
.rs-ci-item .rs-ci-meta { margin-left: auto; font-size: 11px; color: var(--text-muted); font-weight: 500; white-space: nowrap; }
.rs-ci-item .rs-ci-meta.over { color: var(--neg); font-weight: 600; }
.rs-ci-empty { padding: 12px 8px; font-size: 13px; color: var(--text-muted); }
.rs-av {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 12px; font-weight: 700; background: linear-gradient(140deg, #3584bd, #1e516e);
}
.rs-av.c1 { background: linear-gradient(140deg, #15927f, #0f766e); }
.rs-av.c2 { background: linear-gradient(140deg, #8457d8, #6a3cc4); }
.rs-av.c3 { background: linear-gradient(140deg, #c07a12, #965a07); }
.rs-av.c4 { background: linear-gradient(140deg, #cf4a6e, #a92e52); }
.rs-av.has-photo { background: var(--bg-3); overflow: hidden; }
.rs-av.has-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
[data-rs-checkin] .br-checkin-header-left { display: flex; align-items: center; gap: 12px; }
.br-stack[data-rs-one] > .br-checkin-card[data-rs-hide] { display: none; }

/* Selected employee panel */
[data-rs-checkin] .br-checkin-card { border-radius: 16px; padding: 0; overflow: hidden; }
[data-rs-checkin] .br-checkin-header { padding: 16px 20px; margin: 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; gap: 10px; }
[data-rs-checkin] .br-checkin-name { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 12px; }
[data-rs-checkin] .br-checkin-name[data-rs-initials]::before {
  content: attr(data-rs-initials); width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: #fff;
  background: linear-gradient(140deg, #3584bd, #1e516e);
}
[data-rs-checkin] .br-checkin-stats { gap: 8px; flex-wrap: wrap; }
[data-rs-checkin] .br-checkin-stat.done { background: var(--status-success-bg); color: var(--pos); box-shadow: none; }
[data-rs-checkin] .br-checkin-stat.overdue { background: var(--status-danger-bg); color: var(--neg); box-shadow: 0 0 14px -4px var(--neg); }
[data-rs-checkin] .br-checkin-card > :not(.br-checkin-header) { margin-left: 20px; margin-right: 20px; }
[data-rs-checkin] .br-checkin-card > :last-child { margin-bottom: 16px; }

/* Task table */
.rs-ci-thead, [data-rs-checkin] .br-daily-task-card {
  display: grid;
  grid-template-columns: 48px minmax(140px, 1fr) 92px 72px 72px 92px 80px 156px;
  align-items: center; column-gap: 10px;
}
.rs-ci-thead {
  padding: 10px 12px; margin-top: 14px; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-muted); border-bottom: 1px solid var(--border);
}
[data-rs-checkin] .br-checkin-tasks { gap: 0 !important; margin-bottom: 8px; }
[data-rs-checkin] .br-daily-task-card {
  border: 0; border-bottom: 1px solid var(--line-soft); border-radius: 0; box-shadow: none; padding: 0 12px; min-height: 52px; background: transparent;
}
[data-rs-checkin] .br-daily-task-card:hover { background: var(--bg-2); }
[data-rs-checkin] .br-daily-task-row, [data-rs-checkin] .br-daily-task-stats { display: contents; }
[data-rs-checkin] .br-tdr-sno { grid-column: 1; grid-row: 1; }
[data-rs-checkin] .br-tdr-title { grid-column: 2; grid-row: 1; cursor: pointer; font-weight: 500; }
[data-rs-checkin] .br-daily-task-stats > .br-dts-item { grid-row: 1; border: 0; padding: 0; display: block; font-size: 13px; }
[data-rs-checkin] .br-daily-task-stats > .br-dts-item:nth-child(1) { grid-column: 3; }
[data-rs-checkin] .br-daily-task-stats > .br-dts-item:nth-child(2) { grid-column: 4; }
[data-rs-checkin] .br-daily-task-stats > .br-dts-item:nth-child(3) { grid-column: 5; }
[data-rs-checkin] .br-daily-task-stats > .br-dts-item:nth-child(4) { grid-column: 6; }
[data-rs-checkin] .br-daily-task-stats > .br-dts-item:nth-child(5) { grid-column: 7; }
[data-rs-checkin] .br-daily-task-stats .br-dts-label { display: none; }
[data-rs-checkin] .br-tdr-right { grid-column: 8; grid-row: 1; justify-content: flex-start; flex-wrap: wrap; gap: 6px; padding: 8px 0; }
[data-rs-checkin] .br-task-status-select { width: 100%; border-radius: 8px; }
[data-rs-checkin] .br-daily-completed-label { margin-top: 18px; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--pos); }
[data-rs-checkin] .br-daily-task-card--done .br-tdr-title { color: var(--text-secondary); }
/* Overdue rows: red edge + faint red tint (the row style above drops borders/shadow) */
[data-rs-checkin] .br-daily-task-card.br-daily-task-card--overdue {
  box-shadow: inset 3px 0 0 #ef4444; background: rgba(239,68,68,0.06);
}
[data-rs-checkin] .br-daily-task-card.br-daily-task-card--overdue:hover { background: rgba(239,68,68,0.1); }
[data-rs-checkin] .br-task-comment-row {
  display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 14px; margin-top: 10px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--bg-2);
}
[data-rs-checkin] .br-task-comment-input { border: 0 !important; background: transparent !important; box-shadow: none !important; }
@media (max-width: 1199px) {
  .rs-ci-nav { position: static; margin-bottom: 14px; }
  .rs-ci-thead { display: none; }
  [data-rs-checkin] .br-daily-task-card { display: block; padding: 10px 12px; }
  [data-rs-checkin] .br-daily-task-row { display: flex; }
  [data-rs-checkin] .br-daily-task-stats { display: flex; flex-wrap: wrap; gap: 12px; padding-top: 6px; }
  [data-rs-checkin] .br-daily-task-stats .br-dts-label { display: block; }
}
[data-rs-checkin] .br-member-comments-list:empty { display: none; }
/* CHECKIN-END */


/* =====================================================================
   PINNED-START — Chat pinned-message bar (floating card)
   ===================================================================== */
.chat-pinned-banner {
  margin: 10px 16px 0;
  padding: 8px 8px 8px 10px;
  gap: 12px;
  border: 1px solid var(--border);
  border-bottom-color: var(--border);
  border-radius: 14px;
  background: var(--bg-1);
  box-shadow: 0 6px 18px -12px rgba(13, 23, 38, 0.45);
}
.chat-pinned-banner > svg.chat-pinned-icon,
.chat-pinned-banner > svg:first-child {
  width: 30px; height: 30px; padding: 8px; box-sizing: border-box;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  transform: rotate(35deg);
}
.chat-pinned-content { gap: 2px; padding: 2px 4px; border-radius: 8px; transition: background-color 0.15s ease; }
.chat-pinned-content:hover { background: var(--bg-2); }
.chat-pinned-content:hover .chat-pinned-body { color: var(--accent); }
.chat-pinned-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em;
  color: var(--accent);
}
.chat-pinned-edited { color: var(--text-muted); font-weight: 500; letter-spacing: 0; }
.chat-pinned-count {
  padding: 1px 7px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
  font-size: 10.5px; font-weight: 700; letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}
.chat-pinned-body { font-size: 13.5px; font-weight: 500; color: var(--text-primary); transition: color 0.15s ease; }
.chat-pinned-nav {
  gap: 0; padding: 2px; border-radius: 9px;
  background: var(--bg-2); box-shadow: inset 0 0 0 1px var(--border);
}
.chat-pinned-nav-btn {
  width: 26px; height: 26px; padding: 0; border-radius: 7px;
  font-size: 16px; color: var(--text-secondary);
  transition: background-color 0.15s ease, color 0.15s ease;
}
.chat-pinned-nav-btn:hover { background: var(--bg-1); color: var(--text-primary); box-shadow: 0 1px 2px rgba(13, 23, 38, 0.12); }
.chat-pinned-unpin {
  width: 30px; height: 30px; border-radius: 9px;
  color: var(--text-muted);
  transition: background-color 0.15s ease, color 0.15s ease;
}
.chat-pinned-unpin:hover { background: var(--status-danger-bg); color: var(--neg); }
/* PINNED-END */

/* ---------- 25. Admin module (content area; navy admin sidebar unchanged) ---------- */
.admin-shell {
  --bg-0: #f3f5f8; --bg-1: #ffffff; --bg-2: #f7f9fb; --bg-3: #eef2f6; --bg-4: #e2e8f0;
  --line: #e3e8ef; --line-soft: #edf1f5;
  --fg: #0d1726; --fg-mute: #46556a; --fg-dim: #627286;
  --accent: #1e516e; --accent-soft: rgba(30, 81, 110, 0.08); --accent-line: rgba(30, 81, 110, 0.28);
  --border-strong: #cfd8e3; --brand-hover: #173f57;
  --btn-primary-bg: #1e516e; --btn-secondary-bg: #ffffff; --btn-secondary-border: #cfd8e3;
  --shadow-card: 0 0 0 1px rgba(13, 23, 38, 0.02), 0 1px 2px rgba(13, 23, 38, 0.04), 0 6px 16px -8px rgba(13, 23, 38, 0.08);
  --rs-focus: 0 0 0 3px rgba(30, 81, 110, 0.2);
  background: #f3f5f8;
}
.admin-shell .admin-main { font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.admin-shell .admin-sidebar { font-family: -apple-system, BlinkMacSystemFont, sans-serif; }
.admin-shell .admin-main,
.admin-shell .admin-main p,
.admin-shell .admin-main span,
.admin-shell .admin-main div,
.admin-shell .admin-main td,
.admin-shell .admin-main th,
.admin-shell .admin-main label,
.admin-shell .admin-main input,
.admin-shell .admin-main select,
.admin-shell .admin-main textarea { color: #0d1726; }
.admin-shell .admin-page-subtitle { color: #46556a; }
.admin-kpi, .admin-card, .admin-recon-card, .admin-payment-kpi {
  background: #ffffff;
  border-color: #e3e8ef;
  border-radius: 16px;
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.admin-kpi:hover, .admin-card:hover, .admin-payment-kpi:hover { border-color: #cfd8e3; }
.admin-kpi-icon, .admin-payment-kpi-icon { border-radius: 12px; }
.admin-shell .admin-table th { background: #f7f9fb; color: #627286; letter-spacing: 0.06em; border-bottom-color: #e3e8ef; }
.admin-shell .admin-table td { border-bottom-color: #edf1f5; }
.admin-shell .admin-table tr:hover td { background: #f7f9fb; }
.admin-shell .btn-primary { background: #1e516e; border-color: #1e516e; border-radius: 9px; }
.admin-shell .btn-primary:hover:not(:disabled) { background: #173f57; filter: none; }
.admin-shell .btn-secondary { background: #ffffff; border-color: #cfd8e3; border-radius: 9px; }
.admin-tab.active, .admin-tab[aria-selected="true"] { color: #1e516e; border-bottom-color: #1e516e; }
.admin-shell .modal-panel { border-radius: 16px; }
.admin-shell .modal-header h2 { color: #0d1726 !important; }

/* ---------- 26. Partner module (content area; dark rail unchanged) ---------- */
.partner-app {
  --paper: #f3f5f8;
  --line: #e3e8ef;
  --line-soft: #edf1f5;
  --text: #0d1726;
  --text-2: #46556a;
  --text-3: #627286;
  --blue: #1e516e;
  --grad: linear-gradient(103deg, #1e516e 0%, #3b7ea6 100%);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.partner-app .rail { font-family: "Public Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; }
.partner-app .btn { background: #1e516e; border-radius: 10px; }
.partner-app .btn:hover:not(:disabled) { background: #173f57; }
.partner-app .btn-ghost { border-color: #cfd8e3; border-radius: 10px; box-shadow: 0 1px 2px rgba(13, 23, 38, 0.05); }
.partner-app .panel { border-radius: 16px; box-shadow: 0 0 0 1px rgba(13, 23, 38, 0.02), 0 1px 2px rgba(13, 23, 38, 0.04), 0 6px 16px -8px rgba(13, 23, 38, 0.08); }
.partner-app .tbl thead th { background: #f7f9fb; color: #627286; }
.partner-app .tbl tbody tr:hover { background: #f7f9fb; }
.partner-app .modal-panel { border-radius: 16px; }

/* =====================================================================
   HEADINGS-START — one heading system for the whole app
   Tier 1 page title · subtitle · Tier 2 section/card title · Tier 3 label
   ===================================================================== */

/* Tier 1 — page titles */
.page-title, .page-title-sm, .feed-page-title, .profile-title, .admin-page-title, .mdb-title,
.tdv2-title, .br-workspace-title, .br-list-title, .prv-title, .tdb-hero-title,
.partner-app .bar h1 {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 24px;
  line-height: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-transform: none;
  color: var(--text-primary);
}
.admin-page-title { color: #0d1726; }
.partner-app .bar h1 { color: var(--text); }
.page-title, .page-title-sm, .feed-page-title, .profile-title, .admin-page-title, .mdb-title { margin: 0 0 6px; }

/* Page subtitles */
.page-subtitle, .feed-page-subtitle, .br-page-subtitle, .admin-page-subtitle, .mdb-subtitle, .tl-subtitle, .tdb-hero-subtitle {
  font-size: 14px;
  line-height: 21px;
  font-weight: 400;
  color: var(--text-secondary);
}
.admin-page-subtitle { color: #46556a; }
.page-subtitle, .admin-page-subtitle { margin: 0 0 20px; }
.br-workspace-subtitle { font-size: 13px; line-height: 20px; color: var(--text-secondary); }

/* Tier 2 — section and card titles */
.mdb-card-title, .mdb-today-summary-title, .mdb-lb-title, .mdb-focus-title, .section-title, .card-title,
.profile-section-title, .prv-section-title, .br-dash-panel-title, .br-mnew-panel-title, .br-summary-card-title,
.br-rc-section-title, .br-ap-head-title, .rh-dual-col-title, .rt-breakdown-title, .rt-attention-title,
.tdb-ra-title, .org-form-section-title, .policies-group-title, .chat-sidebar-title, .notif-dropdown-title,
.modal-header h2, .tdv2-panel-title, .info-card h3, .manage-roles-title,
.partner-app .pane-h h3, .partner-app .form h3, .partner-app .modal-header h2 {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 24px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--text-primary);
}
.mdb-lb-title { color: #ffffff; }
/* The notifications dropdown follows the theme (dark panel in dark mode). */
.notif-dropdown-title { color: var(--text-primary); }
.partner-app .pane-h h3, .partner-app .form h3, .partner-app .modal-header h2 { color: var(--text); }
.mdb-today-summary-title, .section-title { margin: 0 0 14px; }

/* Tier 3 — small group labels (colour kept: several are colour-coded) */
.br-section-title, .br-task-list-title, .br-wci-section-title, .brq-pending-title, .br-monthly-section-title,
.feed-panel-title, .mdb-routine-section-title, .tdb-section-title, .tdb-kpi-mini-title,
.org-section-title, .org-subsection-title {
  font-size: 11px;
  line-height: 16px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
/* HEADINGS-END */
