/* Kirpa light frost: glass for the frame, solid surfaces for daily work. */
:root {
  --canvas: #eeeae2;
  --secondary: #4f514d;
  --brand-ink: #8b370b;
  --soft: #f0ede7;
  --line: #e4e0d7;
  --sidebar: 216px;
  --glass-fill: #fff;
  --menu-fill: #fff;
  --work-fill: #fff;
  --dense-fill: #fff;
  --control-fill: #fff;
  --glass-filter: none;
  --menu-filter: none;
  --glass-edge: #fffffff0;
  --frame-shadow: 0 16px 40px #68513b26, 0 0 0 1px #72665314, inset 0 1px 0 #fff, inset 0 -1px 0 #ffffff99;
  --panel-shadow: 0 8px 32px #68513b12, 0 0 0 1px #7266530d, inset 0 1px 0 #fff;
}

@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root {
    --glass-fill: #ffffff6b;
    --menu-fill: #ffffffcc;
    --work-fill: #ffffffe0;
    --dense-fill: #fffffff5;
    --control-fill: #ffffff99;
    --glass-filter: blur(24px) saturate(135%);
    --menu-filter: blur(24px) saturate(125%);
  }
}

:root[data-surfaces="solid"] {
  --glass-fill: #fff;
  --menu-fill: #fff;
  --work-fill: #fff;
  --dense-fill: #fff;
  --control-fill: #fff;
  --glass-filter: none;
  --menu-filter: none;
  --glass-edge: var(--line);
}

@media (prefers-reduced-transparency: reduce) {
  :root {
    --glass-fill: #fff;
    --menu-fill: #fff;
    --work-fill: #fff;
    --dense-fill: #fff;
    --control-fill: #fff;
    --glass-filter: none;
    --menu-filter: none;
    --glass-edge: var(--line);
  }
}

html { scroll-padding-top: calc(var(--bar) + 112px); scroll-padding-bottom: 24px; }
body { isolation: isolate; }
body::before {
  content: "";
  position: fixed;
  pointer-events: none;
  z-index: -1;
}
body::before {
  inset: var(--bar) 0 0;
  background: url('assets/glass-backdrop.svg') center / 100% 100% no-repeat;
}

.prototype-bar { background: #eae5db; color: var(--secondary); }
.prototype-bar button { color: var(--ink); min-height: 32px; border-radius: 8px; }
.prototype-bar button:hover { background: #ded7ca; }
.sample-dot { background: var(--brand); }
.sidebar, .topbar {
  background: var(--glass-fill);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--frame-shadow);
  -webkit-backdrop-filter: var(--glass-filter);
  backdrop-filter: var(--glass-filter);
}
.sidebar {
  left: 24px;
  top: calc(var(--bar) + 24px);
  bottom: 24px;
  padding: 24px 16px 16px;
  border-radius: 24px;
  overflow-y: auto;
  scrollbar-width: thin;
}
.wordmark { padding: 0 8px 24px; }
.workspace-button { border-radius: 12px; background: var(--control-fill); border: 1px solid var(--glass-edge); box-shadow: inset 0 1px 0 #ffffffb3; }
.workspace-button:hover { background: #ffffffe6; }
.nav-link, .profile-button { border: 1px solid transparent; border-radius: 12px; }
.nav-link:hover, .profile-button:hover { background: #ffffffb3; }
.nav-link.active { background: #ffffffb3; border-color: #fff; color: var(--brand-ink); box-shadow: 0 4px 12px #68513b12, inset 0 1px 0 #fff; }
.sidebar-foot { padding-top: 24px; }
.app-body {
  margin-left: calc(var(--sidebar) + 24px);
  padding: calc(var(--bar) + 24px) 24px 24px;
}
.topbar {
  min-height: 64px;
  padding: 8px 16px;
  border-radius: 24px;
  position: sticky;
  top: calc(var(--bar) + 24px);
  z-index: 30;
}
.breadcrumb { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-actions { flex-shrink: 0; gap: 12px; }
.search-short { display: none; }
.search-button, .notification-button { min-height: 44px; padding: 8px 12px; border-radius: 12px; }
.notification-count { width: 24px; height: 24px; }
.keycap { background: #ffffff80; border-color: #d8d2c6; }
.page { padding-top: 40px; }
.page-header h1 { font-size: 36px; line-height: 40px; }
.page-header p { max-width: 640px; }

.btn, .dialog-close, .tab, .filter-button { min-height: 44px; }
.btn { border-radius: 12px; background: var(--control-fill); box-shadow: 0 2px 8px #68513b08, inset 0 1px 0 #fff; }
.btn.primary { box-shadow: 0 6px 16px #b547081a, inset 0 1px 0 #ffffff66, inset 0 -1px 0 #72260033; }
.btn.small { min-height: 44px; }
.btn.quiet { box-shadow: none; }
.dialog-close { min-width: 44px; border-radius: 12px; }
.link { min-height: 44px; display: inline-flex; align-items: center; color: var(--brand-ink); }
.brand { color: var(--brand-ink); }
.add-lead-control { border-radius: 12px; box-shadow: 0 4px 12px #b547080d; }
.add-lead-control > .btn.primary { min-height: 44px; border-radius: 12px 0 0 12px; box-shadow: none; }
.add-lead-options > summary { border-radius: 0 12px 12px 0; }
.add-lead-dropdown {
  background: var(--menu-fill);
  -webkit-backdrop-filter: var(--menu-filter);
  backdrop-filter: var(--menu-filter);
  border-color: var(--glass-edge);
  border-radius: 16px;
  box-shadow: var(--frame-shadow);
}
.add-lead-dropdown button:focus-visible { outline-offset: 0; }

.work-panel, .panel, .record-panel, .lead-list, .metric-card, .resource-card, .more-link {
  background: var(--work-fill);
  border: 1px solid var(--glass-edge);
  border-radius: 16px;
  box-shadow: var(--panel-shadow);
}
.work-panel, .lead-list { padding: 24px; }
.lead-list, .record-panel { background: var(--dense-fill); }
.dashboard-grid { gap: 24px; }
.task-list { margin-top: 8px; }
.task-row { min-height: 80px; padding: 16px 0; gap: 16px; border-color: #edeae4; }
.task-row p, .ready-row p { margin-top: 4px; }
.notice { border-radius: 12px; }
.agenda-item {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 4px 12px;
  padding: 16px 12px;
  border: 1px solid transparent;
  border-radius: 12px;
}
.agenda-item::before { content: none; }
.agenda-item .time { grid-row: 1 / 3; color: var(--ink); }
.agenda-item strong { margin: 0; font-size: 14px; line-height: 20px; }
.agenda-item small { grid-column: 2; margin: 0; }
.agenda-item[data-action="shoot"] { background: #fcf4ea; border-color: #f1e6d7; }
.ready-row { gap: 16px; padding: 16px 0; }
.mini-cover { width: 64px; height: 64px; border-radius: 12px; background: #e7dece; }

.tabs {
  display: inline-flex;
  max-width: 100%;
  padding: 4px;
  gap: 4px;
  background: var(--control-fill);
  border: 1px solid var(--glass-edge);
  border-radius: 16px;
  box-shadow: 0 4px 16px #68513b0d, inset 0 1px 0 #fff;
  -webkit-backdrop-filter: var(--menu-filter);
  backdrop-filter: var(--menu-filter);
}
.tab { border-radius: 12px; }
.tab.active { background: #fffffff5; color: var(--brand-ink); box-shadow: 0 3px 12px #68513b1a, inset 0 1px 0 #fff; }
.tab:hover:not(.active) { background: #ffffff66; }
.filter-button { border-radius: 12px; background: var(--control-fill); box-shadow: inset 0 1px 0 #fff; }
.filter-button.active { background: var(--accent); color: var(--brand); border-color: #cf8f63; font-weight: 600; }
.search-field, input:not([type="checkbox"]):not([type="radio"]), select, textarea { border-radius: 12px; }
.lead-card { border: 1px solid transparent; border-radius: 12px; padding: 16px 12px; }
.lead-card:hover { border-radius: 12px; background: #f7f5f0; }
.lead-card.selected { border-color: #d9ae8a; border-radius: 12px; background: #fcf4ea; }
.lead-card + .lead-card { margin-top: 8px; }
.record-panel { top: calc(var(--bar) + 112px); }
.content-card { background: var(--work-fill); border: 1px solid var(--glass-edge); border-radius: 16px; padding: 16px; box-shadow: var(--panel-shadow); }
.content-card.selected { border-color: #d9ae8a; }
.content-card .cover, .large-cover { border-radius: 12px; }
.metric-card { transition: transform 300ms var(--curve), border-color 300ms var(--curve); }
.metric-card:hover { transform: translateY(-2px); border-color: #c7bbac; }
.day-button, .booking-block, .choice, .more-link { border-radius: 12px; }
.day-button.active { box-shadow: inset 0 0 0 1px var(--brand); }
.appointment, .request-row { background: var(--work-fill); border: 1px solid var(--glass-edge); border-radius: 16px; padding: 24px; margin-bottom: 16px; box-shadow: var(--panel-shadow); }
.board-wrap { background: var(--dense-fill); border: 1px solid var(--glass-edge); border-radius: 16px; padding: 24px; box-shadow: var(--panel-shadow); }
.appearance-panel { grid-column: 1 / -1; }
.appearance-panel .check-label { margin-top: 16px; align-items: center; }
.appearance-panel .check-label input { margin-top: 0; }

dialog { border-radius: 24px; border-color: var(--line); box-shadow: 0 24px 64px #20202026; }
dialog::backdrop { background: #20202066; -webkit-backdrop-filter: none; backdrop-filter: none; }
.dialog-footer { background: #faf9f6; border-radius: 0 0 24px 24px; }
.choice { background: #fff; }
.toast { border: 1px solid #ffffff26; border-radius: 16px; }
.app-footer { margin-top: 32px; }
.app-footer button { min-height: 44px; }

@media (max-width: 1279px) {
  :root { --sidebar: 208px; }
  .dashboard-grid > aside { gap: 24px; }
  .page-header h1 { font-size: 30px; line-height: 36px; }
  .record-panel { position: static; }
}

@media (max-width: 899px) {
  :root { --sidebar: 0px; }
  body::before { background-image: url('assets/glass-backdrop-mobile.svg'); }
  .app-body { margin-left: 0; padding: calc(var(--bar) + 16px) 16px calc(128px + env(safe-area-inset-bottom)); }
  html { scroll-padding-top: calc(var(--bar) + 16px); scroll-padding-bottom: 128px; }
  .topbar { position: relative; top: auto; min-height: 64px; gap: 8px; padding: 8px 12px; }
  .topbar-actions { gap: 4px; }
  .search-long { display: none; }
  .search-short { display: inline; }
  .search-button, .notification-button { padding: 8px; }
  .mobile-workspace { min-height: 44px; }
  .page { padding-top: 24px; }
  .page-header { gap: 16px; }
  .page-header h1 { font-size: 30px; line-height: 36px; }
  .page-header:has(.add-lead-control) { flex-wrap: wrap; }
  .page-header:has(.add-lead-control) > div:first-child { flex-basis: 100%; }
  .add-lead-dropdown { left: -1px; right: auto; }
  .work-panel, .panel, .lead-list, .record-panel { padding: 16px; }
  .dashboard-grid > aside { order: initial; }
  .dashboard-grid > aside > .panel .agenda-item,
  .dashboard-grid > aside > .panel .agenda-item ~ .agenda-item { display: grid; padding: 16px 12px; }
  .task-row { padding: 16px 0; }
  .task-row .grow { flex-basis: 100%; }
  .task-row .btn { margin-top: 0; }
  .ready-row .btn { margin-left: 0; }
  .tabs { width: max-content; max-width: 100%; }
  .tab { padding: 8px; }
  .lead-card { padding: 16px 8px; }
  .record-panel { background: var(--dense-fill); border: 1px solid var(--glass-edge); }
  .record-panel .record-section { padding-top: 24px; }
  .content-card { padding: 12px; }
  .content-card .cover { width: 96px; }
  .appointment, .request-row { padding: 16px; }
  .mobile-nav {
    left: 12px;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    min-height: 72px;
    padding: 8px;
    gap: 4px;
    border: 1px solid var(--glass-edge);
    border-radius: 24px;
    background: var(--menu-fill);
    -webkit-backdrop-filter: var(--menu-filter);
    backdrop-filter: var(--menu-filter);
    box-shadow: var(--frame-shadow);
  }
  .mobile-nav a { min-height: 48px; padding: 12px 4px; border-radius: 12px; font-weight: 400; }
  .mobile-nav a.active { font-weight: 600; color: var(--brand-ink); background: #ffffffe6; box-shadow: 0 3px 12px #68513b1a; }
  .toast { bottom: calc(104px + env(safe-area-inset-bottom)); }
  dialog, dialog.wide { border-radius: 24px; }
  dialog[open]:has(form) { display: flex; flex-direction: column; height: calc(100dvh - 24px); max-height: calc(100dvh - 24px); overflow: hidden; }
  dialog:has(form) .dialog-header, dialog:has(form) .dialog-footer { flex-shrink: 0; }
  dialog:has(form) .dialog-body { flex: 1; min-height: 0; overflow-y: auto; }
}

@media (max-width: 389px) {
  .page-header h1 { font-size: 24px; line-height: 32px; }
  .mobile-nav { gap: 0; padding: 8px 4px; }
  .mobile-nav a { padding: 12px 2px; }
  .content-card { align-items: flex-start; }
  .content-card .cover { width: 64px; padding: 8px; }
  .content-card .cover .cover-kicker { font-size: 12px; line-height: 16px; }
  .lead-list .toolbar { flex-wrap: wrap; }
  .lead-list .toolbar .search-field { flex-basis: 100%; }
}

@media (prefers-contrast: more) {
  :root { --line: #7d7b74; --glass-fill: #fff; --menu-fill: #fff; --work-fill: #fff; --dense-fill: #fff; --control-fill: #fff; --glass-filter: none; --menu-filter: none; --glass-edge: #7d7b74; }
}

@media (forced-colors: active) {
  body::before, body::after { display: none; }
  .sidebar, .topbar, .mobile-nav, .add-lead-dropdown { background: Canvas; -webkit-backdrop-filter: none; backdrop-filter: none; border-color: CanvasText; }
  .tab.active, .nav-link.active, .mobile-nav a.active { outline: 2px solid Highlight; outline-offset: -2px; }
}
