/* ============================================================
   DOMIQ — APPLICATION DESIGN SYSTEM
   Tokens & primitives lifted verbatim from the hi-fi wireframe
   (source of truth), extended with product/app-shell components.
   ============================================================ */
:root {
  /* Brand palette */
  --graphite: #2F2F2F;
  --graphite-soft: #3D3D3D;
  --graphite-deep: #1F1F1F;
  --sand: #D8CBB8;
  --sand-light: #EFE8DD;
  --sand-lighter: #F4EFE7;
  --sand-deep: #B8A88E;
  --off-white: #F7F5F2;
  --white: #FFFFFF;
  --sage: #7E8772;
  --sage-light: #A8B19E;
  --sage-deep: #5E6555;

  /* Functional */
  --text: #2F2F2F;
  --text-2: #4A4A4A;
  --text-3: #7A7A7A;
  --text-4: #A5A29C;
  --border: #E8E2D8;
  --border-strong: #D5CCBE;

  /* Status accents — muted, palette-harmonised */
  --clay: #B0735A;          /* attention / pending */
  --clay-bg: #F3E6DE;
  --gold: #B89150;          /* finalised / PDF accent */
  --gold-bg: #F2E9D5;
  --slate: #6E7E8C;         /* under review / info */
  --slate-bg: #E7ECEF;
  --rose: #A65A5A;          /* errors / closed */
  --rose-bg: #F2E2E2;
  --positive: var(--sage);
  --positive-bg: #E7EAE2;

  /* Radii */
  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  /* Shadows — warm and subtle */
  --shadow-xs: 0 1px 2px rgba(47,47,47,0.04);
  --shadow-sm: 0 2px 6px rgba(47,47,47,0.05), 0 1px 2px rgba(47,47,47,0.04);
  --shadow-md: 0 8px 24px rgba(47,47,47,0.06), 0 2px 6px rgba(47,47,47,0.04);
  --shadow-lg: 0 20px 50px rgba(47,47,47,0.10), 0 6px 18px rgba(47,47,47,0.06);

  /* Layout */
  --sidebar-w: 264px;
  --topbar-h: 70px;

  /* Typography */
  --font-serif: 'Fraunces', 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-sans: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;

  /* Easing */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ============================================================ RESET */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.6;
  background: var(--off-white);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv11";
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
:focus-visible { outline: 2px solid var(--sage); outline-offset: 2px; border-radius: 4px; }

/* ============================================================ TYPE */
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  text-transform: uppercase; letter-spacing: 0.18em;
  font-size: 11px; font-weight: 600; color: var(--sage-deep); margin: 0 0 18px;
}
.eyebrow::before { content: ""; width: 28px; height: 1px; background: var(--sage); }
.eyebrow.no-line::before { display: none; }
.eyebrow.gold { color: var(--gold); } .eyebrow.gold::before { background: var(--gold); }
.eyebrow.light { color: rgba(255,255,255,0.7); } .eyebrow.light::before { background: rgba(216,203,184,0.6); }

.display {
  font-family: var(--font-serif); font-weight: 400;
  font-size: clamp(40px, 5.4vw, 68px); line-height: 1.03;
  letter-spacing: -0.025em; margin: 0 0 22px;
  font-variation-settings: "opsz" 144, "SOFT" 50;
}
.display em { font-style: italic; font-weight: 300; color: var(--sage-deep); }
.h1 { font-family: var(--font-serif); font-weight: 400; font-size: clamp(30px, 3.4vw, 44px); line-height: 1.08; letter-spacing: -0.02em; margin: 0 0 16px; font-variation-settings: "opsz" 96; }
.h1 em { font-style: italic; font-weight: 300; color: var(--sage-deep); }
.h2 { font-family: var(--font-serif); font-weight: 400; font-size: clamp(26px, 2.6vw, 34px); line-height: 1.15; letter-spacing: -0.018em; margin: 0 0 14px; }
.h2 em { font-style: italic; font-weight: 300; color: var(--sage-deep); }
.h3 { font-family: var(--font-serif); font-weight: 500; font-size: 22px; line-height: 1.25; letter-spacing: -0.012em; margin: 0 0 10px; }
.h4 { font-family: var(--font-sans); font-weight: 600; font-size: 17px; line-height: 1.35; letter-spacing: -0.005em; margin: 0 0 8px; color: var(--graphite); }
.lead { font-size: 18px; line-height: 1.6; color: var(--text-2); margin: 0 0 28px; }
.body-lg { font-size: 17px; line-height: 1.65; color: var(--text-2); }
.body { font-size: 15px; line-height: 1.65; color: var(--text-2); }
.small { font-size: 13.5px; line-height: 1.55; color: var(--text-3); }
.tiny  { font-size: 12px; line-height: 1.5; color: var(--text-3); }
.muted { color: var(--text-3); }
.serif-n { font-family: var(--font-serif); font-weight: 400; letter-spacing: -0.02em; }
.serif-n em { font-style: italic; color: var(--sage-deep); }

/* ============================================================ BUTTONS */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 13px 24px; border-radius: 999px;
  font-size: 14.5px; font-weight: 600; letter-spacing: 0.01em; line-height: 1;
  transition: transform .25s var(--ease), background .25s var(--ease), border-color .25s var(--ease), color .25s var(--ease), box-shadow .25s var(--ease);
  white-space: nowrap; cursor: pointer; border: 1px solid transparent;
}
.btn-primary { background: var(--graphite); color: var(--white); }
.btn-primary:hover { background: var(--graphite-deep); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-secondary { background: var(--white); color: var(--graphite); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--sand-lighter); border-color: var(--sand-deep); }
.btn-sand { background: var(--sand); color: var(--graphite); }
.btn-sand:hover { background: var(--sand-deep); color: var(--white); transform: translateY(-1px); }
.btn-sage { background: var(--sage); color: var(--white); }
.btn-sage:hover { background: var(--sage-deep); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-ghost { background: transparent; color: var(--graphite); padding: 12px 6px; }
.btn-ghost:hover { color: var(--sage-deep); }
.btn-ghost .arrow { transition: transform .3s var(--ease); display: inline-block; }
.btn-ghost:hover .arrow { transform: translateX(5px); }
.btn-danger { background: var(--white); color: var(--rose); border-color: var(--rose-bg); }
.btn-danger:hover { background: var(--rose-bg); }
.btn-outline-light { background: transparent; color: var(--white); border-color: rgba(255,255,255,0.28); }
.btn-outline-light:hover { border-color: var(--sand); background: rgba(255,255,255,0.06); }
.btn-lg { padding: 16px 30px; font-size: 15px; }
.btn-sm { padding: 9px 16px; font-size: 13px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn .ic { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }

/* ============================================================ ICONS */
.ic { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* ============================================================ BADGES */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px 5px 10px; border-radius: 999px;
  background: var(--sand-lighter); color: var(--sage-deep);
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
}
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge.neutral { background: var(--sand-lighter); color: var(--text-3); }
.badge.positive { background: var(--positive-bg); color: var(--sage-deep); }
.badge.sage { background: var(--positive-bg); color: var(--sage-deep); }
.badge.clay { background: var(--clay-bg); color: var(--clay); }
.badge.gold { background: var(--gold-bg); color: var(--gold); }
.badge.slate { background: var(--slate-bg); color: var(--slate); }
.badge.rose { background: var(--rose-bg); color: var(--rose); }
.badge.dark { background: rgba(255,255,255,0.08); color: var(--sand); }
.badge.solid { background: var(--graphite); color: var(--sand); }
.badge.lg { font-size: 12px; padding: 6px 14px 6px 12px; }

.tag-list { display: flex; gap: 8px; flex-wrap: wrap; }
.tag { padding: 5px 13px; border: 1px solid var(--border-strong); border-radius: 999px; font-size: 12.5px; color: var(--text-2); background: var(--white); }
.tag.active { background: var(--graphite); color: var(--white); border-color: var(--graphite); }

/* ============================================================ CARDS */
.card {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 28px; transition: border-color .3s var(--ease), box-shadow .3s var(--ease), transform .3s var(--ease);
}
.card.hover:hover { border-color: var(--sand-deep); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card.flat { background: transparent; border: none; padding: 0; }
.card.pad-lg { padding: 36px; }
.card.pad-sm { padding: 20px; }
.card .ic-box { width: 48px; height: 48px; border-radius: 13px; background: var(--sand-lighter); display: grid; place-items: center; color: var(--sage-deep); }

/* ============================================================ FORMS */
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 18px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 13px; font-weight: 600; color: var(--graphite); letter-spacing: 0.01em; }
.field .hint { font-size: 12px; color: var(--text-3); font-weight: 400; }
.field input, .field select, .field textarea {
  padding: 13px 15px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--off-white); font-family: var(--font-sans); font-size: 15px; color: var(--graphite);
  transition: border-color .2s, background .2s, box-shadow .2s; appearance: none; width: 100%;
}
.field textarea { resize: vertical; min-height: 110px; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--sage); background: var(--white); box-shadow: 0 0 0 4px rgba(126,135,114,0.12);
}
.field input::placeholder, .field textarea::placeholder { color: var(--text-4); }
.field select { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='none' stroke='%237A7A7A' stroke-width='1.5' d='M1 1l5 5 5-5'/></svg>"); background-repeat: no-repeat; background-position: right 15px center; padding-right: 40px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.field.error input, .field.error select { border-color: var(--rose); background: var(--rose-bg); }
.field .err-msg { font-size: 12px; color: var(--rose); font-weight: 500; }

.checkbox-row { display: flex; gap: 10px; align-items: flex-start; }
.checkbox-row input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--sage); flex-shrink: 0; }
.checkbox-row label { font-size: 13.5px; color: var(--text-2); font-weight: 400; line-height: 1.5; }

/* Toggle switch */
.switch { position: relative; width: 44px; height: 26px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track { position: absolute; inset: 0; background: var(--border-strong); border-radius: 999px; transition: background .25s; }
.switch .track::before { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; background: var(--white); border-radius: 50%; transition: transform .25s var(--ease); box-shadow: var(--shadow-xs); }
.switch input:checked + .track { background: var(--sage); }
.switch input:checked + .track::before { transform: translateX(18px); }

/* Segmented control */
.segmented { display: inline-flex; background: var(--sand-lighter); border: 1px solid var(--border); border-radius: 999px; padding: 4px; gap: 2px; }
.segmented button { padding: 8px 18px; border-radius: 999px; font-size: 13.5px; font-weight: 600; color: var(--text-3); transition: all .2s; }
.segmented button.active { background: var(--white); color: var(--graphite); box-shadow: var(--shadow-xs); }

/* ============================================================ AUTH SHELL */
.auth { display: grid; grid-template-columns: 1.05fr 1fr; min-height: 100vh; }
.auth-brand {
  background: var(--graphite); color: var(--white); position: relative; overflow: hidden;
  padding: 56px 64px; display: flex; flex-direction: column; justify-content: space-between;
}
.auth-brand::after { content: ""; position: absolute; right: -120px; bottom: -120px; width: 420px; height: 420px; border-radius: 50%; background: radial-gradient(circle, rgba(216,203,184,0.16), transparent 68%); }
.auth-brand img.logo { height: 58px; width: auto; align-self: flex-start; flex: none; background: #fff; padding: 13px 18px; border-radius: 16px; box-shadow: var(--shadow-md); }
.auth-brand .quote { position: relative; z-index: 1; max-width: 460px; }
.auth-brand .quote .h1 { color: var(--white); }
.auth-brand .quote .h1 em { color: var(--sand); }
.auth-brand .figure { position: relative; z-index: 1; border-radius: var(--radius-xl); overflow: hidden; aspect-ratio: 16/10; margin-top: 8px; box-shadow: var(--shadow-lg); }
.auth-brand .figure img { width: 100%; height: 100%; object-fit: cover; }
.auth-brand .testi { display: flex; gap: 14px; align-items: center; position: relative; z-index: 1; }
.auth-brand .testi .av { width: 46px; height: 46px; border-radius: 50%; background: var(--sand); color: var(--graphite); display: grid; place-items: center; font-weight: 700; flex-shrink: 0; }
.auth-form-wrap { display: flex; align-items: center; justify-content: center; padding: 48px; background: var(--off-white); }
.auth-card { width: 100%; max-width: 420px; }
.auth-card .top-logo { display: none; }
.auth-switch { font-size: 14px; color: var(--text-3); margin-top: 22px; text-align: center; }
.auth-switch a { color: var(--sage-deep); font-weight: 600; }
.divider-or { display: flex; align-items: center; gap: 14px; color: var(--text-4); font-size: 12.5px; margin: 22px 0; }
.divider-or::before, .divider-or::after { content: ""; height: 1px; background: var(--border); flex: 1; }
.oauth-btn { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 12px; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--white); font-size: 14px; font-weight: 600; transition: background .2s, border-color .2s; }
.oauth-btn:hover { background: var(--sand-lighter); border-color: var(--sand-deep); }
.input-affix { position: relative; }
.input-affix .toggle-eye { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--text-3); cursor: pointer; }
.pw-meter { height: 5px; border-radius: 999px; background: var(--border); margin-top: 8px; overflow: hidden; }
.pw-meter i { display: block; height: 100%; width: 0; border-radius: 999px; transition: width .3s var(--ease), background .3s; }

/* ============================================================ APP SHELL */
.app { display: none; min-height: 100vh; }
.scrim-mob { display: none; }
.app.active { display: grid; grid-template-columns: var(--sidebar-w) 1fr; }
.sidebar {
  background: var(--white); border-right: 1px solid var(--border);
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  padding: 22px 16px; overflow-y: auto;
}
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 22px; }
.sidebar .brand img { height: 42px; width: auto; }
.sidebar .nav-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.16em; color: var(--text-4); font-weight: 700; padding: 18px 12px 8px; }
.nav-link {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 11px;
  font-size: 14.5px; font-weight: 500; color: var(--graphite-soft); transition: background .2s, color .2s; cursor: pointer; position: relative;
}
.nav-link .ic { width: 19px; height: 19px; opacity: 0.75; }
.nav-link:hover { background: var(--sand-lighter); color: var(--graphite); }
.nav-link.active { background: var(--sand-lighter); color: var(--sage-deep); font-weight: 600; }
.nav-link.active .ic { opacity: 1; color: var(--sage-deep); }
.nav-link.active::before { content: ""; position: absolute; left: -16px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--sage); }
.nav-link .count { margin-left: auto; background: var(--clay-bg); color: var(--clay); font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px; }
.sidebar .spacer { flex: 1; }
.side-user { display: flex; align-items: center; gap: 11px; padding: 12px; border-radius: 13px; background: var(--sand-lighter); margin-top: 12px; }
.side-user .av { width: 38px; height: 38px; border-radius: 50%; background: var(--sage); color: var(--white); display: grid; place-items: center; font-weight: 700; font-size: 14px; flex-shrink: 0; }
.side-user .meta { min-width: 0; }
.side-user .meta .nm { font-size: 13.5px; font-weight: 600; color: var(--graphite); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user .meta .em { font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: var(--topbar-h); position: sticky; top: 0; z-index: 40;
  background: rgba(247,245,242,0.9); backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 18px; padding: 0 30px;
}
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-3); }
.crumbs .sep { color: var(--text-4); }
.crumbs .cur { color: var(--graphite); font-weight: 600; }
.topbar .search { margin-left: 8px; flex: 1; max-width: 360px; position: relative; }
.topbar .search input { width: 100%; padding: 9px 14px 9px 38px; border-radius: 999px; border: 1px solid var(--border); background: var(--white); font-size: 13.5px; }
.topbar .search .ic { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text-3); width: 16px; height: 16px; }
.topbar .actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.icon-btn { width: 40px; height: 40px; border-radius: 11px; border: 1px solid var(--border); background: var(--white); display: grid; place-items: center; color: var(--graphite-soft); transition: background .2s, border-color .2s; position: relative; }
.icon-btn:hover { background: var(--sand-lighter); border-color: var(--sand-deep); }
.icon-btn .dot { position: absolute; top: 9px; right: 10px; width: 7px; height: 7px; border-radius: 50%; background: var(--clay); border: 1.5px solid var(--white); }
.top-av { width: 40px; height: 40px; border-radius: 50%; background: var(--sage); color: var(--white); display: grid; place-items: center; font-weight: 700; font-size: 14px; cursor: pointer; }

.content { padding: 34px 40px 80px; max-width: 1280px; width: 100%; margin: 0 auto; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 30px; flex-wrap: wrap; }
.page-head .ttl { display: flex; flex-direction: column; gap: 6px; }
.page-head .actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* screens */
.screen { display: none; animation: fadeUp .4s var(--ease); }
.screen.active { display: block; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ============================================================ GRID HELPERS */
.grid { display: grid; gap: 22px; }
.g2 { grid-template-columns: repeat(2,1fr); }
.g3 { grid-template-columns: repeat(3,1fr); }
.g4 { grid-template-columns: repeat(4,1fr); }
.row { display: flex; gap: 16px; }
.between { justify-content: space-between; }
.center-y { align-items: center; }
.wrap { flex-wrap: wrap; }
.gap-sm { gap: 8px; }
.mt-sm { margin-top: 12px; } .mt { margin-top: 22px; } .mt-lg { margin-top: 36px; }
.mb-sm { margin-bottom: 12px; } .mb { margin-bottom: 22px; }

/* ============================================================ STAT CARDS */
.stat { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.stat .top { display: flex; align-items: center; justify-content: space-between; }
.stat .ic-box { width: 44px; height: 44px; border-radius: 12px; background: var(--sand-lighter); display: grid; place-items: center; color: var(--sage-deep); }
.stat .n { font-family: var(--font-serif); font-size: 38px; line-height: 1; letter-spacing: -0.02em; color: var(--graphite); }
.stat .l { font-size: 13px; color: var(--text-3); font-weight: 500; }
.stat .delta { font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.stat .delta.up { color: var(--sage-deep); } .stat .delta.down { color: var(--rose); }

/* ============================================================ PROJECT CARDS */
.proj-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; transition: border-color .3s, box-shadow .3s, transform .3s; cursor: pointer; display: flex; flex-direction: column; }
.proj-card:hover { border-color: var(--sand-deep); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.proj-card .thumb { aspect-ratio: 16/9; background: var(--sand-light); position: relative; overflow: hidden; }
.proj-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.proj-card:hover .thumb img { transform: scale(1.04); }
.proj-card .thumb .badge { position: absolute; top: 12px; left: 12px; background: rgba(255,255,255,0.94); backdrop-filter: blur(4px); }
.proj-card .body { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.proj-card .ptype { font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-4); font-weight: 700; }
.proj-card .meta-row { display: flex; gap: 16px; font-size: 12.5px; color: var(--text-3); margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border); }
.proj-card .meta-row span { display: inline-flex; align-items: center; gap: 5px; }

/* progress steps */
.steps { display: flex; align-items: center; gap: 0; margin: 8px 0 28px; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: 10px; }
.step .dot { width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--border-strong); display: grid; place-items: center; font-size: 13px; font-weight: 700; color: var(--text-4); background: var(--white); flex-shrink: 0; transition: all .3s; }
.step .lbl { font-size: 13px; font-weight: 600; color: var(--text-3); white-space: nowrap; }
.step.done .dot { background: var(--sage); border-color: var(--sage); color: var(--white); }
.step.done .lbl { color: var(--sage-deep); }
.step.current .dot { border-color: var(--graphite); color: var(--graphite); background: var(--sand-lighter); }
.step.current .lbl { color: var(--graphite); }
.step .bar { width: 38px; height: 1.5px; background: var(--border-strong); margin: 0 12px; }
.step.done .bar { background: var(--sage); }

/* workspace sub-nav (tabs) */
.wtabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 28px; overflow-x: auto; }
.wtab { padding: 13px 16px; font-size: 14px; font-weight: 600; color: var(--text-3); border-bottom: 2px solid transparent; transition: color .2s, border-color .2s; white-space: nowrap; cursor: pointer; }
.wtab:hover { color: var(--graphite); }
.wtab.active { color: var(--sage-deep); border-bottom-color: var(--sage); }
.wtab .num { font-size: 11px; background: var(--sand-lighter); color: var(--text-3); padding: 1px 7px; border-radius: 999px; margin-left: 6px; }

/* room cards */
.room-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; display: flex; align-items: center; gap: 16px; transition: border-color .25s, box-shadow .25s; }
.room-card:hover { border-color: var(--sand-deep); box-shadow: var(--shadow-sm); }
.room-card .ric { width: 46px; height: 46px; border-radius: 12px; background: var(--sand-lighter); display: grid; place-items: center; color: var(--sage-deep); flex-shrink: 0; }
.room-card .info { flex: 1; min-width: 0; }
.room-card .info .nm { font-weight: 600; font-size: 15px; color: var(--graphite); }
.room-card .info .sub { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }

/* style select cards */
.style-card { border: 1.5px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; cursor: pointer; transition: border-color .25s, box-shadow .25s, transform .25s; background: var(--white); position: relative; }
.style-card:hover { border-color: var(--sand-deep); box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.style-card.selected { border-color: var(--sage); box-shadow: 0 0 0 3px rgba(126,135,114,0.16); }
.style-card .pic { aspect-ratio: 4/3; background: var(--sand-light); overflow: hidden; }
.style-card .pic img { width: 100%; height: 100%; object-fit: cover; }
.style-card .cap { padding: 14px 16px; }
.style-card .cap .nm { font-family: var(--font-serif); font-size: 18px; color: var(--graphite); }
.style-card .cap .de { font-size: 12.5px; color: var(--text-3); margin-top: 3px; }
.style-card .check { position: absolute; top: 12px; right: 12px; width: 26px; height: 26px; border-radius: 50%; background: var(--sage); color: #fff; display: grid; place-items: center; opacity: 0; transform: scale(0.6); transition: all .25s var(--ease); }
.style-card.selected .check { opacity: 1; transform: scale(1); }

/* AI generation */
.ai-stage { background: var(--graphite); border-radius: var(--radius-xl); padding: 48px; color: #fff; text-align: center; position: relative; overflow: hidden; }
.ai-stage::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 30% 20%, rgba(216,203,184,0.12), transparent 55%); }
.ai-stage .inner { position: relative; z-index: 1; max-width: 460px; margin: 0 auto; }
.ai-orb { width: 76px; height: 76px; border-radius: 50%; margin: 0 auto 22px; background: conic-gradient(from 0deg, var(--sand), var(--sage-light), var(--sand-deep), var(--sand)); display: grid; place-items: center; animation: spin 3.4s linear infinite; }
.ai-orb .core { width: 58px; height: 58px; border-radius: 50%; background: var(--graphite); display: grid; place-items: center; color: var(--sand); }
@keyframes spin { to { transform: rotate(360deg); } }
.ai-progress { height: 6px; border-radius: 999px; background: rgba(255,255,255,0.14); overflow: hidden; margin: 24px 0 10px; }
.ai-progress i { display: block; height: 100%; width: 0; background: var(--sand); border-radius: 999px; transition: width .4s var(--ease); }
.gen-tile { aspect-ratio: 1/1; border-radius: var(--radius-lg); overflow: hidden; position: relative; background: var(--sand-light); cursor: pointer; }
.gen-tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.gen-tile:hover img { transform: scale(1.05); }
.gen-tile .ov { position: absolute; inset: 0; background: linear-gradient(to top, rgba(31,31,31,0.7), transparent 50%); opacity: 0; transition: opacity .25s; display: flex; align-items: flex-end; padding: 16px; }
.gen-tile:hover .ov { opacity: 1; }
.gen-tile .pill { position: absolute; top: 12px; left: 12px; }
.skeleton { background: linear-gradient(100deg, var(--sand-light) 30%, var(--sand-lighter) 50%, var(--sand-light) 70%); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* package tiers */
.pkg-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 22px; align-items: start; }
.pkg { border: 1.5px solid var(--border); border-radius: var(--radius-xl); padding: 30px 28px; background: var(--white); position: relative; transition: border-color .3s, box-shadow .3s, transform .3s; display: flex; flex-direction: column; }
.pkg:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.pkg.featured { border-color: var(--sage); box-shadow: 0 0 0 3px rgba(126,135,114,0.14), var(--shadow-md); }
.pkg.selected { border-color: var(--graphite); box-shadow: 0 0 0 3px rgba(47,47,47,0.12); }
.pkg .flag { position: absolute; top: -13px; left: 50%; transform: translateX(-50%); background: var(--sage); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; padding: 5px 16px; border-radius: 999px; }
.pkg .nm { font-family: var(--font-serif); font-size: 26px; color: var(--graphite); margin-bottom: 6px; }
.pkg .price { font-family: var(--font-serif); font-size: 40px; letter-spacing: -0.02em; color: var(--graphite); margin: 14px 0 4px; }
.pkg .price small { font-size: 15px; color: var(--text-3); font-family: var(--font-sans); }
.pkg ul { list-style: none; padding: 0; margin: 20px 0; display: flex; flex-direction: column; gap: 11px; flex: 1; }
.pkg ul li { display: flex; gap: 10px; font-size: 13.5px; color: var(--text-2); align-items: flex-start; }
.pkg ul li .ic { color: var(--sage); width: 16px; height: 16px; margin-top: 2px; }
.pkg ul li.off { color: var(--text-4); } .pkg ul li.off .ic { color: var(--text-4); }

/* tables */
.table-wrap { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data thead th { text-align: left; padding: 14px 18px; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-3); font-weight: 700; background: var(--sand-lighter); border-bottom: 1px solid var(--border); }
table.data tbody td { padding: 15px 18px; border-bottom: 1px solid var(--border); color: var(--text-2); vertical-align: middle; }
table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr { transition: background .15s; }
table.data tbody tr:hover { background: var(--sand-lighter); }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
.cell-user { display: flex; align-items: center; gap: 11px; }
.cell-user .av { width: 34px; height: 34px; border-radius: 50%; background: var(--sand); color: var(--graphite); display: grid; place-items: center; font-weight: 700; font-size: 12.5px; flex-shrink: 0; }
.cell-user .nm { font-weight: 600; color: var(--graphite); font-size: 13.5px; }
.cell-user .em { font-size: 12px; color: var(--text-3); }

/* quotation line items */
.quote-room { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 18px; }
.quote-room .rhead { display: flex; align-items: center; gap: 12px; padding: 16px 22px; background: var(--sand-lighter); border-bottom: 1px solid var(--border); }
.quote-room .rhead .ric { width: 36px; height: 36px; border-radius: 10px; background: var(--white); display: grid; place-items: center; color: var(--sage-deep); }
.quote-room .rhead .rt { font-weight: 600; color: var(--graphite); }
.quote-room .rhead .rsub { margin-left: auto; font-family: var(--font-serif); font-size: 19px; color: var(--graphite); }
.line { display: grid; grid-template-columns: 1fr auto auto; gap: 16px; padding: 13px 22px; border-bottom: 1px solid var(--border); align-items: center; }
.line:last-child { border-bottom: none; }
.line .desc { font-size: 14px; color: var(--text-2); }
.line .desc .lt { display: inline-block; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-4); font-weight: 700; margin-right: 8px; }
.line .qty { font-size: 13px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.line .amt { font-size: 14px; font-weight: 600; color: var(--graphite); font-variant-numeric: tabular-nums; text-align: right; min-width: 96px; }
.line .amt.editable { cursor: pointer; border-bottom: 1px dashed var(--border-strong); }
.line .amt .ovr { display: block; font-size: 11px; color: var(--clay); font-weight: 600; }
.line .amt .strike { text-decoration: line-through; color: var(--text-4); font-weight: 400; font-size: 12px; }

/* cost breakdown panel */
.cost-panel { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 26px; position: sticky; top: calc(var(--topbar-h) + 20px); }
.cost-row { display: flex; justify-content: space-between; padding: 11px 0; font-size: 14px; color: var(--text-2); border-bottom: 1px dashed var(--border); }
.cost-row.disc { color: var(--clay); }
.cost-row .v { font-weight: 600; color: var(--graphite); font-variant-numeric: tabular-nums; }
.cost-total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 16px; padding-top: 16px; border-top: 2px solid var(--graphite); }
.cost-total .lbl { font-weight: 700; color: var(--graphite); }
.cost-total .v { font-family: var(--font-serif); font-size: 32px; letter-spacing: -0.02em; color: var(--graphite); }

/* PDF preview */
.pdf-paper { background: var(--white); box-shadow: var(--shadow-lg); border-radius: 4px; max-width: 620px; margin: 0 auto; overflow: hidden; }
.pdf-paper .pdf-top { background: var(--graphite); color: #fff; padding: 32px 40px; display: flex; justify-content: space-between; align-items: flex-start; }
.pdf-paper .pdf-top img { height: 42px; background: #fff; padding: 9px 13px; border-radius: 11px; }
.pdf-paper .pdf-top .meta { text-align: right; font-size: 12px; color: rgba(255,255,255,0.7); }
.pdf-band { height: 5px; background: linear-gradient(90deg, var(--gold), var(--sand-deep)); }
.pdf-body { padding: 36px 40px; }
.pdf-line { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.pdf-line .d { color: var(--text-2); } .pdf-line .a { font-weight: 600; color: var(--graphite); }
.pdf-grand { background: var(--sand-lighter); border-radius: var(--radius); padding: 18px 22px; display: flex; justify-content: space-between; align-items: center; margin-top: 22px; }
.pdf-grand .v { font-family: var(--font-serif); font-size: 28px; color: var(--graphite); }

/* timeline */
.timeline { position: relative; padding-left: 28px; }
.timeline::before { content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.tl-item { position: relative; padding-bottom: 26px; }
.tl-item::before { content: ""; position: absolute; left: -27px; top: 4px; width: 14px; height: 14px; border-radius: 50%; background: var(--white); border: 2.5px solid var(--sand-deep); }
.tl-item.done::before { background: var(--sage); border-color: var(--sage); }
.tl-item.current::before { background: var(--white); border-color: var(--graphite); box-shadow: 0 0 0 4px var(--sand-lighter); }
.tl-item .tt { font-weight: 600; font-size: 14.5px; color: var(--graphite); }
.tl-item .td { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }

/* charts */
.bars { display: flex; align-items: flex-end; gap: 12px; height: 200px; padding-top: 10px; }
.bars .bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.bars .bar { width: 100%; max-width: 44px; border-radius: 8px 8px 3px 3px; background: var(--sage); transition: height .6s var(--ease), background .2s; min-height: 4px; }
.bars .bar.alt { background: var(--sand-deep); }
.bars .bar-col:hover .bar { background: var(--sage-deep); }
.bars .bl { font-size: 11px; color: var(--text-3); }
.spark { width: 100%; height: 220px; }
.legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-3); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

/* empty state */
.empty { text-align: center; padding: 60px 20px; }
.empty .ic-box { width: 64px; height: 64px; border-radius: 18px; background: var(--sand-lighter); display: grid; place-items: center; color: var(--sage-deep); margin: 0 auto 18px; }

/* modal */
.modal-scrim { position: fixed; inset: 0; background: rgba(31,31,31,0.5); backdrop-filter: blur(3px); z-index: 200; display: none; align-items: center; justify-content: center; padding: 24px; }
.modal-scrim.open { display: flex; animation: fadeUp .25s; }
.modal { background: var(--white); border-radius: var(--radius-xl); max-width: 540px; width: 100%; box-shadow: var(--shadow-lg); max-height: 90vh; overflow-y: auto; }
.modal .mhead { padding: 26px 30px 0; display: flex; justify-content: space-between; align-items: flex-start; }
.modal .mbody { padding: 18px 30px 30px; }
.modal .mfoot { padding: 0 30px 26px; display: flex; gap: 10px; justify-content: flex-end; }

/* toast */
.toast-stack { position: fixed; bottom: 26px; right: 26px; z-index: 300; display: flex; flex-direction: column; gap: 10px; }
.toast { background: var(--graphite); color: #fff; padding: 13px 18px; border-radius: 12px; box-shadow: var(--shadow-lg); font-size: 13.5px; display: flex; align-items: center; gap: 10px; animation: fadeUp .3s; max-width: 340px; }
.toast .ic { color: var(--sage-light); width: 18px; height: 18px; }

/* misc */
.divider { height: 1px; background: var(--border); margin: 26px 0; }
.kv { display: flex; flex-direction: column; gap: 4px; }
.kv .k { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-4); font-weight: 700; }
.kv .v { font-size: 15px; color: var(--graphite); font-weight: 500; }
.note { background: var(--sand-lighter); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; font-size: 13px; color: var(--text-2); display: flex; gap: 10px; }
.note .ic { color: var(--sage-deep); flex-shrink: 0; margin-top: 1px; }
.avatar-stack { display: flex; }
.avatar-stack .av { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--white); display: grid; place-items: center; font-size: 11px; font-weight: 700; margin-left: -8px; background: var(--sand); color: var(--graphite); }
.avatar-stack .av:first-child { margin-left: 0; }

/* ============================================================ RESPONSIVE */
@media (max-width: 1100px) {
  .g4 { grid-template-columns: repeat(2,1fr); }
  .g3, .pkg-grid { grid-template-columns: 1fr; }
  .cost-panel { position: static; }
}
@media (max-width: 920px) {
  .app.active { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 120; width: 280px; transform: translateX(-100%); transition: transform .3s var(--ease); box-shadow: var(--shadow-lg); }
  .app.nav-open .sidebar { transform: translateX(0); }
  .scrim-mob { display: none; }
  .app.nav-open .scrim-mob { display: block; position: fixed; inset: 0; background: rgba(31,31,31,0.4); z-index: 110; }
  .menu-btn { display: grid !important; }
  .auth { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .auth-card .top-logo { display: block; text-align: center; margin-bottom: 26px; }
  .auth-card .top-logo img { height: 56px; display: inline-block; }
}
@media (max-width: 760px) {
  .g2, .form-grid { grid-template-columns: 1fr; }
  .content { padding: 24px 20px 70px; }
  .topbar { padding: 0 18px; }
  .topbar .search { display: none; }
  .page-head { flex-direction: column; align-items: flex-start; }
  .display { font-size: 34px; }
}
.menu-btn { display: none; }

/* ============================================================ TAB / CAT PANELS (added) */
.tabpanel { display: none; animation: fadeUp .4s var(--ease); }
.tabpanel.active { display: block; }
.catpanel { display: none; animation: fadeUp .35s var(--ease); }
.catpanel.active { display: block; }

/* compact stat (used on user mgmt header) */
.stat.sm { padding: 18px 20px; }
.stat.sm .n { font-size: 28px; }

/* card padding utility */
.card.pad-md { padding: 22px 24px; }

/* category list (catalogue → materials) */
.catlist { display: flex; flex-direction: column; gap: 2px; }
.catlist .ci { padding: 10px 12px; border-radius: 10px; font-size: 13.5px; font-weight: 600; color: var(--text-2); cursor: pointer; display: flex; align-items: center; justify-content: space-between; transition: background .15s, color .15s; }
.catlist .ci:hover { background: var(--sand-lighter); }
.catlist .ci.active { background: var(--sage-light); color: var(--sage-deep); }
.catlist .ci .c { font-size: 11px; color: var(--text-4); font-weight: 600; }
.catlist .ci.active .c { color: var(--sage-deep); }

/* inline editable price cell */
td.price-cell { cursor: pointer; position: relative; }
td.price-cell:hover { background: var(--sand-lighter); }
td.price-cell.edited { color: var(--clay); font-weight: 700; }
td.price-cell.edited::after { content: "•"; color: var(--clay); margin-left: 5px; }

/* role / status mini badges already covered by .badge variants */
.av.role-admin { background: var(--graphite) !important; }

/* room-type picker (add room modal) */
.roomtype-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.roomtype-grid .rt { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 14px 6px; border: 1px solid var(--border); border-radius: 14px; background: var(--off-white); color: var(--text-2); cursor: pointer; transition: border-color .2s, background .2s, color .2s; font-size: 11.5px; font-weight: 600; }
.roomtype-grid .rt .ic { width: 22px; height: 22px; color: var(--text-3); transition: color .2s; }
.roomtype-grid .rt:hover { border-color: var(--border-strong); }
.roomtype-grid .rt.active { border-color: var(--sage); background: var(--sage-light); color: var(--sage-deep); }
.roomtype-grid .rt.active .ic { color: var(--sage-deep); }
@media (max-width: 540px) { .roomtype-grid { grid-template-columns: repeat(3, 1fr); } }

/* auth screen toggling (added) */
.screen-auth { display: none; }
.screen-auth.active { display: grid; }

/* ============================================================ ADDED COMPONENTS (JS-rendered) */
/* package supporting bits */
.pkg .grade { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--sage-deep); font-weight: 700; }
.pkg .tag { font-size: 13px; color: var(--text-3); line-height: 1.55; margin: 14px 0 4px; }

/* quotation room blocks */
.qroom { border: 1px solid var(--border); border-radius: var(--radius-lg); margin-bottom: 16px; overflow: hidden; background: var(--white); }
.qroom-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; background: var(--sand-lighter); border-bottom: 1px solid var(--border); }
.qroom-head .nm { font-weight: 700; font-size: 15px; color: var(--graphite); }
.qroom-sub { font-family: var(--font-serif); font-size: 20px; color: var(--graphite); }
.qlines { padding: 6px 20px 12px; }
.qline { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.qline:last-child { border-bottom: 0; }
.qline .d { color: var(--text-2); }
.qline .a { font-variant-numeric: tabular-nums; color: var(--graphite); font-weight: 600; }
.ic-box.sm { width: 36px; height: 36px; border-radius: 10px; }
.ic-box.sm .ic { width: 18px; height: 18px; }

/* gallery cards */
.gal-card { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--white); transition: box-shadow .25s, transform .25s; }
.gal-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.gal-card .thumb { position: relative; aspect-ratio: 4/3; background: var(--sand-light); overflow: hidden; }
.gal-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.gal-card .star { position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,0.92); backdrop-filter: blur(4px); display: grid; place-items: center; color: var(--sage-deep); cursor: pointer; border: 0; transition: background .2s, transform .2s; }
.gal-card .star:hover { background: var(--sage); color: #fff; transform: scale(1.08); }
.gal-card .star .ic { width: 16px; height: 16px; }
.gal-card .meta { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; }
.gal-card .meta .rm { font-weight: 600; font-size: 13.5px; color: var(--graphite); }

/* ai result thumbs */
.ai-thumb { aspect-ratio: 1/1; border-radius: 12px; overflow: hidden; background: var(--sand-light); }
.ai-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* mini usage bar (analytics) */
.ubar { height: 8px; border-radius: 999px; background: var(--sand-lighter); overflow: hidden; min-width: 90px; }
.ubar i { display: block; height: 100%; background: var(--sage); border-radius: 999px; }

/* project card progress */
.prog { display: flex; align-items: center; gap: 10px; }
.prog-bar { flex: 1; height: 6px; border-radius: 999px; background: var(--sand-lighter); overflow: hidden; }
.prog-bar i { display: block; height: 100%; background: var(--sage); border-radius: 999px; transition: width .6s var(--ease); }
.btn-ghost-arrow { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: var(--text-3); transition: background .2s, color .2s; }
.proj-card:hover .btn-ghost-arrow { background: var(--sage-light); color: var(--sage-deep); }

/* compact switch (user table) */
.switch.sm { transform: scale(0.85); transform-origin: left center; }

