@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/manrope-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/manrope-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/inter-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Cabin";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/cabin-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Cabin";
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/cabin-italic-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Instrument Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/instrument-serif-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Instrument Serif";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/instrument-serif-italic-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Prata";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/prata-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Prata";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/prata-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #f7f5fb;
  --surface: #ffffff;
  --surface-soft: #faf9fc;
  --text: #211b32;
  --muted: #6d667c;
  --line: #e8e3ef;
  --line-strong: #d7cfe2;
  --primary: #7b39fc;
  --primary-dark: #6128d4;
  --primary-soft: #f0eaff;
  --danger: #d92d20;
  --danger-soft: #fef3f2;
  --warning: #d97706;
  --warning-soft: #fffaeb;
  --success: #16803c;
  --success-soft: #ecfdf3;
  --info: #2563eb;
  --info-soft: #eff6ff;
  --complete: #087e8b;
  --complete-soft: #ecfeff;
  --progress: #6d5bd0;
  --progress-soft: #f3f0ff;
  --sidebar: #211a36;
  --sidebar-soft: #382b55;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 16px 42px rgba(43, 35, 68, 0.09);
  --sidebar-width: 244px;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.48;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button, summary, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3, .button, .nav-link, .topbar, .page-header { font-family: "Manrope", "Inter", sans-serif; }
h1 { margin-bottom: 6px; font-size: clamp(24px, 3vw, 30px); line-height: 1.18; letter-spacing: -0.025em; }
h2 { margin-bottom: 4px; font-size: 18px; line-height: 1.3; }
h3 { margin-bottom: 2px; font-size: 15px; }
small { color: var(--muted); }
code { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; }
button, [role="button"], summary { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.55; }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

:focus-visible { outline: 3px solid rgba(123, 57, 252, 0.38); outline-offset: 2px; }

/* Login */
.auth-body { min-height: 100vh; overflow-x: hidden; }
.video-auth-page {
  --auth-purple: #7b39fc;
  --auth-purple-hover: #8b51ff;
  --auth-dark: #2b2344;
  --auth-black: #09070e;
  --auth-white: #fafafa;
  color: #fff;
  background: var(--auth-black);
}
.video-auth-page .auth-shell {
  min-height: 100vh;
  min-height: 100svh;
  display: block;
  padding: 0;
  background: var(--auth-black);
}
.video-auth-page .auth-wrap { width: 100%; min-height: inherit; }
.auth-hero {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 18% 30%, rgba(123, 57, 252, .54), transparent 34%),
    linear-gradient(135deg, #251242, #09070e 68%);
}
.auth-hero-video {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 1;
}
.auth-navbar {
  position: relative;
  z-index: 20;
  width: 100%;
  min-height: 78px;
  display: flex;
  align-items: center;
  gap: 42px;
  padding: max(16px, env(safe-area-inset-top)) clamp(24px, 6vw, 120px) 16px;
  font-family: "Manrope", sans-serif;
}
.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  flex: 0 0 auto;
  color: #fff;
}
.auth-brand:hover { color: #fff; opacity: .86; }
.auth-brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 11px;
  color: #fff;
  background: rgba(255,255,255,.12);
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 30px rgba(0,0,0,.18);
}
.auth-brand-mark svg { width: 22px; height: 22px; }
.auth-brand-copy { display: grid; line-height: 1.12; }
.auth-brand-copy strong { font-size: 14px; font-weight: 750; letter-spacing: -.02em; }
.auth-brand-copy small { color: rgba(255,255,255,.62); font-size: 10px; }
.auth-nav-links {
  display: flex;
  align-items: center;
  gap: 30px;
}
.auth-nav-links a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: #fff;
  font-size: 14px;
  font-weight: 550;
  transition: opacity 150ms ease;
}
.auth-nav-links a:hover { color: #fff; opacity: .8; }
.auth-nav-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.auth-nav-button,
.auth-cta {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  font-family: "Manrope", sans-serif;
  font-size: 14px;
  font-weight: 700;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}
.auth-nav-button:hover,
.auth-cta:hover { transform: translateY(-1px); }
.auth-nav-button {
  padding: 0 18px;
  border: 1px solid #d4d4d4;
  color: #171717;
  background: #fff;
}
.auth-nav-button:hover { color: #171717; background: #f5f5f5; }
.auth-nav-button-primary {
  padding: 0 19px;
  border-color: transparent;
  color: #fafafa;
  background: var(--auth-purple);
  box-shadow: 0 10px 26px rgba(123,57,252,.28);
}
.auth-nav-button-primary:hover { color: #fff; background: var(--auth-purple-hover); }
.auth-menu-button {
  display: none;
  width: 46px;
  height: 46px;
  margin-left: auto;
  place-items: center;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 10px;
  color: #fff;
  background: rgba(0,0,0,.18);
  backdrop-filter: blur(10px);
}
.auth-menu-button span,
.auth-menu-button span::before,
.auth-menu-button span::after {
  width: 20px;
  height: 2px;
  display: block;
  border-radius: 999px;
  background: currentColor;
}
.auth-menu-button span { position: relative; }
.auth-menu-button span::before,
.auth-menu-button span::after { content: ""; position: absolute; left: 0; }
.auth-menu-button span::before { top: -6px; }
.auth-menu-button span::after { top: 6px; }
.auth-mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 90;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: max(22px, env(safe-area-inset-top)) 24px max(28px, env(safe-area-inset-bottom));
  color: #fff;
  background:
    radial-gradient(circle at 20% 0, rgba(123,57,252,.34), transparent 38%),
    #09070e;
}
.auth-mobile-menu[hidden] { display: none; }
.auth-mobile-menu-head { display: flex; align-items: center; justify-content: space-between; }
.auth-mobile-menu-close {
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 10px;
  color: #fff;
  background: rgba(255,255,255,.08);
  font-size: 27px;
  line-height: 1;
}
.auth-mobile-menu nav {
  display: grid;
  gap: 2px;
  margin: auto 0;
}
.auth-mobile-menu nav a {
  padding: 12px 0;
  color: #fff;
  font-family: "Manrope", sans-serif;
  font-size: clamp(28px, 8vw, 42px);
  font-weight: 650;
  letter-spacing: -.04em;
}
.auth-mobile-menu .auth-nav-button-primary {
  width: 100%;
  min-height: 54px;
  margin-top: 22px;
  font-size: 16px;
}
.auth-hero-stage {
  position: relative;
  z-index: 10;
  width: min(100%, 1320px);
  margin: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 410px);
  align-items: center;
  gap: clamp(42px, 7vw, 105px);
  padding: 54px clamp(24px, 6vw, 80px) 46px;
}
.auth-hero-copy { min-width: 0; max-width: 820px; }
.auth-pill {
  width: fit-content;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 25px;
  padding: 5px 12px 5px 5px;
  border: 1px solid rgba(164,132,215,.5);
  border-radius: 10px;
  color: #fff;
  background: rgba(85,80,110,.4);
  backdrop-filter: blur(14px);
  box-shadow: 0 12px 34px rgba(0,0,0,.14);
  font-family: "Cabin", "Manrope", sans-serif;
  font-size: 14px;
  font-weight: 500;
}
.auth-pill-badge {
  min-height: 28px;
  display: inline-grid;
  place-items: center;
  padding: 0 9px;
  border-radius: 6px;
  background: var(--auth-purple);
  font-family: "Cabin", "Manrope", sans-serif;
  font-size: 12px;
  font-weight: 650;
}
.auth-hero-title {
  max-width: 900px;
  margin: 0;
  color: #fff;
  font-family: "Prata", "Instrument Serif", Georgia, serif;
  font-size: clamp(48px, 6.15vw, 92px);
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: -.055em;
  text-wrap: balance;
  text-shadow: 0 8px 34px rgba(0,0,0,.5);
}
.auth-hero-title em {
  display: inline;
  padding-inline: .04em;
  font-style: italic;
  font-weight: 400;
}
.auth-hero-lead {
  max-width: 662px;
  margin: 25px 0 0;
  color: rgba(255,255,255,.74);
  font-family: "Inter", sans-serif;
  font-size: 17px;
  line-height: 1.65;
  text-shadow: 0 3px 18px rgba(0,0,0,.58);
}
.auth-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 11px;
  margin-top: 29px;
}
.auth-cta {
  min-height: 52px;
  padding: 0 21px;
  border: 1px solid transparent;
  color: #fff;
  font-family: "Cabin", "Manrope", sans-serif;
  font-size: 16px;
  font-weight: 600;
}
.auth-cta-primary {
  background: var(--auth-purple);
  box-shadow: 0 14px 34px rgba(123,57,252,.34);
}
.auth-cta-primary:hover { color: #fff; background: var(--auth-purple-hover); }
.auth-cta-secondary {
  color: #f6f7f9;
  background: rgba(43,35,68,.9);
  backdrop-filter: blur(12px);
}
.auth-cta-secondary:hover { color: #fff; background: #3a3057; }
.auth-capabilities {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 27px;
}
.auth-capability {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 999px;
  color: rgba(255,255,255,.72);
  background: rgba(8,6,13,.24);
  backdrop-filter: blur(10px);
  font-family: "Manrope", sans-serif;
  font-size: 11px;
  font-weight: 600;
}
.auth-capability::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #a77cff;
  box-shadow: 0 0 0 4px rgba(123,57,252,.17);
}
.auth-login-panel {
  width: 100%;
  padding: 26px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 22px;
  color: #fff;
  background: rgba(15,10,26,.68);
  backdrop-filter: blur(24px) saturate(128%);
  box-shadow: 0 30px 80px rgba(0,0,0,.33);
}
.auth-hero-minimal {
  grid-template-rows: 1fr;
  place-items: center;
}
.auth-minimal-stage {
  position: relative;
  z-index: 10;
  grid-row: 1;
  width: min(100%, 430px);
  padding: 28px 18px;
}
.auth-login-panel-minimal {
  padding: 31px;
  background: rgba(15,10,26,.72);
}
.auth-login-panel-minimal .auth-login-icon {
  margin: 0 auto 14px;
}
.auth-login-panel-minimal h1 {
  margin: 0 0 25px;
  color: #fff;
  font-family: "Manrope", sans-serif;
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -.035em;
  text-align: center;
}
.auth-password-toggle-icon {
  width: 44px;
  padding: 0;
  display: grid;
  place-items: center;
}
.auth-password-toggle-icon svg {
  width: 20px;
  height: 20px;
}
.auth-password-toggle-icon[aria-pressed="true"] {
  color: #fff;
  background: rgba(123,57,252,.2);
}
.auth-login-head { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 23px; }
.auth-login-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 12px;
  color: #fff;
  background: var(--auth-purple);
  box-shadow: 0 12px 28px rgba(123,57,252,.26);
}
.auth-login-icon svg { width: 21px; height: 21px; }
.auth-login-head h2 {
  margin: 1px 0 4px;
  color: #fff;
  font-family: "Manrope", sans-serif;
  font-size: 19px;
  letter-spacing: -.025em;
}
.auth-login-head p { margin: 0; color: rgba(255,255,255,.58); font-size: 12px; line-height: 1.5; }
.video-auth-page .login-form { display: grid; gap: 15px; }
.video-auth-page .field-group label {
  color: rgba(255,255,255,.78);
  font-family: "Manrope", sans-serif;
  font-size: 11px;
  font-weight: 650;
}
.video-auth-page .text-input {
  min-height: 48px;
  border-color: rgba(255,255,255,.17);
  color: #fff;
  background: rgba(255,255,255,.09);
}
.video-auth-page .text-input::placeholder { color: rgba(255,255,255,.38); }
.video-auth-page .text-input:hover { border-color: rgba(255,255,255,.27); }
.video-auth-page .text-input:focus {
  border-color: rgba(167,124,255,.92);
  background: rgba(255,255,255,.12);
  box-shadow: 0 0 0 3px rgba(123,57,252,.22);
}
.video-auth-page .password-toggle {
  color: rgba(255,255,255,.68);
  background: transparent;
}
.video-auth-page .password-toggle:hover { color: #fff; background: rgba(255,255,255,.08); }
.video-auth-page .button-primary {
  min-height: 50px;
  border-radius: 10px;
  background: var(--auth-purple);
  box-shadow: 0 13px 30px rgba(123,57,252,.3);
  font-family: "Cabin", "Manrope", sans-serif;
  font-size: 16px;
}
.video-auth-page .button-primary:hover { background: var(--auth-purple-hover); }
.auth-secure-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 17px 0 0;
  color: rgba(255,255,255,.46);
  font-family: "Manrope", sans-serif;
  font-size: 10px;
  text-align: center;
}
.auth-secure-note svg { width: 13px; height: 13px; color: #a77cff; }
.auth-hero-footer {
  position: relative;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 12px clamp(24px, 6vw, 120px) max(20px, env(safe-area-inset-bottom));
  color: rgba(255,255,255,.38);
  font-family: "Manrope", sans-serif;
  font-size: 10px;
}
.video-auth-page .flash-stack {
  position: fixed;
  z-index: 110;
  top: 82px;
  left: 50%;
  width: min(420px, calc(100% - 32px));
  transform: translateX(-50%);
}
.auth-menu-open { overflow: hidden !important; }
.login-mark, .brand-mark {
  display: grid; place-items: center; flex: 0 0 auto;
  width: 48px; height: 48px;
  border-radius: 13px;
  color: #fff; background: var(--primary);
  font-weight: 800; letter-spacing: -0.04em;
}
.login-form { display: grid; gap: 18px; }

/* App shell */
.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 40;
  width: var(--sidebar-width);
  display: flex; flex-direction: column;
  padding: 20px 14px 16px;
  color: #f1edfa;
  background:
    radial-gradient(circle at 25% 0, rgba(123,57,252,.2), transparent 30%),
    var(--sidebar);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 2px 6px 22px; }
.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: linear-gradient(145deg, #8b51ff, var(--primary));
  box-shadow: 0 11px 25px rgba(123,57,252,.27);
  font-size: 13px;
}
.brand-mark svg { width: 22px; height: 22px; }
.brand-copy { display: grid; min-width: 0; line-height: 1.25; }
.brand-copy strong { color: #fff; font-size: 14px; }
.brand-copy small { color: #aaa0be; font-size: 11px; }
.main-nav { flex: 1; }
.nav-label { margin: 10px 10px 7px; color: #968aa9; font-size: 10px; font-weight: 700; letter-spacing: 0.11em; text-transform: uppercase; }
.nav-label-spaced { margin-top: 24px; }
.nav-link {
  display: flex; align-items: center; gap: 10px;
  min-height: 44px; padding: 9px 11px; margin: 3px 0;
  border-radius: 10px; color: #d4cce2; font-weight: 600;
  transition: background 150ms ease, color 150ms ease;
}
.nav-link:hover { color: #fff; background: rgba(255,255,255,.07); }
.nav-link.is-active { color: #fff; background: var(--sidebar-soft); box-shadow: inset 3px 0 #a77cff; }
.nav-icon { display: grid; place-items: center; width: 24px; height: 24px; font-size: 18px; font-weight: 700; }
.nav-icon-people { letter-spacing: -3px; }
.sidebar-user {
  display: flex; align-items: center; gap: 9px; padding: 13px 8px 2px;
  border-top: 1px solid rgba(255,255,255,.09);
}
.user-avatar {
  display: grid; place-items: center; flex: 0 0 auto;
  width: 34px; height: 34px; border-radius: 50%;
  color: #fff; background: var(--primary); font-size: 13px; font-weight: 700;
}
.user-copy { display: grid; min-width: 0; flex: 1; line-height: 1.25; }
.user-copy strong { overflow: hidden; color: #fff; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.user-copy small { color: #9f94b3; font-size: 10px; }
.logout-button, .sidebar-close, .menu-button {
  display: grid; place-items: center; border: 0; background: transparent;
}
.logout-button { width: 34px; height: 34px; border-radius: 9px; color: #aaa0bc; font-size: 21px; }
.logout-button:hover { color: #fff; background: rgba(255,255,255,.08); }
.sidebar-close { display: none; margin-left: auto; width: 38px; height: 38px; color: #c8d7dd; font-size: 22px; }
.app-main { min-height: 100vh; margin-left: var(--sidebar-width); }
.topbar {
  position: sticky; top: 0; z-index: 25;
  height: 62px; display: flex; align-items: center; gap: 16px;
  padding: 0 28px; border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.93); backdrop-filter: blur(12px);
}
.topbar-context { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.topbar-dot { width: 7px; height: 7px; border-radius: 50%; background: #2fac66; box-shadow: 0 0 0 4px #eaf8f0; }
.topbar-user { margin-left: auto; display: flex; align-items: center; gap: 10px; color: #344054; font-weight: 600; }
.user-avatar-small { width: 30px; height: 30px; font-size: 11px; }
.menu-button { display: none; width: 42px; height: 42px; border-radius: 9px; color: var(--text); font-size: 21px; }
.menu-button:hover { background: var(--surface-soft); }
.page-wrap { width: min(100%, 1440px); margin: 0 auto; padding: 28px; }
.nav-scrim { position: fixed; inset: 0; z-index: 35; background: rgba(15, 23, 42, .46); }

/* Shared surfaces and buttons */
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 8px 28px rgba(43,35,68,.055); }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.compact-header { margin-bottom: 16px; }
.page-subtitle { margin: 0; color: var(--muted); }
.eyebrow { margin-bottom: 4px; color: var(--primary); font-size: 11px; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; }
.button {
  min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 16px; border: 1px solid transparent; border-radius: 9px;
  font-weight: 650; line-height: 1.2; text-align: center; transition: transform 120ms ease, background 150ms ease, border-color 150ms ease;
}
.button:active:not(:disabled) { transform: translateY(1px); }
.button-primary { color: #fff; background: var(--primary); }
.button-primary:hover { color: #fff; background: var(--primary-dark); }
.button-secondary { color: #344054; border-color: var(--line-strong); background: #fff; }
.button-secondary:hover { color: var(--text); border-color: #98a2b3; background: var(--surface-soft); }
.button-ghost { color: var(--primary); border-color: transparent; background: var(--primary-soft); }
.button-ghost:hover { color: var(--primary-dark); background: #dceef3; }
.button-danger { color: #fff; background: var(--danger); }
.button-danger:hover { color: #fff; background: #b42318; }
.button-warning { color: #8a4b05; border-color: #fedf89; background: var(--warning-soft); }
.button-success { color: #fff; background: var(--success); }
.button-info { color: #fff; background: var(--info); }
.button-teal { color: #fff; background: var(--complete); }
.button-block { width: 100%; }
.button-small { min-height: 36px; padding: 7px 11px; font-size: 12px; }
.button-group { display: flex; flex-wrap: wrap; gap: 8px; }

/* Inputs */
.field-group { display: grid; gap: 7px; }
.field-group label, .inline-form label, .problem-create label { color: #344054; font-size: 13px; font-weight: 650; }
.text-input, .search-field input, .select-field select {
  width: 100%; min-height: 44px; padding: 10px 12px;
  border: 1px solid var(--line-strong); border-radius: 9px;
  color: var(--text); background: #fff; outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.text-input:hover, .search-field input:hover, .select-field select:hover { border-color: #98a2b3; }
.text-input:focus, .search-field input:focus, .select-field select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(23,107,135,.13); }
.text-input.is-invalid { border-color: var(--danger); }
.textarea { min-height: 112px; resize: vertical; }
.password-field { position: relative; }
.password-field .text-input { padding-right: 82px; }
.password-toggle { position: absolute; top: 50%; right: 8px; transform: translateY(-50%); padding: 6px 8px; border: 0; border-radius: 7px; color: var(--primary); background: transparent; font-size: 12px; font-weight: 650; }
.password-toggle:hover { background: var(--primary-soft); }
.field-hint { margin: -1px 0 0; color: var(--muted); font-size: 12px; }
.field-error { margin: 0; color: var(--danger); font-size: 12px; }
.required-mark { color: var(--danger); }

/* Messages */
.flash-stack { display: grid; gap: 8px; margin-bottom: 16px; }
.auth-wrap .flash-stack { margin-bottom: 12px; }
.flash { display: flex; align-items: center; gap: 10px; padding: 12px 13px; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: var(--shadow); }
.flash-indicator { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }
.flash-error .flash-indicator, .flash-danger .flash-indicator { background: var(--danger); }
.flash-success .flash-indicator { background: var(--success); }
.flash-close { margin-left: auto; width: 28px; height: 28px; border: 0; border-radius: 7px; color: var(--muted); background: transparent; font-size: 18px; }
.flash-close:hover { color: var(--text); background: var(--surface-soft); }

/* Dashboard */
.stats-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat-card { min-width: 0; padding: 16px 17px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.stat-card strong { display: block; margin: 5px 0 1px; font-size: 26px; line-height: 1; }
.stat-label { display: flex; align-items: center; gap: 7px; color: #475467; font-size: 12px; font-weight: 650; }
.stat-icon { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; background: var(--surface-soft); font-weight: 800; }
.stat-danger .stat-icon { color: var(--danger); background: var(--danger-soft); }
.stat-success .stat-icon { color: var(--success); background: var(--success-soft); }
.stat-info .stat-icon { color: var(--info); background: var(--info-soft); }
.stat-complete .stat-icon { color: var(--complete); background: var(--complete-soft); }
.list-panel, .users-panel { overflow: visible; }
.filter-bar { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(160px, auto) minmax(160px, auto) auto auto; gap: 9px; padding: 15px; border-bottom: 1px solid var(--line); }
.search-field { position: relative; }
.search-field > span { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 20px; }
.search-field input { padding-left: 39px; }
.select-field select { padding-right: 32px; }
.table-wrap { width: 100%; overflow: visible; }
.data-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.data-table th { padding: 11px 13px; border-bottom: 1px solid var(--line); color: var(--muted); background: #fbfcfd; font-size: 11px; font-weight: 700; letter-spacing: .03em; text-align: left; text-transform: uppercase; }
.data-table td { padding: 13px; border-bottom: 1px solid #edf0f3; vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.case-row { position: relative; box-shadow: inset 3px 0 #94a3b8; }
.case-row:hover { background: #fbfcfd; }
.row-status-danger, .row-status-problem { box-shadow: inset 3px 0 var(--danger); background: #fffafa; }
.row-status-warning, .row-status-pending { box-shadow: inset 3px 0 var(--warning); background: #fffdf8; }
.row-status-success, .row-status-primary-ready { box-shadow: inset 3px 0 var(--success); }
.row-status-info, .row-status-secondary-ready { box-shadow: inset 3px 0 var(--info); }
.row-status-complete, .row-status-diagnostic-ready { box-shadow: inset 3px 0 var(--complete); }
.row-status-progress, .row-status-in-progress { box-shadow: inset 3px 0 var(--progress); }
.case-number { font-weight: 700; }
.plate-number { display: block; color: var(--text); font-size: 15px; font-weight: 750; }
.cell-primary { color: #344054; font-weight: 550; }
.cell-date { color: var(--muted); white-space: nowrap; font-size: 12px; }
.vin-code { color: #344054; font-size: 12px; white-space: nowrap; }
.status-badge { display: inline-flex; align-items: center; gap: 6px; max-width: 190px; padding: 5px 8px; border-radius: 999px; color: #475467; background: #f1f5f9; font-size: 11px; font-weight: 700; white-space: nowrap; }
.status-dot { display: grid; place-items: center; min-width: 13px; height: 13px; border-radius: 50%; color: currentColor; font-size: 9px; line-height: 1; }
.status-danger, .status-problem { color: var(--danger); background: var(--danger-soft); }
.status-warning, .status-pending { color: #a15c07; background: var(--warning-soft); }
.status-success, .status-primary-ready { color: var(--success); background: var(--success-soft); }
.status-info, .status-secondary-ready { color: var(--info); background: var(--info-soft); }
.status-complete, .status-diagnostic-ready { color: var(--complete); background: var(--complete-soft); }
.status-progress, .status-in-progress { color: var(--progress); background: var(--progress-soft); }
.table-actions { width: 50px; text-align: right; }
.icon-button { width: 34px; height: 34px; display: inline-grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 8px; color: #475467; background: #fff; font-size: 17px; line-height: 1; list-style: none; }
.icon-button:hover { color: var(--primary); border-color: #a8c8d2; background: var(--primary-soft); }
.icon-button-danger:hover { color: var(--danger); border-color: #f0a5a0; background: var(--danger-soft); }
.dropdown { position: relative; display: inline-block; }
.dropdown > summary::-webkit-details-marker, .problem-create > summary::-webkit-details-marker, .inline-action > summary::-webkit-details-marker, .nested-action > summary::-webkit-details-marker { display: none; }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 170px; padding: 5px; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: var(--shadow); text-align: left; }
.dropdown-menu > a, .dropdown-menu > form > button, .nested-action > summary { width: 100%; min-height: 36px; display: flex; align-items: center; padding: 8px 10px; border: 0; border-radius: 7px; color: #344054; background: transparent; font-size: 12px; }
.dropdown-menu > a:hover, .dropdown-menu > form > button:hover, .nested-action > summary:hover { background: var(--surface-soft); }
.empty-state { padding: 56px 20px; text-align: center; }
.empty-state p { color: var(--muted); }
.empty-icon { display: grid; place-items: center; width: 48px; height: 48px; margin: 0 auto 13px; border-radius: 14px; color: var(--primary); background: var(--primary-soft); font-size: 24px; font-weight: 700; }

/* Forms */
.breadcrumbs { display: flex; align-items: center; gap: 7px; margin-bottom: 13px; color: var(--muted); font-size: 12px; }
.case-form { display: grid; gap: 13px; }
.form-section { padding: 20px; }
.section-heading { display: flex; align-items: center; gap: 11px; margin-bottom: 17px; }
.section-heading h2, .section-heading p { margin-bottom: 0; }
.section-heading p { color: var(--muted); font-size: 12px; }
.section-number { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; color: var(--primary); background: var(--primary-soft); font-size: 12px; font-weight: 800; }
.form-grid { display: grid; gap: 16px; }
.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.info-callout { display: flex; gap: 11px; padding: 14px 16px; border: 1px solid #b9d9e2; border-radius: 11px; color: #275267; background: #eff8fa; }
.info-callout p { margin: 1px 0 0; font-size: 12px; }
.info-callout-icon { display: grid; place-items: center; flex: 0 0 auto; width: 24px; height: 24px; border-radius: 50%; color: #fff; background: var(--primary); font-weight: 750; }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; padding: 11px 0 2px; }
.sticky-actions { position: sticky; bottom: 0; z-index: 10; padding: 11px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.95); backdrop-filter: blur(10px); }

/* Case detail */
.case-hero { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 20px 22px; margin-bottom: 14px; }
.case-title-line { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin-bottom: 6px; }
.case-id { color: var(--muted); font-size: 12px; font-weight: 650; }
.case-hero h1 { margin-bottom: 2px; font-size: 27px; }
.case-hero p { margin: 0; color: var(--muted); }
.case-hero-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.problem-banner { display: flex; gap: 13px; padding: 16px 18px; margin-bottom: 14px; border: 1px solid #f2b8b3; border-radius: 12px; color: #7a271a; background: var(--danger-soft); }
.problem-banner-pending { border-color: #fedf89; color: #7a4a06; background: var(--warning-soft); }
.problem-symbol { display: grid; place-items: center; flex: 0 0 auto; width: 30px; height: 30px; border-radius: 9px; color: #fff; background: var(--danger); font-weight: 800; }
.problem-banner-pending .problem-symbol { background: var(--warning); }
.problem-content { flex: 1; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.problem-content p:last-child { margin-bottom: 0; }
.inline-action { position: relative; }
.inline-form { position: absolute; right: 0; top: calc(100% + 7px); z-index: 18; width: min(360px, 84vw); display: grid; gap: 9px; padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: #fff; box-shadow: var(--shadow); }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; align-items: start; gap: 14px; }
.detail-main { min-width: 0; display: grid; gap: 14px; }
.detail-side { position: sticky; top: 76px; display: grid; gap: 14px; }
.detail-section, .workflow-panel { padding: 20px; }
.section-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.section-title-row h2 { margin: 0; }
.facts-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; margin: 0; border-top: 1px solid var(--line); }
.facts-grid > div { min-width: 0; padding: 13px 10px 13px 0; border-bottom: 1px solid var(--line); }
.facts-grid > div:nth-child(even) { padding-left: 15px; border-left: 1px solid var(--line); }
.facts-grid .fact-wide { grid-column: 1 / -1; padding-left: 0; border-left: 0; }
.facts-grid dt { margin-bottom: 4px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .035em; }
.facts-grid dd { margin: 0; color: #344054; font-weight: 550; overflow-wrap: anywhere; }
.plate-value { font-size: 16px; font-weight: 750 !important; }
.copy-button { margin-left: 7px; padding: 3px 6px; border: 0; border-radius: 5px; color: var(--primary); background: var(--primary-soft); font-size: 10px; }
.file-groups { display: grid; gap: 15px; }
.file-group { padding-top: 14px; border-top: 1px solid var(--line); }
.file-group:first-child { padding-top: 0; border-top: 0; }
.file-group-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.file-group-heading > div { display: flex; align-items: baseline; gap: 7px; }
.file-group-heading span { color: var(--muted); font-size: 11px; }
.locked-label { padding: 4px 7px; border-radius: 999px; color: #667085 !important; background: #f2f4f7; }
.file-list { display: grid; gap: 7px; }
.file-item { display: flex; align-items: center; gap: 10px; padding: 8px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.file-main { min-width: 0; flex: 1; display: flex; align-items: center; gap: 9px; color: #344054; }
.file-main:hover { color: var(--primary); }
.file-type { display: grid; place-items: center; flex: 0 0 auto; width: 37px; height: 37px; border-radius: 8px; color: var(--primary); background: var(--primary-soft); font-size: 9px; font-weight: 800; }
.file-copy { min-width: 0; display: grid; }
.file-copy strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.file-copy small { font-size: 10px; }
.file-actions, .photo-actions { display: flex; align-items: center; gap: 5px; }
.file-actions form, .photo-actions form { margin: 0; }
.file-item-locked { opacity: .72; }
.mini-empty { padding: 12px; border: 1px dashed var(--line-strong); border-radius: 9px; color: var(--muted); background: var(--surface-soft); font-size: 12px; text-align: center; }
.photo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.photo-item { position: relative; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-soft); }
.photo-item > a { display: grid; color: #344054; }
.photo-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #e9eef2; }
.photo-item > a > span { overflow: hidden; padding: 7px 8px; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.photo-actions { position: absolute; top: 5px; right: 5px; }
.photo-actions a, .photo-actions button { width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 7px; color: #fff; background: rgba(15,23,42,.72); }
.upload-form { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.upload-control { min-width: 0; flex: 1; display: flex; align-items: center; gap: 9px; padding: 8px 10px; border: 1px dashed #aab8c1; border-radius: 9px; background: var(--surface-soft); cursor: pointer; }
.upload-control:hover { border-color: var(--primary); background: var(--primary-soft); }
.upload-control input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.upload-plus { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; color: var(--primary); background: #fff; font-size: 19px; }
.upload-copy { min-width: 0; display: grid; }
.upload-copy strong { font-size: 12px; }
.upload-copy small { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.timeline { margin: 0; padding: 0; list-style: none; }
.timeline li { position: relative; display: flex; gap: 10px; padding: 0 0 14px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li:not(:last-child)::before { content: ""; position: absolute; left: 5px; top: 11px; bottom: 0; width: 1px; background: var(--line); }
.timeline-marker { z-index: 1; flex: 0 0 auto; width: 11px; height: 11px; margin-top: 4px; border: 3px solid #d5edf2; border-radius: 50%; background: var(--primary); }
.timeline-content { min-width: 0; flex: 1; }
.timeline-meta { display: flex; justify-content: space-between; gap: 10px; }
.timeline-meta strong { font-size: 12px; }
.timeline-meta time { color: var(--muted); font-size: 10px; }
.timeline-content p { margin: 2px 0 0; color: #475467; font-size: 12px; }
.workflow-list { margin: 0; padding: 0; list-style: none; }
.workflow-step { position: relative; display: flex; gap: 10px; min-height: 60px; color: #98a2b3; }
.workflow-step:not(:last-child)::after { content: ""; position: absolute; left: 14px; top: 31px; bottom: 4px; width: 2px; background: var(--line); }
.workflow-marker { z-index: 1; display: grid; place-items: center; flex: 0 0 auto; width: 30px; height: 30px; border: 2px solid var(--line); border-radius: 50%; background: #fff; font-size: 11px; font-weight: 750; }
.workflow-step strong, .workflow-step small { display: block; }
.workflow-step.is-current { color: var(--primary); }
.workflow-step.is-current .workflow-marker { color: #fff; border-color: var(--primary); background: var(--primary); }
.workflow-step.is-done { color: #344054; }
.workflow-step.is-done .workflow-marker { color: #fff; border-color: var(--success); background: var(--success); }
.stage-actions { display: grid; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.problem-create { overflow: hidden; }
.problem-create > summary { display: flex; align-items: center; gap: 9px; padding: 15px; list-style: none; }
.problem-create > summary > span:nth-child(2) { flex: 1; display: grid; }
.problem-create > summary small { font-size: 10px; }
.problem-create-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; color: var(--danger); background: var(--danger-soft); font-weight: 800; }
.problem-create form { display: grid; gap: 9px; padding: 0 15px 15px; }

/* User management */
.users-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; align-items: start; gap: 14px; }
.users-title-row { padding: 17px 17px 0; }
.count-pill { min-width: 28px; padding: 4px 8px; border-radius: 999px; color: var(--primary); background: var(--primary-soft); font-size: 12px; font-weight: 750; text-align: center; }
.user-cell { display: flex; align-items: center; gap: 9px; }
.user-cell > span:last-child { min-width: 0; display: grid; }
.user-cell small { font-size: 11px; }
.role-badge, .active-label { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 999px; font-size: 11px; font-weight: 650; white-space: nowrap; }
.role-badge { color: var(--primary); background: var(--primary-soft); }
.active-label { color: var(--success); background: var(--success-soft); }
.active-label > span { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.active-label.is-disabled { color: #667085; background: #f2f4f7; }
.create-user-panel { position: sticky; top: 76px; padding: 18px; }
.create-user-form { display: grid; gap: 14px; }
.user-dropdown { min-width: 220px; }
.nested-action > form { display: grid; gap: 7px; padding: 8px; }
.nested-action[open] > summary { color: var(--primary); background: var(--primary-soft); }
.password-field-compact .text-input { min-height: 38px; font-size: 12px; }
.dropdown-danger { color: var(--danger) !important; }

.error-page { min-height: 300px; display: grid; place-items: center; align-content: center; }
.error-code { color: var(--primary); font-size: 52px; font-weight: 800; }
.compact-empty { padding: 40px 20px; }

/* Messenger */
.nav-badge { min-width: 20px; height: 20px; display: inline-grid; place-items: center; margin-left: auto; padding: 0 6px; border-radius: 999px; color: #fff; background: var(--danger); font-size: 10px; font-weight: 800; }
.messenger-page-header { margin-bottom: 14px; }
.messenger-shell { min-height: min(720px, calc(100vh - 185px)); display: grid; grid-template-columns: 310px minmax(0, 1fr); overflow: hidden; padding: 0; }
.conversation-list { min-width: 0; display: flex; flex-direction: column; border-right: 1px solid var(--line); background: #fbfcfe; }
.conversation-list-title { height: 66px; display: flex; align-items: center; justify-content: space-between; padding: 0 17px; border-bottom: 1px solid var(--line); }
.conversation-list-title > span { min-width: 25px; padding: 3px 7px; border-radius: 999px; color: var(--muted); background: #eef2f6; font-size: 11px; text-align: center; }
.conversation-scroll { overflow: auto; }
.conversation-item { min-width: 0; display: flex; align-items: center; gap: 11px; padding: 13px 14px; border-bottom: 1px solid #edf0f4; color: inherit; text-decoration: none; transition: background 140ms ease; }
.conversation-item:hover { background: #f0f5ff; }
.conversation-item.is-active { background: var(--primary-soft); box-shadow: inset 3px 0 var(--primary); }
.chat-avatar { flex: 0 0 39px; width: 39px; height: 39px; display: inline-grid; place-items: center; border-radius: 50%; color: #fff; background: linear-gradient(145deg, #965fff, var(--primary)); font-size: 14px; font-weight: 800; }
.conversation-copy { min-width: 0; flex: 1; display: grid; gap: 4px; }
.conversation-line { min-width: 0; display: flex; align-items: center; gap: 7px; }
.conversation-line strong, .conversation-preview > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation-line strong { flex: 1; font-size: 13px; }
.conversation-line time { color: var(--muted); font-size: 9px; }
.conversation-preview { color: var(--muted); font-size: 11px; }
.conversation-preview > span { flex: 1; }
.conversation-preview > b { min-width: 18px; height: 18px; display: inline-grid; place-items: center; padding: 0 5px; border-radius: 999px; color: #fff; background: var(--primary); font-size: 9px; }
.conversation-empty { margin: 15px; }
.chat-panel { min-width: 0; display: grid; grid-template-rows: auto minmax(300px, 1fr) auto; background: #f2f5f8; }
.chat-header { min-height: 66px; display: flex; align-items: center; gap: 11px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: #fff; }
.chat-header > span:nth-child(2) { min-width: 0; flex: 1; display: grid; }
.chat-header strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.chat-header small { color: var(--muted); font-size: 10px; }
.chat-refresh { min-height: 35px; padding: 7px 11px; font-size: 11px; }
.chat-call { min-height: 35px; gap: 6px; padding: 7px 11px; font-size: 11px; }
.chat-call > span:first-child { font-size: 14px; }
.chat-call:disabled { opacity: .48; cursor: not-allowed; }
.call-https-note { margin: 0; padding: 7px 14px; color: #9a6700; background: #fff8dc; border-bottom: 1px solid #f3dc9a; font-size: 10px; text-align: center; }
.message-stream { overflow: auto; display: flex; flex-direction: column; gap: 8px; padding: 21px 24px; background-color: #eef3f5; background-image: radial-gradient(rgba(71, 84, 103, .075) .7px, transparent .7px); background-size: 13px 13px; scroll-behavior: smooth; }
.chat-message { width: fit-content; max-width: min(74%, 610px); display: grid; gap: 4px; padding: 9px 11px 6px; border-radius: 11px; color: #243044; background: #fff; box-shadow: 0 1px 2px rgba(16, 24, 40, .12); }
.chat-message.is-incoming { align-self: flex-start; border-top-left-radius: 3px; }
.chat-message.is-outgoing { align-self: flex-end; border-top-right-radius: 3px; background: #dff8e8; }
.chat-message p { margin: 0; font-size: 13px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.message-author { color: var(--primary); font-size: 10px; }
.message-case { color: #175cd3; font-size: 10px; font-weight: 700; text-decoration: none; }
.message-case:hover { text-decoration: underline; }
.message-meta { display: inline-flex; align-items: center; justify-content: flex-end; gap: 3px; color: #667085; font-size: 8px; }
.read-mark { color: #667085; font-size: 10px; letter-spacing: -2px; }
.read-mark.is-read { color: #1570ef; }
.chat-welcome, .chat-no-selection { margin: auto; max-width: 310px; display: grid; place-items: center; gap: 5px; padding: 26px; color: var(--muted); text-align: center; }
.chat-welcome > span, .chat-no-selection > span { width: 50px; height: 50px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.82); font-size: 24px; }
.chat-welcome p, .chat-no-selection p { margin: 0; font-size: 12px; }
.chat-no-selection { grid-row: 1 / -1; }
.chat-no-selection h2 { margin: 4px 0 0; color: var(--ink); font-size: 17px; }
.message-compose { display: grid; grid-template-columns: minmax(0, 1fr) minmax(125px, 190px) 42px; align-items: end; gap: 8px; padding: 11px 13px; border-top: 1px solid var(--line); background: #fff; }
.message-compose textarea { min-height: 42px; max-height: 130px; resize: none; overflow-y: auto; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: #f8fafc; font: inherit; font-size: 12px; line-height: 1.55; outline: none; }
.message-compose textarea:focus, .case-link-select select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.case-link-select select { width: 100%; min-height: 42px; padding: 0 30px 0 9px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: #fff; font: inherit; font-size: 10px; outline: none; }
.send-message-button { width: 42px; height: 42px; display: grid; place-items: center; border: 0; border-radius: 50%; color: #fff; background: var(--primary); font-size: 17px; cursor: pointer; transition: transform 140ms ease, background 140ms ease; }
.send-message-button:hover { transform: translateY(-1px); background: var(--primary-dark); }
.send-message-button:disabled { opacity: .55; cursor: wait; }

/* Voice calls */
.call-overlay { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 18px; background: rgba(7, 18, 32, .72); backdrop-filter: blur(7px); }
.call-overlay[hidden] { display: none; }
.call-card { width: min(360px, 100%); min-height: 410px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 35px 28px 28px; border: 1px solid rgba(255,255,255,.12); border-radius: 24px; color: #fff; background: linear-gradient(160deg, #352654, #130f20 72%); box-shadow: 0 28px 80px rgba(0,0,0,.42); text-align: center; }
.call-avatar { width: 92px; height: 92px; display: grid; place-items: center; margin-bottom: 22px; border: 2px solid rgba(255,255,255,.28); border-radius: 50%; background: linear-gradient(145deg, #965fff, #6e2ce9); box-shadow: 0 0 0 10px rgba(123,57,252,.11); font-size: 34px; font-weight: 800; }
.call-overlay.is-ringing .call-avatar { animation: call-pulse 1.8s ease-in-out infinite; }
.call-kicker { margin: 0 0 5px; color: #9fb3c8; font-size: 10px; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; }
.call-card h2 { max-width: 100%; margin: 0; overflow: hidden; font-size: 23px; text-overflow: ellipsis; white-space: nowrap; }
.call-status { min-height: 22px; margin: 8px 0 0; color: #c9d6e2; font-size: 12px; }
.call-timer { margin-top: 4px; color: #fff; font-size: 13px; font-variant-numeric: tabular-nums; }
.call-error { max-width: 290px; margin: 10px 0 0; padding: 8px 10px; border-radius: 8px; color: #ffd6d6; background: rgba(217,45,32,.22); font-size: 10px; }
.call-actions { min-height: 82px; display: flex; align-items: flex-end; justify-content: center; gap: 35px; margin-top: 34px; }
.call-action { width: 64px; display: grid; justify-items: center; gap: 7px; border: 0; color: #fff; background: transparent; cursor: pointer; }
.call-action > span { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 50%; font-size: 23px; box-shadow: 0 7px 18px rgba(0,0,0,.25); transition: transform 140ms ease; }
.call-action:hover > span { transform: translateY(-2px); }
.call-action small { color: #d8e1ea; font-size: 10px; }
.call-action-accept > span { background: #12b76a; }
.call-action-reject > span, .call-action-end > span { background: #d92d20; }
.call-action-end > span { transform: rotate(135deg); }
.call-action-end:hover > span { transform: translateY(-2px) rotate(135deg); }
@keyframes call-pulse {
  0%, 100% { box-shadow: 0 0 0 8px rgba(123,57,252,.1); }
  50% { box-shadow: 0 0 0 18px rgba(123,57,252,.025); }
}

@media (max-width: 1060px) {
  .auth-navbar { gap: 28px; }
  .auth-nav-links { gap: 20px; }
  .auth-hero-stage {
    grid-template-columns: minmax(0, 1fr) minmax(330px, 380px);
    gap: 38px;
  }
  .auth-hero-title { font-size: clamp(48px, 6.8vw, 72px); }
}

@media (max-width: 820px) {
  .auth-navbar { min-height: 72px; }
  .auth-navbar > .auth-nav-links,
  .auth-navbar > .auth-nav-actions { display: none; }
  .auth-menu-button { display: grid; }
  .auth-hero {
    overflow: visible;
    background:
      radial-gradient(circle at 22% 18%, rgba(123, 57, 252, .5), transparent 38%),
      linear-gradient(155deg, #251242, #09070e 64%);
  }
  .auth-hero-video {
    position: fixed;
    object-position: 42% center;
  }
  .auth-hero-stage {
    width: min(100%, 780px);
    grid-template-columns: 1fr;
    gap: 34px;
    padding-top: 40px;
    padding-bottom: 36px;
  }
  .auth-hero-copy { margin-inline: auto; text-align: center; }
  .auth-pill { margin-inline: auto; }
  .auth-hero-title { max-width: 760px; margin-inline: auto; font-size: clamp(45px, 10.5vw, 76px); }
  .auth-hero-lead { margin-inline: auto; }
  .auth-hero-actions,
  .auth-capabilities { justify-content: center; }
  .auth-login-panel { max-width: 460px; margin-inline: auto; text-align: left; }
}

@media (max-width: 520px) {
  .auth-navbar { padding-inline: 18px; }
  .auth-brand-copy small { display: none; }
  .auth-hero-stage { gap: 28px; padding: 28px 18px 30px; }
  .auth-pill {
    min-height: 36px;
    margin-bottom: 19px;
    font-size: 12px;
  }
  .auth-pill-badge { min-height: 26px; padding-inline: 8px; font-size: 10px; }
  .auth-hero-title {
    font-size: clamp(39px, 12.8vw, 58px);
    line-height: 1.08;
    letter-spacing: -.047em;
  }
  .auth-hero-lead { margin-top: 19px; font-size: 14px; line-height: 1.62; }
  .auth-hero-actions { display: grid; grid-template-columns: 1fr; margin-top: 23px; }
  .auth-cta { width: 100%; }
  .auth-capabilities { margin-top: 22px; }
  .auth-capability { font-size: 10px; }
  .auth-login-panel { padding: 21px 18px; border-radius: 18px; }
  .auth-login-panel-minimal { padding: 26px 21px; }
  .auth-minimal-stage { padding-inline: 16px; }
  .auth-login-head { margin-bottom: 20px; }
  .auth-hero-footer { justify-content: center; padding-inline: 18px; text-align: center; }
  .auth-hero-footer span:last-child { display: none; }
  .video-auth-page .flash-stack { top: 72px; }
}

@media (max-height: 740px) and (min-width: 821px) {
  .auth-navbar { min-height: 68px; padding-top: 12px; padding-bottom: 12px; }
  .auth-hero-stage { padding-top: 24px; padding-bottom: 24px; }
  .auth-pill { margin-bottom: 16px; }
  .auth-hero-title { font-size: clamp(46px, 5.5vw, 68px); }
  .auth-hero-lead { margin-top: 17px; font-size: 15px; }
  .auth-hero-actions { margin-top: 20px; }
  .auth-capabilities { margin-top: 18px; }
  .auth-login-panel { padding: 22px; }
  .auth-login-head { margin-bottom: 17px; }
  .video-auth-page .login-form { gap: 12px; }
}

@media (max-width: 1180px) {
  .detail-layout, .users-layout { grid-template-columns: minmax(0, 1fr) 310px; }
  .filter-bar { grid-template-columns: minmax(220px, 1fr) 150px 150px auto; }
  .filter-bar .button-ghost { grid-column: -2 / -1; }
  .data-table th, .data-table td { padding-left: 10px; padding-right: 10px; }
}

@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); transition: transform 190ms ease; }
  .sidebar.is-open { transform: translateX(0); box-shadow: 18px 0 50px rgba(15,23,42,.26); }
  .sidebar-close, .menu-button { display: grid; }
  .app-main { margin-left: 0; }
  .topbar { padding: 0 18px; }
  .page-wrap { padding: 22px 18px; }
  .detail-layout, .users-layout { grid-template-columns: 1fr; }
  .detail-side, .create-user-panel { position: static; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .messenger-shell { min-height: calc(100vh - 165px); grid-template-columns: 270px minmax(0, 1fr); }
}

@media (max-width: 760px) {
  .topbar-user > span:first-child { display: none; }
  .topbar-context { margin-right: auto; }
  .page-wrap { padding: 17px 13px 28px; }
  .page-header { align-items: stretch; flex-direction: column; }
  .page-header > .button { align-self: flex-start; }
  .filter-bar { grid-template-columns: 1fr 1fr; }
  .search-field { grid-column: 1 / -1; }
  .filter-submit { width: 100%; }
  .table-wrap { overflow: visible; }
  .data-table thead { display: none; }
  .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; width: 100%; }
  .data-table tbody { display: grid; gap: 10px; padding: 11px; }
  .data-table tr { position: relative; overflow: visible; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: #fff; box-shadow: inset 3px 0 #94a3b8; }
  .data-table td { display: grid; grid-template-columns: 112px minmax(0,1fr); gap: 8px; padding: 7px 3px; border: 0; text-align: left; }
  .data-table td::before { content: attr(data-label); color: var(--muted); font-size: 11px; font-weight: 650; }
  .data-table .table-actions { position: absolute; top: 8px; right: 8px; width: auto; display: block; padding: 0; }
  .data-table .table-actions::before { display: none; }
  .cases-table td:first-child { padding-right: 42px; }
  .dropdown-menu { position: fixed; right: 14px; top: auto; min-width: 210px; }
  .two-columns, .facts-grid { grid-template-columns: 1fr; }
  .facts-grid > div:nth-child(even) { padding-left: 0; border-left: 0; }
  .case-hero { align-items: flex-start; flex-direction: column; }
  .case-hero-actions { width: 100%; justify-content: flex-start; }
  .photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-actions { flex-direction: column-reverse; }
  .form-actions .button { width: 100%; }
  .sticky-actions { position: static; }
  .messenger-page-header { display: none; }
  .messenger-shell { min-height: calc(100vh - 112px); grid-template-columns: 92px minmax(0, 1fr); border-radius: 10px; }
  .conversation-list-title { justify-content: center; padding: 0 5px; }
  .conversation-list-title strong { display: none; }
  .conversation-item { justify-content: center; padding: 11px 7px; }
  .conversation-copy { display: none; }
  .conversation-item.is-active { box-shadow: inset 3px 0 var(--primary); }
  .chat-header { padding: 9px 11px; }
  .chat-refresh { font-size: 0; }
  .chat-refresh::after { content: '\21bb'; font-size: 17px; }
  .chat-call { width: 36px; padding: 0; justify-content: center; font-size: 0; }
  .chat-call > span:first-child { font-size: 17px; }
  .message-stream { padding: 15px 11px; }
  .chat-message { max-width: 88%; }
  .message-compose { grid-template-columns: minmax(0, 1fr) 42px; }
  .case-link-select { grid-column: 1 / -1; grid-row: 2; }
  .send-message-button { grid-column: 2; grid-row: 1; }
}

@media (max-width: 500px) {
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-card { padding: 13px; }
  .stat-card strong { font-size: 23px; }
  .filter-bar { grid-template-columns: 1fr; }
  .filter-bar > * { grid-column: 1 !important; }
  .case-hero-actions .button { flex: 1; }
  .detail-section, .workflow-panel, .form-section { padding: 16px; }
  .problem-content { align-items: stretch; flex-direction: column; }
  .upload-form { align-items: stretch; flex-direction: column; }
  .upload-submit { width: 100%; }
  .photo-grid { grid-template-columns: 1fr 1fr; }
  .timeline-meta { flex-direction: column; gap: 0; }
  .messenger-shell { grid-template-columns: 66px minmax(0, 1fr); }
  .chat-avatar { flex-basis: 36px; width: 36px; height: 36px; }
  .conversation-list-title > span { min-width: 22px; padding-inline: 5px; }
  .conversation-item { padding-inline: 5px; }
  .message-compose { padding: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .001ms !important; animation-duration: .001ms !important; }
  .auth-hero-video { display: none; }
}
