/* ============================================================
   INTRIO — Interior Design Project Management
   Design system: burgundy #65051F · cream · ivory · blush
   Premium, elegant, mobile-app-like presentation that adapts
   to tablet / laptop / desktop with a sidebar layout.
   ============================================================ */

:root {
  --burgundy: #65051f;
  --burgundy-deep: #4a0116;
  --burgundy-dark: #7a1c35;
  --burgundy-soft: #f6e6ea;
  --burgundy-100: #93374f;
  --cream: #faf6f0;
  --ivory: #fffdf8;
  --blush: #f9eef1;
  --ink: #2b1d22;
  --ink-soft: #57424b;
  --muted: #8d7a81;
  --line: #eee2d8;
  --line-soft: #f4ebe2;
  --success: #1e7a4f;
  --success-bg: #e6f3eb;
  --warning: #a86a04;
  --warning-bg: #fbf1e0;
  --danger: #c23a28;
  --danger-bg: #fbe9e4;
  --white: #ffffff;
  --shadow-card: 0 6px 20px rgba(101, 5, 31, 0.07);
  --shadow-card-hover: 0 12px 28px rgba(101, 5, 31, 0.12);
  --shadow-float: 0 10px 30px rgba(43, 29, 34, 0.18);
  --radius-xl: 22px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --font-display: "Fraunces", "Playfair Display", Georgia, "Times New Roman", serif;
  --font-body: "Inter", -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --sidebar-w: 264px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-height: 100dvh;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: 0; background: none; }
input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
ul, ol { list-style: none; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.2; color: var(--ink); }

::selection { background: var(--burgundy-soft); color: var(--burgundy-deep); }

/* thin elegant scrollbars */
.scrollable { scrollbar-width: thin; scrollbar-color: #dcc9bd transparent; }
.scrollable::-webkit-scrollbar { width: 6px; height: 6px; }
.scrollable::-webkit-scrollbar-thumb { background: #dcc9bd; border-radius: 99px; }
.scrollable::-webkit-scrollbar-track { background: transparent; }

/* ============================== Layout ============================== */

.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.app-body {
  display: flex;
  flex: 1;
  min-height: 0;
}

/* --- Sidebar (≥1024px) --- */
.sidebar {
  display: none;
  width: var(--sidebar-w);
  background: linear-gradient(180deg, #fffdf8 0%, var(--cream) 100%);
  border-right: 1px solid var(--line-soft);
  position: sticky;
  top: 0;
  height: 100vh;
  flex-direction: column;
  padding: 26px 18px 18px;
  gap: 6px;
  z-index: 40;
}

.sidebar .brand { display: flex; align-items: center; gap: 11px; padding: 2px 10px 20px; }
.sidebar .brand-mark {
  width: 42px; height: 42px; border-radius: 13px;
  background: var(--burgundy); color: #fff;
  display: grid; place-items: center;
  font-family: var(--font-display); font-size: 21px; font-weight: 700; letter-spacing: .5px;
  box-shadow: 0 6px 14px rgba(101,5,31,.28);
}
.sidebar .brand-name { font-family: var(--font-display); font-size: 22px; font-weight: 700; color: var(--ink); }
.sidebar .brand-sub { font-size: 10.5px; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); margin-top: 1px; }

.side-nav { display: flex; flex-direction: column; gap: 3px; margin-top: 6px; flex: 1; }
.side-label { font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); padding: 16px 12px 7px; }
.side-link {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 13px; border-radius: 13px;
  color: var(--ink-soft); font-weight: 500; font-size: 14.5px;
  transition: background .18s ease, color .18s ease, transform .18s ease;
  position: relative;
}
.side-link svg { flex: 0 0 auto; opacity: .85; }
.side-link:hover { background: var(--blush); color: var(--burgundy); }
.side-link.active {
  background: var(--burgundy); color: #fff;
  box-shadow: 0 8px 18px rgba(101,5,31,.26);
}
.side-link.active svg { opacity: 1; }
.side-link .nav-badge {
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px;
  background: var(--burgundy-soft); color: var(--burgundy);
  border-radius: 99px; font-size: 11px; font-weight: 700;
  display: grid; place-items: center;
}
.side-link.active .nav-badge { background: rgba(255,255,255,.22); color: #fff; }

.side-footer { padding: 14px 10px 2px; border-top: 1px solid var(--line-soft); }
.side-user { display: flex; align-items: center; gap: 11px; padding: 8px 8px 6px; border-radius: 12px; }
.side-user:hover { background: var(--blush); }
.side-user .u-name { font-weight: 600; font-size: 14px; }
.side-user .u-role { font-size: 11.5px; color: var(--muted); text-transform: capitalize; }

/* --- Main column --- */
.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(250, 246, 240, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
  padding: 14px 18px;
  display: flex; align-items: center; gap: 14px;
  min-height: 62px;
}
.topbar .tb-title { font-size: 18px; font-weight: 600; }
.topbar .tb-back {
  width: 38px; height: 38px; border-radius: 12px;
  display: grid; place-items: center;
  color: var(--ink-soft); background: var(--white);
  border: 1px solid var(--line); flex: 0 0 auto;
  transition: all .18s ease;
}
.topbar .tb-back:hover { background: var(--burgundy-soft); color: var(--burgundy); }
.topbar .tb-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.topbar .tb-more { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: var(--ink-soft); }

.bell-btn {
  position: relative; width: 42px; height: 42px; border-radius: 14px;
  background: var(--white); border: 1px solid var(--line);
  display: grid; place-items: center; color: var(--ink-soft);
  transition: all .18s ease;
}
.bell-btn:hover { color: var(--burgundy); border-color: var(--burgundy-100); }
.bell-dot {
  position: absolute; top: -5px; right: -5px;
  min-width: 19px; height: 19px; padding: 0 5px;
  background: var(--danger); color: #fff; font-size: 11px; font-weight: 700;
  border-radius: 99px; display: grid; place-items: center;
  border: 2px solid var(--cream);
}

.topbar-avatar { width: 42px; height: 42px; }

.page {
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: 20px 18px calc(96px + env(safe-area-inset-bottom, 0px));
  flex: 1;
  display: flex; flex-direction: column; gap: 22px;
}
.page-wide { max-width: 1080px; }

@media (min-width: 1024px) {
  .sidebar { display: flex; }
  .page { padding-bottom: 48px; }
  .page-tight { max-width: 720px; }
}

/* --- Bottom navigation (mobile) --- */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  background: rgba(255, 253, 248, .96);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line-soft);
  display: flex; justify-content: space-around; align-items: stretch;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
}
.bn-item {
  flex: 1; max-width: 92px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 7px 4px 5px; border-radius: 14px;
  color: var(--muted); font-size: 10.5px; font-weight: 600;
  transition: color .15s ease;
  position: relative;
}
.bn-item svg { transition: transform .15s ease; }
.bn-item.active { color: var(--burgundy); }
.bn-item.active svg { transform: translateY(-1px); }
.bn-item.active::after {
  content: ""; position: absolute; top: 2px; left: 50%; transform: translateX(-50%);
  width: 18px; height: 3px; border-radius: 99px; background: var(--burgundy);
}
.bn-item .bn-badge {
  position: absolute; top: 2px; right: calc(50% - 24px);
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px;
  background: var(--danger); color: #fff; font-size: 9.5px; font-weight: 700;
  display: grid; place-items: center;
}
.bn-fab {
  flex: 0 0 auto; margin: 0 6px; align-self: center;
  width: 52px; height: 52px; border-radius: 18px;
  background: linear-gradient(140deg, var(--burgundy) 0%, var(--burgundy-deep) 100%);
  color: #fff; display: grid; place-items: center;
  box-shadow: 0 10px 22px rgba(101, 5, 31, .38);
  transform: translateY(-14px);
  transition: transform .18s ease, box-shadow .18s ease;
}
.bn-fab:hover { transform: translateY(-16px); box-shadow: 0 14px 26px rgba(101,5,31,.45); }
@media (min-width: 1024px) { .bottom-nav { display: none; } }

/* ============================== Cards & sections ============================== */

.card {
  background: var(--white);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 18px;
}
.card-hover { transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.card-hover:hover { transform: translateY(-2px); box-shadow: var(--shadow-card-hover); border-color: #e3d2c6; }

.section-head {
  display: flex; align-items: baseline; gap: 10px;
  margin: 4px 0 2px;
}
.section-head h2, .section-head h3 { font-size: 19px; }
.section-head .see-all {
  margin-left: auto; color: var(--burgundy); font-weight: 600; font-size: 13.5px;
  display: inline-flex; align-items: center; gap: 3px;
  padding: 5px 8px; border-radius: 9px; transition: background .15s ease;
}
.section-head .see-all:hover { background: var(--burgundy-soft); }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }

.page-head h1 { font-size: 25px; letter-spacing: .01em; }
.page-head .sub { color: var(--muted); margin-top: 3px; font-size: 14px; }

/* --- Stat cards (dashboard) --- */
.stats-row {
  display: grid; gap: 12px;
  grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 480px) { .stats-row { gap: 9px; } }

.stat-card {
  background: linear-gradient(145deg, var(--burgundy) 0%, var(--burgundy-deep) 130%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 16px 14px 14px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(101, 5, 31, .22);
}
.stat-card::after {
  content: ""; position: absolute; right: -22px; bottom: -26px;
  width: 86px; height: 86px; border-radius: 50%;
  background: rgba(255, 255, 255, .08);
}
.stat-card .stat-icon {
  width: 34px; height: 34px; border-radius: 11px;
  background: rgba(255,255,255,.16);
  display: grid; place-items: center; margin-bottom: 10px;
}
.stat-card .stat-value { font-family: var(--font-display); font-size: 26px; font-weight: 700; line-height: 1; }
.stat-card .stat-label { font-size: 11.5px; opacity: .85; margin-top: 5px; letter-spacing: .02em; }
.stat-card.stat-danger { background: linear-gradient(145deg, #a03023 0%, #7c2115 130%); box-shadow: 0 10px 24px rgba(160,48,35,.24); }

/* --- Greeting header --- */
.greet-row { display: flex; align-items: center; gap: 13px; }
.greet-row h1 { font-size: 22px; }
.greet-row .sub { color: var(--muted); font-size: 13.5px; margin-top: 1px; }
.greet-avatar { margin-left: auto; }

/* --- Avatars --- */
.avatar {
  width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 700; font-size: 15px; color: #fff;
  flex: 0 0 auto; position: relative;
  background: var(--burgundy);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.avatar-sm { width: 36px; height: 36px; font-size: 12.5px; }
.avatar-lg { width: 76px; height: 76px; font-size: 25px; }
.avatar-xl { width: 92px; height: 92px; font-size: 30px; }
.avatar-c0 { background: #65051f; }
.avatar-c1 { background: #57424b; }
.avatar-c2 { background: #8a5a3b; }
.avatar-c3 { background: #1e7a4f; }
.avatar-c4 { background: #7a1c35; }
.avatar-c5 { background: #93374f; }

/* --- Project cards --- */
.project-card {
  display: flex; gap: 14px; align-items: stretch;
  background: var(--white);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 12px;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  color: var(--ink);
}
.project-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-card-hover); border-color: #e3d2c6; }
.project-card .pc-img {
  width: 88px; min-height: 88px; border-radius: var(--radius-md);
  overflow: hidden; flex: 0 0 auto; background: var(--blush);
}
.project-card .pc-img img { width: 100%; height: 100%; object-fit: cover; }
.project-card .pc-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.project-card .pc-name { font-weight: 700; font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.project-card .pc-meta { color: var(--muted); font-size: 12.5px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.project-card .pc-progress { margin-top: auto; padding-top: 10px; }
.project-card .pc-progress .row { display: flex; align-items: center; justify-content: space-between; font-size: 11.5px; color: var(--muted); margin-bottom: 5px; }
.project-card .pc-progress .pct { font-weight: 700; color: var(--burgundy); }

.progress-track { height: 6px; border-radius: 99px; background: #f0e6dc; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--burgundy-100), var(--burgundy)); transition: width .5s ease; }

/* --- Status pills --- */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3.5px 10px; border-radius: 99px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .02em;
  text-transform: capitalize; white-space: nowrap;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-success { background: var(--success-bg); color: var(--success); }
.pill-progress { background: var(--burgundy-soft); color: var(--burgundy); }
.pill-danger { background: var(--danger-bg); color: var(--danger); }
.pill-muted { background: #f0eae4; color: var(--muted); }
.pill-warn { background: var(--warning-bg); color: var(--warning); }
.pill-outline { background: transparent; border: 1px solid var(--line); color: var(--ink-soft); }

.priority { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; }
.priority-high { color: var(--danger); }
.priority-medium { color: var(--warning); }
.priority-low { color: var(--success); }

/* --- Filter chips --- */
.chip-row {
  display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 4px;
  scrollbar-width: none;
}
.chip-row::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; padding: 7.5px 15px; border-radius: 99px;
  background: var(--white); border: 1px solid var(--line);
  color: var(--ink-soft); font-weight: 600; font-size: 13px;
  transition: all .16s ease;
}
.chip:hover { border-color: var(--burgundy-100); color: var(--burgundy); }
.chip.active {
  background: var(--burgundy); border-color: var(--burgundy); color: #fff;
  box-shadow: 0 6px 14px rgba(101,5,31,.25);
}
.chip .chip-count { opacity: .75; font-weight: 500; margin-left: 2px; }

/* --- Search --- */
.search-wrap { position: relative; }
.search-wrap .search-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--muted); pointer-events: none;
}
.search-input {
  width: 100%;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px 14px 12px 42px;
  font-size: 14.5px; color: var(--ink);
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.search-input::placeholder { color: #b3a49d; }
.search-input:focus { border-color: var(--burgundy-100); box-shadow: 0 0 0 4px rgba(101,5,31,.08); }

/* --- Tabs (Timeline / Tasks / Vendors / Details) --- */
.tabs {
  display: flex; gap: 4px;
  background: #f1e8de;
  border-radius: var(--radius-md);
  padding: 4px;
  overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 1 0 auto; text-align: center;
  padding: 9px 16px; border-radius: 11px;
  font-weight: 600; font-size: 13.5px; color: var(--ink-soft);
  transition: all .18s ease; white-space: nowrap;
}
.tab:hover { color: var(--burgundy); }
.tab.active {
  background: var(--white); color: var(--burgundy);
  box-shadow: 0 3px 8px rgba(43,29,34,.08);
}

/* --- Timeline --- */
.timeline-summary { padding: 0; overflow: hidden; }
.timeline-summary .ts-img { width: 100%; height: 148px; object-fit: cover; }
.timeline-summary .ts-body { padding: 15px 17px 16px; }
.timeline-summary .ts-title { display: flex; align-items: center; gap: 10px; }
.timeline-summary .ts-title h2 { font-size: 20px; }
.timeline-summary .ts-meta { color: var(--muted); font-size: 13px; margin-top: 3px; display: flex; flex-wrap: wrap; gap: 5px 14px; }
.timeline-summary .ts-progress { display: flex; align-items: center; gap: 12px; margin-top: 13px; }
.timeline-summary .ts-progress .track { flex: 1; }
.timeline-summary .ts-progress .pct { font-family: var(--font-display); font-size: 20px; font-weight: 700; color: var(--burgundy); }

.tl-wrap { display: flex; flex-direction: column; }
.tl-item {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 0 14px;
  position: relative;
  padding: 0 0 22px 0;
}
.tl-item:last-child { padding-bottom: 2px; }
.tl-rail { position: relative; display: flex; justify-content: center; }
.tl-node {
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  border: 2.5px solid #d9c8bb; background: var(--white);
  color: #c3ab9b; z-index: 2; margin-top: 2px;
  transition: all .2s ease;
}
.tl-item:not(:last-child) .tl-rail::after {
  content: ""; position: absolute; top: 32px; bottom: -6px; width: 2px;
  background: #eadfd3; z-index: 1;
}
.tl-item.done .tl-node { border-color: var(--success); background: var(--success); color: #fff; }
.tl-item.done .tl-rail::after { background: var(--success); opacity: .45; }
.tl-item.current .tl-node { border-color: var(--burgundy); color: var(--burgundy); box-shadow: 0 0 0 5px rgba(101,5,31,.09); }
.tl-item.current .tl-rail::after { background: var(--burgundy); opacity: .4; }
.tl-item.late .tl-node { border-color: var(--danger); background: var(--danger); color: #fff; }
.tl-card {
  background: var(--white);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  box-shadow: 0 3px 10px rgba(101,5,31,.05);
  padding: 13px 15px;
  display: flex; align-items: flex-start; gap: 10px;
  transition: transform .16s ease, box-shadow .16s ease;
}
.tl-card:hover { box-shadow: var(--shadow-card-hover); }
.tl-card .tl-main { flex: 1; min-width: 0; }
.tl-card .tl-title { font-weight: 700; font-size: 14.5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tl-card .tl-date { color: var(--muted); font-size: 12.5px; margin-top: 3px; display: flex; align-items: center; gap: 5px; }
.tl-card .tl-vendor { color: var(--ink-soft); font-size: 12.5px; margin-top: 4px; display: flex; align-items: center; gap: 6px; }
.tl-card .tl-extra { margin-top: 8px; font-size: 12.5px; color: var(--danger); background: var(--danger-bg); border-radius: 9px; padding: 7px 10px; display: flex; gap: 7px; align-items: flex-start; }
.tl-card .tl-extra svg { flex: 0 0 auto; margin-top: 1px; }
.tl-card .tl-icon {
  width: 38px; height: 38px; border-radius: 12px; flex: 0 0 auto;
  background: var(--blush); color: var(--burgundy);
  display: grid; place-items: center;
}
.tl-item.done .tl-icon { background: var(--success-bg); color: var(--success); }
.tl-item.late .tl-icon { background: var(--danger-bg); color: var(--danger); }

/* --- Task cards (list) --- */
.task-card {
  display: flex; gap: 13px; align-items: flex-start;
  background: var(--white);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 15px 16px;
  color: var(--ink);
  transition: transform .18s ease, box-shadow .18s ease;
}
.task-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-card-hover); }
.task-card .tc-icon {
  width: 44px; height: 44px; border-radius: 14px; flex: 0 0 auto;
  background: var(--blush); color: var(--burgundy);
  display: grid; place-items: center;
}
.task-card.late .tc-icon { background: var(--danger-bg); color: var(--danger); }
.task-card.done .tc-icon { background: var(--success-bg); color: var(--success); }
.task-card .tc-body { flex: 1; min-width: 0; }
.task-card .tc-title { font-weight: 700; font-size: 15px; }
.task-card .tc-sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.task-card .tc-dates { color: var(--ink-soft); font-size: 12.5px; margin-top: 6px; display: flex; align-items: center; gap: 6px; }
.task-card .tc-end { margin-top: 10px; }

/* --- Vendor cards --- */
.vendor-card {
  display: flex; gap: 13px; align-items: center;
  background: var(--white);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 15px 16px;
  color: var(--ink);
  transition: transform .18s ease, box-shadow .18s ease;
}
.vendor-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-card-hover); }
.vendor-card .vc-body { flex: 1; min-width: 0; }
.vendor-card .vc-name { font-weight: 700; font-size: 15px; }
.vendor-card .vc-cat { color: var(--muted); font-size: 12.5px; margin-top: 1px; }
.vendor-card .vc-phone { color: var(--ink-soft); font-size: 13px; margin-top: 5px; display: flex; align-items: center; gap: 6px; }
.call-btn {
  width: 42px; height: 42px; border-radius: 14px; flex: 0 0 auto;
  background: var(--success-bg); color: var(--success);
  display: grid; place-items: center;
  transition: all .16s ease;
}
.call-btn:hover { background: var(--success); color: #fff; }

/* --- Detail list (Task Details / Why delayed) --- */
.detail-list { background: var(--white); border: 1px solid var(--line-soft); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); overflow: hidden; }
.detail-row { display: grid; grid-template-columns: 132px 1fr; gap: 14px; padding: 14px 17px; border-bottom: 1px solid var(--line-soft); align-items: start; }
.detail-row:last-child { border-bottom: 0; }
.detail-row .dk { color: var(--muted); font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.detail-row .dv { font-size: 14px; color: var(--ink); min-width: 0; overflow-wrap: break-word; }
.detail-row .dv.accent { color: var(--danger); font-weight: 700; }
@media (max-width: 480px) { .detail-row { grid-template-columns: 108px 1fr; } }

/* --- Banner --- */
.banner {
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex; gap: 12px; align-items: flex-start;
  font-size: 13.5px;
}
.banner svg { flex: 0 0 auto; margin-top: 1px; }
.banner-danger { background: var(--danger-bg); color: #8c2a1c; border: 1px solid #f3d5cd; }
.banner-warn { background: var(--warning-bg); color: #7c5303; border: 1px solid #f0ddba; }
.banner-info { background: var(--burgundy-soft); color: var(--burgundy-deep); border: 1px solid #ecd3da; }
.banner-success { background: var(--success-bg); color: #14603c; border: 1px solid #cfe7d7; }
.banner b { font-weight: 700; }

/* --- Notifications --- */
.notif-item {
  display: flex; gap: 13px; align-items: flex-start;
  background: var(--white);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  padding: 14px 15px;
  color: var(--ink);
  transition: background .15s ease, border-color .15s ease;
}
.notif-item:hover { border-color: #e3d2c6; }
.notif-item.unread { background: #fdf7f4; border-color: #f0dcd6; }
.notif-ic {
  width: 40px; height: 40px; border-radius: 13px; flex: 0 0 auto;
  display: grid; place-items: center;
}
.notif-ic.t-delay { background: var(--danger-bg); color: var(--danger); }
.notif-ic.t-update { background: var(--burgundy-soft); color: var(--burgundy); }
.notif-ic.t-comment { background: var(--burgundy-soft); color: var(--burgundy); }
.notif-ic.t-completion { background: var(--success-bg); color: var(--success); }
.notif-ic.t-assignment { background: #f0eae4; color: var(--ink-soft); }
.notif-ic.t-milestone { background: var(--warning-bg); color: var(--warning); }
.notif-ic.t-approval { background: var(--warning-bg); color: var(--warning); }
.notif-ic.t-deadline { background: var(--warning-bg); color: var(--warning); }
.notif-ic.t-system { background: #f0eae4; color: var(--ink-soft); }
.notif-body { flex: 1; min-width: 0; }
.notif-title { font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.notif-msg { color: var(--ink-soft); font-size: 13px; margin-top: 2px; }
.notif-time { color: var(--muted); font-size: 11.5px; margin-top: 5px; display: flex; align-items: center; gap: 4px; }
.notif-unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--burgundy); flex: 0 0 auto; margin-top: 6px; }
.day-divider { display: flex; align-items: center; gap: 12px; margin: 18px 2px 10px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.day-divider::before, .day-divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }

/* --- Chat / discussion --- */
.chat-panel { display: flex; flex-direction: column; }
.chat-scroll { flex: 1; overflow-y: auto; padding: 18px 16px; display: flex; flex-direction: column; gap: 14px; max-height: 54vh; min-height: 280px; }
.msg { display: flex; gap: 10px; align-items: flex-end; max-width: 86%; }
.msg.out { align-self: flex-end; flex-direction: row-reverse; }
.msg .bubble {
  background: var(--white);
  border: 1px solid var(--line-soft);
  border-radius: 16px 16px 16px 5px;
  padding: 10px 14px;
  font-size: 13.5px;
  box-shadow: 0 2px 8px rgba(101,5,31,.05);
}
.msg.out .bubble {
  background: linear-gradient(135deg, var(--burgundy) 0%, var(--burgundy-deep) 120%);
  color: #fff; border-color: transparent;
  border-radius: 16px 16px 5px 16px;
}
.msg .bubble .b-meta { font-size: 10.5px; opacity: .65; margin-top: 4px; display: flex; gap: 8px; align-items: center; }
.msg .bubble .b-img { margin: -3px -10px 7px; border-radius: 12px 12px 0 0; overflow: hidden; max-height: 210px; }
.msg .bubble .b-img img { width: 100%; object-fit: cover; }
.chat-input {
  display: flex; gap: 9px; align-items: center;
  border-top: 1px solid var(--line-soft);
  padding: 11px 13px;
  background: var(--ivory);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.chat-input input[type=text] {
  flex: 1; border: 1px solid var(--line); border-radius: 99px;
  padding: 10px 16px; font-size: 14px; outline: none; background: var(--white);
  transition: border-color .18s ease, box-shadow .18s ease;
}
.chat-input input[type=text]:focus { border-color: var(--burgundy-100); box-shadow: 0 0 0 4px rgba(101,5,31,.08); }
.send-btn {
  width: 42px; height: 42px; border-radius: 14px; flex: 0 0 auto;
  background: var(--burgundy); color: #fff;
  display: grid; place-items: center;
  transition: background .16s ease, transform .16s ease;
}
.send-btn:hover { background: var(--burgundy-deep); transform: translateY(-1px); }
.send-btn:disabled { opacity: .55; transform: none; cursor: wait; }
.chat-attach {
  width: 42px; height: 42px; border-radius: 14px; flex: 0 0 auto;
  color: var(--ink-soft); background: var(--white); border: 1px solid var(--line);
  display: grid; place-items: center; cursor: pointer;
  transition: all .16s ease;
}
.chat-attach:hover { color: var(--burgundy); border-color: var(--burgundy-100); }

/* --- Photo grid --- */
.photo-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 720px) { .photo-grid { grid-template-columns: repeat(3, 1fr); } }
.photo-card {
  background: var(--white);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease;
  position: relative;
}
.photo-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-card-hover); }
.photo-card .ph-img { aspect-ratio: 4/3; overflow: hidden; background: var(--blush); display: block; }
.photo-card .ph-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.photo-card:hover .ph-img img { transform: scale(1.045); }
.photo-card .ph-body { padding: 10px 12px 11px; }
.photo-card .ph-cap { font-weight: 700; font-size: 13px; }
.photo-card .ph-meta { color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.photo-card .ph-menu { position: absolute; top: 9px; right: 9px; width: 32px; height: 32px; border-radius: 10px; background: rgba(255,253,248,.94); color: var(--ink-soft); display: grid; place-items: center; box-shadow: 0 3px 8px rgba(43,29,34,.16); }

.photo-strip { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: none; }
.photo-strip::-webkit-scrollbar { display: none; }
.photo-strip .photo-card { flex: 0 0 150px; }

/* --- Add photo tile --- */
.add-photo-tile {
  aspect-ratio: 4/3; border-radius: var(--radius-md);
  border: 1.5px dashed #dcc4b4;
  background: var(--ivory);
  display: flex; flex-direction: column; gap: 7px; align-items: center; justify-content: center;
  color: var(--burgundy); font-weight: 600; font-size: 13px;
  cursor: pointer; transition: all .18s ease;
  position: relative;
}
.add-photo-tile:hover { background: var(--blush); border-color: var(--burgundy-100); }
.add-photo-tile input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.add-photo-tile.loading::after {
  content: ""; width: 22px; height: 22px; border-radius: 50%;
  border: 2.5px solid var(--burgundy-soft); border-top-color: var(--burgundy);
  animation: spin .8s linear infinite; position: absolute;
}
.add-photo-tile.loading .tile-content { opacity: .3; }

@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2.5px solid rgba(255,255,255,.35); border-top-color: #fff;
  animation: spin .8s linear infinite; display: inline-block; vertical-align: -4px;
}
.spinner.dark { border-color: rgba(101,5,31,.2); border-top-color: var(--burgundy); }

/* --- Menu list (More / Settings) --- */
.menu-list { display: flex; flex-direction: column; gap: 10px; }
.menu-group-label { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; margin: 8px 4px -2px; }
.menu-item {
  display: flex; align-items: center; gap: 14px;
  background: var(--white); border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  box-shadow: 0 2px 8px rgba(101,5,31,.04);
  padding: 14.5px 16px;
  color: var(--ink);
  transition: transform .16s ease, box-shadow .16s ease;
}
.menu-item:hover { transform: translateY(-1px); box-shadow: var(--shadow-card-hover); }
.menu-item .mi-icon {
  width: 40px; height: 40px; border-radius: 13px; flex: 0 0 auto;
  background: var(--blush); color: var(--burgundy);
  display: grid; place-items: center;
}
.menu-item .mi-icon.green { background: var(--success-bg); color: var(--success); }
.menu-item .mi-icon.amber { background: var(--warning-bg); color: var(--warning); }
.menu-item .mi-icon.red { background: var(--danger-bg); color: var(--danger); }
.menu-item .mi-icon.grey { background: #f0eae4; color: var(--ink-soft); }
.menu-item .mi-body { flex: 1; min-width: 0; }
.menu-item .mi-title { font-weight: 600; font-size: 14.5px; }
.menu-item .mi-sub { color: var(--muted); font-size: 12px; margin-top: 1px; }
.menu-item .mi-chevron { color: #cbb7aa; }
.menu-item.danger .mi-title { color: var(--danger); }

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: var(--radius-md);
  padding: 12px 22px;
  font-weight: 600; font-size: 14.5px;
  transition: all .18s ease;
  border: 1px solid transparent;
  position: relative;
}
.btn:disabled, .btn[disabled] { opacity: .6; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(140deg, var(--burgundy) 0%, var(--burgundy-deep) 115%);
  color: #fff;
  box-shadow: 0 8px 20px rgba(101, 5, 31, .28);
}
.btn-primary:hover:not(:disabled) { box-shadow: 0 12px 26px rgba(101,5,31,.34); transform: translateY(-1px); }
.btn-light {
  background: var(--white); color: var(--ink);
  border-color: var(--line);
  box-shadow: 0 2px 8px rgba(43,29,34,.05);
}
.btn-light:hover:not(:disabled) { border-color: #d8c2b4; background: var(--ivory); }
.btn-outline {
  background: transparent; color: var(--burgundy);
  border: 1.5px solid var(--burgundy-100);
}
.btn-outline:hover:not(:disabled) { background: var(--burgundy-soft); }
.btn-ghost { background: transparent; color: var(--ink-soft); }
.btn-ghost:hover:not(:disabled) { background: var(--blush); color: var(--burgundy); }
.btn-danger { background: var(--danger); color: #fff; box-shadow: 0 8px 20px rgba(194,58,40,.25); }
.btn-danger:hover:not(:disabled) { background: #a93021; }
.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: 11px; }
.btn-block { width: 100%; }

.fab {
  position: fixed; right: 18px; bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  width: 56px; height: 56px; border-radius: 19px;
  background: linear-gradient(140deg, var(--burgundy) 0%, var(--burgundy-deep) 100%);
  color: #fff; display: grid; place-items: center;
  box-shadow: 0 12px 26px rgba(101,5,31,.4);
  z-index: 50;
  transition: transform .18s ease;
}
@media (min-width: 1024px) { .fab { display: none; } }
.fab:hover { transform: translateY(-3px) rotate(90deg); }

/* --- Form fields --- */
.field { margin-bottom: 15px; }
.field label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--ink-soft); margin-bottom: 7px;
}
.field label .req { color: var(--danger); }
.input, .select, .textarea {
  width: 100%;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 14.5px;
  color: var(--ink);
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--burgundy-100);
  box-shadow: 0 0 0 4px rgba(101,5,31,.08);
}
.input::placeholder, .textarea::placeholder { color: #b3a49d; }
.textarea { min-height: 104px; resize: vertical; line-height: 1.5; }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238d7a81' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  padding-right: 40px;
  cursor: pointer;
}
.input-icon-wrap { position: relative; }
.input-icon-wrap .i-icon {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  color: var(--muted); pointer-events: none;
}
.input-icon-wrap .input { padding-left: 40px; }
.input-icon-wrap .i-right {
  position: absolute; right: 11px; top: 50%; transform: translateY(-50%);
  color: var(--muted); cursor: pointer; background: none; padding: 4px; border-radius: 7px;
}
.field-error { color: var(--danger); font-size: 12.5px; margin-top: 6px; display: flex; align-items: center; gap: 5px; }
.field-hint { color: var(--muted); font-size: 12px; margin-top: 6px; }
.form-grid { display: grid; gap: 0 16px; grid-template-columns: 1fr 1fr; }
@media (max-width: 620px) { .form-grid { grid-template-columns: 1fr; } }

.checkbox-row { display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--ink-soft); cursor: pointer; }
.checkbox-row input { width: 17px; height: 17px; accent-color: var(--burgundy); cursor: pointer; }

.segment {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  background: #f1e8de; border-radius: var(--radius-sm); padding: 4px;
}
.segment button {
  padding: 9px; border-radius: 8px; font-weight: 600; font-size: 13px;
  color: var(--ink-soft); transition: all .16s ease;
}
.segment button.active { background: var(--white); color: var(--burgundy); box-shadow: 0 2px 6px rgba(43,29,34,.08); }

/* --- Attachments strip (task details) --- */
.attach-strip { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.attach-strip::-webkit-scrollbar { display: none; }
.attach-thumb {
  flex: 0 0 86px; height: 86px; border-radius: var(--radius-md);
  overflow: hidden; background: var(--blush);
  border: 1px solid var(--line-soft);
}
.attach-thumb img { width: 100%; height: 100%; object-fit: cover; }
.attach-thumb.doc {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  background: var(--ivory); color: var(--ink-soft); font-size: 10px; font-weight: 700; text-align: center; padding: 6px;
}
.attach-thumb.doc .ext { background: var(--burgundy-soft); color: var(--burgundy); border-radius: 6px; padding: 1px 7px; font-size: 10.5px; }

/* --- Map panel --- */
.map-panel {
  position: relative; border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid var(--line-soft); box-shadow: var(--shadow-card);
  background: #eef1e9;
}
.map-panel .map-canvas { display: block; width: 100%; height: 210px; }
.map-open-btn {
  position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%);
  background: var(--white); color: var(--ink);
  border-radius: 99px; box-shadow: var(--shadow-float);
  padding: 11px 19px; font-weight: 600; font-size: 13px;
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line);
  transition: transform .16s ease, box-shadow .16s ease;
  white-space: nowrap;
}
.map-open-btn:hover { transform: translateX(-50%) translateY(-2px); box-shadow: 0 14px 34px rgba(43,29,34,.22); }

/* --- Empty state --- */
.empty-state {
  text-align: center; padding: 46px 22px 42px;
  background: var(--white); border: 1.5px dashed #e6d7ca;
  border-radius: var(--radius-lg); color: var(--ink-soft);
}
.empty-state .es-icon {
  width: 62px; height: 62px; margin: 0 auto 14px; border-radius: 20px;
  background: var(--blush); color: var(--burgundy);
  display: grid; place-items: center;
}
.empty-state h3 { font-size: 17px; }
.empty-state p { color: var(--muted); font-size: 13px; margin: 5px 0 0; }

/* --- Toast --- */
.toast-wrap {
  position: fixed; bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  left: 50%; transform: translateX(-50%);
  z-index: 200; display: flex; flex-direction: column; gap: 8px;
  width: min(92vw, 420px);
  pointer-events: none;
}
@media (min-width: 1024px) { .toast-wrap { bottom: 26px; } }
.toast {
  background: #2b1d22; color: #fff;
  border-radius: 13px; padding: 13px 17px;
  font-size: 13.5px; font-weight: 500;
  box-shadow: var(--shadow-float);
  display: flex; align-items: center; gap: 10px;
  animation: toast-in .28s cubic-bezier(.21,1.02,.73,1);
  pointer-events: auto;
}
.toast.t-success svg { color: #7fd4a6; }
.toast.t-error svg { color: #ff9f8a; }
.toast.t-info svg { color: #e6b8c4; }
.toast.hide { animation: toast-out .25s ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(10px); } }

/* --- Modal --- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 150;
  background: rgba(43, 29, 34, .5);
  backdrop-filter: blur(3px);
  display: none; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; animation: fade-in .2s ease; }
.modal {
  background: var(--ivory);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-float);
  width: min(94vw, 440px);
  max-height: 86vh; overflow-y: auto;
  padding: 24px;
  animation: modal-in .25s cubic-bezier(.21,1.02,.73,1);
}
@keyframes fade-in { from { opacity: 0; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(16px) scale(.98); } }

/* --- Skeleton loading --- */
.skeleton { background: #f0e7dd; border-radius: 10px; position: relative; overflow: hidden; }
.skeleton::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.65), transparent);
  animation: shimmer 1.3s infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* --- Pagination --- */
.pager { display: flex; gap: 6px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }
.pager a, .pager span {
  min-width: 36px; height: 36px; padding: 0 10px;
  display: grid; place-items: center;
  border-radius: 11px; font-size: 13.5px; font-weight: 600;
  background: var(--white); border: 1px solid var(--line); color: var(--ink-soft);
}
.pager a:hover { border-color: var(--burgundy-100); color: var(--burgundy); }
.pager .current { background: var(--burgundy); color: #fff; border-color: var(--burgundy); }
.pager .disabled { opacity: .4; pointer-events: none; }

/* --- Tables (reports) --- */
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table th {
  text-align: left; font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--line);
}
.data-table td { padding: 11px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background .14s ease; }
.data-table tbody tr:hover { background: #fdf8f2; }

.table-scroll { overflow-x: auto; border-radius: var(--radius-lg); }

/* --- Circular progress rings (client dashboard) --- */
.ring-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ring-stat {
  background: var(--white); border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-card);
  padding: 16px 12px; text-align: center;
}
.ring { position: relative; width: 84px; height: 84px; margin: 0 auto 9px; }
.ring svg { transform: rotate(-90deg); }
.ring .ring-bg { fill: none; stroke: #f0e6dc; stroke-width: 7; }
.ring .ring-val { fill: none; stroke: var(--burgundy); stroke-width: 7; stroke-linecap: round; transition: stroke-dashoffset .6s ease; }
.ring .ring-num {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--font-display); font-size: 21px; font-weight: 700; color: var(--ink);
}
.ring-stat .rs-label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.ring.green .ring-val { stroke: var(--success); }

/* ============================== Auth screens ============================== */

.auth-page {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column;
  background: #241318;
}

.auth-hero {
  position: relative;
  min-height: 46vh;
  background-size: cover;
  background-position: center;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 26px 26px 88px;
  color: #fff;
}
.auth-hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(24,10,14,.42) 0%, rgba(24,10,14,.12) 40%, rgba(20,8,12,.78) 100%);
}
.auth-hero > * { position: relative; z-index: 2; }
.auth-hero .brand-row { display: flex; align-items: center; gap: 12px; }
.auth-hero .brand-mark {
  width: 46px; height: 46px; border-radius: 14px;
  background: rgba(255,255,255,.14); backdrop-filter: blur(6px);
  display: grid; place-items: center;
  font-family: var(--font-display); font-size: 23px; font-weight: 700;
  border: 1px solid rgba(255,255,255,.25);
}
.auth-hero .hero-text { margin-top: auto; }
.auth-hero .hero-title { font-family: var(--font-display); font-size: clamp(30px, 7.5vw, 46px); font-weight: 700; line-height: 1.08; color: #fff; }
.auth-hero .hero-sub {
  margin-top: 12px; font-size: 11.5px; letter-spacing: .3em; text-transform: uppercase;
  color: rgba(255,255,255,.82); font-weight: 500;
}

.auth-sheet {
  background: var(--cream);
  border-radius: 28px 28px 0 0;
  margin-top: -38px;
  padding: 26px 22px calc(30px + env(safe-area-inset-bottom, 0px));
  position: relative; z-index: 3;
  flex: 1;
  display: flex; flex-direction: column;
}
.auth-card { width: 100%; max-width: 440px; margin: 0 auto; }
.auth-title { font-family: var(--font-display); font-size: 26px; font-weight: 700; }
.auth-sub { color: var(--muted); font-size: 13.5px; margin: 5px 0 22px; }

.auth-cta { display: flex; flex-direction: column; gap: 12px; }
.auth-footer {
  margin-top: 26px; text-align: center; color: var(--muted); font-size: 12.5px;
}
.auth-footer a { color: var(--burgundy); font-weight: 600; }

.auth-error {
  background: var(--danger-bg); color: #8c2a1c;
  border: 1px solid #f3d5cd; border-radius: var(--radius-sm);
  padding: 11px 14px; font-size: 13px; margin-bottom: 16px;
  display: flex; gap: 9px; align-items: flex-start;
}
.auth-success {
  background: var(--success-bg); color: #14603c;
  border: 1px solid #cfe7d7; border-radius: var(--radius-sm);
  padding: 11px 14px; font-size: 13px; margin-bottom: 16px;
  display: flex; gap: 9px; align-items: flex-start;
}

/* Role selection cards */
.role-card {
  display: flex; align-items: center; gap: 15px;
  background: var(--white);
  border: 1.8px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 17px 16px;
  cursor: pointer;
  transition: all .18s ease;
  position: relative;
}
.role-card:hover { border-color: var(--burgundy-100); }
.role-card.selected {
  border-color: var(--burgundy);
  background: #fefaf6;
  box-shadow: 0 10px 24px rgba(101,5,31,.12);
}
.role-card .rc-icon {
  width: 48px; height: 48px; border-radius: 15px;
  background: #f0eae4; color: var(--ink-soft);
  display: grid; place-items: center; flex: 0 0 auto;
  transition: all .18s ease;
}
.role-card.selected .rc-icon { background: var(--burgundy); color: #fff; }
.role-card .rc-body { flex: 1; }
.role-card .rc-title { font-weight: 700; font-size: 15.5px; }
.role-card .rc-desc { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.role-card .rc-check {
  width: 26px; height: 26px; border-radius: 50%;
  border: 1.8px solid #d9c8bb; color: transparent;
  display: grid; place-items: center; flex: 0 0 auto;
  transition: all .18s ease;
}
.role-card.selected .rc-check { background: var(--burgundy); border-color: var(--burgundy); color: #fff; }

/* Desktop split layout */
@media (min-width: 900px) {
  .auth-page { flex-direction: row; }
  .auth-hero { min-height: 100vh; width: 52%; padding: 40px 44px; }
  .auth-sheet {
    margin: 0; border-radius: 0;
    width: 48%; padding: 48px 40px;
    justify-content: center;
    overflow-y: auto;
  }
}

/* Client login hint card */
.client-hint {
  display: flex; gap: 13px; align-items: flex-start;
  background: var(--burgundy-soft);
  border: 1px solid #ecd3da;
  border-radius: var(--radius-md);
  padding: 13px 15px; color: var(--burgundy-deep);
  font-size: 13px; margin-bottom: 18px;
}

/* ============================== Utilities ============================== */

.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.col { display: flex; flex-direction: column; gap: 10px; }
.wrap { flex-wrap: wrap; }
.gap-4 { gap: 4px; } .gap-6 { gap: 6px; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-20 { gap: 20px; }
.mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-20 { margin-top: 20px; } .mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; } .mb-20 { margin-bottom: 20px; }
.grow { flex: 1; min-width: 0; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.full { width: 100%; }
.ellip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.list-stack { display: flex; flex-direction: column; gap: 11px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .grid-2 { grid-template-columns: 1fr; } }

.badge-soft {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--blush); color: var(--burgundy);
  border-radius: 99px; padding: 4px 11px;
  font-size: 11.5px; font-weight: 700;
}
.badge-soft.green { background: var(--success-bg); color: var(--success); }
.badge-soft.grey { background: #f0eae4; color: var(--ink-soft); }
.badge-soft.amber { background: var(--warning-bg); color: var(--warning); }

.kbd {
  font-family: ui-monospace, monospace; font-size: 11px;
  background: #f0eae4; border: 1px solid var(--line);
  border-radius: 6px; padding: 1px 7px; color: var(--ink-soft);
}

.page-loader { padding: 30px 0; display: flex; justify-content: center; color: var(--muted); }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  clip: rect(0 0 0 0); overflow: hidden; white-space: nowrap; border: 0; padding: 0;
}

.footer-note { text-align: center; color: var(--muted); font-size: 12px; padding: 24px 0 6px; }

.avatar-stack { display: flex; }
.avatar-stack .avatar { margin-left: -9px; border: 2.5px solid var(--cream); }
.avatar-stack .avatar:first-child { margin-left: 0; }

/* --- Dropdown menus (three-dot overflow) --- */
.menu-anchor { position: relative; }
.dropdown-menu {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 120;
  background: var(--ivory); border: 1px solid var(--line-soft);
  border-radius: 14px; box-shadow: var(--shadow-float);
  min-width: 180px; padding: 6px;
  display: none;
}
.dropdown-menu.open { display: block; animation: fade-in .16s ease; }
.dropdown-menu a, .dropdown-menu button {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 10px 12px; border-radius: 10px;
  font-size: 13.5px; font-weight: 500; color: var(--ink-soft);
  text-align: left;
}
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--blush); color: var(--burgundy); }
.dropdown-menu .danger { color: var(--danger); }
.dropdown-menu .danger:hover { background: var(--danger-bg); color: var(--danger); }

.topbar.scrolled { box-shadow: 0 8px 22px rgba(101,5,31,.07); }
.msg.in .avatar { margin-bottom: 18px; }

/* --- Report metric tiles --- */
.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.metric-tile {
  background: var(--white); border: 1px solid var(--line-soft);
  border-radius: var(--radius-md); box-shadow: var(--shadow-card);
  padding: 15px 16px;
}
.metric-tile .m-value { font-family: var(--font-display); font-size: 24px; font-weight: 700; color: var(--ink); }
.metric-tile .m-label { font-size: 12px; color: var(--muted); margin-top: 2px; }
.metric-tile .m-value.green { color: var(--success); }
.metric-tile .m-value.red { color: var(--danger); }
.metric-tile .m-value.burg { color: var(--burgundy); }

/* --- client "read only" banner tag --- */
.readonly-tag {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--burgundy-soft); color: var(--burgundy-deep);
  border: 1px solid #ecd3da; border-radius: 99px;
  padding: 4px 12px; font-size: 11.5px; font-weight: 700;
}

/* --- bar chart (reports, pure CSS) --- */
.bar-chart { display: flex; align-items: flex-end; gap: 10px; height: 160px; padding: 8px 4px 0; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; min-width: 0; }
.bar-col .bar {
  width: 100%; max-width: 46px; border-radius: 9px 9px 3px 3px;
  background: linear-gradient(180deg, var(--burgundy-100), var(--burgundy));
  min-height: 5px;
}
.bar-col .bar.green { background: linear-gradient(180deg, #3d9a6b, var(--success)); }
.bar-col .bar.red { background: linear-gradient(180deg, #d76a55, var(--danger)); }
.bar-col .bar-lbl { font-size: 10.5px; color: var(--muted); font-weight: 600; text-align: center; }
.bar-col .bar-val { font-size: 11.5px; color: var(--ink-soft); font-weight: 700; }

/* Buttons placed inside section heads keep their own colours
   (.see-all alone would override btn-primary text to burgundy). */
.section-head .see-all.btn-primary { color: #fff; }
.section-head .see-all.btn-light { color: var(--ink); }
.section-head .see-all.btn-outline { color: var(--burgundy); }
.section-head .see-all.btn-ghost { color: var(--ink-soft); }
