/* ─── Design Tokens ─── */
:root {
  --bg:           #f8f9fb;
  --surface:      #ffffff;
  --surface-2:    #f8f9fb;
  --border:       rgba(0,0,0,.09);
  --border-light: rgba(0,0,0,.05);
  --text:         #111827;
  --text-muted:   #6b7280;
  --text-light:   #9ca3af;
  --primary:      #0d9488;
  --primary-dark: #0f766e;
  --primary-light:#edfaf8;
  --radius:       14px;
  --radius-sm:    10px;
  --radius-xs:    7px;
  --shadow:       0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:    0 4px 16px rgba(0,0,0,.08), 0 2px 6px rgba(0,0,0,.04);
  --shadow-lg:    0 16px 48px rgba(0,0,0,.12), 0 4px 12px rgba(0,0,0,.06);
  --font:         'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif;
}

/* ─── Reset ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; -webkit-font-smoothing: antialiased; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.5; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: var(--font); cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: var(--font); }

/* ─── Loading ─── */
.app-loading {
  display: flex; align-items: center; justify-content: center; height: 100vh;
}
.app-loading__spinner {
  width: 28px; height: 28px;
  border: 2.5px solid rgba(0,0,0,.08);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Navigation ─── */
.nav {
  position: sticky; top: 0; z-index: 100;
  height: 56px;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid rgba(0,0,0,.06);
  display: flex; align-items: center; padding: 0 28px;
}
.nav__inner {
  max-width: 1140px; width: 100%; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
}
.nav__brand {
  display: flex; align-items: center; gap: 10px;
  font-size: 15px; font-weight: 600; letter-spacing: -.2px; color: var(--text);
}
.nav__right {
  display: flex; align-items: center; gap: 6px;
}
.nav__email {
  font-size: 12px; color: var(--text-muted);
  background: var(--bg); padding: 4px 12px;
  border-radius: 999px; letter-spacing: -.1px;
}
.nav__link {
  font-size: 13px; color: var(--text-muted);
  padding: 5px 12px; border-radius: 8px;
  transition: background .15s, color .15s;
}
.nav__link:hover { background: rgba(0,0,0,.05); color: var(--text); }
.nav__btn {
  font-size: 12px; font-weight: 500;
  padding: 6px 14px;
  background: var(--primary); color: white;
  border-radius: 8px; letter-spacing: -.1px;
  transition: background .15s;
}
.nav__btn:hover { background: var(--primary-dark); }

/* ─── Page Tabs (sticky below nav) ─── */
.page-tabs {
  position: sticky;
  top: 56px;
  z-index: 98;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-bottom: 1px solid rgba(0,0,0,.07);
  padding: 0 28px;
}
.page-tabs__inner {
  max-width: 1140px; margin: 0 auto; display: flex;
}
.page-tab {
  font-size: 13px; font-weight: 500;
  color: var(--text-muted);
  padding: 12px 18px;
  background: none; border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer; letter-spacing: -.1px;
  transition: color .15s, border-color .15s;
  margin-bottom: -1px;
}
.page-tab:hover { color: var(--text); }
.page-tab--active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

/* ─── Page Layout ─── */
.page {
  max-width: 1140px; margin: 0 auto; padding: 32px 28px;
}
.page-header { margin-bottom: 32px; }
.page-header__title {
  font-size: 28px; font-weight: 700;
  color: var(--text); letter-spacing: -.5px;
  margin-bottom: 10px; line-height: 1.2;
}
.page-header__tags {
  display: flex; gap: 6px; flex-wrap: wrap;
}

/* ─── Tags ─── */
.tag {
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 500;
  padding: 3px 10px; border-radius: 999px;
  letter-spacing: .1px;
}
.tag--green  { background: #dcfce7; color: #166534; }
.tag--blue   { background: #dbeafe; color: #1d4ed8; }
.tag--purple { background: #ede9fe; color: #5b21b6; }
.tag--orange { background: #ffedd5; color: #c2410c; }
.tag--gray   { background: #f1f5f9; color: #475569; }
.tag--teal   { background: var(--primary-light); color: var(--primary-dark); }
.tag--red    { background: #fee2e2; color: #b91c1c; }
.tag--amber  { background: #fef9c3; color: #854d0e; }

/* ─── Section ─── */
.section { margin-bottom: 40px; }
.section__header {
  display: flex; align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.section__title {
  font-size: 18px; font-weight: 700;
  color: var(--text); letter-spacing: -.3px;
}

/* ─── Buttons ─── */
.btn {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 13px; font-weight: 500;
  padding: 7px 16px; border-radius: var(--radius-sm);
  cursor: pointer; border: 1px solid transparent;
  letter-spacing: -.1px;
  transition: background .15s, opacity .15s, box-shadow .15s;
}
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn--primary  { background: var(--primary); color: white; }
.btn--primary:hover:not(:disabled)  { background: var(--primary-dark); }
.btn--secondary { background: white; color: var(--text); border-color: var(--border); }
.btn--secondary:hover { background: var(--bg); }
.btn--ghost { background: none; color: var(--text-muted); border: none; padding: 6px 12px; }
.btn--ghost:hover { background: rgba(0,0,0,.05); color: var(--text); }
.btn--active { background: var(--primary); color: white; }
.btn--sm { font-size: 12px; padding: 5px 12px; border-radius: 8px; }

/* ─── Status ─── */
.status {
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 500;
  padding: 3px 9px; border-radius: 999px;
  letter-spacing: .1px;
}
.status--issued     { background: var(--primary-light); color: var(--primary-dark); }
.status--upcoming   { background: #fef3c7; color: #92400e; }
.status--pending    { background: #fef3c7; color: #92400e; }
.status--overdue    { background: #fee2e2; color: #b91c1c; }
.status--completed  { background: #f1f5f9; color: #64748b; }
.status--open       { background: #fff0e6; color: #c2410c; }
.status--resolved   { background: var(--primary-light); color: var(--primary-dark); }
.status--closed     { background: #f1f5f9; color: #64748b; }
.status--ongoing    { background: #dbeafe; color: #1d4ed8; }
.status--in-progress{ background: #dbeafe; color: #1d4ed8; }
.status--gray       { background: #f1f5f9; color: #64748b; }

/* ─── Empty ─── */
.empty {
  text-align: center; padding: 56px 20px;
  color: var(--text-muted); font-size: 13px;
}
.empty__icon { font-size: 32px; margin-bottom: 10px; opacity: .6; }

/* ─── Spinner ─── */
.spinner {
  display: inline-block; width: 18px; height: 18px;
  border: 2px solid rgba(0,0,0,.08);
  border-top-color: var(--primary);
  border-radius: 50%; animation: spin .5s linear infinite;
}

/* ─── Forms ─── */
.form-row { margin-bottom: 14px; }
.form-label {
  display: block; font-size: 12px; font-weight: 500;
  color: var(--text-muted); margin-bottom: 5px; letter-spacing: .1px;
}
.form-input, .form-select, .form-textarea {
  width: 100%; font-size: 13px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text); outline: none;
  background: white;
  transition: border-color .15s, box-shadow .15s;
}
.form-select { appearance: none; -webkit-appearance: none; padding-right: 32px; cursor: pointer; }
.select-wrap { position: relative; }
.select-wrap .form-select { width: 100%; }
.select-wrap__icon {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  font-size: 13px; color: var(--text-muted); pointer-events: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13,148,136,.08);
}
.form-textarea { resize: vertical; min-height: 80px; }
.form-actions { display: flex; gap: 8px; margin-top: 4px; }

/* ─── Utility ─── */
.text-muted { color: var(--text-muted); font-size: 12px; }
.divider { border: none; border-top: 1px solid var(--border-light); margin: 20px 0; }

/* ══════════════════════════════════════
   PROJECT HISTORY
══════════════════════════════════════ */
.project-list { display: flex; flex-direction: column; gap: 16px; }

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow .2s;
}
.project-card:hover { box-shadow: var(--shadow-md); }

.project-card__header { padding: 20px 24px 16px; }
.project-card__meta {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 10px; flex-wrap: wrap;
}
.project-card__date {
  font-size: 12px; color: var(--text-light);
  margin-left: auto; display: flex; align-items: center;
}
.project-card__title-row {
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: 16px;
}
.project-card__title {
  font-size: 16px; font-weight: 700;
  color: var(--text); line-height: 1.4; letter-spacing: -.3px;
}
.project-card__actions { display: flex; gap: 6px; flex-shrink: 0; align-items: center; }

/* Timeline section inside card */
.project-card__timeline { border-top: 1px solid var(--border-light); }
.project-card__timeline-header {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
}
.project-card__timeline-label {
  display: flex; align-items: center; gap: 5px;
  font-size: 10px; font-weight: 600;
  color: var(--text-light); text-transform: uppercase; letter-spacing: .7px;
}
.project-card__timeline-header .view-toggle { padding: 2px; }
.project-card__timeline-header .view-toggle .btn {
  font-size: 11px; padding: 3px 10px; border-radius: 6px;
}

/* ── Gantt list view ── */
.gantt-list {
  padding: 12px 24px 20px;
  display: flex; flex-direction: column; gap: 20px;
}
.gantt-list__group-title {
  display: flex; align-items: center;
  font-size: 10px; font-weight: 700;
  color: var(--text-light); text-transform: uppercase; letter-spacing: .7px;
  margin-bottom: 6px;
}
.gantt-list__row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: 8px;
  transition: background .12s; cursor: default;
}
.gantt-list__row:hover { background: var(--bg); }
.gantt-list__color-dot {
  width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0;
}
.gantt-list__ms-dot {
  width: 20px; height: 20px; border-radius: 6px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 8px;
}
.gantt-list__label {
  flex: 1; font-size: 13px; font-weight: 500; color: var(--text);
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.gantt-list__range {
  font-size: 12px; color: var(--text-muted); white-space: nowrap;
  font-feature-settings: "tnum"; display: flex; align-items: center; gap: 4px;
}
.gantt-list__arrow {
  color: var(--text-light); font-size: 11px;
}
.gantt-list__range--single {
  font-size: 12px; font-weight: 500; color: var(--text-muted);
}
.gantt-list__row--milestone .gantt-list__label {
  font-weight: 600;
}

/* ─── Gantt ─── */
.gantt {
  border-top: 1px solid var(--border-light);
  background: var(--surface);
  padding: 12px 20px 16px;
}
.gantt__scroll { overflow-x: auto; overflow-y: hidden; padding-bottom: 30px; }
.gantt__inner  { position: relative; min-width: 600px; }
.gantt__head   { position: relative; height: 20px; margin-bottom: 2px; }
.gantt__wk-label {
  position: absolute; font-size: 10px; color: var(--text-muted);
  white-space: nowrap;
}
.gantt__head--days { height: 18px; margin-bottom: 4px; }
.gantt__day-letter {
  position: absolute; font-size: 9px; color: var(--text-light);
  transform: translateX(-50%); font-weight: 500;
}
.gantt__day-letter--weekend { color: #d1d1d6; }
.gantt__day-letter--today   { color: #ef4444; font-weight: 700; }
.gantt__body { position: relative; }
.gantt__dayline  { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(0,0,0,.03); }
.gantt__weekline { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(0,0,0,.07); }
.gantt__today-line { position: absolute; top: 0; bottom: 0; width: 2px; background: #ef4444; z-index: 5; }
.gantt__today-tag {
  position: absolute; top: -18px; left: 50%;
  transform: translateX(-50%);
  background: #ef4444; color: white;
  font-size: 9px; font-weight: 600;
  padding: 1px 6px; border-radius: 4px; white-space: nowrap;
}
.gantt__bar-wrap { position: absolute; height: 26px; cursor: default; }
.gantt__bar {
  height: 100%; border-radius: 6px; overflow: hidden;
  display: flex; align-items: center; padding: 0 8px;
}
.gantt__bar-label {
  font-size: 10px; color: rgba(255,255,255,.95);
  white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; font-weight: 500;
}
.gantt__milestone { position: absolute; top: 0; bottom: 0; width: 0; z-index: 4; }
.gantt__ms-line   { position: absolute; top: 0; bottom: 0; left: 0; border-left: 2px dashed; }
.gantt__ms-label  {
  position: absolute; bottom: -22px; left: 4px;
  font-size: 9px; font-weight: 600; white-space: nowrap;
  border: 1px solid; border-radius: 4px; padding: 1px 5px; background: white;
}
.gantt__tip {
  position: fixed; z-index: 1000;
  background: var(--text); color: white;
  border-radius: 10px; padding: 9px 12px;
  font-size: 12px; pointer-events: none;
  box-shadow: var(--shadow-md); max-width: 280px;
}
.gantt__tip-label { font-weight: 600; margin-bottom: 4px; }
.gantt__tip-dates { display: flex; align-items: center; gap: 6px; color: var(--text-light); font-size: 11px; }
.gantt__empty {
  padding: 24px 20px; font-size: 12px;
  color: var(--text-light); text-align: center;
  border-top: 1px solid var(--border-light);
}

/* ══════════════════════════════════════
   BILLING
══════════════════════════════════════ */
.bill-stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 14px; margin-bottom: 28px;
}
.bill-stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow);
}
.bill-stat-card--upcoming  { border-top: 3px solid #f59e0b; }
.bill-stat-card--issued    { border-top: 3px solid var(--primary); }
.bill-stat-card--completed { border-top: 3px solid #cbd5e1; }
.bill-stat-card__label {
  font-size: 11px; font-weight: 500; text-transform: uppercase;
  letter-spacing: .6px; color: var(--text-light); margin-bottom: 10px;
}
.bill-stat-card__amount {
  font-size: 22px; font-weight: 700;
  color: var(--text); letter-spacing: -.5px; margin-bottom: 4px;
}
.bill-stat-card__count { font-size: 12px; color: var(--text-muted); }

.inv-list { display: flex; flex-direction: column; gap: 10px; }
.inv-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid;
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow);
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: 20px;
  transition: box-shadow .2s;
}
.inv-card:hover { box-shadow: var(--shadow-md); }
.inv-card--upcoming  { border-left-color: #f59e0b; }
.inv-card--pending   { border-left-color: #f59e0b; }
.inv-card--issued    { border-left-color: var(--primary); }
.inv-card--completed { border-left-color: #cbd5e1; }
.inv-card__left  { flex: 1; min-width: 0; }
.inv-card__top   { display: flex; align-items: center; gap: 7px; margin-bottom: 6px; flex-wrap: wrap; }
.inv-card__type  {
  font-size: 11px; color: var(--text-muted);
  background: var(--bg); padding: 2px 8px; border-radius: 999px;
}
.inv-card__title { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 3px; letter-spacing: -.1px; }
.inv-card__desc  { font-size: 12px; color: var(--text-muted); line-height: 1.5; }
.inv-card__right { text-align: right; flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.inv-card__amount { font-size: 20px; font-weight: 700; color: var(--text); letter-spacing: -.4px; }
.inv-card__meta  { display: flex; flex-direction: column; gap: 2px; }
.inv-card__num   { font-size: 12px; font-weight: 500; color: var(--text-muted); }
.inv-card__date  { font-size: 11px; color: var(--text-light); }

/* ══════════════════════════════════════
   CHANGELOG
══════════════════════════════════════ */
.view-toggle {
  display: flex; gap: 2px;
  background: rgba(0,0,0,.05);
  padding: 3px; border-radius: 10px;
}
.view-toggle .btn { font-size: 12px; padding: 4px 12px; border-radius: 8px; }

.cms-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden; margin-bottom: 8px;
  transition: box-shadow .2s;
}
.cms-item:hover { box-shadow: var(--shadow); }
.cms-item__header {
  padding: 14px 18px;
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; user-select: none;
  transition: background .15s;
}
.cms-item__header:hover { background: var(--bg); }
.cms-item__date  { font-size: 12px; color: var(--text-light); white-space: nowrap; min-width: 72px; }
.cms-item__tags  { display: flex; gap: 4px; flex-wrap: wrap; }
.cms-item__title { font-size: 13px; font-weight: 500; color: var(--text); flex: 1; letter-spacing: -.1px; }
.cms-item__disc  { font-size: 12px; color: var(--text-light); white-space: nowrap; }
.cms-item__chevron { color: var(--text-light); transition: transform .2s; font-size: 16px; }
.cms-item__chevron--open { transform: rotate(180deg); }
.cms-item__body  { border-top: 1px solid var(--border-light); padding: 18px; }
.cms-item__image { width: 100%; height: auto; display: block; border-radius: 10px; margin-bottom: 14px; }
.cms-item__content {
  font-size: 13px; color: var(--text);
  line-height: 1.75; margin-bottom: 14px; white-space: pre-wrap;
}

/* Full view */
.cl-feed { display: flex; flex-direction: column; }
.cl-entry { padding: 36px 0 0; }
.cl-entry__meta { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.cl-entry__date { font-size: 12px; font-weight: 500; color: var(--text-light); white-space: nowrap; letter-spacing: .1px; }
.cl-entry__tags { display: flex; gap: 5px; flex-wrap: wrap; }
.cl-entry__title {
  font-size: 24px; font-weight: 700; color: var(--text);
  line-height: 1.25; letter-spacing: -.5px; margin-bottom: 16px;
}
.cl-entry__image {
  width: 100%; height: auto; display: block;
  border-radius: var(--radius); margin-bottom: 20px;
  border: 1px solid var(--border);
}
.cl-entry__summary {
  font-size: 15px; font-weight: 500; color: var(--text);
  line-height: 1.7; margin-bottom: 10px; letter-spacing: -.1px;
}
.cl-entry__body {
  font-size: 14px; color: var(--text-muted);
  line-height: 1.8; white-space: pre-wrap; margin-bottom: 24px;
}
.cl-entry__discussion {
  background: var(--bg); border-radius: var(--radius); padding: 18px; margin-top: 8px;
}
.cl-entry__divider { border: none; border-top: 1px solid var(--border); margin: 36px 0 0; }

/* Discussion */
.discussion { border-top: 1px solid var(--border-light); padding-top: 14px; }
.discussion__title { font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 12px; letter-spacing: .1px; }
.discussion__messages { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.comment { display: flex; gap: 10px; }
.comment__avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--primary); color: white;
  font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.comment__body { flex: 1; }
.comment__meta { font-size: 11px; color: var(--text-muted); margin-bottom: 3px; }
.comment__meta strong { color: var(--text); font-weight: 600; }
.comment__text { font-size: 13px; color: var(--text); line-height: 1.6; }
.discussion__input-row { display: flex; gap: 8px; align-items: flex-start; }
.discussion__textarea {
  flex: 1; font-size: 13px; padding: 9px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  resize: vertical; min-height: 64px; color: var(--text); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.discussion__textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13,148,136,.08);
}

/* ══════════════════════════════════════
   VENDOR REFERENCES
══════════════════════════════════════ */
.vr-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 640px) { .vr-grid { grid-template-columns: 1fr; } }

.vr-col {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
}
.vr-col__heading {
  font-size: 11px; font-weight: 600; color: var(--text-light);
  text-transform: uppercase; letter-spacing: .6px; margin-bottom: 16px;
}
.vr-row {
  display: flex; align-items: baseline; gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid var(--border-light);
}
.vr-row:last-child { border-bottom: none; }
.vr-row__label {
  font-size: 11px; font-weight: 500; color: var(--text-light);
  white-space: nowrap; min-width: 36px;
}
.vr-row__val {
  font-size: 13px; color: var(--text); line-height: 1.55;
}
.vr-row__val--strong { font-weight: 600; letter-spacing: -.1px; }
.vr-tag {
  font-size: 11px; font-weight: 600;
  background: var(--bg); color: var(--text-muted);
  padding: 2px 10px; border-radius: 999px;
}
.vr-divider {
  border: none; border-top: 1px solid var(--border);
  margin: 8px 0;
}

/* ══════════════════════════════════════
   MODAL
══════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.35);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fade-in .15s ease;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--surface);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 600px; max-height: 90vh; overflow-y: auto;
  animation: modal-up .2s ease;
}
@keyframes modal-up { from { transform: translateY(12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal__header {
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: 12px;
}
.modal__body { padding: 20px 22px; }

/* ══════════════════════════════════════
   SUPPORT HUB
══════════════════════════════════════ */
.sh-wrap { display: flex; flex-direction: column; gap: 28px; }

.sh-hero {
  background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
  border-radius: var(--radius);
  padding: 28px 32px;
  color: white;
  display: flex; align-items: center; gap: 18px;
  box-shadow: 0 4px 20px rgba(13,148,136,.25);
}
.sh-hero__icon { font-size: 36px; flex-shrink: 0; }
.sh-hero__title { font-size: 20px; font-weight: 700; letter-spacing: -.3px; margin-bottom: 4px; }
.sh-hero__sub   { font-size: 13px; color: rgba(255,255,255,.75); }

.sh-categories {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
}
.sh-cat {
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  padding: 20px 18px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer; text-align: left;
  transition: border-color .15s, box-shadow .15s, transform .15s, background .15s;
  box-shadow: var(--shadow);
}
.sh-cat:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.sh-cat--orange:hover { border-color: #f97316; }
.sh-cat--blue:hover   { border-color: #3b82f6; }
.sh-cat--green:hover  { border-color: #22c55e; }
.sh-cat--purple:hover { border-color: #8b5cf6; }
.sh-cat--active.sh-cat--orange { border-color: #f97316; background: #fff7ed; }
.sh-cat--active.sh-cat--blue   { border-color: #3b82f6; background: #eff6ff; }
.sh-cat--active.sh-cat--green  { border-color: #22c55e; background: #f0fdf4; }
.sh-cat--active.sh-cat--purple { border-color: #8b5cf6; background: #faf5ff; }
.sh-cat__emoji {
  width: 42px; height: 42px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.sh-cat--orange .sh-cat__emoji { background: #fff7ed; color: #ea580c; }
.sh-cat--blue .sh-cat__emoji   { background: #eff6ff; color: #3b82f6; }
.sh-cat--green .sh-cat__emoji  { background: #f0fdf4; color: #16a34a; }
.sh-cat--purple .sh-cat__emoji { background: #faf5ff; color: #7c3aed; }
.sh-cat--active.sh-cat--orange .sh-cat__emoji { background: #ffedd5; }
.sh-cat--active.sh-cat--blue .sh-cat__emoji   { background: #dbeafe; }
.sh-cat--active.sh-cat--green .sh-cat__emoji  { background: #dcfce7; }
.sh-cat--active.sh-cat--purple .sh-cat__emoji { background: #ede9fe; }
.sh-cat__label { font-size: 13px; font-weight: 600; color: var(--text); letter-spacing: -.1px; }
.sh-cat__desc  { font-size: 11px; color: var(--text-muted); line-height: 1.5; }

.sh-form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow-md);
}
.sh-form-card__header {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 22px; padding-bottom: 18px;
  border-bottom: 1px solid var(--border-light);
}
.sh-form-card__emoji { font-size: 26px; }
.sh-form-card__title { font-size: 16px; font-weight: 700; color: var(--text); letter-spacing: -.2px; }
.sh-form-card__sub   { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.sh-form-actions { display: flex; gap: 8px; margin-top: 20px; }
.sh-msg {
  font-size: 12px; padding: 9px 13px;
  border-radius: var(--radius-xs); margin-bottom: 14px;
}
.sh-msg--ok    { background: var(--primary-light); color: var(--primary-dark); }
.sh-msg--error { background: #fee2e2; color: #b91c1c; }

.sh-fade-enter-active, .sh-fade-leave-active { transition: opacity .2s, transform .2s; }
.sh-fade-enter-from, .sh-fade-leave-to { opacity: 0; transform: translateY(-8px); }

.sh-submissions { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); }
.sh-submissions__header { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.sh-submissions__title  { font-size: 13px; font-weight: 700; color: var(--text); letter-spacing: -.1px; }
.sh-submissions__count  {
  font-size: 11px; font-weight: 700;
  background: var(--bg); color: var(--text-muted);
  padding: 2px 9px; border-radius: 999px;
}
.sh-empty { text-align: center; padding: 48px 20px; color: var(--text-muted); font-size: 13px; }
.sh-ticket-list { display: flex; flex-direction: column; gap: 8px; }
.sh-ticket {
  display: flex; align-items: flex-start; gap: 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-left-width: 3px;
  border-radius: var(--radius); padding: 16px 18px;
  box-shadow: var(--shadow); transition: box-shadow .2s;
}
.sh-ticket:hover { box-shadow: var(--shadow-md); }
.sh-ticket__cat-icon { font-size: 22px; flex-shrink: 0; margin-top: 2px; }
.sh-ticket__body  { flex: 1; min-width: 0; }
.sh-ticket__top   { display: flex; align-items: center; gap: 7px; margin-bottom: 5px; flex-wrap: wrap; }
.sh-ticket__subtype {
  font-size: 11px; font-weight: 500; color: var(--text-muted);
  background: var(--bg); padding: 2px 9px; border-radius: 999px;
}
.sh-ticket__title   { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 2px; letter-spacing: -.1px; }
.sh-ticket__preview { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sh-ticket__right   { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }
.sh-ticket__date    { font-size: 11px; color: var(--text-light); white-space: nowrap; }

/* ══════════════════════════════════════
   LOGIN
══════════════════════════════════════ */
.login-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg); padding: 24px;
}
.login-card {
  background: var(--surface);
  border-radius: 20px;
  box-shadow: 0 0 0 1px rgba(0,0,0,.06), 0 20px 60px rgba(0,0,0,.08);
  padding: 40px; width: 100%; max-width: 380px;
}
.login-card__brand { display: flex; align-items: center; gap: 14px; margin-bottom: 32px; }
.login-error {
  font-size: 12px; color: #991b1b; background: #fee2e2;
  border-radius: var(--radius-xs); padding: 9px 12px; margin-bottom: 14px;
}
.login-back-link {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin-top: 28px; padding-top: 20px;
  border-top: 1px solid var(--border-light);
  font-size: 12px; color: var(--text-muted);
  text-decoration: none; transition: color 0.2s;
}
.login-back-link:hover { color: var(--primary); text-decoration: none; }

/* ── Support form (legacy, kept for compat) ── */
.support-form {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow); margin-bottom: 20px;
}
.support-form__title { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.support-form__sub   { font-size: 12px; color: var(--text-muted); margin-bottom: 16px; }
.tickets-label {
  font-size: 11px; font-weight: 600; color: var(--text-light);
  text-transform: uppercase; letter-spacing: .6px; margin-bottom: 10px;
}
.ticket-row {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 16px;
  display: flex; align-items: center; gap: 10px;
  box-shadow: var(--shadow); margin-bottom: 6px;
}
.ticket-row__title {
  flex: 1; font-size: 13px; font-weight: 500; color: var(--text);
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ticket-row__meta { font-size: 11px; color: var(--text-muted); }
.ticket-row__disc { font-size: 12px; color: var(--text-light); }

/* ══════════════════════════════════════
   ADMIN MODE
══════════════════════════════════════ */
/* Admin bar: visible to admins always. Neutral by default, teal when editing mode on */
.admin-bar {
  background: rgba(255,255,255,.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0,0,0,.07);
  padding: 0 28px;
  transition: background .2s, border-color .2s;
}
.admin-bar--on {
  background: var(--primary-light);
  border-bottom-color: rgba(13,148,136,.2);
}
.admin-bar__inner {
  max-width: 1140px; margin: 0 auto;
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 500; color: var(--text-muted);
  padding: 6px 0;
}
.admin-bar--on .admin-bar__inner { color: var(--primary); }
.admin-bar__label { font-size: 11px; font-weight: 500; color: inherit; white-space: nowrap; }
.admin-bar__editing {
  display: flex; align-items: center; gap: 4px;
  margin-left: 12px; padding-left: 12px;
  border-left: 1px solid rgba(13,148,136,.25);
  font-size: 11px; font-weight: 600; color: var(--primary);
}
.client-select-compact {
  font-size: 12px; padding: 4px 26px 4px 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: white; color: var(--text);
  min-width: 180px; outline: none;
  transition: border-color .15s;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256'%3E%3Cpath fill='%236b7280' d='M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 12px 12px;
}
.client-select-compact:focus { border-color: var(--primary); }
.admin-bar--on .client-select-compact {
  border-color: rgba(13,148,136,.3);
  background: white;
}

.admin-toggle {
  display: flex; align-items: center; gap: 7px;
  cursor: pointer; padding: 5px 10px; border-radius: 8px;
  transition: background .15s; user-select: none;
}
.admin-toggle:hover { background: rgba(0,0,0,.04); }
.admin-toggle__label { font-size: 12px; font-weight: 500; color: var(--text-muted); transition: color .2s; }
.admin-toggle__label--on { color: var(--primary); font-weight: 600; }
.admin-toggle__switch {
  width: 32px; height: 18px; border-radius: 9px; background: #d1d5db;
  position: relative; transition: background .2s; flex-shrink: 0;
}
.admin-toggle__switch--on { background: var(--primary); }
.admin-toggle__thumb {
  position: absolute; top: 2px; left: 2px;
  width: 14px; height: 14px; border-radius: 50%;
  background: white; transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.admin-toggle__switch--on .admin-toggle__thumb { transform: translateX(14px); }

.btn--icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 7px;
  background: none; color: var(--text-muted); border: none;
  cursor: pointer; transition: background .15s, color .15s; flex-shrink: 0;
}
.btn--icon:hover { background: rgba(0,0,0,.06); color: var(--text); }
.btn--icon--danger:hover { background: #fee2e2; color: #b91c1c; }
.admin-actions { display: flex; gap: 2px; margin-left: 6px; }

.status-select {
  font-size: 11px; font-weight: 500;
  border: 1px solid var(--border);
  border-radius: 999px; padding: 3px 24px 3px 8px;
  background: white; color: var(--text);
  cursor: pointer; outline: none;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256'%3E%3Cpath fill='%236b7280' d='M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 7px center;
  background-size: 11px 11px;
}

/* ══════════════════════════════════════
   NOTIFICATION BELL
══════════════════════════════════════ */
.notif-bell {
  position: relative;
  display: inline-flex; align-items: center;
}

.notif-bell__btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 10px;
  color: var(--text-muted); background: none; border: none;
  cursor: pointer; transition: background .15s, color .15s;
}
.notif-bell__btn:hover   { background: rgba(0,0,0,.06); color: var(--text); }
.notif-bell__btn--active { background: var(--primary-light); color: var(--primary); }

.notif-bell__badge {
  position: absolute; top: 3px; right: 3px;
  min-width: 16px; height: 16px; border-radius: 999px;
  background: #ef4444; color: white;
  font-size: 9px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px; border: 2px solid white;
  line-height: 1;
}

/* Dropdown panel */
.notif-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: -8px;
  width: 360px;
  max-height: 500px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  z-index: 500;
  overflow: hidden;
  display: flex; flex-direction: column;
}

.notif-panel__header {
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.notif-panel__header-left {
  display: flex; align-items: center; gap: 7px;
}
.notif-panel__title {
  font-size: 15px; font-weight: 700;
  color: var(--text); letter-spacing: -.2px;
}
.notif-panel__unread-badge {
  font-size: 10px; font-weight: 700;
  background: #fee2e2; color: #b91c1c;
  padding: 2px 8px; border-radius: 999px;
}

.notif-panel__state {
  padding: 48px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  display: flex; flex-direction: column; align-items: center;
}

/* Notification list */
.notif-list {
  overflow-y: auto;
  flex: 1;
}
.notif-list::-webkit-scrollbar { width: 4px; }
.notif-list::-webkit-scrollbar-track { background: transparent; }
.notif-list::-webkit-scrollbar-thumb { background: rgba(0,0,0,.1); border-radius: 4px; }

.notif-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 13px 18px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-light);
  transition: background .12s;
  position: relative;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--bg); }
.notif-item--unread { background: rgba(13,148,136,.03); }
.notif-item--unread:hover { background: rgba(13,148,136,.06); }

.notif-item__icon {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  margin-top: 1px;
}
.notif-item__content { flex: 1; min-width: 0; }
.notif-item__title {
  font-size: 13px; font-weight: 600; color: var(--text);
  line-height: 1.4; letter-spacing: -.1px; margin-bottom: 2px;
}
.notif-item__body {
  font-size: 12px; color: var(--text-muted);
  line-height: 1.5; margin-bottom: 4px;
  overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.notif-item__time {
  font-size: 11px; color: var(--text-light);
}
.notif-item__dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #ef4444; flex-shrink: 0; margin-top: 6px;
}

/* Transition */
.notif-drop-enter-active { transition: opacity .15s ease, transform .15s ease; }
.notif-drop-leave-active { transition: opacity .1s ease, transform .1s ease; }
.notif-drop-enter-from,
.notif-drop-leave-to   { opacity: 0; transform: translateY(-6px) scale(.98); }

/* ══════════════════════════════════════
   MOBILE — iPhone 16 / Samsung S24
   (390–430px)
══════════════════════════════════════ */
@media (max-width: 640px) {
  /* Nav */
  .nav { padding: 0 16px; }
  .nav__email { display: none; }
  .nav__brand { font-size: 14px; }
  .nav__link { padding: 5px 8px; font-size: 12px; }

  /* Page tabs — scrollable row */
  .page-tabs { padding: 0 16px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .page-tabs::-webkit-scrollbar { display: none; }
  .page-tabs__inner { gap: 0; min-width: max-content; }
  .page-tab { padding: 12px 14px; font-size: 12px; white-space: nowrap; }

  /* Page layout */
  .page { padding: 20px 16px; }
  .page-header__title { font-size: 22px; }
  .section { margin-bottom: 28px; }
  .section__header { flex-wrap: wrap; gap: 8px; }
  .section__title { font-size: 16px; }

  /* Project cards */
  .project-card__header { padding: 16px 16px 12px; }
  .project-card__title { font-size: 14px; }
  .project-card__timeline-header { padding: 10px 16px; }
  .project-card__actions { gap: 4px; }
  .project-card__title-row { flex-wrap: wrap; }

  /* Billing — stack invoice card vertically */
  .bill-stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
  .bill-stat-card { padding: 14px 12px; }
  .bill-stat-card__amount { font-size: 16px; }
  .inv-card { flex-direction: column; gap: 10px; }
  .inv-card__right { align-items: flex-start; flex-direction: row; align-items: center; gap: 12px; }
  .inv-card__amount { font-size: 16px; }

  /* Login */
  .login-card { padding: 28px 24px; }

  /* Changelog compact row — wrap gracefully */
  .cms-item__header { flex-wrap: wrap; gap: 6px; padding: 12px 14px; }
  .cms-item__date { min-width: auto; font-size: 11px; }
  .cms-item__title { width: 100%; flex: none; font-size: 13px; }
  .cms-item__disc { margin-left: auto; }

  /* Support Hub — 2×2 grid */
  .sh-categories { grid-template-columns: 1fr 1fr; gap: 10px; }
  .sh-cat { padding: 16px 14px; }
  .sh-cat__emoji { width: 36px; height: 36px; font-size: 17px; }
  .sh-cat__label { font-size: 12px; }
  .sh-cat__desc { font-size: 11px; }
  .sh-form-card { padding: 20px 16px; }
  .sh-ticket { padding: 12px 14px; gap: 10px; }
  .sh-ticket__right { flex-direction: row; align-items: center; gap: 8px; }

  /* Notification dropdown — pin to screen edges */
  .notif-dropdown {
    position: fixed;
    top: 56px;
    left: 16px;
    right: 16px;
    width: auto;
  }

  /* Gantt / chart overflow */
  .gantt-wrap, .chart-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* Vendor references */
  .vr-grid { grid-template-columns: 1fr; }
}

@media (max-width: 400px) {
  .nav__btn { font-size: 11px; padding: 5px 10px; }
  .page-header__title { font-size: 20px; }
  .login-card { padding: 24px 18px; }
  .sh-categories { grid-template-columns: 1fr 1fr; }
}
