/* Mellenza workspace: one calm shell for every operational screen. */
html { color-scheme: light; }
body { background: rgb(var(--paper)); background-image: none; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
button, summary { cursor: pointer; }
:where(a, button, summary, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid rgb(var(--accent)); outline-offset: 3px;
}
[hidden] { display: none !important; }
.workspace-shell { display: flex; height: 100vh; height: 100dvh; isolation: isolate; }
.workspace-main { flex: 1; min-width: 0; overflow: auto; overscroll-behavior-y: contain; }
.workspace-sidebar {
  display: flex; flex-direction: column; width: 238px; flex: 0 0 238px;
  background: rgb(var(--surface)); border-right: 1px solid rgb(var(--line));
}
.sidebar-brand { display: flex; align-items: center; justify-content: space-between; min-height: 104px; padding: 24px 23px 21px; }
.sidebar-brand a { display: flex; flex-direction: column; gap: 9px; }
.sidebar-brand img { width: 132px; height: auto; }
.sidebar-brand a > span { color: rgb(var(--ink-3)); font-size: 11px; line-height: 1; letter-spacing: .13em; text-transform: uppercase; }
.sidebar-navigation { flex: 1; min-height: 0; overflow-y: auto; padding: 0 13px 18px; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 11px; min-height: 37px;
  padding: 8px 11px; margin: 2px 0; border-radius: 6px; color: rgb(var(--ink-2));
  font-size: 12.5px; font-weight: 450; line-height: 1.4; transition: background-color .13s, color .13s;
}
.nav-item > svg { width: 16px; height: 16px; flex: 0 0 16px; color: rgb(var(--ink-3)); }
.nav-item:hover { color: rgb(var(--ink)); background: rgb(var(--stone-50)); }
.nav-item.is-active { background: rgb(var(--accent-soft)); color: rgb(var(--accent)); font-weight: 600; }
.nav-item.is-active > svg { color: inherit; }
.nav-item.is-active::before { position: absolute; content: ''; left: -13px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 2px 2px 0; background: rgb(var(--accent)); }
.nav-group { margin-top: 17px; }
.nav-group > summary {
  display: flex; align-items: center; justify-content: space-between; padding: 6px 11px;
  font-size: 10px; line-height: 1.5; font-weight: 600; text-transform: uppercase;
  letter-spacing: .095em; color: rgb(var(--ink-3)); list-style: none; user-select: none;
}
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary svg { transition: transform .13s; }
.nav-group[open] > summary svg { transform: rotate(90deg); }
.nav-group > summary:hover { color: rgb(var(--ink)); }
.nav-group-links { padding-top: 3px; }
.sidebar-footer { flex: 0 0 auto; border-top: 1px solid rgb(var(--line)); padding: 14px 13px 10px; }
.sidebar-identity { display: flex; align-items: center; gap: 10px; padding: 0 8px 10px; }
.sidebar-identity > div { min-width: 0; }
.identity-mark, .workspace-avatar { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 32px; height: 32px; border: 1px solid rgb(var(--line)); background: rgb(var(--paper)); border-radius: 50%; font-size: 12px; font-weight: 600; color: rgb(var(--ink-2)); }
.identity-email { display: block; max-width: 157px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; font-weight: 500; }
.identity-role { display: block; color: rgb(var(--ink-3)); font-size: 10.5px; margin-top: 2px; }
.signout-link { min-height: 32px; font-size: 11.5px; color: rgb(var(--ink-3)); }
.workspace-topbar { position: sticky; top: 0; z-index: 30; background: rgb(var(--surface)); border-bottom: 1px solid rgb(var(--line)); }
.topbar-inner { display: flex; align-items: center; gap: 21px; height: 65px; max-width: 1504px; padding: 0 34px; margin: 0 auto; }
.topbar-workspace { font-size: 12px; font-weight: 500; color: rgb(var(--ink-2)); }
.topbar-divider { width: 1px; height: 17px; background: rgb(var(--line)); }
.workspace-search { display: flex; align-items: center; gap: 10px; min-width: 0; width: min(310px, 35vw); color: rgb(var(--ink-3)); text-align: left; font-size: 12px; }
.workspace-search > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace-search svg { flex: 0 0 auto; }
.workspace-search .key { margin-left: auto; white-space: nowrap; }
.workspace-search:hover { color: rgb(var(--ink)); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 20px; flex-shrink: 0; }
.topbar-date { color: rgb(var(--ink-3)); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.topbar-capture { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 32px; padding: 6px 10px; border: 1px solid rgb(var(--line)); border-radius: 6px; background: rgb(var(--surface)); color: rgb(var(--ink-2)); font-size: 11.5px; font-weight: 500; }
.topbar-capture:hover { background: rgb(var(--paper)); border-color: rgb(var(--stone-300)); }
.workspace-avatar { width: 29px; height: 29px; font-size: 11px; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; flex: 0 0 auto; border: 1px solid rgb(var(--line)); border-radius: 7px; color: rgb(var(--ink-2)); background: rgb(var(--surface)); }
.mobile-nav-toggle { display: none; }
.app-canvas { max-width: 1504px; padding-bottom: 32px; }
#main-content:focus { outline: none; }
.page-head { padding: 30px 34px 24px; background: transparent; border-bottom: 0; }
.page-head > .flex:not(nav) { flex-wrap: wrap; row-gap: 18px; }
.page-head > .flex > .flex, .page-head form { flex-wrap: wrap; }
.page-title { font-family: var(--font-sans); font-size: 28px; font-weight: 600; line-height: 1.2; letter-spacing: -.045em; }
.page-crumb { font-size: 10px; font-weight: 500; letter-spacing: .06em; }
.page-subtitle { margin-top: 8px; font-size: 12.5px; line-height: 1.7; max-width: 760px; }
.section { padding: 8px 34px 0; margin-bottom: 22px; }
.section-head { margin-bottom: 13px; align-items: center; }
.section-label { font-size: 13px; font-weight: 600; text-transform: none; letter-spacing: -.01em; color: rgb(var(--ink-2)); }
.section-meta { font-size: 11.5px; }
.card, .kpi { border-color: rgb(var(--line)); border-radius: 10px; box-shadow: 0 1px 2px rgb(24 32 41 / .025); }
.kpi { padding: 19px 20px; min-width: 0; }
.kpi-label { font-size: 11.5px; font-weight: 500; text-transform: none; letter-spacing: 0; }
.kpi-value { margin-top: 12px; font-size: 29px; line-height: 1.1; letter-spacing: -.04em; }
.kpi-sub { margin-top: 10px; font-size: 11px; line-height: 1.5; }
.btn-primary, .btn-secondary, .btn-ghost, .btn-danger { min-height: 35px; padding: 7px 12px; font-size: 12px; line-height: 1.4; border-radius: 6px; }
.btn-primary { box-shadow: 0 1px 2px rgb(24 32 41 / .08); }
.input { min-height: 36px; font-size: 12.5px; border-radius: 6px; }
textarea.input { min-height: 90px; }
.pill { padding: 4px 7px; font-size: 10.5px; line-height: 1.25; border-radius: 4px; }
.pill-dot { width: 5px; height: 5px; }
table { font-variant-numeric: tabular-nums; }
thead { background-color: rgb(var(--stone-50)); }
thead th { border-bottom: 1px solid rgb(var(--line)); color: rgb(var(--ink-3)); }
tbody tr { transition: background-color .1s; }
table td, table th { vertical-align: middle; }
.overflow-x-auto { overscroll-behavior-x: contain; }
.app-canvas :where(.card, .rounded-lg, .rounded-md):has(> table) { overflow-x: auto; overscroll-behavior-x: contain; }
input[type="checkbox"], input[type="radio"] { width: 14px; height: 14px; vertical-align: middle; }
kbd.key { font-size: 10px; height: 20px; padding: 0 5px; border-radius: 4px; }
.cmdk-panel { border-radius: 12px; box-shadow: 0 18px 70px rgb(24 32 41 / .18); }
.cmdk-row:focus { background: rgb(var(--accent-soft)); outline: none; }
#cmdk-input { min-height: 54px; }
#cmdk-results { padding: 8px; }
#idea-quick { border: 0; max-width: 96vw; border-radius: 12px; box-shadow: 0 18px 70px rgb(24 32 41 / .18); }
#idea-quick::backdrop { background: rgb(24 32 41 / .35); }
.skip-link { position: fixed; top: 10px; left: 10px; transform: translateY(-150%); z-index: 100; padding: 10px 15px; background: rgb(var(--surface)); border: 1px solid rgb(var(--accent)); border-radius: 6px; font-size: 13px; }
.skip-link:focus { transform: translateY(0); }
.nav-backdrop { display: none; }
/* Keep long forms, filters and tab rows usable on narrow viewports. */
@media (max-width: 1199px) {
  .topbar-workspace, .topbar-divider { display: none; }
  .topbar-actions { gap: 12px; }
  .workspace-sidebar { width: 220px; flex-basis: 220px; }
  .topbar-inner { padding: 0 25px; }
  .page-head { padding-left: 25px; padding-right: 25px; }
  .section { padding-left: 25px; padding-right: 25px; }
}
@media (max-width: 900px) {
  .workspace-sidebar { position: fixed; inset: 0 auto 0 0; width: 264px; z-index: 60; transform: translateX(-100%); transition: transform .16s ease; visibility: hidden; }
  .workspace-shell.nav-open .workspace-sidebar { transform: translateX(0); visibility: visible; }
  .workspace-shell.nav-open .nav-backdrop { display: block; position: fixed; inset: 0; z-index: 55; background: rgb(24 32 41 / .35); }
  .mobile-nav-toggle { display: inline-flex; }
  .topbar-inner { height: 60px; padding: 0 20px; gap: 15px; }
  .workspace-search { width: auto; flex: 1; max-width: 310px; }
  .workspace-search .key { display: none; }
  .sidebar-brand { min-height: 96px; }
  .topbar-date { display: none; }
  .page-head { padding: 26px 20px 20px; }
  .section { padding-left: 20px; padding-right: 20px; }
  .app-canvas .px-8 { padding-left: 20px; padding-right: 20px; }
  .app-canvas .mx-8 { margin-left: 20px; margin-right: 20px; }
  .identity-email { max-width: 183px; }
}
@media (max-width: 600px) {
  .topbar-inner { padding: 0 14px; gap: 10px; }
  .topbar-actions { gap: 9px; }
  .topbar-capture { width: 33px; padding: 0; }
  .topbar-capture span { display: none; }
  .workspace-avatar { width: 29px; height: 29px; }
  .workspace-search { font-size: 11.5px; }
  .page-head { padding: 24px 16px 20px; }
  .page-title { font-size: 26px; }
  .page-subtitle { font-size: 12px; }
  .section { padding-left: 16px; padding-right: 16px; margin-bottom: 20px; }
  .app-canvas .px-8 { padding-left: 16px; padding-right: 16px; }
  .app-canvas .mx-8 { margin-left: 16px; margin-right: 16px; }
  .page-head > .flex { align-items: flex-start; }
  .page-head > .flex > *, .page-head form, .page-head form > div { max-width: 100%; }
  .page-head form { width: 100%; }
  .page-head .input { max-width: 100%; }
  .page-head nav { max-width: 100%; }
  .kpi { padding: 16px; }
  .kpi-value { font-size: 25px; }
  .section-head { gap: 10px; flex-wrap: wrap; }
  .app-canvas .grid-cols-4:not(.home-metrics), .app-canvas .grid-cols-5, .app-canvas .grid-cols-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .btn-primary, .btn-secondary, .btn-ghost, .btn-danger { min-height: 38px; }
  .input { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0s !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
