@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

/* Cittaz components. Values come from tokens.css; nothing here re-declares a token. */

body { margin: 0; font-family: var(--font-sans); background: var(--surface); color: var(--ink); -webkit-font-smoothing: antialiased; }
.cz-row { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; padding: var(--space-4); }
.cz-stack { display: flex; flex-direction: column; gap: var(--space-4); padding: var(--space-4); }
.cz-num { font-variant-numeric: tabular-nums; }
.cz-unit { font-size: 14px; line-height: 20px; font-weight: 400; color: var(--ink-subtle); margin-left: 6px; letter-spacing: 0; }
.cz-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.cz-focus:focus-visible, .cz-btn:focus-visible, .cz-icon-btn:focus-visible, .cz-tab:focus-visible, .cz-switch:focus-visible, .cz-nav-item:focus-visible, .cz-bnav-item:focus-visible, .cz-search input:focus-visible {
  outline: 2px solid var(--focus-ring); outline-offset: 2px;
}

/* Icon */
.cz-icon { display: inline-block; flex: none; vertical-align: middle; }

/* Button */
.cz-btn { font: inherit; font-size: 14px; font-weight: 500; line-height: 20px; display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  height: 40px; padding: 0 var(--space-5); border-radius: var(--radius-pill); border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease; text-decoration: none; }
.cz-btn-sm { height: 32px; padding: 0 var(--space-3); font-size: 13px; }
.cz-btn-lg { height: 48px; padding: 0 var(--space-6); font-size: 15px; }
.cz-btn-block { width: 100%; }
.cz-btn-primary { background: var(--surface-inverse); color: var(--on-inverse); }
.cz-btn-primary:hover { opacity: .88; }
.cz-btn-brand { background: var(--brand); color: var(--on-brand); }
.cz-btn-brand:hover { background: var(--brand-hover); }
.cz-btn-secondary { background: var(--surface-raised); color: var(--ink); border-color: var(--line); }
.cz-btn-secondary:hover { border-color: var(--line-strong); }
.cz-btn-ghost { background: transparent; color: var(--brand-ink); }
.cz-btn-ghost:hover { background: var(--brand-soft); }
.cz-btn:disabled { opacity: .45; cursor: not-allowed; }
@media (pointer: coarse) { .cz-btn { min-height: var(--target-min); } }

/* IconButton */
.cz-icon-btn { font: inherit; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: var(--radius-pill);
  border: 1px solid var(--line); background: var(--surface-raised); color: var(--ink); cursor: pointer; flex: none; padding: 0; }
.cz-icon-btn:hover { border-color: var(--line-strong); }
.cz-icon-btn-sm { width: 32px; height: 32px; }
.cz-icon-btn-primary { background: var(--surface-inverse); color: var(--on-inverse); border-color: transparent; }
.cz-icon-btn-hero { background: rgba(255,255,255,.18); color: var(--on-hero); border-color: rgba(255,255,255,.35); }
@media (pointer: coarse) { .cz-icon-btn { width: var(--target-min); height: var(--target-min); } }

/* Badge */
.cz-badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 500; line-height: 16px; white-space: nowrap;
  background: var(--surface-sunken); color: var(--ink-muted); }
.cz-badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.cz-badge-brand { background: var(--brand-soft); color: var(--brand-ink); }
.cz-badge-success { background: var(--success-soft); color: var(--success); }
.cz-badge-warning { background: var(--warning-soft); color: var(--warning); }
.cz-badge-danger { background: var(--danger-soft); color: var(--danger); }
.cz-badge-inverse { background: var(--surface-inverse); color: var(--on-inverse); }

/* SegmentedTabs */
.cz-tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: var(--radius-pill); background: var(--surface-raised); border: 1px solid var(--line); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.cz-tabs::-webkit-scrollbar { display: none; }
.cz-tab { font: inherit; font-size: 13px; font-weight: 500; display: inline-flex; align-items: center; gap: var(--space-2); height: 36px; padding: 0 var(--space-4);
  border: 0; border-radius: var(--radius-pill); background: transparent; color: var(--ink-muted); cursor: pointer; white-space: nowrap; }
.cz-tab:hover { color: var(--ink); }
.cz-tab[aria-selected="true"] { background: var(--surface-inverse); color: var(--on-inverse); }
.cz-tab-count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 600; background: var(--surface-sunken); color: var(--ink); box-sizing: border-box; }
.cz-tab[aria-selected="true"] .cz-tab-count { background: var(--brand); color: var(--on-brand); }
@media (pointer: coarse) { .cz-tab { height: 40px; } }

/* Switch */
.cz-switch-wrap { display: inline-flex; align-items: center; gap: var(--space-3); font-size: 14px; color: var(--ink); cursor: pointer; }
.cz-switch { position: relative; width: 44px; height: 26px; border-radius: var(--radius-pill); border: 1.5px solid var(--line-strong); background: var(--surface-sunken);
  cursor: pointer; padding: 0; flex: none; transition: background-color .15s ease, border-color .15s ease; }
.cz-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: var(--line-strong); transition: transform .15s ease, background-color .15s ease; }
.cz-switch[aria-checked="true"] { background: var(--surface-inverse); border-color: var(--surface-inverse); }
.cz-switch[aria-checked="true"]::after { transform: translateX(18px); background: var(--brand); }
.cz-switch:disabled { opacity: .45; cursor: not-allowed; }

/* SearchField */
.cz-search { position: relative; display: flex; align-items: center; min-width: 0; }
.cz-search .cz-icon { position: absolute; left: 14px; color: var(--ink-subtle); pointer-events: none; }
.cz-search input { font: inherit; font-size: 14px; width: 100%; height: 40px; box-sizing: border-box; padding: 0 var(--space-4) 0 40px; border-radius: var(--radius-pill);
  border: 1px solid var(--line-strong); background: var(--surface-raised); color: var(--ink); }
.cz-search input::placeholder { color: var(--ink-subtle); }
@media (pointer: coarse) { .cz-search input { height: var(--target-min); font-size: 16px; } }

/* Avatar */
.cz-avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--brand-soft); color: var(--brand-ink);
  font-weight: 600; font-size: 12px; flex: none; overflow: hidden; box-sizing: border-box; }
.cz-avatar img { width: 100%; height: 100%; object-fit: cover; }
.cz-avatars { display: inline-flex; align-items: center; }
.cz-avatars .cz-avatar { border: 2px solid var(--surface-raised); margin-left: -8px; }
.cz-avatars .cz-avatar:first-child { margin-left: 0; }
.cz-avatar-more { background: var(--surface-sunken); color: var(--ink-muted); }

/* Card */
.cz-card { background: var(--surface-raised); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); padding: var(--space-5); box-sizing: border-box; min-width: 0; }
.cz-card-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); margin-bottom: var(--space-4); }
.cz-card-title { font-size: 16px; line-height: 22px; font-weight: 600; margin: 0; flex: 1; min-width: 140px; }
.cz-chip-icon { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: var(--surface-sunken); color: var(--ink); flex: none; }
.cz-chip-icon-brand { background: var(--brand-soft); color: var(--brand-ink); }

/* ProgressBar */
.cz-progress { display: flex; gap: 3px; align-items: center; width: 100%; }
.cz-progress-bar { height: 6px; border-radius: var(--radius-pill); background: var(--chart-bar); overflow: hidden; width: 100%; }
.cz-progress-fill { height: 100%; border-radius: inherit; background: var(--chart-bar-active); }
.cz-progress-tick { flex: 1; height: 16px; border-radius: 2px; background: var(--chart-bar); min-width: 2px; max-width: 4px; }
.cz-progress-tick.is-on { background: var(--chart-bar-active); }
.cz-progress-hero .cz-progress-tick { background: rgba(255,255,255,.3); }
.cz-progress-hero .cz-progress-tick.is-on { background: var(--on-hero); }
.cz-progress-hero.cz-progress-bar { background: rgba(255,255,255,.3); }
.cz-progress-hero .cz-progress-fill { background: var(--on-hero); }

/* HeroStat */
.cz-hero { position: relative; overflow: hidden; border-radius: var(--radius-lg); padding: var(--space-6); color: var(--on-hero); box-shadow: var(--shadow-pop);
  background: radial-gradient(60% 90% at 100% 0%, color-mix(in srgb, var(--hero-glow) 55%, transparent) 0%, transparent 70%), linear-gradient(135deg, var(--hero-from) 0%, var(--hero-to) 100%);
  display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-5); align-content: space-between; min-width: 0; }
.cz-hero-label { font-size: 13px; font-weight: 500; line-height: 18px; margin: 0 0 var(--space-2); }
.cz-hero-value { font-size: 56px; line-height: 60px; font-weight: 300; letter-spacing: -0.02em; margin: 0; white-space: nowrap; }
.cz-hero-value .cz-unit { color: var(--on-hero); font-size: 16px; }
.cz-hero-caption { font-size: 13px; line-height: 18px; margin: var(--space-3) 0 0; }
.cz-hero-segs { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: var(--space-3); }
.cz-hero-seg-label { font-size: 12px; line-height: 16px; margin: 0; }
.cz-hero-seg-value { font-size: 14px; font-weight: 600; line-height: 20px; margin: 2px 0 var(--space-2); }
.cz-hero-action { position: absolute; top: var(--space-5); right: var(--space-5); }

/* StatCard */
.cz-stat { display: flex; flex-direction: column; gap: var(--space-4); }
.cz-stat-head { display: flex; align-items: center; gap: var(--space-3); }
.cz-stat-label { font-size: 13px; font-weight: 500; color: var(--ink-muted); flex: 1; margin: 0; }
.cz-stat-value { font-size: 40px; line-height: 44px; font-weight: 300; letter-spacing: -0.01em; margin: 0; }
.cz-stat-foot { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.cz-stat-soft { background: linear-gradient(160deg, var(--brand-soft) 0%, var(--surface-raised) 100%); }
.cz-stat-soft .cz-stat-label, .cz-stat-soft .cz-stat-value { color: var(--brand-ink); }

/* BarChart */
.cz-chart { display: flex; align-items: flex-end; gap: 4px; width: 100%; position: relative; }
.cz-chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; position: relative; min-width: 0; }
.cz-chart-bar { width: 100%; max-width: 18px; border-radius: 6px 6px 3px 3px; background: var(--chart-bar); }
.cz-chart-col.is-active .cz-chart-bar { background: var(--chart-bar-active); }
.cz-chart-tip { position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: var(--surface-inverse); color: var(--on-inverse);
  font-size: 11px; font-weight: 600; line-height: 16px; padding: 4px 10px; border-radius: var(--radius-pill); white-space: nowrap; z-index: 1; }
.cz-chart-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-subtle); margin-top: var(--space-2); }

/* DataList: a table that turns into stacked cards in a narrow container */
.cz-dl { container-type: inline-size; container-name: dl; width: 100%; }
.cz-dl table { width: 100%; border-collapse: separate; border-spacing: 0 4px; font-size: 14px; }
.cz-dl th { text-align: left; font-size: 12px; font-weight: 400; color: var(--ink-subtle); padding: 0 var(--space-3) var(--space-1); white-space: nowrap; }
.cz-dl td { padding: var(--space-3); background: var(--surface-sunken); white-space: nowrap; }
.cz-dl td:first-child { border-radius: var(--radius-pill) 0 0 var(--radius-pill); }
.cz-dl td:last-child { border-radius: 0 var(--radius-pill) var(--radius-pill) 0; }
.cz-dl .is-right { text-align: right; }
.cz-dl .is-primary { font-weight: 500; }
.cz-dl tbody tr { cursor: default; }
.cz-dl tbody tr:hover td { background: var(--pink-50); }
@container dl (max-width: 560px) {
  .cz-dl thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .cz-dl table, .cz-dl tbody, .cz-dl tr, .cz-dl td { display: block; }
  .cz-dl table { border-spacing: 0; }
  .cz-dl tr { background: var(--surface-sunken); border-radius: var(--radius-md); padding: var(--space-3) var(--space-4); margin-bottom: var(--space-2);
    display: grid; grid-template-columns: 1fr auto; column-gap: var(--space-3); row-gap: 2px; }
  .cz-dl td { background: none !important; padding: 0; border-radius: 0 !important; white-space: normal; display: flex; justify-content: space-between; gap: var(--space-3); font-size: 13px; }
  .cz-dl td::before { content: attr(data-label); color: var(--ink-subtle); font-size: 12px; }
  .cz-dl td.is-primary { grid-column: 1 / -1; font-size: 15px; margin-bottom: var(--space-1); }
  .cz-dl td.is-primary::before { display: none; }
  .cz-dl td { grid-column: 1 / -1; }
}
[data-theme="dark"] .cz-dl tbody tr:hover td { background: var(--brand-soft); }

/* Stepper */
.cz-steps { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: var(--space-3); list-style: none; margin: 0; padding: var(--space-2); background: var(--surface-sunken); border-radius: var(--radius-md); }
.cz-steps-wrap { container-type: inline-size; container-name: steps; }
.cz-step { background: var(--surface-raised); border-radius: var(--radius-md); padding: var(--space-3) var(--space-4); display: flex; flex-direction: column; gap: 4px; min-width: 0; position: relative; }
.cz-step-top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.cz-step-eyebrow { font-size: 11px; color: var(--ink-subtle); }
.cz-step-title { font-size: 14px; font-weight: 600; margin: var(--space-1) 0 0; }
.cz-step-caption { font-size: 12px; color: var(--ink-muted); margin: 0 0 var(--space-1); }
.cz-step.is-current { background: var(--surface-inverse); color: var(--on-inverse); }
.cz-step.is-current .cz-step-eyebrow, .cz-step.is-current .cz-step-caption { color: var(--on-inverse); opacity: .8; }
@container steps (max-width: 560px) {
  .cz-steps { grid-auto-flow: row; }
}

/* SideNav */
.cz-nav { display: flex; flex-direction: column; gap: 2px; width: var(--nav-width); box-sizing: border-box; padding: var(--space-5) var(--space-4); background: var(--surface-raised); height: 100%; }
.cz-nav-logo { display: flex; align-items: center; height: 40px; padding: 0 var(--space-3); margin-bottom: var(--space-4); }
.cz-nav-logo img { height: 26px; width: auto; display: block; }
.cz-nav-group { font-size: 11px; font-weight: 500; color: var(--ink-subtle); padding: var(--space-4) var(--space-3) var(--space-1); text-transform: uppercase; letter-spacing: .06em; }
.cz-nav-item { font: inherit; font-size: 14px; display: flex; align-items: center; gap: var(--space-3); height: 40px; padding: 0 var(--space-3); border: 0; border-radius: var(--radius-pill);
  background: transparent; color: var(--ink-muted); cursor: pointer; text-align: left; width: 100%; }
.cz-nav-item:hover { background: var(--surface-sunken); color: var(--ink); }
.cz-nav-item[aria-current="page"] { background: var(--surface-inverse); color: var(--on-inverse); }
.cz-nav-item-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cz-nav-count { min-width: 20px; height: 20px; padding: 0 6px; box-sizing: border-box; border-radius: var(--radius-pill); background: var(--brand); color: var(--on-brand); font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.cz-nav-foot { margin-top: auto; display: flex; flex-direction: column; gap: 2px; padding-top: var(--space-4); }

/* BottomNav (mobile) */
.cz-bnav { display: flex; justify-content: space-around; align-items: center; gap: var(--space-1); height: var(--bottom-nav-height); padding: 0 var(--space-3) env(safe-area-inset-bottom); background: var(--surface-raised);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0; box-shadow: var(--shadow-pop); box-sizing: border-box; }
.cz-bnav-item { font: inherit; position: relative; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: var(--target-min); height: 52px; padding: 0 var(--space-2);
  border: 0; border-radius: var(--radius-pill); background: transparent; color: var(--ink-muted); cursor: pointer; font-size: 11px; font-weight: 500; white-space: nowrap; }
.cz-bnav-item[aria-current="page"] { flex-direction: row; gap: var(--space-2); padding: 0 var(--space-4); height: 44px; background: var(--surface-inverse); color: var(--on-inverse); font-size: 13px; }
.cz-bnav-dot { position: absolute; top: 6px; right: 8px; min-width: 16px; height: 16px; padding: 0 4px; box-sizing: border-box; border-radius: var(--radius-pill); background: var(--brand); color: var(--on-brand); font-size: 10px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.cz-bnav-item[aria-current="page"] .cz-bnav-dot { position: static; }

/* AppShell: sidebar on wide containers, top bar + bottom nav on narrow ones. Same features, same order. */
.cz-shell { container-type: inline-size; container-name: shell; background: var(--surface); min-height: 100%; }
.cz-shell-grid { display: grid; grid-template-columns: var(--nav-width) minmax(0, 1fr); min-height: 100%; }
.cz-shell-side { position: sticky; top: 0; height: 100%; min-height: 100%; }
.cz-shell-main { padding: var(--space-6) var(--space-8) var(--space-8); min-width: 0; }
.cz-shell-top { display: none; }
.cz-shell-bottom { display: none; }
.cz-page-head { display: flex; align-items: flex-start; gap: var(--space-4); margin-bottom: var(--space-6); flex-wrap: wrap; }
.cz-page-titles { flex: 1; min-width: 220px; }
.cz-page-title { font-size: 32px; line-height: 38px; font-weight: 400; letter-spacing: -0.01em; margin: 0; }
.cz-page-sub { font-size: 14px; line-height: 20px; color: var(--ink-muted); margin: 4px 0 0; }
.cz-page-actions { display: flex; gap: var(--space-2); align-items: center; flex-wrap: wrap; }
.cz-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--space-5); }
.cz-span-12 { grid-column: span 12; } .cz-span-8 { grid-column: span 8; } .cz-span-7 { grid-column: span 7; } .cz-span-6 { grid-column: span 6; }
.cz-span-5 { grid-column: span 5; } .cz-span-4 { grid-column: span 4; } .cz-span-3 { grid-column: span 3; }
@container shell (max-width: 1100px) {
  .cz-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--space-4); }
  .cz-span-8, .cz-span-7, .cz-span-12 { grid-column: span 6; }
  .cz-span-6, .cz-span-5, .cz-span-4, .cz-span-3 { grid-column: span 3; }
  .cz-shell-main { padding: var(--space-6); }
}
@container shell (max-width: 720px) {
  .cz-shell-grid { grid-template-columns: minmax(0, 1fr); }
  .cz-shell-side { display: none; }
  .cz-shell-top { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-3) var(--space-4); position: sticky; top: 0; z-index: 2; background: var(--surface); }
  .cz-shell-top img { height: 22px; width: auto; display: block; margin-right: auto; }
  .cz-shell-bottom { display: block; position: sticky; bottom: 0; z-index: 2; }
  .cz-shell-main { padding: var(--space-2) var(--space-4) var(--space-6); }
  .cz-page-title { font-size: 26px; line-height: 32px; }
  .cz-page-actions { width: 100%; }
  .cz-page-actions > * { flex: 1; }
  .cz-grid { grid-template-columns: minmax(0, 1fr); gap: var(--space-3); }
  .cz-grid > * { grid-column: 1 / -1; }
  .cz-hero { grid-template-columns: minmax(0, 1fr); padding: var(--space-5); gap: var(--space-5); }
  .cz-hero-value { font-size: 44px; line-height: 48px; }
  .cz-card { padding: var(--space-4); }
}

.cz-nav-sheet { width: 100%; height: auto; border-radius: var(--radius-lg); box-shadow: var(--shadow-pop); }
