/* Shared workspace surfaces and controls. Feature-specific layouts keep their own rules. */
:root {
  --ui-page: #f6f7f9;
  --ui-sidebar: #f0f2f5;
  --ui-panel: #fff;
  --ui-hover: #e5eaf1;
  --ui-active: #dce8f8;
  --ui-border: #dde1e8;
  --ui-text: #252b34;
  --ui-muted: #68717f;
  --ui-accent: #2869bd;
  --ui-action: #2564ad;
  --ui-action-hover: #1e5495;
  --ui-shadow: 0 1px 3px rgb(32 41 56 / .05);
}
html.dark {
  --ui-page: #101114;
  --ui-sidebar: #1c1d21;
  --ui-panel: #191a1e;
  --ui-hover: #292b31;
  --ui-active: #30333d;
  --ui-border: #34363d;
  --ui-text: #e8e9ed;
  --ui-muted: #a4a9b3;
  --ui-accent: #8abaff;
  --ui-action: #286bb8;
  --ui-action-hover: #2e72bf;
  --ui-shadow: 0 1px 3px rgb(0 0 0 / .15);
}
.app-shell { background: var(--ui-page); color: var(--ui-text); }
.app-sidebar { background: var(--ui-sidebar); border-right: 1px solid var(--ui-border); }
.app-brand { display: flex; align-items: center; gap: 11px; min-height: 72px; padding: 14px 16px; color: var(--ui-text); text-decoration: none; }
.app-brand-mark { display: grid; flex: 0 0 auto; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: #347fe1; color: #fff; box-shadow: inset 0 1px 0 #ffffff38; }
.app-brand-mark .material-symbols-outlined { font-size: 21px; }
.app-brand-copy { display: flex; flex-direction: column; min-width: 0; }
.app-brand-copy strong { font-size: 15px; font-weight: 700; letter-spacing: -.025em; line-height: 1.25; }
.app-brand-copy small { margin-top: 3px; color: var(--ui-muted); font-size: 11px; line-height: 1.2; }
.app-sidebar-items { padding: 4px 10px 16px; }
.app-nav-group { padding: 12px 9px 6px; color: var(--ui-muted); font-size: 11px; font-weight: 600; }
.app-nav-group-spaced { padding-top: 20px; }
.app-nav-link { display: flex; align-items: center; gap: 11px; min-height: 39px; margin: 2px 0; padding: 8px 10px; border-radius: 7px; color: var(--ui-muted); font-size: 13px; font-weight: 500; line-height: 1.3; text-decoration: none; transition: color .15s, background-color .15s; }
.app-nav-link .material-symbols-outlined { flex: 0 0 auto; font-size: 19px; }
.app-nav-link:hover { background: var(--ui-hover); color: var(--ui-text); }
.app-nav-link.is-active { background: var(--ui-active); color: var(--ui-accent); font-weight: 650; }
.app-sidebar-footer { display: flex; align-items: flex-start; gap: 9px; padding: 15px 17px 17px; border-top: 1px solid var(--ui-border); }
.app-sidebar-footer div { display: flex; flex-direction: column; min-width: 0; }
.app-sidebar-footer strong { color: var(--ui-text); font-size: 11px; font-weight: 600; }
.app-sidebar-footer small { overflow: hidden; margin-top: 3px; color: var(--ui-muted); font-size: 10px; line-height: 1.4; text-overflow: ellipsis; }
.app-status-dot { display: inline-block; flex: 0 0 auto; width: 7px; height: 7px; margin-top: 4px; border-radius: 50%; background: #27ad7b; box-shadow: 0 0 0 3px rgb(39 173 123 / .12); }
.app-header { gap: 16px; min-height: 68px; border-bottom-color: var(--ui-border); background: var(--ui-panel); }
.app-shell .app-header-title { color: var(--ui-text); font-family: Inter, sans-serif; font-size: 16px; font-weight: 650; letter-spacing: -.01em; }
.app-header-kicker { margin-top: 2px; color: var(--ui-muted); font-size: 10px; font-weight: 500; letter-spacing: .06em; }
.app-header-controls { gap: 8px; }
.app-header-status { display: inline-flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--ui-border); border-radius: 7px; color: var(--ui-muted); font-size: 11px; font-weight: 600; white-space: nowrap; }
.app-header-status .app-status-dot { margin-top: 0; }
.theme-toggle, .app-profile-control select, .app-profile-control button, .app-header > a, .app-desktop-user > div { border-color: var(--ui-border); border-radius: 7px; background: var(--ui-panel); color: var(--ui-text); box-shadow: none; }
.theme-toggle { min-height: 36px; padding: 7px 10px; }
.theme-toggle:hover, .app-profile-control button:hover, .app-header > a:hover { border-color: var(--ui-accent); background: var(--ui-hover); color: var(--ui-accent); }
.app-profile-control { gap: 6px; }
.app-profile-label { display: inline-flex; align-items: center; gap: 5px; color: var(--ui-muted); font-size: 11px; font-weight: 600; }
.app-profile-label .material-symbols-outlined { font-size: 18px; }
.app-profile-control select { font-size: 12px; font-weight: 600; }
.app-header > a { align-items: center; min-height: 36px; font-size: 11px; }
.app-desktop-user > div { font-weight: 500; }
.app-content { background: var(--ui-page); }
.app-content :is(h1, h2, h3, h4)[class~="text-primary"] { color: var(--ui-text); }
.app-content :is(h1, h2, h3, h4) { letter-spacing: -.015em; }
.app-content :is(section, article, aside)[class~="border"]:not(.cw-shell) { border-color: var(--ui-border); border-radius: 9px; box-shadow: var(--ui-shadow); }
.app-content :is(div, section, article, aside)[class~="rounded-sm"][class~="bg-surface-container-lowest"] { border-color: var(--ui-border); border-radius: 9px; }
.app-content :is(button, a, input, select, textarea, summary)[class~="rounded-sm"] { border-radius: 7px; }
.app-content :where(input:not([type="checkbox"]):not([type="radio"]), select, textarea) { border-radius: 7px; }
.app-content :where(input, select, textarea):focus-visible { outline-color: var(--ui-accent); }
.app-content :is(button, a)[class~="bg-primary"], .app-content :is(button, a)[class~="bg-secondary"] { background-color: var(--ui-action); color: #fff; }
.app-content :is(button, a)[class~="bg-primary"]:hover, .app-content :is(button, a)[class~="bg-secondary"]:hover { background-color: var(--ui-action-hover); }
.app-content :is(button, a)[class~="bg-primary"]:disabled, .app-content :is(button, a)[class~="bg-secondary"]:disabled { opacity: .5; }
.app-content table { border-collapse: collapse; }
.app-content thead { color: var(--ui-muted); }
.app-content :is(td, th) { border-color: var(--ui-border); }
.app-metric { min-height: 128px; border-color: var(--ui-border) !important; border-radius: 9px !important; box-shadow: var(--ui-shadow); }
.app-metric-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; color: var(--ui-muted); font-size: 12px; font-weight: 600; }
.app-metric-icon { display: grid; flex: 0 0 auto; place-items: center; width: 32px; height: 32px; margin: -3px -3px 0 0; border-radius: 8px; background: var(--ui-hover); color: var(--ui-accent); }
.app-metric-icon .material-symbols-outlined { font-size: 18px; }
.app-metric-value { margin-top: 6px; color: var(--ui-text); font-size: 26px; font-weight: 700; letter-spacing: -.035em; line-height: 1.15; }
.app-metric-note { display: flex; align-items: center; gap: 6px; margin-top: 10px; color: var(--ui-muted); font-size: 11px; line-height: 1.4; }
.app-metric-dot { flex: 0 0 auto; width: 6px; height: 6px; border-radius: 50%; }
.navigation-drawer { background: var(--ui-sidebar); color: var(--ui-text); }
.navigation-drawer header, .navigation-drawer footer { border-color: var(--ui-border); }
.navigation-drawer header h2 { color: var(--ui-text); font-family: Inter, sans-serif; font-size: 16px; }
.navigation-trigger, .navigation-close { border-color: var(--ui-border); border-radius: 7px; background: var(--ui-panel); color: var(--ui-text); }
.navigation-drawer::backdrop { background: rgb(4 8 15 / .65); }
.navigation-area-link { margin-top: 8px; border-radius: 7px; color: var(--ui-accent); }
.navigation-area-link:hover { background: var(--ui-hover); }
.navigation-drawer footer > div { border-color: var(--ui-border); border-radius: 7px; background: var(--ui-panel); }
html.dark .navigation-drawer { background: var(--ui-sidebar); }
html.dark .navigation-trigger { border-color: var(--ui-border); background: var(--ui-panel); color: var(--ui-text); }
html.dark .app-content ::selection { background: #30588a; color: #eef5ff; }
.app-scrollbar::-webkit-scrollbar-thumb { border-radius: 99px; }
@media (min-width: 1280px) {
  .app-sidebar { width: 240px; }
  .app-shell-main { margin-left: 240px; }
}
@media (min-width: 1280px) and (max-width: 1500px) {
  .app-shell .cw-shell { grid-template-columns: 285px minmax(0, 1fr); }
  .app-shell .cw-conversation:not(.cw-details-hidden) { grid-template-columns: minmax(0, 1fr) 225px; }
}
@media (max-width: 1279px) {
  .app-header { gap: 10px; }
  .navigation-drawer nav { padding: 8px 10px 16px; }
  .navigation-drawer .app-nav-link { min-height: 44px; }
}
@media (max-width: 639px) {
  .app-header { min-height: 0; }
  .app-shell .app-header-title { font-size: 15px; }
  .app-header-controls { gap: 7px; }
  .app-profile-label > span:last-child { display: none; }
  .app-content :is(section, article, aside)[class~="border"]:not(.cw-shell) { border-radius: 8px; }
}
