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

/* ============================================================
   CSS VARIABLES
   ============================================================ */
:root {
  /* ── shadcn-canonical tokens (OKLCH 1:1 from apicula-design reference,
   *    which itself was extracted byte-for-byte from shadcnstudio.com).
   *    These are the source of truth — every other variable below is an
   *    alias mapped onto one of these for backward compatibility with
   *    the 175+ inline styles and per-page classes that still reference
   *    the old apicula naming. */
  --background: oklch(100% 0 0);
  --foreground: oklch(14.5% 0 0);
  --card: oklch(100% 0 0);
  --card-foreground: oklch(14.5% 0 0);
  --popover: oklch(100% 0 0);
  --popover-foreground: oklch(14.5% 0 0);
  --primary: #2563eb;
  --primary-foreground: oklch(98.5% 0 0);
  --secondary: oklch(97% 0 0);
  --secondary-foreground: oklch(20.5% 0 0);
  --muted: oklch(97% 0 0);
  --muted-foreground: oklch(55.6% 0 0);
  --accent: oklch(97% 0 0);
  --accent-foreground: oklch(20.5% 0 0);
  --destructive: oklch(57.7% 0.245 27.325);
  --destructive-foreground: oklch(98.5% 0 0);
  --border: oklch(92.2% 0 0);
  --input: oklch(92.2% 0 0);
  --ring: oklch(70.8% 0 0);

  /* shadcn sidebar palette */
  --sidebar: oklch(98.5% 0 0);
  --sidebar-foreground: oklch(14.5% 0 0);
  --sidebar-primary: #2563eb;
  --sidebar-primary-foreground: oklch(98.5% 0 0);
  --sidebar-accent: oklch(97% 0 0);
  --sidebar-accent-foreground: oklch(20.5% 0 0);
  --sidebar-border: oklch(92.2% 0 0);
  --sidebar-ring: oklch(70.8% 0 0);

  /* charts */
  --chart-1: oklch(64.6% 0.222 41.116);
  --chart-2: oklch(60% 0.118 184.704);
  --chart-3: oklch(39.8% 0.07 227.392);
  --chart-4: oklch(82.8% 0.189 84.429);
  --chart-5: oklch(76.9% 0.188 70.08);

  /* shadcn spacing + sizing tokens */
  --spacing: 0.25rem;
  --radius: 0.625rem; /* 10px — shadcn default */
  --header-height: 64px;

  /* shadcn Tailwind v4 typography helpers — used by component rules
   * adapted from the apicula-design reference so calc() expressions
   * like var(--text-sm) resolve to a literal pixel value. */
  --text-xs: 12px;
  --text-xs--line-height: 16px;
  --text-sm: 14px;
  --text-sm--line-height: 20px;
  --text-base: 16px;
  --text-base--line-height: 24px;
  --text-lg: 18px;
  --text-lg--line-height: 28px;
  --text-xl: 20px;
  --text-xl--line-height: 28px;
  --text-2xl: 24px;
  --text-2xl--line-height: 32px;
  --text-3xl: 30px;
  --text-3xl--line-height: 36px;

  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  /* ── apicula legacy aliases — every value resolves through a shadcn
   *    token above. Existing CSS that uses var(--bg) / var(--surface)
   *    etc. visually shifts to the shadcn palette without any rule
   *    rewrites required. */
  --bg: var(--background);
  --surface: var(--card);
  --surface-2: var(--muted);
  --surface-3: oklch(94% 0 0);
  --border-2: var(--input);
  --text-1: var(--foreground);
  --text-2: var(--muted-foreground);
  --text-3: oklch(68% 0 0);
  --primary-fg: var(--primary-foreground);
  --primary-hover: #1d4ed8;
  --primary-subtle: #eff6ff;
  --primary-subtle-2: #dbeafe;
  --destructive-hover: oklch(50% 0.24 27);
  --destructive-subtle: oklch(96% 0.025 27);
  --destructive-border: oklch(88% 0.08 27);
  --destructive-text: oklch(45% 0.22 27);
  --success: oklch(72% 0.18 145);
  --success-subtle: oklch(97% 0.04 145);
  --success-text: oklch(52% 0.18 145);
  --warning: oklch(78% 0.16 70);
  --warning-subtle: oklch(97% 0.04 70);
  --warning-text: oklch(55% 0.15 65);
  --danger: var(--destructive);
  --overlay: rgba(0, 0, 0, 0.48);
  --sidebar-w: 240px;
  --topbar-h: 56px;

  /* radii — shadcn formula: --radius is the lg base, others derive */
  --r-xs: calc(var(--radius) - 6px);  /* 4px */
  --r-sm: calc(var(--radius) - 4px);  /* 6px */
  --r-md: calc(var(--radius) - 2px);  /* 8px */
  --r-lg: var(--radius);              /* 10px */
  --r-xl: calc(var(--radius) + 6px);  /* 16px */
  --r-full: 9999px;
  --radius-sm: var(--r-sm);
  --radius-md: var(--r-md);
  --radius-lg: var(--r-lg);
  --radius-xl: var(--r-xl);

  /* shadows — shadcn studio split (color, offset, blur, opacity) */
  --shadow-color: oklch(30% 0.0891 19.6);
  --shadow-opacity: 0.08;
  --shadow-blur: 3px;
  --shadow-spread: 0px;
  --shadow-offset-x: 0;
  --shadow-offset-y: 1px;
  --shadow-xs: var(--shadow-offset-x) var(--shadow-offset-y) var(--shadow-blur)
    var(--shadow-spread) color-mix(in oklab, var(--shadow-color) calc(var(--shadow-opacity) * 100%), transparent);
  --shadow-sm: 0 1px 3px 0 color-mix(in oklab, var(--shadow-color) 10%, transparent),
    0 1px 2px -1px color-mix(in oklab, var(--shadow-color) 10%, transparent);
  --shadow-md: 0 4px 6px -1px color-mix(in oklab, var(--shadow-color) 10%, transparent);
  --shadow-lg: 0 20px 60px color-mix(in oklab, var(--shadow-color) 15%, transparent);
  --room-bg: #0f0f0f;
  /* ── motion tokens — single source for all transition durations ─── */
  --t-snap: 80ms;
  --t-fast: 120ms;
  --t-base: 200ms;
  --t-ease: cubic-bezier(0.4, 0, 0.2, 1);
  /* ── org-tree kind tokens — drive card accents per node kind ────── */
  --kind-company: var(--primary);
  --kind-company-subtle: var(--primary-subtle);
  --kind-department: #8b5cf6;
  --kind-department-subtle: #f5f3ff;
  --kind-team: #10b981;
  --kind-team-subtle: #ecfdf5;
  --kind-branch: #f59e0b;
  --kind-branch-subtle: #fffbeb;
  --kind-position: var(--text-2);
  --kind-position-subtle: var(--surface-2);
}

/* ============================================================
   RESET
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  font-family: "Geologica", sans-serif;
  background: var(--bg);
  color: var(--text-1);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

/* ============================================================
   APP SHELL
   ============================================================ */
.app-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  padding: 0;
}

.sidebar__logo {
  padding: 20px 16px 8px;
}

.sidebar__brand {
  text-decoration: none;
  display: inline-flex;
  align-items: baseline;
  gap: 0;
}

.brand-main {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: -0.5px;
}

.brand-dot {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
}

.brand-tld {
  font-size: 17px;
  font-weight: 400;
  color: var(--text-2);
}

.sidebar__nav {
  flex: 1;
  padding: 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  min-height: 0;
  scrollbar-width: none;
}
.sidebar__nav::-webkit-scrollbar {
  display: none;
}

/* shadcn-style sidebar item — left-accent rail on active, neutral hover bg.
 * Active state lifts to text-1 + semi-bold instead of recolouring the
 * whole row blue (less noise, clearer page identity). */
/* shadcn sidebar nav-item: text-sm font-medium, accent on hover, soft
 * primary tint on active. Accent stripe stays as the apicula signature
 * — shadcn examples vary on this but the stripe gives a clearer "you
 * are here" affordance on long sidebars. */
.sidebar__item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--muted-foreground);
  text-decoration: none;
  transition: background var(--t-fast) var(--t-ease),
    color var(--t-fast) var(--t-ease);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
  line-height: 1.4;
}

.sidebar__item:hover {
  background: var(--accent);
  color: var(--accent-foreground);
}

.sidebar__item--active {
  background: var(--primary-subtle);
  color: var(--primary);
  font-weight: 600;
}

.sidebar__item--active::before {
  content: "";
  position: absolute;
  left: -4px;
  top: 6px;
  bottom: 6px;
  width: 3px;
  background: var(--primary);
  border-radius: var(--r-full);
}

.sidebar__item--active:hover {
  background: var(--primary-subtle);
  color: var(--primary);
}

.sidebar__item--muted {
  opacity: 0.45;
  pointer-events: none;
}

.sidebar__item i {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.sidebar__divider {
  height: 1px;
  background: var(--border);
  margin: 8px 0;
}

.sidebar__section-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);

  padding: 4px 10px;
}

.sidebar__footer {
  padding: 12px 8px;
  border-top: 1px solid var(--border);
}

.sidebar__badge {
  margin-left: auto;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  min-width: 20px;
  height: 20px;
  line-height: 20px;
  text-align: center;
  border-radius: 10px;
  padding: 0 6px;
}

.sidebar__logout {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  transition: all 150ms;
}

.sidebar__logout:hover {
  background: #fef2f2;
  color: var(--destructive);
}

.sidebar__logout i {
  width: 16px;
  height: 16px;
}

/* ============================================================
   MAIN AREA
   ============================================================ */
.main-area {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ============================================================
   PAGE
   ============================================================ */
.page {
  padding: 32px 40px;
  max-width: 1000px;
  margin: 0 auto;
  width: 100%;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 32px;
  gap: 16px;
}

.page-header__actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* shadcn page heading: big, tight, semibold-bold. */
.page-title {
  font-size: 30px;
  font-weight: 700;
  color: var(--foreground);
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.page-subtitle {
  font-size: 14px;
  color: var(--muted-foreground);
  margin-top: 6px;
  line-height: 1.5;
}

/* ============================================================
   BREADCRUMB
   ============================================================ */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-3);
  margin-bottom: 20px;
}

.breadcrumb a {
  color: var(--text-2);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--primary);
}

.breadcrumb i {
  width: 12px;
  height: 12px;
}

/* ============================================================
   CARD — shadcn React primitive contract:
     rounded-xl, border 1px, bg-card text-card-foreground, p-6, soft shadow.
   Kept as a *plain block container* — existing pages mount arbitrary
   children inside .card (form rows, tables, lists, kanban columns)
   that aren't prepared for a flex layout, so the rules below only set
   surface + spacing, never structure.
   ============================================================ */
.card {
  background-color: var(--card);
  color: var(--card-foreground);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);              /* 16px */
  padding: calc(var(--spacing) * 6);       /* 24px */
  box-shadow: var(--shadow-xs);
}

.card + .card {
  margin-top: calc(var(--spacing) * 4);    /* 16px between stacked cards */
}

/* Header keeps the existing horizontal flex layout used by every
 * vanilla page (title on the left, action button / status on the right). */
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: calc(var(--spacing) * 3);
  margin-bottom: calc(var(--spacing) * 4);
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--card-foreground);
}

.card-description {
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted-foreground);
}

/* ============================================================
   BUTTONS — rules adapted 1:1 from
   /Users/busyden/Documents/Projects/apicula-design/src/styles/button.css
   (shadcn-studio "vega" preset). Tailwind helper vars are inlined to
   literal values so the rules work in vanilla CSS without preflight.

     - default size: h calc(spacing * 9) = 36px, padding-inline 2.5 = 10px
     - radius:       calc(radius * .8) ≈ 8px
     - text-sm:      14px / 20px line-height
     - weight:       500 (medium)
     - hover:        80% opacity background mix (NOT a separate "hover" colour)
     - focus-visible: 3px ring in --ring colour
     - active (non-aria-haspopup): translate-y 1px
     - destructive variant: SUBTLE — bg = 10% destructive, text = destructive.
       This is the shadcn signature for destructive (not a solid red bg).
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: calc(var(--spacing) * 1.5);                /* 6px */
  height: calc(var(--spacing) * 9);               /* 36px */
  padding-inline: calc(var(--spacing) * 2.5);     /* 10px */
  border-radius: calc(var(--radius) * 0.8);       /* 8px */
  font-family: inherit;
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  white-space: nowrap;
  background-clip: padding-box;
  border-width: 1px;
  border-style: solid;
  border-color: transparent;
  cursor: pointer;
  text-decoration: none;
  background-color: transparent;
  color: var(--foreground);
  transition: all var(--t-fast) var(--t-ease);
  outline: none;
}

.btn:focus-visible {
  border-color: var(--ring);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 50%, transparent);
}

.btn:active:not([aria-haspopup]) {
  translate: 0 1px;
}

.btn:disabled {
  opacity: 0.5;
  pointer-events: none;
}

.btn > i,
.btn > svg {
  width: calc(var(--spacing) * 4);                /* 16px */
  height: calc(var(--spacing) * 4);
  flex-shrink: 0;
  pointer-events: none;
}

/* ── Variants ─────────────────────────────────────────────────────── */

.btn-primary {
  background-color: var(--primary);
  color: var(--primary-foreground);
}
.btn-primary:hover {
  background-color: color-mix(in oklab, var(--primary) 80%, transparent);
}

.btn-secondary {
  background-color: var(--secondary);
  color: var(--secondary-foreground);
}
.btn-secondary:hover {
  background-color: color-mix(in oklab, var(--secondary) 80%, transparent);
}

.btn-outline {
  background-color: var(--background);
  color: var(--foreground);
  border-color: var(--border);
  box-shadow: var(--shadow-xs);
}
.btn-outline:hover {
  background-color: var(--muted);
  color: var(--foreground);
}

.btn-ghost {
  background-color: transparent;
  color: var(--foreground);
  border-color: transparent;
}
.btn-ghost:hover {
  background-color: var(--muted);
  color: var(--foreground);
}

.btn-destructive {
  background-color: color-mix(in oklab, var(--destructive) 10%, transparent);
  color: var(--destructive);
  border-color: transparent;
}
.btn-destructive:hover {
  background-color: color-mix(in oklab, var(--destructive) 20%, transparent);
}
.btn-destructive:focus-visible {
  border-color: color-mix(in oklab, var(--destructive) 40%, transparent);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--destructive) 20%, transparent);
}

.btn-link {
  background-color: transparent;
  border-color: transparent;
  color: var(--primary);
  text-underline-offset: 4px;
  height: auto;
  padding: 0;
}
.btn-link:hover {
  text-decoration: underline;
}

/* ── Sizes ────────────────────────────────────────────────────────── */

.btn-sm {
  height: calc(var(--spacing) * 8);               /* 32px */
  padding-inline: calc(var(--spacing) * 2.5);     /* 10px */
  gap: calc(var(--spacing) * 1);                  /* 4px */
  border-radius: min(var(--radius-md), 10px);
  font-size: 14px;
}

.btn-sm > i,
.btn-sm > svg {
  width: calc(var(--spacing) * 3.5);
  height: calc(var(--spacing) * 3.5);
}

.btn-xs {
  height: calc(var(--spacing) * 6);               /* 24px */
  padding-inline: calc(var(--spacing) * 2);
  gap: calc(var(--spacing) * 1);
  border-radius: min(var(--radius-md), 8px);
  font-size: 12px;
  line-height: 16px;
}

.btn-xs > i,
.btn-xs > svg {
  width: calc(var(--spacing) * 3);
  height: calc(var(--spacing) * 3);
}

.btn-lg {
  height: calc(var(--spacing) * 10);              /* 40px */
  padding-inline: calc(var(--spacing) * 2.5);
  gap: calc(var(--spacing) * 1.5);
  font-size: 14px;
}

.btn-block {
  width: 100%;
  justify-content: center;
}

/* ============================================================
   INPUTS
   ============================================================ */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-1);
}

/* shadcn Input: h-9, px-3, rounded-md, text-sm, border-input, focus-ring.
 * Uses the `--input` and `--ring` tokens so a future palette swap
 * propagates from a single root-level change. */
.input {
  width: 100%;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--input);
  border-radius: var(--r-sm);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.4;
  color: var(--foreground);
  background: var(--background);
  outline: none;
  transition:
    border-color var(--t-fast) var(--t-ease),
    box-shadow var(--t-fast) var(--t-ease);
}

.input:focus,
.input:focus-visible {
  border-color: var(--ring);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 18%, transparent);
}

.input::placeholder {
  color: var(--muted-foreground);
  opacity: 0.6;
}

.input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Textarea variant — same primitive, just multi-line. */
textarea.input {
  height: auto;
  min-height: 80px;
  padding: 8px 12px;
  resize: vertical;
}

.input-wrapper {
  position: relative;
}

.input-wrapper .input {
  padding-right: 40px;
}

.input-action {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-3);
  padding: 2px;
  display: flex;
  align-items: center;
}

.input-action:hover {
  color: var(--text-2);
}

.input-action i {
  width: 16px;
  height: 16px;
}

/* Select styled */
select.input {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
  cursor: pointer;
}

/* OpenRouter filters bar */
.or-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.or-filter-input {
  max-width: 250px;
}
.or-filter-select {
  width: auto;
  min-width: 140px;
}

/* ============================================================
   BADGE — rules from
   /Users/busyden/Documents/Projects/apicula-design/src/styles/badge.css
   (shadcn-studio "vega" preset, Tailwind helpers inlined):

     height:        calc(spacing * 5) = 20px
     border-radius: calc(radius * 2.6) ≈ 26px (effectively pill)
     padding:       inline 2 = 8px, block .5 = 2px
     text-xs:       12px / 16px line-height
     weight:        500 (medium)
     border:        1px transparent (variant fills it in)
     transition:    all, default duration

   Variants follow the same shadcn pattern as buttons: default = solid
   primary, secondary = solid muted-ish, outline = border only,
   destructive = SUBTLE (10% bg, destructive text), ghost = hover muted.
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: calc(var(--spacing) * 1);                  /* 4px */
  height: calc(var(--spacing) * 5);               /* 20px */
  padding-inline: calc(var(--spacing) * 2);       /* 8px */
  padding-block: calc(var(--spacing) * 0.5);      /* 2px */
  border-radius: calc(var(--radius) * 2.6);       /* pill */
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  white-space: nowrap;
  border-width: 1px;
  border-style: solid;
  border-color: transparent;
  transition: all var(--t-fast) var(--t-ease);
}

.badge > svg,
.badge > i {
  width: calc(var(--spacing) * 3);                /* 12px */
  height: calc(var(--spacing) * 3);
  flex-shrink: 0;
}

.badge-default {
  background-color: var(--primary);
  color: var(--primary-foreground);
}

.badge-secondary {
  background-color: var(--secondary);
  color: var(--secondary-foreground);
}

.badge-outline {
  border-color: var(--border);
  color: var(--foreground);
}

.badge-destructive {
  background-color: color-mix(in oklab, var(--destructive) 10%, transparent);
  color: var(--destructive);
}

.badge-ghost:hover {
  background-color: var(--muted);
  color: var(--muted-foreground);
}

.badge-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}

.badge--scheduled {
  background: #f4f4f5;
  color: #52525b;
}

.badge--scheduled .badge-dot {
  background: #a1a1aa;
}

.badge--active {
  background: var(--primary-subtle);
  color: var(--primary);
}

.badge--active .badge-dot {
  background: var(--primary);
}

.badge--processing {
  background: var(--warning-subtle);
  color: #92400e;
}

.badge--processing .badge-dot {
  background: var(--warning);
  animation: pulse-dot 1s infinite;
}

.badge--completed {
  background: var(--success-subtle);
  color: #166534;
}

.badge--completed .badge-dot {
  background: var(--success);
}

.badge--failed {
  background: #fef2f2;
  color: #991b1b;
}

.badge--failed .badge-dot {
  background: var(--destructive);
}

@keyframes pulse-dot {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
}

/* ============================================================
   MEETING CARDS GRID
   ============================================================ */
.meetings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.meeting-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 16px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 150ms;
  cursor: pointer;
}

.meeting-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.meeting-card__body {
  flex: 1;
}

.meeting-card__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
  line-height: 1.3;
}

.meeting-card__meta {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-3);
  margin-top: 4px;
}

.meeting-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.meeting-card__arrow {
  width: 15px;
  height: 15px;
  color: var(--text-3);
}

.toolbar {
  margin-bottom: 16px;
}

/* Phase 15.5 — active status-filter chip on meetings list. */
.ml-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  margin-bottom: 16px;
  border-radius: var(--r-full);
  background: var(--primary-subtle);
  color: var(--primary);
  font-size: 13px;
}
.ml-filter-chip__label {
  color: var(--text-2);
}
.ml-filter-chip__value {
  font-weight: 600;
}
.ml-filter-chip__reset {
  color: var(--primary);
  text-decoration: none;
  border-left: 1px solid color-mix(in srgb, var(--primary) 30%, transparent);
  padding-left: 8px;
  margin-left: 4px;
  font-size: 12px;
}
.ml-filter-chip__reset:hover {
  color: var(--primary-hover);
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 64px 20px;
}

.empty-state__icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  color: var(--text-3);
}

.empty-state__icon i {
  width: 48px;
  height: 48px;
}

.empty-state__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
}

.empty-state__text {
  font-size: 13px;
  color: var(--text-3);
}

/* ============================================================
   PARTICIPANT ROW
   ============================================================ */
.participants-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.participant-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.participant-row .input {
  flex: 1;
}

.btn-remove {
  padding: 8px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-3);
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: all 150ms;
  flex-shrink: 0;
}

.btn-remove:hover {
  background: #fef2f2;
  color: var(--destructive);
  border-color: #fecaca;
}

.btn-remove i {
  width: 14px;
  height: 14px;
}

/* ============================================================
   DROPZONE
   ============================================================ */
.dropzone {
  border: 2px dashed var(--border-2);
  border-radius: var(--r-md);
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 150ms;
}

.dropzone:hover,
.dropzone--active {
  border-color: var(--primary);
  background: var(--primary-subtle);
}

.dropzone__icon {
  color: var(--text-3);
  margin-bottom: 12px;
}

.dropzone__icon i {
  width: 32px;
  height: 32px;
}

.dropzone__text {
  font-size: 13.5px;
  color: var(--text-2);
  font-weight: 500;
}

.dropzone__hint {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 4px;
}

.dropzone__input {
  display: none;
}

.file-info {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-2);
  padding: 8px 12px;
  background: var(--surface-2);
  border-radius: var(--r-sm);
  margin-top: 8px;
}

.file-info i {
  color: var(--primary);
  width: 14px;
  height: 14px;
}

/* ============================================================
   INVITE BOX
   ============================================================ */
.invite-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 16px;
}

.invite-box__label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-3);

  margin-bottom: 8px;
}

.invite-box__row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.invite-box__url {
  flex: 1;
  font-family: monospace;
  font-size: 12.5px;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xs);
  padding: 7px 10px;
}

/* ============================================================
   AUDIO PLAYER
   ============================================================ */
.audio-player {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--surface-2);
  border-radius: var(--r-md);
}

.play-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 150ms;
  font-size: 14px;
  font-family: inherit;
  line-height: 1;
}

.play-btn:hover {
  background: var(--primary-hover);
}

.player-track {
  flex: 1;
  height: 4px;
  background: var(--border);
  border-radius: var(--r-full);
  cursor: pointer;
  position: relative;
}

.player-fill {
  height: 100%;
  background: var(--primary);
  border-radius: var(--r-full);
  transition: width 100ms linear;
  width: 0%;
}

.player-time {
  font-size: 12px;
  font-family: monospace;
  color: var(--text-3);
  flex-shrink: 0;
  min-width: 90px;
  text-align: right;
}

/* ============================================================
   PROCESSING
   ============================================================ */
.processing {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 32px;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 2.5px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.processing-text {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-1);
}

.processing-step {
  font-size: 12.5px;
  color: var(--text-3);
}

/* ============================================================
   TRANSCRIPT
   ============================================================ */
.transcript {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.transcript-segment {
  display: flex;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.transcript-segment:last-child {
  border-bottom: none;
}

.transcript-segment:hover {
  background: var(--surface-2);
  margin: 0 -20px;
  padding: 10px 20px;
  border-radius: var(--r-xs);
}

.segment-time {
  font-size: 11.5px;
  font-family: monospace;
  color: var(--text-3);
  min-width: 44px;
  padding-top: 2px;
  flex-shrink: 0;
}

.segment-speaker {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 2px;
}

.segment-text {
  font-size: 13.5px;
  color: var(--text-1);
  line-height: 1.5;
}

/* ============================================================
   PROTOCOL
   ============================================================ */
.protocol-body h3 {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-1);
  margin: 16px 0 8px;
}

.protocol-body h3:first-child {
  margin-top: 0;
}

.protocol-body p {
  font-size: 13.5px;
  color: var(--text-2);
  line-height: 1.6;
}

.protocol-body ul {
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.protocol-body li {
  font-size: 13.5px;
  color: var(--text-2);
  line-height: 1.5;
}

/* ============================================================
   TASKS TABLE
   ============================================================ */
.tasks-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.tasks-table th {
  text-align: left;
  padding: 8px 12px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-3);

  border-bottom: 1px solid var(--border);
}

.tasks-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-1);
}

.tasks-table tr:last-child td {
  border-bottom: none;
}

.priority--critical {
  color: #991b1b;
  font-weight: 600;
}

.priority--high {
  color: #c2410c;
  font-weight: 500;
}

.priority--medium {
  color: #b45309;
}

.priority--low {
  color: var(--text-3);
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.login-brand {
  flex: 0 0 55%;
  background: var(--primary);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 60px;
  position: relative;
  overflow: hidden;
}

.login-brand__title {
  font-size: 52px;
  font-weight: 800;
  color: white;
  letter-spacing: -2px;
  line-height: 1;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}

.login-brand__title span {
  color: rgba(255, 255, 255, 0.6);
}

.login-brand__sub {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 400;
  max-width: 340px;
  line-height: 1.4;
  position: relative;
  z-index: 1;
}

.login-brand__deco {
  position: absolute;
  pointer-events: none;
  inset: 0;
}

.login-form-area {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: white;
}

.login-form-box {
  width: 100%;
  max-width: 360px;
}

.login-form-box__title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}

.login-form-box__sub {
  font-size: 14px;
  color: var(--text-2);
  margin-bottom: 32px;
}

.error-msg {
  display: none;
  padding: 10px 12px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--r-sm);
  font-size: 13px;
  color: #991b1b;
  margin-top: 12px;
}

/* ============================================================
   ROOM PAGE
   ============================================================ */
.room-page {
  height: 100vh;
  background: #0c0c0c;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  font-family: "Geologica", sans-serif;
}

.room-prejoin {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  width: 100%;
  max-width: 320px;
  padding: 20px;
}

.room-prejoin__title {
  font-size: 13px;

  color: rgba(255, 255, 255, 0.4);
}

.room-prejoin__name {
  font-size: 22px;
  font-weight: 600;
  color: white;
  text-align: center;
}

.room-prejoin__form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.room-input {
  width: 100%;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: white;
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 150ms;
}

.room-input:focus {
  border-color: rgba(255, 255, 255, 0.4);
}

.room-input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.btn-join {
  width: 100%;
  padding: 11px;
  background: var(--primary);
  border: none;
  border-radius: 8px;
  color: white;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 150ms;
}

.btn-join:hover {
  background: var(--primary-hover);
}

.room-incall {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  width: 100%;
  max-width: 500px;
  padding: 20px;
}

.room-header {
  display: flex;
  align-items: center;
  gap: 24px;
}

.rec-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 0.1em;
}

.rec-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  animation: blink 1.2s ease infinite;
}

@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}

.room-timer {
  font-size: 56px;
  font-weight: 700;
  color: white;
  letter-spacing: -2px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.participants-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.participants-label {
  font-size: 11px;

  color: rgba(255, 255, 255, 0.3);
}

.participants-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.room__participant {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--r-full);
  font-size: 13px;
  color: rgba(255, 255, 255, 0.8);
  transition: all 150ms;
}

.room__participant-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
}

.room__participant--speaking {
  border-color: #4ade80;
  background: rgba(74, 222, 128, 0.1);
  color: white;
}

.room__participant--speaking .room__participant-dot {
  animation: pulse-speaker 0.6s ease infinite alternate;
}

@keyframes pulse-speaker {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.6);
  }
}

.waiting-hint {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.3);
  font-style: italic;
}

.room-controls {
  display: flex;
  gap: 12px;
}

.btn-mute-self {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--r-full);
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--text-1);
  cursor: pointer;
  transition: all 150ms;
  flex-shrink: 0;
}
.btn-mute-self:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.btn-mute-self.muted {
  background: #fef2f2;
  border-color: #ef4444;
  color: #ef4444;
}
.btn-mute-self i {
  width: 18px;
  height: 18px;
}

.btn-end {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: #ef4444;
  border: none;
  border-radius: var(--r-full);
  color: white;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 150ms;
}

.btn-end:hover {
  background: #dc2626;
  transform: scale(1.02);
}

.btn-end i {
  width: 17px;
  height: 17px;
}

.btn-dashboard {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--r-full);
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 150ms;
  text-decoration: none;
}
.btn-dashboard:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.02);
}
.btn-dashboard i {
  width: 17px;
  height: 17px;
}

.btn-minimize {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--r-full);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 150ms;
}
.btn-minimize:hover {
  background: rgba(255, 255, 255, 0.2);
}
.btn-minimize i {
  width: 16px;
  height: 16px;
}

#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 9999;
}

/* ============================================================
   UTILITY HELPERS
   ============================================================ */
.flex {
  display: flex;
}
.items-center {
  align-items: center;
}
.justify-between {
  justify-content: space-between;
}
.gap-2 {
  gap: 8px;
}
.gap-3 {
  gap: 12px;
}
.mt-2 {
  margin-top: 8px;
}
.mt-3 {
  margin-top: 12px;
}
.mt-4 {
  margin-top: 16px;
}
.mt-6 {
  margin-top: 24px;
}
.text-sm {
  font-size: 12.5px;
}
.text-muted {
  color: var(--text-3);
}
.font-medium {
  font-weight: 500;
}
.font-semibold {
  font-weight: 600;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
/* ── Mobile top-bar + hamburger sidebar ──────────────────── */
.mobile-topbar {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.mobile-burger {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  cursor: pointer;
  font-size: 18px;
  color: var(--text-1);
}
.mobile-topbar-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1);
}
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--overlay);
  z-index: 299;
}

@media (max-width: 768px) {
  .login-brand {
    display: none;
  }
  .login-form-area {
    padding: 24px;
  }

  /* App shell becomes column, fills viewport */
  .app-shell {
    flex-direction: column;
    height: 100vh;
  }
  @supports (height: 100dvh) {
    .app-shell {
      height: 100dvh;
    }
  }

  .mobile-topbar {
    display: flex;
  }

  /* Sidebar becomes fixed overlay drawer */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    height: 100%;
    z-index: 300;
    transform: translateX(-100%);
    transition: transform 220ms cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: none;
  }
  .sidebar.is-open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgb(0 0 0 / 0.15);
  }
  .sidebar-overlay.is-open {
    display: block;
  }

  /* Main area fills remaining space */
  .main-area {
    flex: 1;
    width: 100%;
    min-height: 0;
    overflow-y: auto;
  }
  .page {
    padding: 16px 14px;
  }
  .page-header {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
  .meetings-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   SKELETON LOADERS
   ============================================================ */

@keyframes shimmer {
  0% {
    background-position: -600px 0;
  }
  100% {
    background-position: 600px 0;
  }
}

.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, #e8e8eb 50%, var(--surface-2) 75%);
  background-size: 600px 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: var(--r-sm);
}

.skel-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-xs);
}

.skel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.skel-row {
  display: flex;
  gap: 12px;
  align-items: center;
}
.skel-gap {
  margin-top: 12px;
}

/* Header skeleton */
.skel-title-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.skel-h1 {
  height: 32px;
  width: 280px;
}
.skel-meta {
  height: 16px;
  width: 160px;
}
.skel-badge {
  height: 24px;
  width: 100px;
  border-radius: var(--r-full);
}

/* Player skeleton */
.skel-player {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 4px 0;
}
.skel-play {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
}
.skel-track {
  height: 6px;
  flex: 1;
  border-radius: var(--r-full);
}
.skel-time {
  width: 80px;
  height: 14px;
  flex-shrink: 0;
}

/* Text lines */
.skel-line {
  height: 14px;
  border-radius: var(--r-xs);
}
.skel-line--full {
  width: 100%;
}
.skel-line--lg {
  width: 85%;
}
.skel-line--md {
  width: 65%;
}
.skel-line--sm {
  width: 40%;
}

/* Transcript skeleton */
.skel-transcript-row {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.skel-transcript-row:last-child {
  border-bottom: none;
}
.skel-ts-time {
  width: 44px;
  height: 13px;
  flex-shrink: 0;
  margin-top: 2px;
}
.skel-ts-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Table skeleton */
.skel-table {
  width: 100%;
  border-collapse: collapse;
}
.skel-table th {
  padding: 8px 12px;
  text-align: left;
}
.skel-table td {
  padding: 12px;
  border-top: 1px solid var(--border);
}
.skel-cell {
  height: 14px;
  border-radius: var(--r-xs);
}

/* Section label */
.skel-section-label {
  height: 13px;
  width: 120px;
  margin-bottom: 20px;
  border-radius: var(--r-xs);
}

/* Pending skeleton state — shimmer stops, shows label */
.skel-pending .skeleton {
  animation: none;
  background: var(--surface-2);
  opacity: 0.5;
}
.skel-pending-label {
  text-align: center;
  font-size: 12.5px;
  color: var(--text-3);
  padding: 12px 0 4px;
  font-style: italic;
}

/* Fade-in for content reveal */
.content-reveal {
  animation: contentReveal 0.35s ease forwards;
}
@keyframes contentReveal {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================================
   PROTOCOL PREVIEW MODAL
   ============================================================ */

.proto-modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  z-index: 2000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
  backdrop-filter: blur(4px);
}

.proto-modal {
  background: #f4f4f5;
  border-radius: 12px;
  width: 100%;
  max-width: 820px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.proto-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  border-radius: 12px 12px 0 0;
  position: sticky;
  top: 0;
  z-index: 10;
}

.proto-modal-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
}

.proto-modal-body {
  padding: 32px 24px 40px;
  overflow-y: auto;
}

/* ── A4 page ── */
.proto-page {
  background: #fff;
  width: 100%;
  max-width: 740px;
  margin: 0 auto;
  padding: 56px 64px 64px;
  box-shadow: 0 4px 32px rgba(0, 0, 0, 0.18);
  border-radius: 4px;
  font-family: "Times New Roman", Times, serif;
  font-size: 13px;
  line-height: 1.6;
  color: #000;
}

/* ── УТВЕРЖДАЮ block ── */
.proto-utv {
  text-align: right;
  margin-bottom: 24px;
}
.proto-utv-label {
  font-weight: 700;
  font-size: 13px;

}
.proto-utv-sub {
  font-size: 13px;
}
.proto-utv-sig {
  font-size: 13px;
  margin-top: 4px;
}
.proto-utv-date {
  font-size: 13px;
  margin-top: 4px;
}

/* ── Title block ── */
.proto-title-block {
  text-align: center;
  margin: 20px 0 16px;
}
.proto-doc-title {
  font-size: 16px;
  font-weight: 700;

}
.proto-doc-sub {
  font-size: 13px;
  margin-top: 4px;
}
.proto-meeting-title {
  font-size: 13px;
  font-weight: 700;
  margin-top: 6px;
  min-height: 22px;
}

/* ── Date line ── */
.proto-dateline {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin: 12px 0 16px;
}

.proto-divider {
  border-top: 1px solid #000;
  margin: 16px 0;
}

/* ── Sections ── */
.proto-section {
  margin-bottom: 20px;
}
.proto-section-label {
  font-weight: 700;
  font-size: 13px;

  margin-bottom: 8px;
}

/* ── Editable fields ── */
.proto-edit {
  display: inline-block;
  min-width: 60px;
  border-bottom: 1px dashed #2563eb;
  outline: none;
  padding: 0 2px;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}
.proto-edit:focus {
  background: rgba(37, 99, 235, 0.06);
  border-bottom-color: #2563eb;
}

.proto-meeting-title.proto-edit {
  display: block;
  border: none;
  border-bottom: 1px dashed #2563eb;
  width: 100%;
  text-align: center;
  padding: 4px 8px;
  box-sizing: border-box;
}
.proto-meeting-title.proto-edit:focus {
  background: rgba(37, 99, 235, 0.06);
  border-radius: 4px;
  border-bottom-color: #2563eb;
}

/* ── Editable list items ── */
.proto-list-item {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 4px;
}
.proto-list-item-num {
  min-width: 20px;
  font-size: 13px;
  padding-top: 2px;
  color: #555;
  user-select: none;
}
.proto-list-item-text {
  flex: 1;
  min-height: 20px;
  border: none;
  border-bottom: 1px dashed #ccc;
  outline: none;
  font-family: inherit;
  font-size: 13px;
  padding: 1px 4px;
  background: transparent;
}
.proto-list-item-text:focus {
  background: rgba(37, 99, 235, 0.05);
  border-bottom-color: #2563eb;
  border-radius: 2px;
}
.proto-list-item-del {
  background: none;
  border: none;
  cursor: pointer;
  color: #dc2626;
  opacity: 0.4;
  padding: 2px 4px;
  font-size: 14px;
  line-height: 1;
  font-family: sans-serif;
}
.proto-list-item-del:hover {
  opacity: 1;
}

/* ── Decision items ── */
.proto-decision-item {
  border: 1px dashed #d4d4d8;
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 10px;
  position: relative;
}
.proto-decision-num {
  font-weight: 700;
  font-size: 12px;
  color: #555;
  margin-bottom: 6px;
  user-select: none;
}
.proto-decision-field {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 4px;
}
.proto-decision-key {
  font-weight: 700;
  font-size: 12px;
  min-width: 100px;
  padding-top: 3px;
  white-space: nowrap;
}
.proto-decision-val {
  flex: 1;
  min-height: 20px;
  border: none;
  border-bottom: 1px dashed #ccc;
  outline: none;
  font-family: "Times New Roman", Times, serif;
  font-size: 13px;
  padding: 1px 4px;
  background: transparent;
}
.proto-decision-val:focus {
  background: rgba(37, 99, 235, 0.05);
  border-bottom-color: #2563eb;
  border-radius: 2px;
}
.proto-decision-del {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  cursor: pointer;
  color: #dc2626;
  opacity: 0.35;
  font-size: 16px;
  font-family: sans-serif;
  line-height: 1;
}
.proto-decision-del:hover {
  opacity: 1;
}

/* ── Add button ── */
.proto-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  padding: 4px 10px;
  font-family: inherit;
  font-size: 11px;
  border: 1px dashed #2563eb;
  border-radius: 4px;
  color: #2563eb;
  background: rgba(37, 99, 235, 0.05);
  cursor: pointer;
  transition: background 150ms;
}
.proto-add-btn:hover {
  background: rgba(37, 99, 235, 0.12);
}
.proto-add-btn i {
  width: 11px;
  height: 11px;
}

/* ── Signatures ── */
.proto-signatures {
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.proto-sig-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 13px;
}
.proto-sig-label {
  font-weight: 700;
  min-width: 220px;
}
.proto-sig-line {
  letter-spacing: 2px;
}

/* ============================================================
   ROOM — RECORDING CONTROLS + ADMIN UI
   ============================================================ */

.rec-badge--paused {
  background: rgba(251, 191, 36, 0.15);
  border-color: rgba(251, 191, 36, 0.4);
  color: #fbbf24;
}

.rec-badge--paused .rec-dot {
  background: #fbbf24;
  animation: none;
}

.room-title-display {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 500;
  flex: 1;
  text-align: center;
  padding: 0 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.room-recording-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px 0;
}

.btn-rec {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 20px;
  border: 1px solid rgba(239, 68, 68, 0.5);
  border-radius: var(--r-full);
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 150ms;
}

.btn-rec:hover {
  background: rgba(239, 68, 68, 0.22);
  border-color: rgba(239, 68, 68, 0.8);
}

.btn-rec i {
  width: 14px;
  height: 14px;
}

.btn-rec--pause {
  border-color: rgba(251, 191, 36, 0.5);
  background: rgba(251, 191, 36, 0.1);
  color: #fbbf24;
}
.btn-rec--pause:hover {
  background: rgba(251, 191, 36, 0.2);
  border-color: rgba(251, 191, 36, 0.8);
}

.btn-rec--resume {
  border-color: rgba(74, 222, 128, 0.5);
  background: rgba(74, 222, 128, 0.1);
  color: #4ade80;
}
.btn-rec--resume:hover {
  background: rgba(74, 222, 128, 0.2);
  border-color: rgba(74, 222, 128, 0.8);
}

.room__participant-name {
  flex: 1;
}

.role-admin {
  font-size: 10px;
  font-weight: 700;

  color: #fbbf24;
  background: rgba(251, 191, 36, 0.15);
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 6px;
  vertical-align: middle;
}

.btn-mute {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: 50%;
  background: transparent;
  color: rgba(239, 68, 68, 0.7);
  cursor: pointer;
  transition: all 150ms;
  margin-left: auto;
  flex-shrink: 0;
}

.btn-mute:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border-color: #f87171;
}

.btn-mute i {
  width: 13px;
  height: 13px;
}

/* ============================================================
   USERS ADMIN PAGE
   ============================================================ */

.users-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.users-table th {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  font-weight: 600;

  color: var(--text-3);
}

.users-table td {
  padding: 12px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-1);
}

.users-table tr:last-child td {
  border-bottom: none;
}

.badge--admin {
  background: rgba(251, 191, 36, 0.15);
  color: #b45309;
  border: 1px solid rgba(251, 191, 36, 0.4);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: var(--r-full);
}

.badge--member {
  background: var(--surface-2);
  color: var(--text-3);
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: var(--r-full);
}

.badge--inactive {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.3);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: var(--r-full);
}

/* ============================================================
   INTEGRATIONS PAGE
   ============================================================ */

.badge--integration-active {
  background: var(--success-subtle);
  color: #166534;
  border: 1px solid rgba(34, 197, 94, 0.3);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: var(--r-full);
}

.badge--integration-disabled {
  background: var(--surface-2);
  color: var(--text-3);
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: var(--r-full);
}

.badge--integration-not-configured {
  background: var(--warning-subtle);
  color: #92400e;
  border: 1px solid rgba(245, 158, 11, 0.3);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: var(--r-full);
}

.integration-section {
  margin-bottom: 32px;
}

.integration-section-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);

  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.integration-section-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.integration-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 20px;
  margin-bottom: 12px;
}

.integration-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.integration-card__title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.integration-card__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1);
}

.integration-card__actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.integration-config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.integration-config-item {
  background: var(--surface-2);
  border-radius: var(--r-sm);
  padding: 8px 12px;
}

.integration-config-item__key {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);

  margin-bottom: 2px;
}

.integration-config-item__val {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-1);
  font-family: monospace;
}

.integration-note {
  font-size: 12.5px;
  color: var(--text-3);
  font-style: italic;
  margin-top: 8px;
}

.integration-test-result {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  font-size: 13px;
  display: none;
}

.integration-test-result--ok {
  background: var(--success-subtle);
  color: #166534;
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.integration-test-result--error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.llm-test-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.llm-test-response {
  background: var(--surface-2);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  font-size: 13.5px;
  color: var(--text-1);
  line-height: 1.6;
  white-space: pre-wrap;
  max-height: 300px;
  overflow-y: auto;
  display: none;
}

.llm-test-meta {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 4px;
}

.llm-history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-top: 12px;
}

.llm-history-table th {
  text-align: left;
  padding: 8px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);

  border-bottom: 1px solid var(--border);
}

.llm-history-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
}

.llm-history-table tr:last-child td {
  border-bottom: none;
}

.sip-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}

.sip-form .form-group:nth-child(3),
.sip-form .form-group:nth-child(4) {
  grid-column: span 1;
}

.sip-instruction {
  margin-top: 16px;
  padding: 12px 14px;
  background: var(--primary-subtle);
  border: 1px solid var(--primary-subtle-2);
  border-radius: var(--r-sm);
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.6;
}

.sip-instruction strong {
  color: var(--primary);
}

.dial-in-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--primary-subtle);
  border: 1px solid var(--primary-subtle-2);
  border-radius: var(--r-md);
  margin-top: 12px;
}

.dial-in-card i {
  width: 22px;
  height: 22px;
  color: var(--primary);
  flex-shrink: 0;
}

.dial-in-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);

  margin-bottom: 2px;
}

.dial-in-number {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1);
  letter-spacing: 0.03em;
}

.dial-in-pin {
  font-size: 13px;
  color: var(--text-2);
  margin-top: 2px;
}

/* ============================================================
   GLOBAL TOAST NOTIFICATIONS
   ============================================================ */
#cs-toast-root {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.cs-toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  max-width: 360px;
  pointer-events: all;
  box-shadow: var(--shadow-md);
  border: 1px solid transparent;
  animation: cs-toast-in 0.2s ease;
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
}
.cs-toast.fade-out {
  opacity: 0;
  transform: translateX(16px);
}

@keyframes cs-toast-in {
  from {
    opacity: 0;
    transform: translateX(16px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.cs-toast--info {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text-1);
}
.cs-toast--success {
  background: var(--success-subtle);
  border-color: #bbf7d0;
  color: var(--success-text);
}
.cs-toast--error {
  background: var(--destructive-subtle);
  border-color: var(--destructive-border);
  color: var(--destructive-text);
}
.cs-toast--warning {
  background: var(--warning-subtle);
  border-color: #fde68a;
  color: var(--warning-text);
}
.cs-toast__icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-top: 1px;
}
.cs-toast__close {
  margin-left: auto;
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  opacity: 0.6;
  font-size: 15px;
  line-height: 1;
  padding: 0 0 0 6px;
}
.cs-toast__close:hover {
  opacity: 1;
}

/* ============================================================
   GLOBAL CONFIRM DIALOG
   ============================================================ */
/* ── Universal Action Menu ────────────────────────────────── */
.cs-action-menu {
  position: fixed;
  z-index: 999;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 4px;
  min-width: 170px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  animation: cs-menu-in 120ms ease-out;
}
@keyframes cs-menu-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.cs-action-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 14px;
  border: none;
  background: none;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--r-md);
  color: var(--text-1);
  transition: background 80ms;
}
.cs-action-item:hover {
  background: var(--surface-2);
}
.cs-action-item i {
  width: 15px;
  height: 15px;
  color: var(--text-3);
}
.cs-action-item--danger {
  color: var(--destructive);
}
.cs-action-item--danger i {
  color: var(--destructive);
}

.cs-confirm-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: cs-fadein 0.15s ease;
}
@keyframes cs-fadein {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.cs-confirm-dialog {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 24px;
  width: min(400px, 90vw);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.cs-confirm-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-1);
}
.cs-confirm-body {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.5;
}
.cs-confirm-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* ============================================================
   GLOBAL MODAL OVERLAY (shared class)
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ============================================================
   STYLED NATIVE SELECT (globally override appearance)
   ============================================================ */
select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23A1A1AA' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}

/* ============================================================
   STYLED CHECKBOX
   ============================================================ */
input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 15px;
  height: 15px;
  border: 1.5px solid var(--border-2);
  border-radius: var(--r-xs);
  background: var(--surface);
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition:
    border-color 120ms,
    background 120ms;
}
input[type="checkbox"]:checked {
  background: var(--primary);
  border-color: var(--primary);
}
input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 1px;
  width: 6px;
  height: 9px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}
input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ============================================================
   GLOBAL SEARCH — sidebar input + command-palette overlay
   ============================================================ */

/* ── Sidebar search bar ─────────────────────────────────── */
.sidebar__search {
  padding: 12px 12px 4px;
}

.sidebar__search-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 7px 10px;
  cursor: pointer;
  /* Reset browser <button> defaults — this element is rendered as a button
   * rather than an <input> to dodge Chrome's auto-fill of credentials into
   * the global-search field. The visual contract is unchanged. */
  -webkit-appearance: none;
  appearance: none;
  font: inherit;
  color: inherit;
  text-align: left;
  transition:
    border-color 120ms,
    box-shadow 120ms;
}
.sidebar__search-wrap:hover {
  border-color: var(--border-2);
}
.sidebar__search-wrap.is-focused {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 14%, transparent);
}
.sidebar__search-wrap svg {
  width: 14px;
  height: 14px;
  color: var(--text-3);
  flex-shrink: 0;
}
.sidebar__search-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 13px;
  color: var(--text-1);
  outline: none;
}
.sidebar__search-input::placeholder {
  color: var(--text-3);
}
.sidebar__search-kbd {
  font-size: 10px;
  font-family: inherit;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--text-3);
  flex-shrink: 0;
  line-height: 1.6;
  pointer-events: none;
  transition: opacity 120ms;
}
.sidebar__search-wrap.is-focused .sidebar__search-kbd {
  opacity: 0;
}

/* ── Command-palette overlay ────────────────────────────── */
.gs-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--overlay);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.gs-overlay.is-open {
  opacity: 1;
  pointer-events: all;
}

.gs-panel {
  width: min(660px, calc(100vw - 32px));
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow:
    0 24px 64px rgb(0 0 0 / 0.22),
    0 2px 8px rgb(0 0 0 / 0.08);
  overflow: hidden;
  transform: translateY(-8px) scale(0.98);
  transition: transform 160ms cubic-bezier(0.22, 0.68, 0, 1.2);
}
.gs-overlay.is-open .gs-panel {
  transform: translateY(0) scale(1);
}

/* Input row */
.gs-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.gs-input-row svg {
  width: 18px;
  height: 18px;
  color: var(--text-2);
  flex-shrink: 0;
}
.gs-input {
  flex: 1;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 15px;
  color: var(--text-1);
  outline: none;
}
.gs-input::placeholder {
  color: var(--text-3);
}
.gs-esc {
  font-size: 11px;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: 4px;
  padding: 2px 6px;
  color: var(--text-3);
  flex-shrink: 0;
}

/* Results list */
.gs-results {
  max-height: 380px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.gs-results::-webkit-scrollbar {
  width: 4px;
}
.gs-results::-webkit-scrollbar-track {
  background: transparent;
}
.gs-results::-webkit-scrollbar-thumb {
  background: var(--border-2);
  border-radius: 4px;
}

/* Result item */
.gs-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 80ms;
  text-decoration: none;
  color: inherit;
}
.gs-item:last-child {
  border-bottom: none;
}
.gs-item:hover,
.gs-item.is-active {
  background: var(--primary-subtle);
}
.gs-item.is-active .gs-item-title {
  color: var(--primary);
}

.gs-item-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
  font-size: 13px;
}
.gs-item-icon--title {
  background: var(--primary-subtle-2);
  color: var(--primary);
}
.gs-item-icon--transcript {
  background: #f4f4f5;
  color: #52525b;
}
.gs-item-icon--summary {
  background: #f3e8ff;
  color: #7c3aed;
}
.gs-item-icon--action {
  background: #fef3c7;
  color: #b45309;
}
.gs-item-icon--participant {
  background: #dcfce7;
  color: #15803d;
}

.gs-item-body {
  flex: 1;
  min-width: 0;
}
.gs-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
}
.gs-item-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gs-item-date {
  font-size: 11px;
  color: var(--text-3);
  flex-shrink: 0;
}
.gs-item-snippet {
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.gs-item-snippet mark {
  background: color-mix(in srgb, #fbbf24 35%, transparent);
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
}
.gs-item-type {
  font-size: 10px;
  font-weight: 500;

  color: var(--text-3);
}

/* Status rows */
.gs-status {
  padding: 32px 16px;
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
}
.gs-status-icon {
  width: 36px;
  height: 36px;
  margin: 0 auto 10px;
  color: var(--border-2);
}
.gs-status-icon svg {
  width: 100%;
  height: 100%;
}

/* Footer hint */
.gs-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}
.gs-footer-hint {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-3);
}
.gs-footer-hint kbd {
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: 3px;
  padding: 1px 5px;
  font-family: inherit;
  font-size: 10px;
}

/* ============================================================
   TASKS PAGE — tabs, toolbar, views, detail panel
   ============================================================ */

/* ── Priority colors ─────────────────────────────────────── */
.pr-critical {
  --pr: #ef4444;
  --pr-bg: #fef2f2;
}
.pr-high {
  --pr: #f59e0b;
  --pr-bg: #fffbeb;
}
.pr-medium {
  --pr: #2563eb;
  --pr-bg: #eff6ff;
}
.pr-low {
  --pr: #a1a1aa;
  --pr-bg: #f4f4f5;
}

/* ── Tab bar + toolbar row ──────────────────────────────── */
.tk-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 20px 0 16px;
  flex-wrap: wrap;
}

.tk-tabs {
  display: flex;
  position: relative;
  gap: 2px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 3px;
}
.tk-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: none;
  background: none;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  border-radius: var(--r-sm);
  position: relative;
  z-index: 1;
  transition: color 160ms;
  white-space: nowrap;
}
.tk-tab svg,
.tk-tab i {
  width: 15px;
  height: 15px;
}
.tk-tab:hover {
  color: var(--text-1);
}
.tk-tab.is-active {
  color: var(--primary);
}
.tk-tab-ink {
  position: absolute;
  top: 3px;
  height: calc(100% - 6px);
  background: var(--surface);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-xs);
  transition:
    left 220ms cubic-bezier(0.4, 0, 0.2, 1),
    width 220ms cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 0;
}

.tk-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.tk-search-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 5px 10px;
}
.tk-search-wrap svg,
.tk-search-wrap i {
  width: 14px;
  height: 14px;
  color: var(--text-3);
  flex-shrink: 0;
}
.tk-search {
  border: none;
  background: transparent;
  font: inherit;
  font-size: 13px;
  color: var(--text-1);
  outline: none;
  width: 140px;
}
.tk-search::placeholder {
  color: var(--text-3);
}
.tk-select {
  padding: 5px 28px 5px 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font: inherit;
  font-size: 13px;
  color: var(--text-1);
  background: var(--surface);
  cursor: pointer;
}

/* ── View container ──────────────────────────────────────── */
.tk-view {
  min-height: 200px;
}
.tk-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 20px;
  color: var(--text-3);
  font-size: 14px;
  text-align: center;
}

/* ── Priority badge ──────────────────────────────────────── */
.tk-pr-dot {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--r-full);
  background: var(--pr-bg);
  color: var(--pr);
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.tk-pr-dot::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--pr);
}

/* ── Overdue styles ──────────────────────────────────────── */
.is-overdue {
  color: var(--destructive-text);
}

/* ============================================================
   TABLE VIEW
   ============================================================ */
.tk-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
}
.tk-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.tk-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
}
.tk-table th {
  text-align: left;
  padding: 10px 14px;
  font-weight: 600;
  font-size: 11px;

  color: var(--text-2);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.tk-table th:hover {
  color: var(--text-1);
}
.tk-table th svg,
.tk-table th i {
  vertical-align: -2px;
  margin-left: 2px;
}
.tk-th-pr {
  width: 130px;
}
.tk-row {
  cursor: pointer;
  transition: background 80ms;
}
.tk-row:hover {
  background: var(--primary-subtle);
}
.tk-row td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.tk-row:last-child td {
  border-bottom: none;
}
.tk-cell-task {
  font-weight: 500;
  color: var(--text-1);
  max-width: 340px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tk-cell-assignee {
  color: var(--text-2);
  white-space: nowrap;
}
.tk-cell-deadline {
  white-space: nowrap;
}
.tk-cell-meeting {
  color: var(--text-3);
  font-size: 12px;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============================================================
   KANBAN VIEW
   ============================================================ */
.kb-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  min-height: 300px;
}
@media (max-width: 960px) {
  .kb-board {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 580px) {
  .kb-board {
    grid-template-columns: 1fr;
  }
}

.kb-col {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  display: flex;
  flex-direction: column;
  min-height: 180px;
}
.kb-col-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px 8px;
}
.kb-col-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pr);
}
.kb-col-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-1);

}
.kb-col-count {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-3);
  background: var(--surface);
  border-radius: var(--r-full);
  padding: 1px 7px;
  font-weight: 500;
}
.kb-col-body {
  flex: 1;
  padding: 4px 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.kb-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  font-size: 12px;
  color: var(--text-3);
}

.kb-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--pr);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  cursor: pointer;
  transition:
    box-shadow 120ms,
    transform 100ms;
}
.kb-card:hover {
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.kb-card.kb-dragging {
  opacity: 0.4;
  transform: rotate(2deg);
}
.kb-col.kb-drop-target {
  outline: 2px dashed var(--primary);
  outline-offset: -2px;
  background: var(--primary-subtle);
}
.kb-card-task {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-1);
  line-height: 1.45;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.kb-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--text-2);
  margin-bottom: 4px;
}
.kb-card-assignee,
.kb-card-deadline {
  display: flex;
  align-items: center;
  gap: 4px;
}
.kb-card-meeting {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 4px;
}

/* ============================================================
   CALENDAR VIEW
   ============================================================ */
.cal-wrap {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  overflow: hidden;
}
.cal-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.cal-month-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1);
  min-width: 160px;
  text-align: center;
}
.cal-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--r-sm);
  padding: 4px 8px;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  color: var(--text-2);
  transition: background 80ms;
}
.cal-nav:hover {
  background: var(--surface-2);
}
.cal-nav svg,
.cal-nav i {
  width: 16px;
  height: 16px;
}
.cal-today-btn {
  margin-left: auto;
  font-weight: 500;
}

.cal-grid {
  display: grid;
  /* minmax(0, 1fr) — без 0-минимума колонка раздувается под min-content
   * самой длинной ячейки (chip с `white-space:nowrap`) и ломает сетку:
   * один длинный титул раздвигает «свою» колонку поперёк всех строк.
   * Phase 13.6 — defensive fix. */
  grid-template-columns: repeat(7, minmax(0, 1fr));
}
.cal-dow {
  padding: 8px 4px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);

  border-bottom: 1px solid var(--border);
}
.cal-cell {
  min-height: 90px;
  padding: 6px;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  position: relative;
}
.cal-cell:nth-child(7n + 7) {
  border-right: none;
}
.cal-cell--empty {
  background: var(--surface-2);
  opacity: 0.5;
}
.cal-cell--today {
  background: var(--primary-subtle);
}
.cal-cell--today .cal-day {
  background: var(--primary);
  color: var(--primary-fg);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.cal-day {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  display: inline-block;
  margin-bottom: 4px;
}

/* Day number + meeting-count badge on the same row, badge right-aligned. */
.cal-day-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
  gap: 4px;
}
.cal-day-header-row .cal-day {
  margin-bottom: 0;
}
.cal-meeting-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(37, 99, 235, 0.12);
  color: #2563EB;
  line-height: 1.4;
}
.cal-meeting-badge i {
  width: 10px;
  height: 10px;
}

/* Day drill-down — meeting list block, sits below the orders list. */
.cal-day-meetings {
  margin-top: 20px;
}
.cal-day-meetings__title {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);

}
.cal-day-meetings__list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cal-day-meeting {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  text-decoration: none;
  color: var(--text-1);
  transition: background 100ms, border-color 100ms;
}
.cal-day-meeting:hover {
  background: var(--surface-2);
  border-color: var(--accent);
}
.cal-day-meeting__time {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.cal-day-meeting__title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-1);
}
.cal-day-meeting__status {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-2);
}
.cal-day-meeting__status--completed { background: #F0FDF4; color: #16A34A; }
.cal-day-meeting__status--active    { background: #EFF6FF; color: #2563EB; }
.cal-day-meeting__status--processing{ background: #FFFBEB; color: #B45309; }
.cal-day-meeting__status--failed    { background: #FEF2F2; color: #B91C1C; }
.cal-day-meeting__status--scheduled { background: #F4F4F5; color: #6B7280; }
.cal-tasks {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cal-pill {
  font-size: 10px;
  font-weight: 500;
  padding: 2px 5px;
  border-radius: 3px;
  background: var(--pr-bg);
  color: var(--pr);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  border-left: 2px solid var(--pr);
  transition: opacity 80ms;
}
.cal-pill:hover {
  opacity: 0.75;
}
.cal-more {
  font-size: 10px;
  color: var(--text-3);
  padding: 1px 5px;
  font-weight: 500;
}
.cal-cell[data-date] {
  cursor: pointer;
}
.cal-cell[data-date]:hover {
  background: var(--surface-2);
}

/* ── Calendar Day View ──────────────────────────────────────── */
.cal-day-view {
  max-width: 640px;
  margin: 0 auto;
}
.cal-day-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.cal-day-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-1);
  margin: 0;
}
.cal-day-count {
  font-size: 13px;
  color: var(--text-3);
  margin-left: auto;
}
.cal-day-tasks {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cal-day-task {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px 16px;
  cursor: pointer;
  transition: box-shadow 120ms;
}
.cal-day-task:hover {
  box-shadow: var(--shadow-sm);
}
.cal-day-task-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.cal-day-task-meeting {
  font-size: 12px;
  color: var(--text-3);
  margin-left: auto;
}
.cal-day-task-body {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-1);
  margin-bottom: 8px;
}
.cal-day-task-bottom {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-2);
}
.cal-day-empty {
  padding: 48px 20px;
  text-align: center;
  font-size: 14px;
  color: var(--text-3);
}
.kb-priority-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--r-sm);
  text-transform: uppercase;
}
.kb-priority-badge.pr-critical {
  background: #dc262620;
  color: #dc2626;
}
.kb-priority-badge.pr-high {
  background: #f59e0b20;
  color: #d97706;
}
.kb-priority-badge.pr-medium {
  background: #3b82f620;
  color: #3b82f6;
}
.kb-priority-badge.pr-low {
  background: #6b728020;
  color: #6b7280;
}

/* ============================================================
   GANTT VIEW
   ============================================================ */
.gt-wrap {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  overflow-x: auto;
  overflow-y: auto;
  max-height: 540px;
}
.gt-chart {
  min-width: 800px;
}
.gt-header-row {
  display: flex;
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.gt-header-label {
  width: 240px;
  min-width: 240px;
  padding: 8px 14px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);

  border-right: 1px solid var(--border);
}
.gt-header-timeline {
  flex: 1;
  display: flex;
}
.gt-hcell {
  flex: 1;
  min-width: 32px;
  text-align: center;
  padding: 4px 2px;
  border-right: 1px solid var(--border);
  position: relative;
}
.gt-hcell--weekend {
  background: color-mix(in srgb, var(--surface-2) 60%, var(--border));
}
.gt-hcell--today {
  background: var(--primary-subtle-2);
}
.gt-hcell-month {
  display: block;
  font-size: 9px;
  font-weight: 600;
  color: var(--text-3);

}
.gt-hcell-day {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-2);
}
.gt-hcell--today .gt-hcell-day {
  color: var(--primary);
  font-weight: 700;
}

.gt-body {
  position: relative;
}

.gt-row {
  display: flex;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 80ms;
}
.gt-row:hover {
  background: var(--primary-subtle);
}
.gt-row:last-child {
  border-bottom: none;
}
.gt-row-label {
  width: 240px;
  min-width: 240px;
  padding: 8px 14px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}
.gt-row-task {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gt-row-assignee {
  font-size: 11px;
  color: var(--text-3);
}
.gt-row-timeline {
  flex: 1;
  position: relative;
  height: 44px;
}
.gt-bar {
  position: absolute;
  top: 10px;
  height: 24px;
  border-radius: 4px;
  background: var(--pr);
  opacity: 0.85;
  display: flex;
  align-items: center;
  padding: 0 8px;
  min-width: 20px;
  transition: opacity 120ms;
}
.gt-bar:hover {
  opacity: 1;
}
.gt-bar-label {
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgb(0 0 0 / 0.2);
}

.gt-today-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--destructive);
  z-index: 2;
  pointer-events: none;
}
.gt-today-line::before {
  content: "Сегодня";
  position: absolute;
  top: -18px;
  left: -22px;
  font-size: 9px;
  font-weight: 600;
  color: var(--destructive);

}

/* ============================================================
   DETAIL PANEL (slide-in from right)
   ============================================================ */
.tk-detail-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  z-index: 900;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms;
}
.tk-detail-overlay.is-open {
  opacity: 1;
  pointer-events: all;
}

.tk-detail {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(420px, 90vw);
  background: var(--surface);
  z-index: 901;
  transform: translateX(100%);
  transition: transform 260ms cubic-bezier(0.22, 0.68, 0, 1.1);
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 32px rgb(0 0 0 / 0.12);
}
.tk-detail.is-open {
  transform: translateX(0);
}

.tk-d-header {
  display: flex;
  justify-content: flex-end;
  padding: 16px 20px 0;
}
.tk-d-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  cursor: pointer;
  color: var(--text-2);
  transition: background 80ms;
}
.tk-d-close:hover {
  background: var(--surface-2);
}
.tk-d-close svg,
.tk-d-close i {
  width: 16px;
  height: 16px;
}

.tk-d-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px 24px;
}
.tk-d-priority {
  margin-bottom: 12px;
}
.tk-d-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-1);
  line-height: 1.4;
  margin: 0 0 24px;
}

.tk-d-fields {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}
.tk-d-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tk-d-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;

  color: var(--text-3);
}
.tk-d-label svg,
.tk-d-label i {
  width: 14px;
  height: 14px;
}
.tk-d-value {
  font-size: 14px;
  color: var(--text-1);
}
.tk-d-link {
  color: var(--primary);
  text-decoration: none;
}
.tk-d-link:hover {
  text-decoration: underline;
}
.tk-d-overdue-tag {
  font-size: 10px;
  font-weight: 600;
  background: var(--destructive-subtle);
  color: var(--destructive-text);
  border-radius: var(--r-full);
  padding: 2px 7px;
  margin-left: 6px;
}

.tk-d-quote-wrap {
  margin-bottom: 20px;
}
.tk-d-quote {
  margin: 8px 0 0;
  padding: 12px 16px;
  border-left: 3px solid var(--primary);
  background: var(--primary-subtle);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  font-size: 13px;
  font-style: italic;
  color: var(--text-2);
  line-height: 1.55;
}

.tk-d-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}

/* ============================================================
   MESSENGER — layout, sidebar, chat, messages, compose
   ============================================================ */

/* ── Layout ──────────────────────────────────────────────── */
.ms-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

/* ── Chat Sidebar ────────────────────────────────────────── */
.ms-sidebar {
  width: 300px;
  min-width: 300px;
  border-right: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.ms-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 16px 10px;
}
.ms-sidebar-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-1);
  margin: 0;
}
.ms-btn-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  cursor: pointer;
  color: var(--text-2);
  transition: background 80ms;
}
.ms-btn-icon:hover {
  background: var(--surface-2);
}
.ms-btn-icon svg,
.ms-btn-icon i {
  width: 16px;
  height: 16px;
}
.ms-btn-xs {
  width: 24px;
  height: 24px;
  border: none;
}
.ms-btn-xs svg,
.ms-btn-xs i {
  width: 14px;
  height: 14px;
}

.ms-sidebar-search {
  padding: 0 12px 10px;
}
.ms-search-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 7px 10px;
}
.ms-search-wrap svg,
.ms-search-wrap i {
  width: 14px;
  height: 14px;
  color: var(--text-3);
  flex-shrink: 0;
}
.ms-search-input {
  flex: 1;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 13px;
  color: var(--text-1);
  outline: none;
}
.ms-search-input::placeholder {
  color: var(--text-3);
}

/* ── Channel List ────────────────────────────────────────── */
.ms-channel-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 6px;
}
.ms-channel-list::-webkit-scrollbar {
  width: 4px;
}
.ms-channel-list::-webkit-scrollbar-thumb {
  background: var(--border-2);
  border-radius: 4px;
}

.ms-ch-empty {
  padding: 32px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--text-3);
}

.ms-ch-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px;
  cursor: pointer;
  border-radius: var(--r-md);
  transition: background 100ms;
  position: relative;
}
.ms-ch-item:hover {
  background: var(--surface-2);
}
.ms-ch-item.is-active {
  background: var(--primary-subtle);
}
.ms-ch-item.has-unread .ms-ch-name {
  font-weight: 700;
}
.ms-ch-item.has-unread .ms-ch-preview {
  color: var(--text-1);
  font-weight: 500;
}

.ms-ch-avatar {
  width: 42px;
  height: 42px;
  border-radius: var(--r-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
  position: relative;
}
.ms-online-dot {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--success);
  border: 2px solid var(--surface);
}
.ms-online-dot--static {
  position: static;
  border: none;
  width: 8px;
  height: 8px;
  flex-shrink: 0;
}

.ms-ch-body {
  flex: 1;
  min-width: 0;
}
.ms-ch-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
}
.ms-ch-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ms-ch-time {
  font-size: 11px;
  color: var(--text-3);
  flex-shrink: 0;
}
.ms-ch-preview {
  font-size: 12.5px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}
.ms-ch-preview-name {
  color: var(--text-2);
  font-weight: 500;
}
.ms-ch-badge {
  min-width: 20px;
  height: 20px;
  border-radius: var(--r-full);
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  flex-shrink: 0;
}

/* ── Chat Area ───────────────────────────────────────────── */
.ms-chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  overflow: hidden;
}
.ms-chat-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Empty state */
.ms-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.ms-empty-icon {
  width: 56px;
  height: 56px;
  color: var(--border-2);
}
.ms-empty-icon svg {
  width: 100%;
  height: 100%;
}
.ms-empty-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-2);
  margin: 8px 0 0;
}
.ms-empty-text {
  font-size: 13px;
  color: var(--text-3);
  margin: 0 0 12px;
}

/* ── Chat Header ─────────────────────────────────────────── */
.ms-chat-header {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.ms-header-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--r-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 13px;
  flex-shrink: 0;
}
.ms-header-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.ms-header-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
}
.ms-header-sub {
  font-size: 12px;
  color: var(--text-3);
}
.ms-header-online {
  color: var(--success-text);
}
.ms-header-offline {
  color: var(--text-3);
}

/* ── Messages ────────────────────────────────────────────── */
.ms-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.ms-messages::-webkit-scrollbar {
  width: 5px;
}
.ms-messages::-webkit-scrollbar-thumb {
  background: var(--border-2);
  border-radius: 4px;
}

.ms-no-messages {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--text-3);
}

/* Date separator */
.ms-date-sep {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);

}
.ms-date-sep::before,
.ms-date-sep::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* System message */
.ms-msg-system {
  text-align: center;
  padding: 6px 0;
  font-size: 12px;
  color: var(--text-3);
  font-style: italic;
}

/* Message bubble */
.ms-msg {
  display: flex;
  gap: 8px;
  max-width: 65%;
  align-self: flex-start;
  margin-top: 2px;
}
.ms-msg--own {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.ms-msg--grouped {
  margin-top: 1px;
}
.ms-msg--grouped .ms-msg-sender {
  display: none;
}

.ms-msg-avatar {
  width: 30px;
  height: 30px;
  border-radius: var(--r-full);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}
.ms-msg-avatar-spacer {
  width: 30px;
  flex-shrink: 0;
}

.ms-msg-bubble {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px 12px 12px 4px;
  padding: 8px 12px;
}
.ms-msg--own .ms-msg-bubble {
  background: var(--primary-subtle);
  border-color: var(--primary-subtle-2);
  border-radius: 12px 12px 4px 12px;
}
.ms-msg-sender {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 2px;
}
.ms-msg-content {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-1);
  word-break: break-word;
  white-space: pre-wrap;
}
.ms-msg-deleted {
  font-style: italic;
  color: var(--text-3);
  font-size: 12.5px;
}
.ms-msg-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  justify-content: flex-end;
  margin-top: 3px;
}
.ms-msg-time {
  font-size: 10.5px;
  color: var(--text-3);
}
.ms-msg-edited {
  font-size: 10px;
  color: var(--text-3);
  font-style: italic;
}
.ms-msg-check {
  font-size: 11px;
  color: var(--text-3);
  margin-left: 2px;
  letter-spacing: -2px;
}
.ms-msg-check--read {
  color: var(--primary);
}

/* Reply in message */
.ms-msg-reply {
  padding: 4px 8px;
  margin-bottom: 6px;
  border-left: 2px solid var(--primary);
  background: var(--surface-2);
  border-radius: 0 var(--r-xs) var(--r-xs) 0;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.ms-msg-reply-name {
  font-weight: 600;
  color: var(--primary);
}
.ms-msg-reply-text {
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Typing Indicator ────────────────────────────────────── */
.ms-typing {
  padding: 0 20px;
  height: 0;
  overflow: hidden;
  transition: height 200ms;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-3);
}
.ms-typing.is-visible {
  height: 28px;
}
.ms-typing-dots {
  display: flex;
  gap: 3px;
}
.ms-typing-dots span {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-3);
  animation: ms-dot-bounce 1.4s infinite;
}
.ms-typing-dots span:nth-child(2) {
  animation-delay: 0.2s;
}
.ms-typing-dots span:nth-child(3) {
  animation-delay: 0.4s;
}
@keyframes ms-dot-bounce {
  0%,
  80%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-5px);
  }
}

/* ── Compose ─────────────────────────────────────────────── */
.ms-compose {
  padding: 12px 20px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}
.ms-reply-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--primary-subtle);
  border-left: 3px solid var(--primary);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  margin-bottom: 8px;
  font-size: 12px;
}
.ms-reply-bar-body {
  flex: 1;
  min-width: 0;
}
.ms-reply-bar-name {
  font-weight: 600;
  color: var(--primary);
  margin-right: 6px;
}
.ms-reply-bar-text {
  color: var(--text-2);
}

.ms-compose-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
.ms-compose-input {
  flex: 1;
  resize: none;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 10px 14px;
  font: inherit;
  font-size: 13.5px;
  max-height: 120px;
  outline: none;
  transition: border-color 150ms;
  line-height: 1.5;
  background: var(--surface);
}
.ms-compose-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 12%, transparent);
}
.ms-compose-input::placeholder {
  color: var(--text-3);
}
.ms-send-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--r-md);
  background: var(--primary);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 100ms;
}
.ms-send-btn:hover {
  background: var(--primary-hover);
}
.ms-send-btn svg,
.ms-send-btn i {
  width: 18px;
  height: 18px;
}

/* ── Context Menu ────────────────────────────────────────── */
.ms-ctx-menu {
  position: fixed;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-md);
  padding: 4px 0;
  z-index: 800;
  min-width: 190px;
}
.ms-ctx-item {
  padding: 8px 14px;
  font-size: 13px;
  color: var(--text-1);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 80ms;
}
.ms-ctx-item:hover {
  background: var(--surface-2);
}
.ms-ctx-item svg,
.ms-ctx-item i {
  width: 15px;
  height: 15px;
  color: var(--text-2);
}
.ms-ctx-item--danger {
  color: var(--destructive-text);
}
.ms-ctx-item--danger svg,
.ms-ctx-item--danger i {
  color: var(--destructive-text);
}

/* ── New Chat Modal ──────────────────────────────────────── */
.ms-modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ms-modal {
  background: var(--surface);
  border-radius: var(--r-lg);
  width: min(440px, 90vw);
  max-height: 80vh;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.ms-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 12px;
}
.ms-modal-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-1);
  margin: 0;
}
.ms-modal-tabs {
  display: flex;
  gap: 2px;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
}
.ms-modal-tab {
  padding: 8px 16px;
  border: none;
  background: none;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-3);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition:
    color 120ms,
    border-color 120ms;
}
.ms-modal-tab:hover {
  color: var(--text-1);
}
.ms-modal-tab.is-active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.ms-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}
.ms-modal-search {
  margin-bottom: 12px;
}
.ms-modal-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font: inherit;
  font-size: 13px;
  outline: none;
}
.ms-modal-input:focus {
  border-color: var(--primary);
}
.ms-modal-field {
  margin-bottom: 14px;
}
.ms-modal-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
}

.ms-user-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 320px;
  overflow-y: auto;
}
.ms-user-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background 80ms;
}
.ms-user-item:hover {
  background: var(--surface-2);
}
.ms-user-item--check {
  cursor: pointer;
}
.ms-user-item--check input[type="checkbox"] {
  flex-shrink: 0;
}
.ms-user-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.ms-user-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-1);
}
.ms-user-email {
  font-size: 11.5px;
  color: var(--text-3);
}

/* ── Messenger mobile back button ─────────────────────────── */
.ms-back-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  cursor: pointer;
  color: var(--text-2);
  flex-shrink: 0;
}
.ms-back-btn svg,
.ms-back-btn i {
  width: 16px;
  height: 16px;
}

/* ── Messenger mobile ────────────────────────────────────── */
@media (max-width: 768px) {
  .ms-layout {
    flex: 1;
    min-height: 0;
    height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  .ms-sidebar {
    width: 100%;
    min-width: 100%;
    flex: 1;
    min-height: 0;
    border-right: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .ms-channel-list {
    -webkit-overflow-scrolling: touch;
  }

  .ms-ch-item {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.08);
  }

  .ms-chat {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 250;
    background: var(--bg);
    transform: translateX(100%);
    transition: transform 220ms cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
  }
  .ms-layout.ms-show-chat .ms-chat {
    transform: translateX(0);
  }

  .ms-back-btn {
    display: flex;
  }
  .ms-sidebar-header {
    padding: 14px 16px 8px;
  }
  .ms-compose {
    padding: 10px 14px 14px;
  }
  .ms-messages {
    padding: 12px 14px;
    flex: 1;
    min-height: 0;
  }
  .ms-chat-header {
    padding: 10px 14px;
  }
  .ms-chat-view {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }
}

/* ── Messenger attachments ───────────────────────────────── */
.ms-msg-attach {
  margin-bottom: 4px;
}
.ms-msg-img {
  max-width: 280px;
  max-height: 320px;
  border-radius: var(--r-md);
  display: block;
  cursor: pointer;
  object-fit: cover;
}
@media (max-width: 768px) {
  .ms-msg-img {
    max-width: 200px;
    max-height: 240px;
  }
}
.ms-msg-file {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  text-decoration: none;
  color: inherit;
  transition: background 80ms;
  margin-bottom: 4px;
}
.ms-msg-file:hover {
  background: var(--bg);
}
.ms-msg-file-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  background: var(--primary-subtle);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ms-msg-file-icon svg,
.ms-msg-file-icon i {
  width: 18px;
  height: 18px;
}
.ms-msg-file-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.ms-msg-file-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ms-msg-file-size {
  font-size: 11px;
  color: var(--text-3);
}

/* Compose attach button */
.ms-btn-attach {
  border: none;
  background: none;
  color: var(--text-3);
  flex-shrink: 0;
  width: 36px;
  height: 36px;
}
.ms-btn-attach:hover {
  color: var(--primary);
}
.ms-btn-attach svg,
.ms-btn-attach i {
  width: 20px;
  height: 20px;
}

/* Drag & drop overlay */
.ms-dragover::after {
  content: "Перетащите файлы сюда";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--primary) 8%, var(--surface) 92%);
  border: 2px dashed var(--primary);
  border-radius: var(--r-lg);
  font-size: 15px;
  font-weight: 600;
  color: var(--primary);
  z-index: 10;
  pointer-events: none;
  margin: 8px;
}
.ms-chat {
  position: relative;
}

/* Messenger burger button on mobile */
.ms-burger {
  display: none;
}
@media (max-width: 768px) {
  .ms-burger {
    display: flex;
  }
}

/* ── Attach preview before send ──────────────────────────── */
.ms-attach-preview {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  margin-bottom: 8px;
  flex-wrap: wrap;
  align-items: flex-start;
}
.ms-ap-item {
  position: relative;
  border-radius: var(--r-sm);
  overflow: hidden;
}
.ms-ap-img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: var(--r-sm);
  display: block;
  border: 1px solid var(--border);
}
.ms-ap-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  border: none;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ms-ap-remove:hover {
  background: rgba(0, 0, 0, 0.8);
}
.ms-ap-file {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
}
.ms-ap-file-info {
  display: flex;
  align-items: center;
  gap: 6px;
}
.ms-ap-file-icon svg,
.ms-ap-file-icon i {
  width: 16px;
  height: 16px;
  color: var(--primary);
}
.ms-ap-file-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-1);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ms-ap-file-size {
  font-size: 11px;
  color: var(--text-3);
}

/* ============================================================
   DASHBOARD — KPI cards, charts, widgets
   ============================================================ */

/* ── KPI Row ─────────────────────────────────────────────── */
.db-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 20px 0;
}
@media (max-width: 900px) {
  .db-kpi-row {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 500px) {
  .db-kpi-row {
    grid-template-columns: 1fr;
  }
}

/* shadcn-style KPI card: roomy padding, vertical layout, oversize numeric.
 * Icon sits in the top-right corner like the shadcn dashboard examples. */
.db-kpi {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 24px;
  background: var(--card);
  color: var(--card-foreground);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
  opacity: 0;
  transform: translateY(12px);
  animation: db-kpi-in 0.5s cubic-bezier(0.22, 0.68, 0, 1.1) forwards;
  animation-delay: var(--delay, 0s);
}
@keyframes db-kpi-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.db-kpi-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.db-kpi-icon svg,
.db-kpi-icon i {
  width: 20px;
  height: 20px;
}
.db-kpi-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.db-kpi-value {
  font-size: 36px;
  font-weight: 700;
  color: var(--foreground);
  line-height: 1;
  letter-spacing: -0.025em;
}
.db-kpi-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted-foreground);
  margin-top: 8px;
}
.db-kpi-sub {
  font-size: 12px;
  color: var(--muted-foreground);
  opacity: 0.75;
  margin-top: 4px;
}

/* ── Card Grid ───────────────────────────────────────────── */
.db-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
@media (max-width: 768px) {
  .db-grid {
    grid-template-columns: 1fr;
  }
}

.db-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}

/* ── Meeting-orders report (Phase 3 task [1]) ───────────────────── */
.db-report-select {
  appearance: none;
  font: inherit;
  font-size: 13px;
  padding: 6px 28px 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background:
    var(--surface)
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'><path d='m6 9 6 6 6-6'/></svg>")
    no-repeat right 8px center;
  background-size: 12px;
  color: var(--text-1);
  max-width: 360px;
  cursor: pointer;
}
.db-report-select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.mr-totals {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.mr-totals__pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-size: 12px;
  color: var(--text-1);
  background: var(--surface-2);
  border-radius: var(--r-full);
}
.mr-totals__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--mr-c, currentColor);
}
.mr-totals__pill strong {
  font-weight: 700;
}
.mr-table-wrap {
  overflow-x: auto;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
}
.mr-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.mr-table thead th {
  text-align: left;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 600;

  color: var(--text-2);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.mr-table tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  color: var(--text-1);
}
.mr-table tbody tr:last-child td {
  border-bottom: 0;
}
.mr-table tbody tr:hover {
  background: var(--surface-2);
}
.mr-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
.mr-link:hover {
  text-decoration: underline;
}
.mr-status-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 600;
  color: var(--mr-c, var(--text-2));
  background: color-mix(in srgb, var(--mr-c, #94a3b8) 12%, transparent);
}
.db-card--anim {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 0.45s cubic-bezier(0.22, 0.68, 0, 1.1),
    transform 0.45s cubic-bezier(0.22, 0.68, 0, 1.1);
  transition-delay: var(--delay, 0s);
}
.db-card--anim.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.db-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 0;
}
.db-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);

  margin: 0;
}
.db-card-link {
  font-size: 12px;
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}
.db-card-body {
  padding: 16px 20px 20px;
}
.db-empty-msg {
  font-size: 13px;
  color: var(--text-3);
  text-align: center;
  padding: 20px 0;
}

/* ── Donut Chart ─────────────────────────────────────────── */
.db-donut-wrap {
  display: flex;
  align-items: center;
  gap: 24px;
}
@media (max-width: 500px) {
  .db-donut-wrap {
    flex-direction: column;
  }
}

/* Empty state replaces the grey ring when there are no meetings yet. */
.db-donut-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px 16px;
  gap: 8px;
  color: var(--text-2);
}
.db-donut-empty__icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
}
.db-donut-empty__icon i {
  width: 24px;
  height: 24px;
}
.db-donut-empty__title {
  margin-top: 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
}
.db-donut-empty__sub {
  font-size: 12px;
  color: var(--text-3);
  max-width: 280px;
}
.db-donut-empty__cta {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  background: var(--accent);
  border-radius: var(--r-md);
  text-decoration: none;
  transition: filter 100ms;
}
.db-donut-empty__cta:hover {
  filter: brightness(1.08);
}
.db-donut-empty__cta i {
  width: 14px;
  height: 14px;
}
.db-donut {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
}
.db-donut--svg {
  background: transparent;
}
.db-donut-svg {
  width: 100%;
  height: 100%;
  display: block;
}
/* Each <a><path/></a> is a clickable status segment.
   - hover: brighten + slight outward bias so it visually pops
   - focus-visible: dotted outline ring for keyboard nav (donut is data-nav) */
.db-donut-seg {
  cursor: pointer;
  transition: filter 100ms ease-out, transform 100ms ease-out, opacity 100ms ease-out;
  transform-origin: 50px 50px;
  transform-box: fill-box;
}
.db-donut-seg-link:hover .db-donut-seg {
  filter: brightness(1.08) drop-shadow(0 1px 2px rgba(0, 0, 0, 0.15));
  transform: scale(1.04);
}
.db-donut-seg-link:focus-visible {
  outline: none;
}
.db-donut-seg-link:focus-visible .db-donut-seg {
  filter: brightness(1.08);
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.db-donut-center {
  position: absolute;
  inset: 18px;
  background: var(--surface);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.db-donut-num {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-1);
}
.db-donut-lbl {
  font-size: 11px;
  color: var(--text-3);
}
.db-legend {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.db-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-1);
}
.db-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.db-legend-label {
  flex: 1;
}
.db-legend-count {
  font-weight: 600;
  color: var(--text-2);
}

/* ── Bar Charts ──────────────────────────────────────────── */
.db-bars {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.db-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.db-bar-label {
  width: 95px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  flex-shrink: 0;
  text-align: right;
}
.db-bar-label--wide {
  width: 140px;
  text-align: left;
}
.db-bar-track {
  flex: 1;
  height: 22px;
  background: var(--surface-2);
  border-radius: var(--r-full);
  overflow: hidden;
}
/* Stacked: meetings fill then orders fill, both inline-flexed inside the
   track so widths combine without overlap. Without this the second
   .db-bar-fill would absolute-cover the first. */
.db-bar-track--stacked {
  display: flex;
  align-items: stretch;
  gap: 1px;
  background: var(--surface-2);
}
.db-bar-track--stacked .db-bar-fill {
  border-radius: 0;
}
.db-bar-track--stacked .db-bar-fill:first-child {
  border-top-left-radius: var(--r-full);
  border-bottom-left-radius: var(--r-full);
}
.db-bar-track--stacked .db-bar-fill:last-child {
  border-top-right-radius: var(--r-full);
  border-bottom-right-radius: var(--r-full);
}

/* Legend below the stacked bars (single line, hidden on tiny screens) */
.db-bars-legend {
  display: flex;
  gap: 16px;
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
  font-size: 11px;
  color: var(--text-2);
}
.db-bars-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.db-bars-legend__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.db-bar-fill {
  height: 100%;
  border-radius: var(--r-full);
  transition: width 0.7s cubic-bezier(0.22, 0.68, 0, 1.1);
  min-width: 0;
}
.db-bar-count {
  width: 28px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1);
  flex-shrink: 0;
}

/* ── Deadline List ───────────────────────────────────────── */
.db-deadline-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.db-deadline-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.db-deadline-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}
.db-deadline-body {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.db-deadline-task {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-1);
  line-height: 1.4;
}
.db-deadline-meta {
  font-size: 11.5px;
  color: var(--text-3);
}

/* ── Sparkline Bar Chart ─────────────────────────────────── */
.db-spark {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 100px;
  padding-bottom: 18px;
  position: relative;
}
.db-spark-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  position: relative;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
.db-spark-bar {
  width: 100%;
  max-width: 24px;
  background: var(--primary);
  border-radius: 3px 3px 0 0;
  opacity: 0.7;
  transition: height 0.6s cubic-bezier(0.22, 0.68, 0, 1.1);
}
.db-spark-col--today .db-spark-bar {
  background: var(--primary);
  opacity: 1;
}
.db-spark-col:hover .db-spark-bar {
  opacity: 1;
}
.db-spark-lbl {
  position: absolute;
  bottom: -16px;
  font-size: 9px;
  color: var(--text-3);
  font-weight: 500;
}
.db-spark-col--today .db-spark-lbl {
  color: var(--primary);
  font-weight: 700;
}

/* ── Recent Meetings ─────────────────────────────────────── */
.db-recent-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.db-recent-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  text-decoration: none;
  color: inherit;
  transition: background 80ms;
}
.db-recent-item:hover {
  background: var(--surface-2);
}
.db-recent-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.db-recent-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.db-recent-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.db-recent-meta {
  font-size: 11px;
  color: var(--text-3);
}
.db-recent-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--r-full);
  flex-shrink: 0;
  white-space: nowrap;
}

/* ── Dashboard clickable elements ────────────────────────── */
.db-kpi {
  cursor: pointer;
  transition:
    box-shadow 150ms,
    transform 120ms,
    border-color 150ms;
}
.db-kpi:hover {
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
  border-color: var(--border-2);
}

.db-bar-row--link {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  border-radius: var(--r-sm);
  padding: 4px 6px;
  margin: -4px -6px;
  transition: background 100ms;
}
.db-bar-row--link:hover {
  background: var(--surface-2);
}

.db-deadline-item--link {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  border-radius: var(--r-sm);
  padding: 6px 8px;
  margin: -6px -8px;
  transition: background 100ms;
}
.db-deadline-item--link:hover {
  background: var(--surface-2);
}
.db-deadline-arrow {
  flex-shrink: 0;
  color: var(--text-3);
  opacity: 0;
  transition: opacity 150ms;
}
.db-deadline-item--link:hover .db-deadline-arrow {
  opacity: 1;
}
.db-deadline-arrow svg,
.db-deadline-arrow i {
  width: 14px;
  height: 14px;
}

.db-legend-item--link {
  cursor: pointer;
  border-radius: var(--r-xs);
  padding: 3px 6px;
  margin: -3px -6px;
  transition: background 100ms;
}
.db-legend-item--link:hover {
  background: var(--surface-2);
}
.db-legend-arrow {
  margin-left: auto;
  color: var(--text-3);
  opacity: 0;
  transition: opacity 150ms;
}
.db-legend-item--link:hover .db-legend-arrow {
  opacity: 1;
}
.db-legend-arrow svg,
.db-legend-arrow i {
  width: 12px;
  height: 12px;
}

/* ============================================================
   AI AGENTS MODULE
   ============================================================ */
.ag-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
}
.ag-sidebar {
  width: 200px;
  min-width: 200px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}
.ag-sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px 12px;
  font-weight: 700;
  font-size: 15px;
}
.ag-sidebar-header i {
  width: 20px;
  height: 20px;
}
.ag-sidebar-nav {
  padding: 4px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ag-nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--r-md);
  border: none;
  background: none;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  text-align: left;
  transition: background 100ms;
}
.ag-nav-item:hover {
  background: var(--surface-2);
  color: var(--text-1);
}
.ag-nav-item.is-active {
  background: var(--primary-subtle);
  color: var(--primary);
}
.ag-nav-item i {
  width: 16px;
  height: 16px;
}
.ag-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px;
}

/* Page header */
.ag-page-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.ag-page-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
}
.ag-page-sub {
  font-size: 13px;
  color: var(--text-3);
  margin: 0;
}

/* Grid */
.ag-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

/* Card */
.ag-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px;
  transition: box-shadow 120ms;
}
.ag-card:hover {
  box-shadow: var(--shadow-sm);
}
.ag-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.ag-card-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
}
.ag-card-icon i {
  width: 18px;
  height: 18px;
}
.ag-card-name {
  font-weight: 600;
  font-size: 14px;
}
.ag-card-role {
  font-size: 11px;
  color: var(--text-3);
}
.ag-card-desc {
  font-size: 12px;
  color: var(--text-2);
  margin-bottom: 10px;
  line-height: 1.5;
}
.ag-card-actions {
  display: flex;
  gap: 6px;
}

/* Form */
.ag-form {
  max-width: 560px;
}
.ag-form .form-group {
  margin-bottom: 14px;
}
.ag-form textarea {
  min-height: 80px;
  resize: vertical;
}
.ag-form-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

/* Empty */
.ag-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-3);
}
.ag-empty h3 {
  margin: 12px 0 4px;
  font-size: 16px;
  color: var(--text-1);
}
.ag-empty-icon i {
  width: 40px;
  height: 40px;
}
.ag-loading {
  text-align: center;
  padding: 40px;
  color: var(--text-3);
  font-size: 14px;
}

/* Models */
.ag-models-filter {
  margin-bottom: 16px;
}
.ag-model-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.ag-model-row:hover {
  background: var(--surface-2);
}
.ag-model-name {
  flex: 1;
  font-weight: 500;
}
.ag-model-id {
  font-size: 11px;
  color: var(--text-3);
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: var(--r-sm);
}
.ag-model-meta {
  font-size: 11px;
  color: var(--text-3);
  min-width: 60px;
  text-align: right;
}

/* Runs */
.ag-run-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.ag-run-row:hover {
  background: var(--surface-2);
}
.ag-run--error {
  background: #fef2f2;
}
.ag-run-agent {
  font-weight: 600;
  min-width: 120px;
}
.ag-run-input {
  flex: 1;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ag-run-meta {
  font-size: 11px;
  color: var(--text-3);
  min-width: 120px;
}
.ag-run-status {
  min-width: 50px;
  font-size: 11px;
  font-weight: 600;
}
.ag-run-time {
  font-size: 11px;
  color: var(--text-3);
  min-width: 80px;
  text-align: right;
}

/* Test Chat */
.ag-chat {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 180px);
}
.ag-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ag-chat-msg {
  display: flex;
}
.ag-chat-msg--user {
  justify-content: flex-end;
}
.ag-chat-bubble {
  max-width: 70%;
  padding: 10px 14px;
  border-radius: var(--r-lg);
  font-size: 14px;
  line-height: 1.5;
}
.ag-chat-msg--user .ag-chat-bubble {
  background: var(--primary);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.ag-chat-msg--bot .ag-chat-bubble {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
.ag-chat-compose {
  display: flex;
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}
.ag-chat-input {
  flex: 1;
  resize: none;
}

/* Mobile */
@media (max-width: 768px) {
  .ag-sidebar {
    display: none;
  }
  .ag-content {
    padding: 16px;
  }
  .ag-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   COMMAND CENTER
   ============================================================ */
.cmd-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
  height: 100%;
}
.cmd-sidebar {
  width: 220px;
  min-width: 220px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}
.cmd-sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px 12px;
  font-weight: 700;
  font-size: 15px;
}
.cmd-sidebar-header i {
  width: 20px;
  height: 20px;
}
.cmd-sidebar-title {
  font-size: 14px;
}
.cmd-new-chat {
  margin: 8px 12px;
  padding: 8px 12px;
  border-radius: var(--r-md);
  border: 1px dashed var(--border);
  background: none;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 100ms;
}
.cmd-new-chat:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.cmd-new-chat i {
  width: 14px;
  height: 14px;
}

.cmd-chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.cmd-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px;
}

/* Welcome */
.cmd-welcome {
  text-align: center;
  padding: 60px 20px;
  max-width: 480px;
  margin: 0 auto;
}
.cmd-welcome-icon {
  margin-bottom: 16px;
}
.cmd-welcome-icon i {
  width: 48px;
  height: 48px;
  color: var(--primary);
}
.cmd-welcome h2 {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 8px;
}
.cmd-welcome p {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.6;
  margin: 0 0 24px;
}
.cmd-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.cmd-suggestion {
  padding: 8px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-1);
  cursor: pointer;
  transition: all 120ms;
}
.cmd-suggestion:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-subtle);
}

/* Messages */
.cmd-msg {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  max-width: 800px;
}
.cmd-msg--user {
  justify-content: flex-end;
  margin-left: auto;
}
.cmd-msg-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.cmd-msg-avatar i {
  width: 16px;
  height: 16px;
  color: var(--primary);
}
.cmd-msg-body {
  flex: 1;
  min-width: 0;
}
.cmd-msg-bubble {
  padding: 12px 16px;
  border-radius: var(--r-lg);
  font-size: 14px;
  line-height: 1.6;
}
.cmd-msg--user .cmd-msg-bubble {
  background: var(--primary);
  color: #fff;
  border-bottom-right-radius: 4px;
  display: inline-block;
}
.cmd-msg--bot .cmd-msg-bubble {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
.cmd-msg--error {
  color: var(--destructive);
}
.cmd-msg-meta {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 6px;
}

/* Thinking dots */
.cmd-thinking {
  display: flex;
  gap: 4px;
  padding: 4px 0;
}
.cmd-thinking span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-3);
  animation: cmd-dot 1.2s infinite;
  opacity: 0.3;
}
.cmd-thinking span:nth-child(2) {
  animation-delay: 0.2s;
}
.cmd-thinking span:nth-child(3) {
  animation-delay: 0.4s;
}
@keyframes cmd-dot {
  0%,
  80% {
    opacity: 0.3;
  }
  40% {
    opacity: 1;
  }
}

/* Composer (shadcn-style) */
.cmd-composer {
  padding: 16px 32px 24px;
  background: var(--bg);
}
.cmd-composer-box {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  padding: 4px;
  transition:
    border-color 150ms,
    box-shadow 150ms;
}
.cmd-composer-box:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.08);
}
.cmd-composer-input {
  width: 100%;
  border: none;
  background: none;
  resize: none;
  outline: none;
  font: inherit;
  font-size: 15px;
  padding: 12px 16px 4px;
  min-height: 24px;
  max-height: 120px;
  color: var(--text-1);
}
.cmd-composer-input::placeholder {
  color: var(--text-3);
}
.cmd-composer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px 8px;
}
.cmd-composer-left {
  display: flex;
  align-items: center;
  gap: 2px;
}
.cmd-tool-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: none;
  background: none;
  color: var(--text-3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 100ms;
}
.cmd-tool-btn:hover {
  background: var(--surface-2);
  color: var(--text-1);
}
.cmd-tool-btn.is-recording {
  background: #dc262615;
  color: #dc2626;
  animation: cmd-pulse 1.5s infinite;
}
.cmd-tool-btn i {
  width: 18px;
  height: 18px;
}
.cmd-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: none;
  background: var(--text-1);
  color: var(--bg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 100ms;
}
.cmd-send-btn:hover {
  opacity: 0.85;
}
.cmd-send-btn i {
  width: 16px;
  height: 16px;
}
@keyframes cmd-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.3);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(220, 38, 38, 0);
  }
}
.cmd-mic-status {
  font-size: 12px;
  color: #dc2626;
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.cmd-mic-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #dc2626;
  animation: cmd-dot 1s infinite;
}

/* Chat list items */
.cmd-chat-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  margin: 0 8px;
  border-radius: var(--r-md);
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
  transition: background 100ms;
  overflow: hidden;
}
.cmd-chat-item:hover {
  background: var(--surface-2);
  color: var(--text-1);
}
.cmd-chat-item.is-active {
  background: var(--primary-subtle);
  color: var(--primary);
}
.cmd-chat-item-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Context menu */
.cmd-ctx-menu {
  position: fixed;
  z-index: 999;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 4px;
  min-width: 160px;
  box-shadow: var(--shadow-lg);
}
.cmd-ctx-menu button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border: none;
  background: none;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  border-radius: var(--r-md);
  color: var(--text-1);
  transition: background 100ms;
}
.cmd-ctx-menu button:hover {
  background: var(--surface-2);
}
.cmd-ctx-menu button i {
  width: 14px;
  height: 14px;
}
.cmd-loading {
  text-align: center;
  padding: 40px;
  color: var(--text-3);
  font-size: 14px;
}

/* ── Rich Components ─────────────────────────────────────── */
.cmd-component {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.cmd-comp-title {
  font-size: 13px;
  font-weight: 600;
  padding: 10px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

/* Stat cards */
.cmd-stat-cards {
  display: flex;
  gap: 0;
  border: none;
}
.cmd-stat-card {
  flex: 1;
  padding: 14px 16px;
  border-right: 1px solid var(--border);
  background: var(--surface);
}
.cmd-stat-card:last-child {
  border-right: none;
}
.cmd-stat-card:hover {
  background: var(--surface-2);
}
.cmd-stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-1);
}
.cmd-stat-label {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 2px;
}

/* Table */
.cmd-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.cmd-table th {
  padding: 8px 12px;
  text-align: left;
  font-weight: 600;
  font-size: 11px;

  color: var(--text-3);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.cmd-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}
.cmd-table tbody tr {
  cursor: pointer;
  transition: background 100ms;
}
.cmd-table tbody tr:hover {
  background: var(--primary-subtle);
}
.cmd-row--danger {
  background: #fef2f2;
}
.cmd-row--danger:hover {
  background: #fde8e8;
}
.cmd-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
}
.cmd-badge--red {
  background: #dc262620;
  color: #dc2626;
}
.cmd-badge--orange {
  background: #f59e0b20;
  color: #d97706;
}

/* Task list */
.cmd-task-list {
  display: flex;
  flex-direction: column;
}
.cmd-task-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.cmd-task-row:last-child {
  border-bottom: none;
}
.cmd-task-row:hover {
  background: var(--primary-subtle);
}
.cmd-task-prio {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--r-sm);

  min-width: 60px;
  text-align: center;
}
.cmd-task-text {
  flex: 1;
}
.cmd-task-assignee {
  color: var(--text-2);
  min-width: 80px;
}
.cmd-task-deadline {
  color: var(--text-3);
  font-size: 12px;
  min-width: 80px;
  text-align: right;
}
.cmd-overdue {
  color: #dc2626;
  font-weight: 600;
}

/* Bar chart */
.cmd-bar-chart {
  padding: 12px 14px;
}
.cmd-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.cmd-bar-label {
  font-size: 12px;
  min-width: 100px;
  color: var(--text-2);
}
.cmd-bar-track {
  flex: 1;
  height: 20px;
  background: var(--surface-2);
  border-radius: var(--r-sm);
  overflow: hidden;
}
.cmd-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: var(--r-sm);
  transition: width 300ms;
}
.cmd-bar-value {
  font-size: 12px;
  font-weight: 600;
  min-width: 30px;
  text-align: right;
}

/* ── Command msg actions ──────────────────────────────────── */
.cmd-msg-actions {
  margin-top: 6px;
}
.cmd-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface);
  font: inherit;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-3);
  cursor: pointer;
  transition: all 100ms;
}
.cmd-action-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-subtle);
}

/* ============================================================
   DRIVE MODULE
   ============================================================ */
.drv-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.drv-views {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}
.drv-view-btn {
  padding: 7px 12px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-3);
  transition: all 100ms;
  display: flex;
  align-items: center;
}
.drv-view-btn:hover {
  background: var(--surface-2);
  color: var(--text-1);
}
.drv-view-btn.is-active {
  background: var(--primary-subtle);
  color: var(--primary);
}
.drv-view-btn i {
  width: 16px;
  height: 16px;
}

/* Cards */
.drv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.drv-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px;
  cursor: pointer;
  transition: box-shadow 120ms;
}
.drv-card:hover {
  box-shadow: var(--shadow-sm);
}
.drv-card-icon {
  margin-bottom: 10px;
  color: var(--primary);
}
.drv-card-icon i {
  width: 24px;
  height: 24px;
}
.drv-card-title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 6px;
}
.drv-card-preview {
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.5;
  margin-bottom: 10px;
}
.drv-card-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-3);
}
.drv-source-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--primary-subtle);
  color: var(--primary);
  text-transform: uppercase;
}

/* Table */
.drv-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.drv-table th {
  padding: 8px 12px;
  text-align: left;
  font-weight: 600;
  font-size: 11px;

  color: var(--text-3);
  border-bottom: 1px solid var(--border);
}
.drv-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.drv-table tbody tr:hover {
  background: var(--surface-2);
}

/* Calendar grouped */
.drv-cal-group {
  margin-bottom: 20px;
}
.drv-cal-date {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.drv-cal-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  border-radius: var(--r-md);
  font-size: 13px;
  transition: background 100ms;
}
.drv-cal-item:hover {
  background: var(--surface-2);
}

/* Empty */
.drv-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-3);
}
.drv-empty h3 {
  margin: 12px 0 4px;
  font-size: 16px;
  color: var(--text-1);
}

/* Modal */
.drv-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.drv-modal {
  background: var(--surface);
  border-radius: var(--r-xl);
  width: 100%;
  max-width: 640px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.2);
}
.drv-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
}
.drv-modal-header h2 {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
}
.drv-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}
/* Detail full page */
.drv-detail {
  max-width: 800px;
}
.drv-detail-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 10px;
}
.drv-detail-actions {
  display: flex;
  gap: 8px;
}
.drv-detail-title {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 10px;
}
.drv-detail-meta-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text-3);
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.drv-detail-body {
}
.drv-detail-text {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-1);
  margin-bottom: 20px;
}
.drv-detail-components {
}

/* ============================================================
   SETTINGS (superadmin)
   ============================================================ */
.st-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
}
.st-sidebar {
  width: 200px;
  min-width: 200px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}
.st-sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px 12px;
  font-weight: 700;
  font-size: 15px;
}
.st-sidebar-header i {
  width: 20px;
  height: 20px;
}
.st-sidebar-nav {
  padding: 4px 8px;
}
.st-nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--r-md);
  border: none;
  background: none;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  width: 100%;
  text-align: left;
}
.st-nav-item:hover {
  background: var(--surface-2);
}
.st-nav-item.is-active {
  background: var(--primary-subtle);
  color: var(--primary);
}
.st-nav-item i {
  width: 16px;
  height: 16px;
}
.st-content {
  flex: 1;
  overflow-y: auto;
  /* No outer padding — child sections control their own. The canvas
   * view needs to bleed edge-to-edge (sticky .oc-toolbar with its own
   * inner padding + full-bleed .oc-canvas grid); the CSV view below
   * re-adds a comfortable inner padding. */
  padding: 0;
}
.st-content > section[data-view-section="csv"] {
  padding: 24px 32px;
}
.st-page-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}
.st-page-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
}
.st-page-count {
  font-size: 13px;
  color: var(--text-3);
}

/* User list */
.st-user-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.st-user-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background 100ms;
}
.st-user-row:hover {
  background: var(--surface-2);
}
.st-user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
.st-avatar-lg {
  width: 56px;
  height: 56px;
  font-size: 18px;
}
.st-user-info {
  flex: 1;
  min-width: 0;
}
.st-user-name {
  font-weight: 600;
  font-size: 14px;
}
.st-user-email {
  font-size: 12px;
  color: var(--text-3);
}
.st-role-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 10px;
}
.st-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.st-status-dot.green {
  background: #10b981;
}
.st-status-dot.gray {
  background: #d1d5db;
}

/* Profile */
.st-profile {
  max-width: 600px;
}
.st-profile-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 28px;
}
.st-profile-name {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 2px;
}
.st-profile-email {
  font-size: 13px;
  color: var(--text-3);
  margin-bottom: 8px;
}

/* Feature toggles */
.st-section {
  margin-bottom: 24px;
}
.st-section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
  margin: 0 0 12px;

  font-size: 11px;
}
.st-toggles {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.st-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-radius: var(--r-md);
  transition: background 100ms;
}
.st-toggle-row:hover {
  background: var(--surface-2);
}
.st-toggle-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
}

/* Toggle switch */
.st-switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.st-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.st-switch-slider {
  position: absolute;
  inset: 0;
  background: #d1d5db;
  border-radius: 12px;
  cursor: pointer;
  transition: background 200ms;
}
.st-switch-slider::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform 200ms;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}
.st-switch input:checked + .st-switch-slider {
  background: var(--primary);
}
.st-switch input:checked + .st-switch-slider::before {
  transform: translateX(20px);
}

/* ============================================================
   MEETING PIP WIDGET
   ============================================================ */
.mw-widget {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 900;
  font-family: inherit;
}

/* Mini card */
.mw-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 14px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  cursor: default;
  min-width: 220px;
}
.mw-mini-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #10b981;
  animation: mw-pulse 2s infinite;
  flex-shrink: 0;
}
@keyframes mw-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }
}
.mw-mini-info {
  flex: 1;
  min-width: 0;
}
.mw-mini-title {
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mw-mini-timer {
  font-size: 11px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.mw-mini-actions {
  display: flex;
  gap: 4px;
}

.mw-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: var(--surface-2);
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 100ms;
}
.mw-btn svg {
  width: 16px;
  height: 16px;
}
.mw-btn:hover {
  background: var(--surface-3, #e5e5e5);
  color: var(--text-1);
}
.mw-btn--muted {
  background: #dc262620;
  color: #dc2626;
}
.mw-btn--hangup {
  background: #dc262615;
  color: #dc2626;
}
.mw-btn--hangup:hover {
  background: #dc2626;
  color: #fff;
}

/* Expanded panel */
.mw-panel {
  width: 320px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  max-height: 400px;
  animation: mw-slide-up 200ms ease-out;
}
@keyframes mw-slide-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

.mw-panel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.mw-panel-title {
  font-size: 14px;
  font-weight: 600;
  flex: 1;
}
.mw-panel-timer {
  font-size: 12px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.mw-btn--collapse {
  width: 28px;
  height: 28px;
  border-radius: 6px;
}
.mw-btn--collapse svg {
  width: 14px;
  height: 14px;
}

.mw-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
}

.mw-participants {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mw-participant {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.mw-participant-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  flex-shrink: 0;
}
.mw-participant--you .mw-participant-dot {
  background: var(--primary);
}

.mw-panel-footer {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}
.mw-panel-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-1);
  cursor: pointer;
  transition: all 100ms;
  text-decoration: none;
}
.mw-panel-btn:hover {
  background: var(--surface-2);
}
.mw-panel-btn--muted {
  background: #dc262615;
  color: #dc2626;
  border-color: #dc262640;
}
.mw-panel-btn--hangup {
  background: #dc2626;
  color: #fff;
  border-color: #dc2626;
}
.mw-panel-btn--hangup:hover {
  filter: brightness(0.9);
}

/* Mobile */
@media (max-width: 768px) {
  .mw-widget {
    bottom: 10px;
    right: 10px;
    left: 10px;
  }
  .mw-panel {
    width: auto;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .cmd-sidebar {
    display: none;
  }
  .cmd-messages {
    padding: 16px;
  }
  .cmd-compose {
    padding: 12px 16px 16px;
  }
  .cmd-stat-cards {
    flex-wrap: wrap;
  }
  .cmd-stat-card {
    min-width: 45%;
  }
}

/* ============================================================
   PHASE 6 — Orders v2 UI (or- prefix to avoid clashing with tk- tasks)
   ============================================================ */

.or-board {
  display: flex;
  gap: 16px;
  padding: 8px 0 24px;
  overflow-x: auto;
  min-height: calc(100vh - 220px);
}
.or-col {
  flex: 0 0 280px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
}
.or-col__head {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.or-col__title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1);
  display: flex;
  align-items: center;
  gap: 8px;
}
.or-col__count {
  background: var(--surface-2);
  color: var(--text-2);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
}
.or-col__body {
  flex: 1;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
}
/* Status dot colour comes from --st-color set inline by status-meta.js
 * (see public/js/orders/status-meta.js + public/css/orders.css). The
 * legacy per-status rules were deleted in Phase 13 to remove the
 * hardcoded palette. */

.or-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  cursor: grab;
  transition: all 100ms;
}
.or-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transform: translateY(-1px);
}
.or-card:active {
  cursor: grabbing;
}
.or-card.is-dragging {
  transition: none !important;
  z-index: 9999;
  pointer-events: none;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  cursor: grabbing;
  opacity: 0.96;
  transform-origin: top left;
}
.or-card.is-dragging:hover {
  transform: none;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
}
.or-card-placeholder {
  background: var(--surface-2);
  border: 1px dashed var(--border-2);
  border-radius: 10px;
  opacity: 0.5;
}
.or-card__title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-1);
  margin-bottom: 6px;
  line-height: 1.35;
}
.or-card__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-2);
  flex-wrap: wrap;
}
.or-card__priority {
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 500;
}
/* Priority background/foreground are set inline by priorityMeta() — keeping
 * a single source of truth in JS. The legacy per-priority hex rules were
 * deleted in Phase 13. */
.or-card__dup {
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 3px;
}
.or-card__dup i {
  width: 12px;
  height: 12px;
}

.or-col__body--drop-over {
  background: rgba(59, 130, 246, 0.08);
  border-radius: 8px;
}

.or-empty {
  padding: 32px 16px;
  text-align: center;
  color: var(--text-2);
  font-size: 13px;
}
.or-403 {
  padding: 40px;
  text-align: center;
  color: var(--text-2);
}
.or-403 i {
  width: 48px;
  height: 48px;
  opacity: 0.4;
  margin-bottom: 12px;
}

/* ─── Order detail page ─── */

.od-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
}
.od-main {
  min-width: 0;
}
.od-aside {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.od-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.od-title {
  font-size: 22px;
  font-weight: 600;
  color: var(--text-1);
  line-height: 1.3;
  flex: 1;
  min-width: 0;
}
.od-status-pill {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}
.od-status-pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.od-status--draft {
  background: #f1f5f9;
  color: #475569;
}
.od-status--draft::before {
  background: #9ca3af;
}
.od-status--accepted {
  background: #dbeafe;
  color: #1e40af;
}
.od-status--accepted::before {
  background: #3b82f6;
}
.od-status--in_progress {
  background: #fef3c7;
  color: #b45309;
}
.od-status--in_progress::before {
  background: #f59e0b;
}
.od-status--under_review {
  background: #ede9fe;
  color: #6d28d9;
}
.od-status--under_review::before {
  background: #8b5cf6;
}
.od-status--completed {
  background: #d1fae5;
  color: #047857;
}
.od-status--completed::before {
  background: #10b981;
}
.od-status--rejected {
  background: #fee2e2;
  color: #b91c1c;
}
.od-status--rejected::before {
  background: #ef4444;
}

.od-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px 22px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-xs);
}
/* shadcn-style — title row reads as a quiet section header, not a UPPERCASE
 * SHOUT. Icon scaled to match the type's optical weight (16 ≈ 1em at 15px). */
.od-section__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  letter-spacing: -0.005em;
}
.od-section__title:hover {
  color: var(--primary);
}
.od-section__title i {
  width: 16px;
  height: 16px;
  color: var(--text-2);
  stroke-width: 1.75;
}
.od-section__title:hover i {
  color: var(--primary);
}
.od-section__chevron {
  margin-left: auto;
  transition: transform var(--t-fast) var(--t-ease);
}
.od-section[data-collapsed="true"] .od-section__chevron {
  transform: rotate(-90deg);
}
.od-section[data-collapsed="true"] .od-section__body {
  display: none;
}
.od-section[data-collapsed="true"] {
  margin-bottom: 8px;
  padding: 12px 20px;
}
.od-section[data-collapsed="true"] .od-section__title {
  margin-bottom: 0;
}
.od-description {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-1);
  white-space: pre-wrap;
}

.od-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.od-action-btn {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 100ms;
}
.od-action-btn:hover {
  background: var(--surface-2);
}
.od-action-btn--primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.od-action-btn--primary:hover {
  filter: brightness(0.95);
}
.od-action-btn--danger {
  /* shadcn destructive — solid red, white text, matches the primary
   * action's visual weight so Accept/Reject read as siblings, not
   * solid-vs-subtle siblings. */
  background: var(--destructive);
  color: #fff;
  border-color: var(--destructive);
}
.od-action-btn--danger:hover {
  background: var(--destructive-hover);
  border-color: var(--destructive-hover);
}
.od-action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.od-chain {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.od-chain-step {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  color: var(--text-1);
}
.od-chain-arrow {
  color: var(--text-2);
}
/* shadcn-style Alert — full-width attention pattern. Subtle amber bg, a
 * matching border (so the box has real edges, not a vague tint), icon
 * top-aligned for multi-line content. */
.od-chain-diagnostic {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--r-md);
  background: var(--warning-subtle);
  border: 1px solid #fde68a;
  color: var(--warning-text);
  font-size: 13px;
  line-height: 1.5;
}
.od-chain-diagnostic i {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 1px;
  stroke-width: 2;
}

/* shadcn-style key/value table — rows separated by a subtle divider only
 * BETWEEN siblings (no trailing rule); label-color muted, value-color
 * primary text. Slight monospace-ish numeric feel via tabular-nums. */
.od-meta-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  font-size: 13px;
}
.od-meta-row + .od-meta-row {
  border-top: 1px solid var(--border);
}
.od-meta-label {
  color: var(--text-2);
}
.od-meta-value {
  color: var(--text-1);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* ─── Evidence ─── */

.ev-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}
.ev-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}
.ev-card__preview {
  aspect-ratio: 1;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.ev-card__preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ev-card__preview i {
  width: 32px;
  height: 32px;
  color: var(--text-2);
}
.ev-card__meta {
  padding: 8px 10px;
  font-size: 11px;
}
.ev-card__kind {
  color: var(--text-2);
  margin-bottom: 2px;
}
/* shadcn-style verified badge — inline pill (green-50 bg, green-700 text,
 * small Lucide check). No more standalone bright green circle. */
.ev-card__verified {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--r-full);
  background: var(--success-subtle);
  color: var(--success-text);
  border: 1px solid #bbf7d0;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
}
.ev-card__verified i {
  width: 12px;
  height: 12px;
  stroke-width: 2.25;
}

/* Photo-card actions live over the image preview. Text-cards push them
 * into the footer (see .ev-card--text .ev-card__actions below) so they
 * don't sit on top of the comment text. */
.ev-card__actions {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  gap: 4px;
}
.ev-card__action-btn {
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border: none;
  border-radius: 4px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--t-fast) var(--t-ease);
}
.ev-card__action-btn:hover {
  background: rgba(0, 0, 0, 0.8);
}
.ev-card__action-btn i {
  width: 12px;
  height: 12px;
}

/* Text-comment evidence — no preview block, body shown in-card. */
.ev-card--text {
  display: flex;
  flex-direction: column;
}
.ev-card__text-body {
  flex: 1;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-1);
  background: var(--surface);
  white-space: pre-wrap;
  word-break: break-word;
  overflow-y: auto;
  max-height: 180px;
}
/* Re-flow the action buttons into the footer for text cards — over-text
 * absolute positioning was clipping the trash icon on top of the comment.
 * Buttons here are neutral (no semi-black tint that only worked on a
 * photo backdrop). */
.ev-card--text .ev-card__actions {
  position: static;
  align-self: flex-end;
  margin-left: auto;
}
.ev-card--text .ev-card__action-btn {
  background: var(--surface);
  color: var(--text-2);
  border: 1px solid var(--border);
}
.ev-card--text .ev-card__action-btn:hover {
  background: var(--surface-2);
  color: var(--text-1);
}
.ev-card--text .ev-card__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Toggle + textarea for adding a text-comment evidence. */
.ev-text-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 13px;
  background: var(--surface);
  color: var(--text-1);
  border: 1px dashed var(--border);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background 100ms;
}
.ev-text-toggle:hover {
  background: var(--surface-2);
}
.ev-text-toggle i {
  width: 16px;
  height: 16px;
}
.ev-text-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ev-text-area {
  width: 100%;
  min-height: 90px;
  padding: 10px 12px;
  font: inherit;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  resize: vertical;
  background: var(--surface);
  color: var(--text-1);
}
.ev-text-area:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}
.ev-text-form__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.ev-uploader {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all 100ms;
}
.ev-uploader--drag {
  background: rgba(59, 130, 246, 0.08);
  border-color: var(--primary);
}
.ev-uploader__hint {
  color: var(--text-2);
  font-size: 13px;
  margin-bottom: 8px;
}
.ev-uploader__kind {
  margin: 12px 0;
}
.ev-uploader__kind select {
  width: 100%;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  font: inherit;
  font-size: 13px;
}
.ev-uploader__error {
  color: #b91c1c;
  font-size: 12px;
  margin-top: 8px;
}

/* ─── Similarity banner ─── */

.sim-banner {
  background: linear-gradient(90deg, #fef3c7 0%, #fde68a 100%);
  border: 1px solid #f59e0b;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.sim-banner i {
  width: 20px;
  height: 20px;
  color: #b45309;
  flex-shrink: 0;
}
.sim-banner__text {
  flex: 1;
  font-size: 13px;
  color: #78350f;
}
.sim-banner__text strong {
  color: #78350f;
}
.sim-banner__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.sim-banner__btn {
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid #f59e0b;
  background: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  color: #78350f;
  cursor: pointer;
}
.sim-banner__btn:hover {
  background: #fef3c7;
}
.sim-banner__btn--primary {
  background: #f59e0b;
  color: #fff;
  border-color: #d97706;
}
.sim-banner__btn--primary:hover {
  background: #d97706;
}
.sim-banner__suggestion {
  flex-basis: 100%;
  font-size: 13px;
  color: #78350f;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid #fde68a;
  border-radius: 6px;
  padding: 8px 10px;
  margin-top: 4px;
}

/* ── Order-detail dependencies section (Phase 22.3) ─────────────── */
.od-deps {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.od-deps__heading {
  font-size: 11px;

  color: var(--text-3);
  font-weight: 600;
  margin-bottom: 8px;
}
.od-deps__col {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.od-deps__empty {
  font-size: 13px;
  color: var(--text-3);
  padding: 8px 0;
}
.od-deps__card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  text-decoration: none;
  color: var(--text-1);
  background: var(--surface);
  transition: border-color var(--t-fast) var(--t-ease);
}
.od-deps__card:hover {
  border-color: var(--primary);
}
.od-deps__title {
  font-size: 14px;
  font-weight: 500;
}
.od-deps__status {
  font-size: 11px;
  font-weight: 600;
  color: var(--st-color, var(--text-3));
}
.sim-banner__suggestion strong {
  color: #78350f;
}

/* ─── Org tree ─── */

.ot-tree {
  font-size: 14px;
}
.ot-node {
  padding: 6px 0;
}
.ot-node__head {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 6px;
}
.ot-node__head:hover {
  background: var(--surface-2);
}
.ot-node__icon {
  width: 14px;
  height: 14px;
  color: var(--text-2);
  transition: transform 100ms;
}
.ot-node__icon--open {
  transform: rotate(90deg);
}
.ot-node__title {
  color: var(--text-1);
  font-weight: 500;
}
.ot-node__count {
  color: var(--text-2);
  font-size: 11px;
  margin-left: auto;
}
.ot-children {
  margin-left: 22px;
  border-left: 1px solid var(--border);
  padding-left: 12px;
}

.ot-pos {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  font-size: 13px;
  color: var(--text-1);
}
.ot-pos__level {
  padding: 1px 5px;
  background: var(--surface-2);
  color: var(--text-2);
  border-radius: 3px;
  font-size: 10px;
}
.ot-pos__del {
  margin-left: auto;
  opacity: 0;
  padding: 2px 6px;
  background: transparent;
  border: none;
  color: #b91c1c;
  cursor: pointer;
  font-size: 11px;
}
.ot-pos:hover .ot-pos__del {
  opacity: 1;
}

.ot-import {
  margin-top: 24px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.ot-import textarea {
  width: 100%;
  min-height: 200px;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  font: inherit;
  font-family: monospace;
  font-size: 12px;
  resize: vertical;
}
.ot-import__result {
  margin-top: 12px;
  padding: 12px;
  border-radius: 8px;
  font-size: 13px;
}
.ot-import__result--ok {
  background: #d1fae5;
  color: #047857;
}
.ot-import__result--err {
  background: #fee2e2;
  color: #b91c1c;
}

/* ============================================================
   PHASE 23 — date-range-picker shadcn-style
   Was rendering as raw <button>/<input> with no CSS.
   ============================================================ */
.drp {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.drp-chips {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.drp-chip {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  padding: 6px 10px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition:
    background var(--t-fast) var(--t-ease),
    color var(--t-fast) var(--t-ease),
    border-color var(--t-fast) var(--t-ease);
}
.drp-chip:hover {
  background: var(--surface-2);
  color: var(--text-1);
}
.drp-chip--active {
  background: var(--primary);
  color: var(--primary-fg);
  border-color: var(--primary);
}
.drp-chip--active:hover {
  background: var(--primary-hover);
  color: var(--primary-fg);
}
.drp-custom {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-left: 8px;
  border-left: 1px solid var(--border);
}
.drp-custom-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-3);
  font-weight: 500;
}
.drp-input {
  font: inherit;
  font-size: 13px;
  color: var(--text-1);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 6px 8px;
  transition:
    border-color var(--t-fast) var(--t-ease),
    box-shadow var(--t-fast) var(--t-ease);
  font-family: inherit;
}
.drp-input:hover {
  border-color: var(--border-2);
}
.drp-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-subtle-2);
}
.drp-input::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.6;
  transition: opacity var(--t-fast) var(--t-ease);
}
.drp-input::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}
.drp-clear {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition:
    background var(--t-fast) var(--t-ease),
    color var(--t-fast) var(--t-ease);
}
.drp-clear:hover:not(:disabled) {
  background: var(--surface-2);
  color: var(--text-1);
}
.drp-clear:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ============================================================
   PHASE 23 — global font-inherit for form controls.
   Native form controls use the UA system font (Arial on macOS) — we
   want Geologica everywhere. Plain type selector instead of a
   compound :not()-chain over input[type=text]: the negation chain
   forced extra style-match work on every text input on the page
   (settings, integrations, users had it visibly).
   ============================================================ */
input,
textarea,
select,
button {
  font-family: inherit;
}

select {
  appearance: none;
  -webkit-appearance: none;
  background-color: var(--surface);
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2352525b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 16px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 6px 28px 6px 10px;
  font-size: 13px;
  color: var(--text-1);
  cursor: pointer;
  transition:
    border-color var(--t-fast) var(--t-ease),
    box-shadow var(--t-fast) var(--t-ease);
}
select:hover {
  border-color: var(--border-2);
}
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-subtle-2);
}
select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ============================================================
   PHASE 23 — showPrompt overlay (replaces native prompt())
   Pairs with .cs-confirm-overlay reused via api.js
   ============================================================ */
.cs-prompt-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: cs-fade-in 0.18s var(--t-ease);
}
.cs-prompt-dialog {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  padding: 20px 24px 18px;
  min-width: 360px;
  max-width: 480px;
  width: 90%;
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: cs-pop-in 0.18s var(--t-ease);
}
.cs-prompt-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-1);
  margin: 0;
}
.cs-prompt-body {
  font-size: 13px;
  color: var(--text-2);
  margin: 0;
  line-height: 1.4;
}
.cs-prompt-input {
  font-family: inherit;
  font-size: 14px;
  color: var(--text-1);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 8px 10px;
  transition:
    border-color var(--t-fast) var(--t-ease),
    box-shadow var(--t-fast) var(--t-ease);
}
.cs-prompt-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-subtle-2);
}
.cs-prompt-error {
  background: var(--destructive-subtle);
  color: var(--destructive-text);
  border: 1px solid var(--destructive-border);
  border-radius: var(--r-sm);
  padding: 8px 10px;
  font-size: 12px;
}
.cs-prompt-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}
@keyframes cs-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes cs-pop-in {
  from {
    transform: scale(0.96);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* ============================================================
   PHASE 23.1 — custom <select> wrapper (replaces native dropdown popup)
   ============================================================ */
.ui-select {
  position: relative;
  display: inline-block;
}
.ui-select > select {
  /* Native select stays for FormData + a11y, but is invisible. */
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  pointer-events: none;
}
.ui-select__trigger {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 140px;
  padding: 6px 10px 6px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font: inherit;
  font-size: 13px;
  color: var(--text-1);
  cursor: pointer;
  transition:
    border-color var(--t-fast) var(--t-ease),
    box-shadow var(--t-fast) var(--t-ease);
}
.ui-select__trigger:hover:not(:disabled) {
  border-color: var(--border-2);
}
.ui-select__trigger:focus-visible,
.ui-select.is-open .ui-select__trigger {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-subtle-2);
}
.ui-select__trigger:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.ui-select__label {
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.ui-select__label--placeholder {
  color: var(--text-3);
}
.ui-select__chevron {
  width: 14px;
  height: 14px;
  color: var(--text-3);
  transition: transform var(--t-fast) var(--t-ease);
  flex-shrink: 0;
}
.ui-select.is-open .ui-select__chevron {
  transform: rotate(180deg);
}

.ui-select__menu {
  position: fixed;
  z-index: 10000;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  padding: 4px;
  max-height: 280px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1px;
  animation: cs-pop-in 0.12s var(--t-ease);
}
.ui-select__option {
  appearance: none;
  background: transparent;
  border: 0;
  font: inherit;
  font-size: 13px;
  color: var(--text-1);
  text-align: left;
  padding: 7px 10px;
  border-radius: var(--r-xs);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background-color var(--t-snap) var(--t-ease);
}
.ui-select__option:hover,
.ui-select__option.is-highlighted {
  background: var(--surface-2);
}
.ui-select__option.is-selected {
  background: var(--primary-subtle);
  color: var(--text-1);
  font-weight: 500;
}
.ui-select__option.is-selected::before {
  content: "✓";
  color: var(--primary);
  font-size: 12px;
  margin-right: -2px;
}

/* === Orders → Bank view (Пункт 8 из BACKLOG) ============================ */
.or-bank {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  padding: 4px 0;
}
.or-bank__group {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  min-height: 180px;
}
.or-bank__group--unassigned {
  background: var(--muted, #f4f4f5);
  border-style: dashed;
}
.or-bank__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.or-bank__title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--foreground);
}
.or-bank__count {
  font-size: 12px;
  color: var(--muted-foreground);
  background: var(--muted, #f4f4f5);
  padding: 2px 8px;
  border-radius: 999px;
}
.or-bank__dropzone {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  transition: background-color 120ms ease, outline-color 120ms ease;
  outline: 2px dashed transparent;
  outline-offset: -6px;
  border-radius: 8px;
  min-height: 80px;
}
.or-bank__dropzone.is-over {
  background: color-mix(in oklab, var(--primary) 8%, transparent);
  outline-color: var(--primary);
}
.or-bank__empty {
  color: var(--muted-foreground);
  font-size: 12px;
  text-align: center;
  padding: 24px 8px;
  font-style: italic;
}
.or-bank__card {
  background: var(--background);
  border: 1px solid var(--border);
  border-left: 4px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: grab;
  user-select: none;
  transition: transform 80ms ease, box-shadow 80ms ease;
}
.or-bank__card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}
.or-bank__card.is-dragging {
  opacity: 0.5;
  cursor: grabbing;
}
.or-bank__card.pr-critical { border-left-color: #DC2626; }
.or-bank__card.pr-high     { border-left-color: #F59E0B; }
.or-bank__card.pr-medium   { border-left-color: #3B82F6; }
.or-bank__card.pr-low      { border-left-color: #9CA3AF; }
.or-bank__card-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--foreground);
  line-height: 1.3;
  margin-bottom: 4px;
}
.or-bank__card-meta {
  font-size: 11px;
  color: var(--muted-foreground);
}

/* ============================================================
   PROCESSING STEPPER — meeting page progress
   ============================================================ */
.proc-stepper {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 28px 24px 8px;
}
.proc-step {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 14px 0;
}
/* connector line between steps */
.proc-step::before {
  content: "";
  position: absolute;
  left: 19px;
  top: 50px;
  bottom: -10px;
  width: 2px;
  background: var(--border);
  transition: background 0.3s ease;
}
.proc-step:last-child::before { display: none; }
.proc-step.is-done::before { background: var(--success, #16a34a); }

.proc-step__icon {
  position: relative;
  z-index: 1;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--surface, #f5f5f5);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3, #999);
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.proc-step__icon-glyph {
  width: 18px;
  height: 18px;
  transition: opacity 0.2s ease;
}

/* Linear indeterminate progress bar under the step text.
 * Renders only on the active step. We deliberately don't fake a percentage
 * — whisper / LLM don't report real progress, and showing "100%" while
 * work continues is worse UX than admitting we just know "it's running". */
.proc-step__bar {
  position: relative;
  height: 4px;
  margin-top: 8px;
  width: 100%;
  max-width: 320px;
  background: rgba(59, 130, 246, 0.10);
  border-radius: 3px;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.proc-step__bar-fill {
  position: absolute;
  inset: 0;
  width: 35%;
  background: linear-gradient(90deg,
    transparent 0%,
    #3b82f6 50%,
    transparent 100%);
  border-radius: 3px;
  transform: translateX(-100%);
}
.proc-step.is-active .proc-step__bar { opacity: 1; }
.proc-step.is-active .proc-step__bar-fill {
  animation: proc-bar-sweep 1.4s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
@keyframes proc-bar-sweep {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(385%); }
}

/* Elapsed-time line under the bar */
.proc-step__timer {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--text-3, #999);
  margin-top: 6px;
  letter-spacing: 0.2px;
  min-height: 14px;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.proc-step.is-active .proc-step__timer {
  opacity: 1;
  color: #3b82f6;
  font-weight: 500;
}
.proc-step__body { padding-top: 8px; }
.proc-step__title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-3, #999);
  transition: color 0.3s ease;
}
.proc-step__detail {
  font-size: 12.5px;
  color: var(--text-3, #999);
  margin-top: 2px;
  transition: color 0.3s ease;
}

/* ── DONE state ── */
.proc-step.is-done .proc-step__icon {
  background: var(--success, #16a34a);
  border-color: var(--success, #16a34a);
  color: #fff;
  animation: proc-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.proc-step.is-done .proc-step__title { color: var(--text-1); }
.proc-step.is-done .proc-step__detail { color: var(--text-2, #666); }

/* ── ACTIVE state — pulsing spinning ring around the icon ────────────────── */
.proc-step.is-active .proc-step__icon {
  background: rgba(59, 130, 246, 0.08);
  border-color: var(--primary, #3b82f6);
  color: var(--primary, #3b82f6);
}
/* Outer rotating arc — the eye-catching "something is happening" cue. */
.proc-step.is-active .proc-step__icon::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid var(--primary, #3b82f6);
  border-top-color: transparent;
  border-right-color: transparent;
  animation: spin 1s linear infinite;
}
/* Soft outward pulse — adds depth without screaming. */
.proc-step.is-active .proc-step__icon::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 2px solid var(--primary, #3b82f6);
  animation: proc-pulse 1.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
.proc-step.is-active .proc-step__title {
  color: var(--primary, #3b82f6);
  font-weight: 600;
}
.proc-step.is-active .proc-step__detail {
  color: var(--text-1);
  animation: proc-detail-fade 0.5s ease;
}

@keyframes proc-pop {
  0%   { transform: scale(0.6); }
  60%  { transform: scale(1.12); }
  100% { transform: scale(1); }
}
@keyframes proc-pulse {
  0%   { transform: scale(1);   opacity: 0.55; }
  70%  { transform: scale(1.45); opacity: 0; }
  100% { transform: scale(1.45); opacity: 0; }
}
@keyframes proc-detail-fade {
  from { opacity: 0; transform: translateY(-3px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Legacy ETA badge — kept hidden because the per-step timer replaces it. */
.proc-eta { display: none; }

/* ============================================================
   JOIN PROGRESS — pre-call connection stepper
   ============================================================ */
.join-progress {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 24px;
  width: 100%;
  max-width: 360px;
  padding: 18px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  animation: jp-fade-in 0.3s ease;
}

.join-progress__step {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 12px;
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.35);
  transition: color 0.25s ease;
}

.join-progress__icon {
  position: relative;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.18);
  transition: all 0.25s ease;
}

.join-progress__label {
  flex: 1;
  line-height: 1.3;
}

.join-progress__detail {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.5);
  font-variant-numeric: tabular-nums;
}

/* ── ACTIVE state — pulsing spinner ── */
.join-progress__step.is-active {
  color: rgba(255, 255, 255, 0.95);
}
.join-progress__step.is-active .join-progress__icon {
  border-color: #3b82f6;
  border-top-color: transparent;
  animation: jp-spin 0.9s linear infinite;
}
.join-progress__step.is-active .join-progress__icon::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 2px solid #3b82f6;
  opacity: 0;
  animation: jp-pulse 1.6s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
.join-progress__step.is-active .join-progress__detail {
  color: #3b82f6;
  font-weight: 600;
}

/* ── DONE state — solid green check ── */
.join-progress__step.is-done {
  color: rgba(255, 255, 255, 0.75);
}
.join-progress__step.is-done .join-progress__icon {
  background: #16a34a;
  border-color: #16a34a;
  animation: jp-pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.join-progress__step.is-done .join-progress__icon::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 5px;
  height: 9px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(45deg);
}
.join-progress__step.is-done .join-progress__detail {
  color: rgba(34, 197, 94, 0.85);
}

/* ── FAILED state ── */
.join-progress__step.is-failed {
  color: #f87171;
}
.join-progress__step.is-failed .join-progress__icon {
  background: #dc2626;
  border-color: #dc2626;
  animation: jp-shake 0.4s ease;
}
.join-progress__step.is-failed .join-progress__icon::before {
  content: "×";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -55%);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
}

.join-progress__error {
  margin-top: 8px;
  padding: 10px 12px;
  background: rgba(220, 38, 38, 0.12);
  border-left: 3px solid #dc2626;
  border-radius: 6px;
  font-size: 12.5px;
  color: #fca5a5;
  line-height: 1.4;
}

@keyframes jp-spin { to { transform: rotate(360deg); } }
@keyframes jp-pop {
  0%   { transform: scale(0.5); }
  60%  { transform: scale(1.15); }
  100% { transform: scale(1); }
}
@keyframes jp-pulse {
  0%   { transform: scale(1);   opacity: 0.6; }
  70%  { transform: scale(1.6); opacity: 0; }
  100% { transform: scale(1.6); opacity: 0; }
}
@keyframes jp-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}
@keyframes jp-fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
