:root {
  --brand-pink: #ff0067;
  --brand-pink-dark: #d90058;
  --brand-pink-soft: #fff0f6;
  --brand-blue: #1649da;
  --brand-blue-dark: #1038ab;
  --brand-blue-soft: #eef3ff;
  --navy-950: #08080d;
  --navy-900: #111111;
  --navy-800: #1a1a1a;
  --navy-700: #31333b;
  --ink: #111111;
  --muted: #63636b;
  --subtle: #707078;
  --line: #ededed;
  --line-strong: #d0d0d0;
  --canvas: #f5f5f5;
  --card: #ffffff;
  --blue: var(--brand-pink);
  --blue-dark: var(--brand-pink-dark);
  --blue-soft: var(--brand-pink-soft);
  --mint: #159b75;
  --mint-soft: #e9f8f3;
  --amber: #e79a22;
  --amber-soft: #fff5e3;
  --red: #db3e51;
  --red-soft: #fff0f2;
  --violet: var(--brand-blue);
  --violet-soft: var(--brand-blue-soft);
  --shadow-sm: 0 3px 12px rgba(17, 17, 17, .045);
  --shadow-md: 0 14px 36px rgba(17, 17, 17, .12);
  --shadow-brand: 0 9px 22px rgba(255, 0, 103, .22);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --sidebar: 244px;
  font-family: "GT Eesti Pro Display", "GT Eesti Pro", "Segoe UI", Arial, ui-sans-serif, system-ui, sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { min-width: 320px; background: var(--canvas); }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 3px solid rgba(255, 0, 103, .23); outline-offset: 2px; }
button { cursor: pointer; }
.is-hidden { display: none !important; }
.mobile-only { display: none !important; }
.muted { color: var(--muted); }
.eyebrow { margin: 0 0 8px; color: var(--brand-pink); font-size: 11px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.eyebrow--light { color: var(--brand-pink); }

/* Shared primitives */
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; }
.brand-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.brand-wordmark { display: block; width: 108px; height: 25px; flex: 0 0 auto; background: currentColor; clip-path: url("#bidzaar-wordmark-clip"); }
.brand > span:last-child { display: flex; flex-direction: column; line-height: 1; }
.brand-product { padding-left: 10px; border-left: 1px solid var(--line-strong); }
.brand small { margin: 0; color: var(--subtle); font-size: 7px; font-weight: 800; letter-spacing: .08em; line-height: 1.25; text-transform: uppercase; white-space: nowrap; }
.brand--light { color: #fff; }
.brand--light small { color: rgba(255,255,255,.55); }
.avatar { display: inline-grid; width: 36px; height: 36px; flex: 0 0 auto; place-items: center; border-radius: 10px; color: white; font-size: 11px; font-weight: 800; letter-spacing: .02em; }
.avatar--navy { background: #111111; }
.avatar--blue { background: var(--brand-blue); }
.avatar--violet { background: #7147c7; }
.avatar--green { background: #159b75; }
.avatar--amber { background: #c87d0f; }
.avatar--rose { background: var(--brand-pink); }
.avatar--slate { background: #62626a; }
.btn { min-height: 39px; padding: 0 16px; border: 1px solid transparent; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 12px; font-weight: 700; transition: background .16s ease, border-color .16s ease, transform .16s ease, box-shadow .16s ease; }
.btn:hover { transform: translateY(-2px); }
.btn--primary { color: #fff; background: var(--brand-pink); box-shadow: var(--shadow-brand); }
.btn--primary:hover { background: var(--brand-pink-dark); box-shadow: 0 10px 24px rgba(255, 0, 103, .29); }
.btn--ghost { background: #fff; border-color: var(--line-strong); color: var(--ink); }
.btn--ghost:hover { color: var(--brand-pink); background: #fff; border-color: var(--brand-pink); }
.btn--soft { color: var(--brand-blue); background: var(--brand-blue-soft); }
.btn--danger { color: var(--red); background: var(--red-soft); }
.btn--large { width: 100%; min-height: 49px; justify-content: space-between; padding: 0 19px; font-size: 13px; }
.icon-btn { width: 38px; height: 38px; padding: 0; border: 1px solid var(--line); border-radius: 12px; display: inline-grid; place-items: center; background: white; font-size: 18px; }
.icon-btn:hover { color: var(--brand-pink); border-color: #ffc2da; background: var(--brand-pink-soft); }
.badge { display: inline-flex; min-height: 23px; padding: 0 8px; align-items: center; gap: 5px; border-radius: 6px; font-size: 10px; font-weight: 800; white-space: nowrap; }
.badge--new { color: #2e5fda; background: #edf2ff; }
.badge--progress { color: #6c4acb; background: #f1edff; }
.badge--waiting { color: #a76a15; background: #fff4df; }
.badge--external { color: #37628f; background: #eaf4ff; }
.badge--resolved { color: #158568; background: #e7faf5; }
.badge--closed { color: #5f6b7c; background: #edf0f4; }
.badge--danger { color: #c64254; background: #fff0f2; }
.badge--neutral { color: #506078; background: #f0f3f7; }
.badge--channel { color: #41516a; background: #f2f4f7; font-weight: 700; }
.priority { display: inline-flex; align-items: center; gap: 6px; font-size: 10px; font-weight: 800; }
.priority::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #9aa5b5; }
.priority--p1::before { background: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.priority--p2::before { background: var(--amber); }
.priority--p3::before { background: var(--blue); }
.priority--p4::before { background: #8e9aab; }
.empty-state { padding: 64px 24px; display: grid; justify-items: center; text-align: center; color: var(--muted); }
.empty-state span { width: 52px; height: 52px; margin-bottom: 14px; display: grid; place-items: center; border-radius: 14px; color: var(--blue); background: var(--blue-soft); font-size: 24px; }
.empty-state h3 { margin: 0 0 6px; color: var(--ink); font-size: 15px; }
.empty-state p { max-width: 350px; margin: 0; font-size: 12px; line-height: 1.6; }

/* Login */
.login-screen { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 1.08fr) minmax(520px, .92fr); background: #fff; }
.login-brand { position: relative; min-height: 680px; padding: clamp(32px, 5vw, 72px); display: flex; flex-direction: column; color: #fff; background:
  radial-gradient(circle at 78% 20%, rgba(71,116,233,.32), transparent 30%),
  radial-gradient(circle at 18% 82%, rgba(49,199,161,.18), transparent 32%),
  linear-gradient(145deg, #0b1425, #172b4c 64%, #13243d); overflow: hidden; }
.login-brand::before { content: ''; position: absolute; width: 540px; height: 540px; right: -280px; bottom: -240px; border: 1px solid rgba(255,255,255,.09); border-radius: 50%; box-shadow: 0 0 0 62px rgba(255,255,255,.018), 0 0 0 126px rgba(255,255,255,.018); }
.login-brand::after { content: ''; position: absolute; left: -10%; top: 40%; width: 120%; height: 1px; background: linear-gradient(90deg, transparent, rgba(255,255,255,.08), transparent); transform: rotate(-18deg); }
.login-pitch { position: relative; z-index: 1; max-width: 610px; margin: auto 0; padding: 60px 0 160px; }
.login-pitch h1 { margin: 0; color: #fff; font-size: clamp(42px, 5vw, 70px); line-height: 1.04; letter-spacing: -.055em; }
.login-pitch > p:not(.eyebrow) { max-width: 550px; margin: 25px 0 34px; color: rgba(255,255,255,.65); font-size: 15px; line-height: 1.75; }
.login-features { display: flex; flex-wrap: wrap; gap: 20px 30px; }
.login-features span { display: flex; align-items: center; gap: 9px; color: rgba(255,255,255,.8); font-size: 11px; font-weight: 700; }
.login-features b { color: #5dd5b8; font-size: 9px; letter-spacing: .1em; }
.login-orbit { position: absolute; z-index: 2; right: 8%; bottom: 10%; width: min(430px, 56%); height: 160px; }
.orbit-card { position: absolute; min-width: 210px; padding: 15px 17px 15px 38px; display: flex; flex-direction: column; border: 1px solid rgba(255,255,255,.14); border-radius: 12px; background: rgba(255,255,255,.09); backdrop-filter: blur(15px); box-shadow: 0 16px 38px rgba(0,0,0,.16); }
.orbit-card b { font-size: 11px; }
.orbit-card small { margin-top: 5px; color: rgba(255,255,255,.5); font-size: 9px; }
.orbit-card .dot { position: absolute; left: 17px; top: 18px; }
.orbit-card--one { right: 0; top: 0; }
.orbit-card--two { left: 0; bottom: 0; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #8c98a9; }
.dot--mint { background: var(--mint); box-shadow: 0 0 0 4px rgba(49,199,161,.13); }
.dot--amber { background: var(--amber); box-shadow: 0 0 0 4px rgba(233,162,59,.13); }
.login-footnote { position: relative; z-index: 1; margin: 0; color: rgba(255,255,255,.35); font-size: 9px; text-transform: uppercase; letter-spacing: .1em; }
.login-panel { display: grid; place-items: center; padding: 40px clamp(32px, 7vw, 100px); }
.login-card { width: min(100%, 430px); display: grid; gap: 18px; }
.login-card h2 { margin: 0; font-size: 30px; letter-spacing: -.035em; }
.login-card > div:first-child .muted { margin: 8px 0 4px; font-size: 12px; }
.demo-roles { margin: 4px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.demo-role { position: relative; min-height: 68px; padding: 9px 10px; display: flex; align-items: center; gap: 9px; text-align: left; border: 1px solid var(--line); border-radius: 11px; background: #fff; transition: .15s ease; }
.demo-role:hover { border-color: #bfc9d8; background: #fafbfc; }
.demo-role.is-selected { border-color: var(--blue); background: var(--blue-soft); box-shadow: 0 0 0 2px rgba(22,73,218,.07); }
.demo-role span:nth-child(2) { min-width: 0; display: flex; flex-direction: column; }
.demo-role b { font-size: 10px; }
.demo-role small { margin-top: 3px; color: var(--muted); font-size: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.demo-role i { position: absolute; top: 6px; right: 7px; width: 15px; height: 15px; display: none; place-items: center; color: #fff; border-radius: 50%; background: var(--blue); font-size: 8px; font-style: normal; }
.demo-role.is-selected i { display: grid; }
.field { display: grid; gap: 7px; }
.field > span:first-child { color: #4f5d72; font-size: 10px; font-weight: 800; }
.field input, .field select, .field textarea { width: 100%; min-height: 43px; padding: 0 12px; color: var(--ink); border: 1px solid var(--line-strong); border-radius: 9px; background: #fff; font-size: 12px; outline: none; transition: border-color .15s, box-shadow .15s; }
.field textarea { min-height: 110px; padding: 11px 12px; resize: vertical; line-height: 1.55; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(22,73,218,.08); }
.field > small { margin-top: -2px; color: var(--subtle); font-size: 8px; line-height: 1.45; }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 84px; }
.password-wrap button { position: absolute; top: 50%; right: 8px; border: 0; transform: translateY(-50%); color: var(--blue); background: none; font-size: 9px; font-weight: 800; }
.form-error { min-height: 16px; margin: -8px 0 0; color: var(--red); font-size: 10px; }
.login-note { margin: -4px 0 0; color: var(--subtle); text-align: center; font-size: 9px; }
.login-note span { color: var(--mint); }

/* Application shell */
.app { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); }
.sidebar-backdrop { display: none; }
.sidebar { position: sticky; z-index: 30; top: 0; height: 100vh; padding: 24px 15px 16px; display: flex; flex-direction: column; background: #fff; border-right: 1px solid var(--line); }
.sidebar-top { padding: 0 8px 25px; display: flex; align-items: center; justify-content: space-between; }
.main-nav { display: grid; gap: 3px; }
.main-nav p { margin: 19px 12px 7px; color: #a1aaba; font-size: 8px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.main-nav button { min-height: 42px; padding: 0 11px; display: flex; align-items: center; gap: 11px; border: 0; border-radius: 9px; color: #607087; background: transparent; font-size: 11px; font-weight: 700; text-align: left; }
.main-nav button:hover { color: var(--ink); background: #f6f8fa; }
.main-nav button.is-active { color: var(--blue); background: var(--blue-soft); }
.main-nav .nav-icon { width: 20px; color: currentColor; font-size: 18px; font-weight: 500; text-align: center; }
.main-nav em { min-width: 22px; height: 20px; margin-left: auto; padding: 0 6px; display: grid; place-items: center; color: #6f7d90; border-radius: 6px; background: #eef1f4; font-size: 9px; font-style: normal; }
.main-nav button.is-active em { color: white; background: var(--blue); }
.sidebar-bottom { margin-top: auto; }
.system-health { margin: 0 3px 12px; padding: 11px; display: flex; align-items: center; gap: 9px; border-radius: 10px; background: #f7f9fa; }
.system-health > span:last-child { display: flex; flex-direction: column; }
.system-health b { font-size: 9px; }
.system-health small { margin-top: 3px; color: var(--subtle); font-size: 8px; }
.status-pulse { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 4px var(--mint-soft); }
.user-menu { width: 100%; padding: 11px 8px; display: flex; align-items: center; gap: 9px; border: 0; border-top: 1px solid var(--line); background: transparent; text-align: left; }
.user-menu > span:nth-child(2) { min-width: 0; display: flex; flex: 1; flex-direction: column; }
.user-menu b { font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-menu small { margin-top: 4px; color: var(--subtle); font-size: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-menu > span:last-child { color: var(--subtle); }
.logout-button { width: 100%; padding: 7px; color: var(--subtle); border: 0; background: transparent; font-size: 9px; }
.logout-button:hover { color: var(--red); }
.workspace { min-width: 0; }
.topbar { position: sticky; z-index: 20; top: 0; height: 72px; padding: 0 30px; display: flex; align-items: center; justify-content: space-between; gap: 22px; background: rgba(255,255,255,.92); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.crumbs { display: flex; align-items: center; gap: 9px; font-size: 10px; white-space: nowrap; }
.crumbs span { color: var(--subtle); }
.crumbs b { color: #c1c7d0; font-weight: 400; }
.crumbs strong { font-weight: 800; }
.topbar-actions { display: flex; align-items: center; gap: 9px; }
.global-search { width: min(28vw, 290px); height: 38px; padding: 0 9px 0 12px; display: flex; align-items: center; gap: 7px; color: #8a96a8; border: 1px solid var(--line); border-radius: 9px; background: #f8f9fb; }
.global-search input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; font-size: 10px; }
.global-search kbd { padding: 3px 5px; color: #9aa4b3; border: 1px solid #dfe3e9; border-radius: 4px; background: #fff; font-family: inherit; font-size: 7px; }
.view-container { padding: 27px 30px 36px; }
.page-heading { margin-bottom: 19px; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.page-heading h1 { margin: 0; font-size: 24px; letter-spacing: -.035em; }
.page-heading p:not(.eyebrow) { margin: 6px 0 0; color: var(--muted); font-size: 10px; }
.page-heading-actions { display: flex; gap: 8px; }

/* Dashboard */
.overview-hero { position: relative; min-height: 184px; margin-bottom: 18px; padding: 29px 32px; display: grid; grid-template-columns: minmax(0,1.2fr) minmax(340px,.8fr); align-items: center; gap: 30px; color: #fff; border-radius: var(--radius-lg); background: linear-gradient(130deg, #13233d, #203b65); overflow: hidden; box-shadow: var(--shadow-sm); }
.overview-hero::before { content: ''; position: absolute; right: -90px; top: -160px; width: 360px; height: 360px; border: 1px solid rgba(255,255,255,.1); border-radius: 50%; box-shadow: 0 0 0 42px rgba(255,255,255,.02), 0 0 0 88px rgba(255,255,255,.018); }
.overview-hero > div { position: relative; z-index: 1; }
.overview-hero h1 { margin: 0 0 10px; font-size: 27px; letter-spacing: -.035em; }
.overview-hero p { max-width: 570px; margin: 0; color: rgba(255,255,255,.62); font-size: 11px; line-height: 1.65; }
.hero-kpis { display: grid; grid-template-columns: repeat(3, 1fr); }
.hero-kpi { padding: 6px 18px; border-left: 1px solid rgba(255,255,255,.13); }
.hero-kpi:first-child { border-left: 0; }
.hero-kpi strong { display: block; font-size: 25px; letter-spacing: -.04em; }
.hero-kpi span { margin-top: 5px; display: block; color: rgba(255,255,255,.48); font-size: 8px; line-height: 1.4; }
.metric-grid { margin-bottom: 18px; display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; }
.metric-card { padding: 17px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm); }
.metric-card-head { display: flex; align-items: center; justify-content: space-between; }
.metric-card-head span:first-child { color: var(--muted); font-size: 9px; font-weight: 700; }
.metric-icon { width: 27px; height: 27px; display: grid; place-items: center; color: var(--blue); border-radius: 8px; background: var(--blue-soft); font-size: 14px; }
.metric-icon--amber { color: #b27219; background: var(--amber-soft); }
.metric-icon--red { color: #be4152; background: var(--red-soft); }
.metric-icon--mint { color: #17836a; background: var(--mint-soft); }
.metric-value { margin-top: 12px; display: flex; align-items: baseline; gap: 8px; }
.metric-value strong { font-size: 25px; letter-spacing: -.04em; }
.metric-value small { font-size: 8px; font-weight: 800; }
.trend-up { color: #179175; }
.trend-down { color: var(--red); }
.metric-card > small { margin-top: 5px; display: block; color: var(--subtle); font-size: 8px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.48fr) minmax(300px, .72fr); gap: 18px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm); overflow: hidden; }
.panel-header { min-height: 59px; padding: 0 18px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.panel-header h2 { margin: 0; font-size: 13px; }
.panel-header p { margin: 4px 0 0; color: var(--muted); font-size: 8px; }
.panel-header button { padding: 5px; border: 0; color: var(--blue); background: transparent; font-size: 9px; font-weight: 800; }
.attention-list { display: grid; }
.attention-item { min-height: 76px; padding: 13px 18px; display: grid; grid-template-columns: minmax(0, 1fr) 110px 105px; align-items: center; gap: 16px; border-bottom: 1px solid #edf0f3; cursor: pointer; }
.attention-item:last-child { border-bottom: 0; }
.attention-item:hover { background: #fafbfc; }
.attention-item:focus-visible, .ticket-card:focus-visible { z-index: 1; outline: 3px solid rgba(22, 73, 218, .28); outline-offset: -3px; background: #f3f6ff; }
.attention-main { min-width: 0; }
.attention-main > div { display: flex; align-items: center; gap: 8px; }
.attention-main strong { margin-top: 6px; display: block; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attention-main small { color: var(--subtle); font-size: 8px; }
.sla-mini { display: grid; gap: 5px; }
.sla-mini > div { height: 4px; border-radius: 8px; background: #edf0f4; overflow: hidden; }
.sla-mini i { display: block; height: 100%; border-radius: inherit; background: var(--mint); }
.sla-mini.is-warning i { background: var(--amber); }
.sla-mini.is-danger i { background: var(--red); }
.sla-mini span { color: var(--muted); font-size: 8px; }
.assignee-mini { display: flex; align-items: center; gap: 7px; }
.assignee-mini .avatar { width: 27px; height: 27px; border-radius: 8px; font-size: 8px; }
.assignee-mini span { min-width: 0; font-size: 8px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dashboard-side { display: grid; align-content: start; gap: 18px; }
.office-load { padding: 10px 18px 18px; display: grid; gap: 14px; }
.office-row { display: grid; grid-template-columns: 72px minmax(0,1fr) 25px; align-items: center; gap: 10px; }
.office-row span, .office-row strong { font-size: 9px; }
.office-row strong { text-align: right; }
.bar { height: 6px; border-radius: 8px; background: #edf0f4; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: inherit; background: var(--blue); }
.office-row:nth-child(3) .bar i { background: var(--mint); }
.office-row:nth-child(4) .bar i { background: var(--violet); }
.office-row:nth-child(5) .bar i { background: var(--amber); }
.activity-list { padding: 6px 18px 14px; }
.activity-item { position: relative; padding: 9px 0 9px 24px; }
.activity-item::before { content: ''; position: absolute; left: 4px; top: 15px; width: 7px; height: 7px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 4px var(--blue-soft); }
.activity-item::after { content: ''; position: absolute; left: 7px; top: 25px; bottom: -7px; width: 1px; background: var(--line); }
.activity-item:last-child::after { display: none; }
.activity-item p { margin: 0; color: #526176; font-size: 8px; line-height: 1.5; }
.activity-item p b { color: var(--ink); }
.activity-item small { margin-top: 4px; display: block; color: var(--subtle); font-size: 7px; }

/* Ticket queue */
.queue-summary { display: flex; align-items: center; gap: 7px; }
.summary-pill { min-height: 35px; padding: 0 12px; display: flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 9px; background: #fff; font-size: 9px; font-weight: 700; }
.summary-pill b { font-size: 13px; }
.summary-pill--danger b { color: var(--red); }
.summary-pill--warning b { color: #ba7619; }
.queue-toolbar { margin-bottom: 12px; padding: 9px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm); }
.filter-tabs { display: flex; gap: 3px; }
.filter-tab { min-height: 32px; padding: 0 12px; border: 0; border-radius: 7px; color: var(--muted); background: transparent; font-size: 9px; font-weight: 800; }
.filter-tab.is-active { color: var(--blue); background: var(--blue-soft); }
.filter-controls { display: flex; align-items: center; gap: 7px; }
.select-control { height: 32px; padding: 0 27px 0 9px; border: 1px solid var(--line); border-radius: 7px; color: #526176; background: #fff; font-size: 9px; font-weight: 700; }
.queue-layout { height: calc(100vh - 252px); min-height: 460px; display: grid; grid-template-columns: var(--queue-list-width, 380px) 10px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm); overflow: hidden; }
.ticket-list-panel { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.queue-resizer { position: relative; z-index: 2; width: 10px; min-width: 10px; border: 0; border-right: 1px solid var(--line); border-left: 1px solid var(--line); outline: 0; background: #fafbfc; cursor: col-resize; touch-action: none; transition: border-color .14s, background .14s; }
.queue-resizer span { position: absolute; left: 50%; top: 50%; width: 4px; height: 44px; border-radius: 999px; transform: translate(-50%, -50%); background: radial-gradient(circle, #a7b1bf 1px, transparent 1.5px) center / 4px 8px; }
.queue-resizer:hover,
.queue-resizer:focus-visible,
.queue-resizer.is-resizing { border-color: #b7c5ef; background: var(--blue-soft); }
.queue-resizer:focus-visible { box-shadow: inset 0 0 0 2px var(--blue); }
.queue-resizer:hover span,
.queue-resizer:focus-visible span,
.queue-resizer.is-resizing span { background-image: radial-gradient(circle, var(--blue) 1px, transparent 1.5px); }
body.is-resizing-queue,
body.is-resizing-queue * { cursor: col-resize !important; user-select: none !important; }
.ticket-list-head { min-height: 49px; padding: 0 15px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.ticket-list-head span { color: var(--muted); font-size: 9px; }
.ticket-list-head button { border: 0; color: var(--subtle); background: transparent; font-size: 16px; }
.ticket-list { min-height: 0; overflow-y: auto; }
.ticket-card { position: relative; min-height: 116px; padding: 15px 16px; display: grid; gap: 8px; border-bottom: 1px solid #ebeff3; cursor: pointer; transition: background .14s; }
.ticket-card:hover { background: #fafbfc; }
.ticket-card.is-active { background: #f3f6ff; }
.ticket-card.is-active::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--blue); }
.ticket-card-top, .ticket-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ticket-card-top > div, .ticket-card-foot > div { display: flex; align-items: center; gap: 7px; min-width: 0; }
.ticket-id { color: var(--blue); font-size: 9px; font-weight: 800; }
.ticket-time { color: var(--subtle); font-size: 8px; white-space: nowrap; }
.ticket-card h3 { margin: 0; font-size: 11px; line-height: 1.42; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ticket-card p { margin: -3px 0 0; color: var(--muted); font-size: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ticket-card-foot { margin-top: 2px; }
.ticket-card-foot .avatar { width: 23px; height: 23px; border-radius: 7px; font-size: 7px; }
.ticket-card-foot small { min-width: 0; color: var(--muted); font-size: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sla-chip { display: inline-flex; align-items: center; flex: 0 0 auto; gap: 5px; color: #66748a; font-size: 8px; font-weight: 700; white-space: nowrap; }
.sla-chip::before { content: '◷'; color: var(--mint); font-size: 11px; }
.sla-chip.is-warning { color: #a76610; }
.sla-chip.is-warning::before { color: var(--amber); }
.sla-chip.is-danger { color: var(--red); }
.sla-chip.is-danger::before { color: var(--red); }
.ticket-detail-panel { min-width: 0; min-height: 0; overflow: hidden; }
.ticket-detail { height: 100%; display: flex; flex-direction: column; }
.ticket-detail-head { position: relative; z-index: 1; padding: 17px 21px 15px; border-bottom: 1px solid var(--line); }
.ticket-detail-kicker { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ticket-detail-kicker > div { display: flex; align-items: center; gap: 7px; }
.ticket-detail-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.ticket-detail-actions .btn { min-height: 32px; padding: 0 10px; font-size: 9px; }
.ticket-detail-actions .btn--handoff { color: #37628f; background: #eaf4ff; }
.ticket-detail h2 { margin: 10px 0 7px; font-size: 17px; line-height: 1.35; letter-spacing: -.02em; }
.requester-line { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 8px; }
.requester-line .avatar { width: 22px; height: 22px; border-radius: 6px; font-size: 7px; }
.ticket-detail-body { position: relative; z-index: 2; min-height: 0; flex: 1; display: grid; grid-template-columns: minmax(0,1fr) 205px; }
.conversation { min-width: 0; min-height: 0; height: 100%; display: flex; flex-direction: column; border-right: 1px solid var(--line); overflow: visible; }
.thread { min-height: 0; padding: 18px 21px; flex: 1; overflow-y: auto; background: #fbfcfd; }
.thread-date { margin: 2px 0 17px; display: flex; align-items: center; gap: 9px; color: var(--subtle); font-size: 7px; text-align: center; }
.thread-date::before, .thread-date::after { content: ''; height: 1px; flex: 1; background: var(--line); }
.message { margin-bottom: 17px; display: grid; grid-template-columns: 29px minmax(0, 1fr); gap: 9px; }
.message .avatar { width: 29px; height: 29px; border-radius: 8px; font-size: 8px; }
.message-main { min-width: 0; }
.message-meta { margin: 0 0 5px; display: flex; align-items: baseline; gap: 7px; }
.message-meta b { font-size: 9px; }
.message-meta span { color: var(--subtle); font-size: 7px; }
.message-bubble { max-width: 620px; padding: 10px 12px; color: #3e4d63; border: 1px solid var(--line); border-radius: 3px 11px 11px 11px; background: #fff; font-size: 9px; line-height: 1.6; white-space: pre-wrap; }
.message--agent .message-bubble { border-color: #dce4fa; background: #f4f7ff; }
.message--internal .message-bubble { border-color: #f1d79e; background: #fff8e9; }
.message--internal .message-meta::after { content: 'Внутренний комментарий'; padding: 2px 5px; color: #9a6214; border-radius: 4px; background: #ffefca; font-size: 6px; font-weight: 800; text-transform: uppercase; }
.message-attachments { margin-top: 7px; display: flex; flex-wrap: wrap; gap: 6px; }
.file-chip { padding: 7px 9px; display: inline-flex; align-items: center; gap: 6px; color: #42526a; border: 1px solid var(--line); border-radius: 7px; background: #fff; font-size: 8px; }
.file-chip[href] { cursor: pointer; text-decoration: none; }
.file-chip[href]:hover { color: var(--blue); border-color: var(--blue); }
.file-chip::before { content: '▧'; color: var(--blue); font-size: 12px; }
.event-line { margin: 4px 0 15px; display: flex; align-items: center; gap: 7px; color: var(--subtle); font-size: 7px; }
.event-line::before { content: '✓'; width: 18px; height: 18px; display: grid; place-items: center; color: #188b70; border-radius: 50%; background: var(--mint-soft); font-size: 8px; }
.composer { position: relative; z-index: 2; padding: 12px 16px 14px; border-top: 1px solid var(--line); background: #fff; }
.composer-tabs { margin-bottom: 8px; display: flex; gap: 4px; }
.composer-tab { padding: 5px 7px; border: 0; border-radius: 6px; color: var(--muted); background: transparent; font-size: 8px; font-weight: 800; }
.composer-tab.is-active { color: var(--blue); background: var(--blue-soft); }
.composer-tab[data-composer-kind="internal"].is-active { color: #956012; background: var(--amber-soft); }
.composer--internal { background: #fffaf0; }
.composer--internal .composer-box { border-color: #e6c679; background: #fffdf8; }
.composer--internal .composer-box textarea, .composer--internal .composer-actions { background: #fffdf8; }
.composer-box { border: 1px solid var(--line-strong); border-radius: 9px; overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.composer-box:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(22,73,218,.07); }
.composer-box textarea { width: 100%; min-height: 68px; padding: 10px 11px 5px; display: block; border: 0; outline: 0; resize: none; font-size: 9px; line-height: 1.55; }
.composer-actions { min-width: 0; padding: 6px 7px; display: flex; align-items: center; justify-content: space-between; gap: 8px; background: #fafbfc; }
.composer-tools { min-width: 0; display: flex; align-items: center; gap: 5px; }
.composer-tools label, .composer-tools button { width: 27px; height: 27px; display: grid; place-items: center; border: 0; border-radius: 6px; color: var(--muted); background: transparent; font-size: 13px; cursor: pointer; }
.composer-tools label:hover, .composer-tools button:hover { color: var(--blue); background: var(--blue-soft); }
.composer-tools input { display: none; }
.composer-attachment-unavailable { min-height: 27px; padding: 0 7px; display: inline-flex; align-items: center; gap: 5px; color: var(--muted); border-radius: 6px; font-size: 7px; cursor: not-allowed; }
.composer-attachment-unavailable > span[aria-hidden="true"] { font-size: 13px; }
.composer-attachment-picker { position: relative; min-height: 27px; padding: 0 7px; display: inline-flex; align-items: center; gap: 5px; color: var(--muted); border-radius: 6px; font-size: 7px; cursor: pointer; }
.composer-attachment-picker:hover, .composer-attachment-picker:focus-within { color: var(--blue); background: #eef4ff; }
.composer-attachment-picker input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.composer-attachment-icon { font-size: 17px; line-height: 1; transform: rotate(-12deg); }
.composer-files { padding: 8px 12px 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; border-top: 1px solid var(--line); }
.composer-file { max-width: 240px; min-height: 30px; padding: 4px 5px 4px 9px; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 8px; background: #f8fafc; }
.composer-file b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 8px; }
.composer-file small { flex: none; color: var(--muted); font-size: 7px; }
.composer-file button, .composer-files-clear { border: 0; background: transparent; cursor: pointer; }
.composer-file button { width: 20px; height: 20px; border-radius: 50%; color: var(--muted); }
.composer-file button:hover { color: var(--danger); background: #fff0f3; }
.composer-files-clear { color: var(--blue); font-size: 8px; }
.composer-actions .btn { min-height: 29px; padding: 0 10px; font-size: 8px; }
.ticket-sidebar { min-height: 0; padding: 17px 15px; overflow-y: auto; background: #fff; }
.ticket-sidebar section { padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.ticket-sidebar section:last-child { border: 0; }
.ticket-sidebar h3 { margin: 0 0 11px; color: #8c97a7; font-size: 7px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.property { margin-bottom: 11px; display: grid; gap: 5px; }
.property > span { color: var(--subtle); font-size: 7px; }
.property > b, .property > div { font-size: 8px; }
.property > small { margin-top: -1px; color: var(--subtle); font-size: 10px; line-height: 1.4; }
.property select { width: 100%; min-height: 32px; padding: 0 25px 0 8px; border: 1px solid var(--line); border-radius: 7px; background: #fff; font-size: 8px; font-weight: 700; }
.ticket-properties-actions { margin-top: 4px; display: grid; grid-template-columns: auto minmax(0,1fr); gap: 7px; }
.ticket-properties-actions .btn { min-height: 34px; padding-inline: 9px; font-size: 10px; }
.ticket-properties-hint { margin-top: 7px; display: block; color: var(--subtle); font-size: 9px; line-height: 1.4; }
.ticket-properties-section.is-dirty, #ticket-properties-form.is-dirty .ticket-properties-section { border-bottom-color: #c7d3f8; }
.person-property { display: flex; align-items: center; gap: 7px; }
.person-property .avatar { width: 25px; height: 25px; border-radius: 7px; font-size: 7px; }
.person-property span { display: flex; flex-direction: column; }
.person-property b { font-size: 8px; }
.person-property small { margin-top: 2px; color: var(--subtle); font-size: 7px; }
.sla-panel { padding: 11px; border-radius: 9px; background: #f7f9fb; }
.sla-panel + .sla-panel { margin-top: 8px; }
.sla-panel-top { display: flex; justify-content: space-between; gap: 5px; }
.sla-panel-top span { color: var(--muted); font-size: 7px; }
.sla-panel-top b { font-size: 8px; }
.sla-track { height: 5px; margin: 9px 0 6px; border-radius: 6px; background: #e6eaf0; overflow: hidden; }
.sla-track i { display: block; height: 100%; background: var(--mint); border-radius: inherit; }
.sla-panel.is-warning .sla-track i { background: var(--amber); }
.sla-panel.is-danger .sla-track i { background: var(--red); }
.sla-panel.is-paused { background: #eef6ff; }
.sla-panel.is-paused .sla-track i { background: #4f83c2; }
.sla-panel.is-resolved .sla-track i { background: var(--mint); }
.sla-panel small { color: var(--subtle); font-size: 7px; }
.external-handoff-card { padding: 11px; border: 1px solid #cee0f4; border-radius: 9px; background: #f3f8fe; }
.external-handoff-top { display: flex; align-items: center; gap: 8px; }
.external-handoff-icon { width: 27px; height: 27px; flex: 0 0 auto; display: grid; place-items: center; color: #37628f; border-radius: 7px; background: #deedfd; font-size: 13px; font-weight: 800; }
.external-handoff-top > span:last-child { min-width: 0; display: flex; flex-direction: column; }
.external-handoff-top b { font-size: 8px; }
.external-handoff-top small { margin-top: 2px; color: #6c7e92; font-size: 7px; overflow-wrap: anywhere; }
.external-handoff-state { margin-top: 9px; padding: 4px 6px; display: inline-flex; color: #37628f; border-radius: 5px; background: #deedfd; font-size: 7px; font-weight: 800; }
.external-handoff-state.is-active { color: #315f96; background: #dbeafe; }
.external-handoff-card p { margin: 8px 0 0; color: #4c5f75; font-size: 7px; line-height: 1.5; white-space: pre-wrap; }
.external-handoff-card footer { margin-top: 8px; color: var(--subtle); font-size: 7px; }
.watcher-property { position: relative; }
.watchers { min-height: 29px; display: flex; align-items: center; }
.watchers > span { display: inline-flex; margin-left: -5px; }
.watchers > span:first-child { margin-left: 0; }
.watchers .avatar { width: 25px; height: 25px; border: 2px solid #fff; border-radius: 8px; font-size: 6px; }
.watchers button { width: 25px; height: 25px; margin-left: 4px; border: 1px dashed #bdc6d2; border-radius: 8px; color: var(--subtle); background: #fff; font-size: 11px; }
.watchers-empty { color: var(--subtle); font-size: 10px; }
.watcher-picker { position: fixed; z-index: 80; right: max(18px, env(safe-area-inset-right)); bottom: max(18px, env(safe-area-inset-bottom)); width: min(360px, calc(100vw - 36px)); max-height: min(560px, calc(100dvh - 36px)); box-sizing: border-box; padding: 12px; display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 13px; background: #fff; box-shadow: 0 18px 44px rgba(17,17,17,.16); }
.watcher-picker[hidden] { display: none; }
.watcher-picker > strong { font-size: 12px; }
.watcher-picker > p { margin: 4px 0 10px; color: var(--subtle); font-size: 10px; line-height: 1.4; }
.watcher-options { min-height: 0; max-height: 320px; display: grid; gap: 4px; overflow-y: auto; overscroll-behavior: contain; }
.watcher-options label { min-height: 38px; padding: 5px 7px; display: flex; align-items: center; gap: 8px; border-radius: 8px; cursor: pointer; }
.watcher-options label:hover { background: var(--blue-soft); }
.watcher-options input { width: 15px; height: 15px; accent-color: var(--brand-blue); }
.watcher-options label > span { min-width: 0; display: flex; align-items: center; gap: 7px; }
.watcher-options .avatar { width: 25px; height: 25px; border-radius: 7px; font-size: 7px; }
.watcher-options b { font-size: 10px; line-height: 1.3; }
.watcher-picker-actions { margin-top: 10px; display: flex; justify-content: flex-end; gap: 6px; }
.watcher-picker-actions .btn { min-height: 32px; padding-inline: 10px; font-size: 10px; }

/* Analytics */
.analytics-toolbar { display: flex; align-items: flex-end; gap: 8px; }
.analytics-grid { display: grid; grid-template-columns: repeat(12, minmax(0,1fr)); gap: 16px; }
.analytics-grid .metric-card { grid-column: span 3; }
.chart-panel { grid-column: span 8; min-height: 340px; }
.chart-panel--small { grid-column: span 4; }
.chart-panel--half { grid-column: span 6; }
.chart-body { padding: 20px; }
.chart-legend { display: flex; gap: 15px; }
.chart-legend span { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 8px; }
.chart-legend i { width: 7px; height: 7px; border-radius: 2px; background: var(--blue); }
.chart-legend span:nth-child(2) i { background: var(--mint); }
.volume-chart { height: 220px; padding: 10px 4px 0 35px; display: flex; align-items: flex-end; justify-content: space-around; gap: 10px; border-bottom: 1px solid var(--line); background: repeating-linear-gradient(to top, transparent 0, transparent 54px, #eef1f4 55px); }
.volume-day { height: 100%; flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 3px; }
.volume-day i { width: min(16px, 34%); border-radius: 4px 4px 0 0; background: var(--blue); }
.volume-day i:nth-child(2) { background: var(--mint); }
.chart-labels { padding: 8px 4px 0 35px; display: flex; justify-content: space-around; color: var(--subtle); font-size: 7px; }
.donut-wrap { min-height: 228px; display: grid; place-items: center; }
.donut { position: relative; width: 150px; height: 150px; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--blue) 0 34%, var(--mint) 34% 57%, var(--violet) 57% 75%, var(--amber) 75% 89%, #9aa8b9 89%); }
.donut::before { content: ''; position: absolute; width: 96px; height: 96px; border-radius: 50%; background: white; }
.donut strong, .donut span { position: relative; z-index: 1; }
.donut strong { margin-top: 17px; font-size: 24px; }
.donut span { margin-top: -32px; color: var(--muted); font-size: 7px; }
.category-legend { display: grid; gap: 8px; }
.category-legend div { display: grid; grid-template-columns: 8px 1fr 28px; align-items: center; gap: 7px; color: var(--muted); font-size: 8px; }
.category-legend i { width: 7px; height: 7px; border-radius: 2px; background: var(--blue); }
.category-legend div:nth-child(2) i { background: var(--mint); }
.category-legend div:nth-child(3) i { background: var(--violet); }
.category-legend div:nth-child(4) i { background: var(--amber); }
.category-legend div:nth-child(5) i { background: #9aa8b9; }
.category-legend b { color: var(--ink); text-align: right; }
.agent-table { width: 100%; border-collapse: collapse; }
.agent-table th, .agent-table td { padding: 10px 7px; border-bottom: 1px solid var(--line); text-align: left; font-size: 8px; }
.agent-table th { color: var(--subtle); font-weight: 800; text-transform: uppercase; letter-spacing: .07em; }
.agent-table tr:last-child td { border-bottom: 0; }
.agent-table .person-property .avatar { width: 29px; height: 29px; }
.score { color: #17896e; font-weight: 800; }
.load-cell { display: flex; align-items: center; gap: 7px; }
.load-cell .bar { width: 65px; }

/* Catalog and team */
.catalog-heading-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.catalog-search { width: min(260px, 34vw); }
.catalog-adminbar { margin-bottom: 14px; padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-color: #bfd0f7; background: var(--blue-soft); }
.catalog-adminbar > div { min-width: 0; display: flex; flex-direction: column; }
.catalog-adminbar b { font-size: 10px; }
.catalog-adminbar span { margin-top: 3px; color: var(--muted); font-size: 8px; line-height: 1.45; }
.catalog-adminbar-actions { display: flex; align-items: center; gap: 8px; }
.catalog-section-tabs { width: fit-content; margin: 0 0 14px; padding: 5px; display: flex; gap: 4px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.catalog-section-tabs .filter-tab { min-height: 36px; font-size: 11px; }
.owner-directory-page > .handoff-intro { margin: 0 0 14px; }
.owner-directory-layout--page { min-height: 560px; }
.catalog-layout { display: grid; grid-template-columns: 250px minmax(0,1fr); gap: 16px; }
.catalog-layout .panel-header { gap: 12px; }
.catalog-layout .panel-header > div { min-width: 0; }
.catalog-layout .panel-header > .service-card-head-actions { flex-wrap: wrap; justify-content: flex-end; }
.catalog-layout .panel-header .btn { min-height: 31px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.catalog-layout .panel-header .btn--primary { color: #fff; border-color: var(--blue); background: var(--blue); }
.catalog-categories { padding: 8px; align-self: start; }
.catalog-category-row { position: relative; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; border-radius: 9px; }
.catalog-category-row.is-active { background: var(--blue-soft); }
.catalog-category-row.is-archived { opacity: .66; }
.catalog-category-row .catalog-category { min-width: 0; }
.catalog-category { width: 100%; min-height: 52px; padding: 8px 10px; display: flex; align-items: center; gap: 10px; border: 0; border-radius: 9px; background: transparent; text-align: left; }
.catalog-category:hover { background: #f7f8fa; }
.catalog-category.is-active { color: var(--blue); background: var(--blue-soft); }
.catalog-category > span:first-child { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; background: #f0f3f7; font-size: 15px; }
.catalog-category.is-active > span:first-child { background: #fff; }
.catalog-category > span:nth-child(2) { min-width: 0; display: flex; flex: 1; flex-direction: column; }
.catalog-category b { font-size: 9px; }
.catalog-category small { margin-top: 3px; color: var(--subtle); font-size: 7px; }
.catalog-category em { color: var(--subtle); font-size: 10px; font-style: normal; }
.catalog-inline-action { width: 30px; height: 30px; margin-right: 7px; display: grid; place-items: center; flex: 0 0 auto; color: #66768b; border: 1px solid #dce2ea; border-radius: 8px; background: #fff; font-size: 12px; }
.catalog-inline-action:hover { color: var(--blue); border-color: #b9c9f6; }
.catalog-add-category { width: 100%; min-height: 42px; margin-top: 6px; border: 1px dashed #b9c6d7; border-radius: 9px; color: var(--blue); background: #fafcff; font-size: 8px; font-weight: 800; }
.service-grid { padding: 16px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 11px; }
.service-card { min-height: 145px; padding: 17px; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 11px; background: #fff; text-align: left; transition: .15s ease; }
.service-card:hover { transform: translateY(-2px); border-color: #bac6d6; box-shadow: var(--shadow-md); }
.service-card.is-archived { opacity: .66; border-style: dashed; background: #fafbfc; }
.service-card--manage:hover { transform: none; }
.service-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.service-card-head-actions { display: flex; align-items: center; gap: 6px; }
.service-icon { width: 34px; height: 34px; display: grid; place-items: center; color: var(--blue); border-radius: 9px; background: var(--blue-soft); font-size: 16px; }
.service-card h3 { margin: 13px 0 5px; font-size: 11px; }
.service-card p { margin: 0; color: var(--muted); font-size: 8px; line-height: 1.55; }
.service-card footer { margin-top: auto; padding-top: 12px; display: flex; align-items: center; justify-content: space-between; color: var(--subtle); font-size: 7px; }
.service-card footer b { color: var(--blue); font-size: 8px; }
.service-card-edit, .service-card-delete { width: 29px; height: 29px; display: grid; place-items: center; color: #66768b; border: 1px solid #dce2ea; border-radius: 8px; background: #fff; font-size: 11px; }
.service-card-edit:hover { color: var(--blue); border-color: #b9c9f6; }
.service-card-delete { color: var(--red); border-color: #f1c7cd; background: var(--red-soft); }
.service-card-delete:hover { color: #a91f35; border-color: var(--red); background: #fff; }
.catalog-delete-warning { padding: 14px; display: flex; align-items: flex-start; gap: 12px; color: #762032; border: 1px solid #efc7ce; border-radius: 14px; background: var(--red-soft); }
.catalog-delete-warning > span { width: 26px; height: 26px; flex: 0 0 auto; display: grid; place-items: center; color: #fff; border-radius: 50%; background: var(--red); font-weight: 900; }
.catalog-delete-warning b { display: block; font-size: 13px; overflow-wrap: anywhere; }
.catalog-delete-warning p { margin: 5px 0 0; font-size: 12px; line-height: 1.55; }
.catalog-delete-confirm-field { margin-top: 18px; }
.catalog-delete-confirm-field small { display: block; margin-top: 6px; color: var(--subtle); font-size: 11px; line-height: 1.45; }
.catalog-delete-conflict { margin-top: 14px; padding: 13px 14px; color: #6b541f; border: 1px solid #eedba9; border-radius: 12px; background: #fff9ea; }
.catalog-delete-conflict b { display: block; font-size: 12px; }
.catalog-delete-conflict p { margin: 5px 0 0; font-size: 11px; line-height: 1.5; }
.catalog-delete-footer { flex-wrap: wrap; }
.btn--danger:hover { color: #fff; border-color: var(--red); background: var(--red); }
.catalog-empty { min-height: 240px; padding: 32px 20px; display: grid; place-items: center; align-content: center; gap: 7px; color: var(--muted); text-align: center; }
.catalog-empty > span { width: 42px; height: 42px; display: grid; place-items: center; color: var(--blue); border-radius: 12px; background: var(--blue-soft); font-size: 20px; }
.catalog-empty h3 { margin: 4px 0 0; color: var(--ink); font-size: 13px; }
.catalog-empty p { max-width: 390px; margin: 0; font-size: 8px; line-height: 1.5; }
.team-toolbar { margin-bottom: 14px; padding: 12px; display: grid; grid-template-columns: minmax(220px,1fr) 180px 170px auto; align-items: center; gap: 9px; }
.global-search--team { width: auto; }
.team-result-count { color: var(--subtle); font-size: 8px; font-weight: 700; white-space: nowrap; }
.team-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.team-card { padding: 18px; }
.team-card.is-inactive { opacity: .72; }
.team-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.team-card .person-property .avatar { width: 42px; height: 42px; border-radius: 11px; font-size: 11px; }
.team-card .person-property b { font-size: 11px; }
.team-card .person-property small { font-size: 8px; }
.team-card > p { min-height: 37px; margin: 14px 0; color: var(--muted); font-size: 8px; line-height: 1.55; }
.permission-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.permission-chips span { padding: 4px 6px; color: #53647b; border-radius: 5px; background: #f0f3f7; font-size: 7px; font-weight: 700; }
.team-card footer { margin-top: 15px; padding-top: 13px; display: flex; justify-content: space-between; border-top: 1px solid var(--line); color: var(--subtle); font-size: 7px; }
.team-action-note { color: var(--subtle); font-size: 7px; font-weight: 700; }

/* Modal and notifications */
.modal { width: min(660px, calc(100vw - 32px)); max-height: calc(100vh - 40px); padding: 0; border: 0; border-radius: 15px; background: #fff; box-shadow: 0 28px 80px rgba(12,21,39,.25); overflow: hidden; }
.modal--compact { width: min(580px, calc(100vw - 32px)); }
.modal::backdrop { background: rgba(10,18,32,.56); backdrop-filter: blur(3px); }
.modal form, .modal-frame { max-height: calc(100vh - 40px); display: flex; flex-direction: column; }
.modal-header { padding: 20px 23px 16px; display: flex; align-items: flex-start; justify-content: space-between; border-bottom: 1px solid var(--line); }
.modal-header h2 { margin: 0; font-size: 20px; letter-spacing: -.025em; }
.modal-body { min-height: 0; padding: 20px 23px; overflow-y: auto; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.user-access-form-grid > .field { min-width: 0; align-self: start; }
.field--wide { grid-column: 1 / -1; }
.ticket-classification { min-width: 0; margin: 0; padding: 14px 15px 15px; border: 1px solid var(--line-strong); border-radius: 12px; background: #fafbfc; }
.ticket-classification legend { padding: 0 6px; color: var(--ink); font-size: 13px; font-weight: 800; }
.ticket-classification > p { margin: 0 0 13px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.ticket-classification-steps { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ticket-classification-step { min-width: 0; display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: start; gap: 9px; }
.ticket-classification-number { width: 28px; height: 28px; margin-top: 1px; display: grid; place-items: center; color: #fff; border-radius: 50%; background: var(--brand-blue); font-size: 12px; font-weight: 900; }
.ticket-classification-step .field { min-width: 0; }
.field input[type="color"] { min-height: 39px; padding: 4px 6px; cursor: pointer; }
.sla-duration-control { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) 104px; align-items: stretch; }
.sla-duration-control input[name="sla_value"] { min-width: 0; border-radius: 8px 0 0 8px; }
.sla-duration-control select { min-width: 0; padding-left: 11px; padding-right: 28px; color: var(--ink); border-left: 0; border-radius: 0 8px 8px 0; background-color: #f7f9fb; font-weight: 700; }
.permission-fieldset { min-width: 0; margin: 0; padding: 13px; border: 1px solid var(--line-strong); border-radius: 10px; }
.permission-fieldset legend { padding: 0 5px; color: #4f5d72; font-size: 10px; font-weight: 800; }
.permission-fieldset > p { margin: 0 0 10px; color: var(--subtle); font-size: 8px; line-height: 1.5; }
.permission-fieldset.is-automatic { background: #f7f9fb; }
.permission-checks { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
.permission-check { min-width: 0; padding: 8px 9px; display: flex; align-items: flex-start; gap: 7px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.permission-check input { width: 15px; height: 15px; margin: 1px 0 0; accent-color: var(--blue); }
.permission-check span { min-width: 0; color: #4f5d72; font-size: 8px; font-weight: 700; line-height: 1.4; }
.permission-check:has(input:checked) { border-color: #b9c9f6; background: var(--blue-soft); }
.access-switch { min-height: 52px; padding: 10px 12px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 10px; background: #fafbfc; }
.access-switch input { width: 18px; height: 18px; flex: 0 0 auto; accent-color: var(--blue); }
.access-switch > span { display: flex; flex-direction: column; }
.access-switch b { font-size: 9px; }
.access-switch small { margin-top: 3px; color: var(--subtle); font-size: 8px; }
.journal-toolbar { margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
.global-search--journal { width: auto; flex: 1; }
.access-journal-list { min-height: 220px; display: grid; gap: 8px; }
.journal-entry { padding: 12px 13px; display: grid; grid-template-columns: 34px minmax(0,1fr) auto; align-items: flex-start; gap: 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.journal-entry-icon { width: 34px; height: 34px; display: grid; place-items: center; color: var(--blue); border-radius: 9px; background: var(--blue-soft); font-size: 14px; font-weight: 800; }
.journal-entry-main { min-width: 0; }
.journal-entry-main b { display: block; font-size: 10px; }
.journal-entry-main p { margin: 4px 0 0; color: var(--muted); font-size: 8px; line-height: 1.5; overflow-wrap: anywhere; }
.journal-entry-main small { display: block; margin-top: 5px; color: var(--subtle); font-size: 7px; }
.journal-entry time { color: var(--subtle); font-size: 7px; white-space: nowrap; }
.handoff-intro { margin: 0 0 17px; color: var(--muted); font-size: 10px; line-height: 1.6; }
.demo-warning { margin-top: 16px; padding: 11px 12px; display: flex; align-items: flex-start; gap: 9px; color: #6b541f; border: 1px solid #eedba9; border-radius: 9px; background: #fff9ea; }
.demo-warning > span { width: 20px; height: 20px; flex: 0 0 auto; display: grid; place-items: center; color: #fff; border-radius: 50%; background: #c78b20; font-size: 8px; font-weight: 800; }
.demo-warning p { margin: 1px 0 0; font-size: 8px; line-height: 1.55; }
.attachment-drop { position: relative; min-height: 72px; margin-top: 16px; padding: 13px; display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); border: 1px dashed #c8d0dc; border-radius: 10px; background: #fafbfc; text-align: left; }
.attachment-drop > span { color: var(--blue); font-size: 22px; }
.attachment-drop div { display: flex; flex-direction: column; }
.attachment-drop b { color: var(--ink); font-size: 9px; }
.attachment-drop small { margin-top: 4px; font-size: 7px; }
.attachment-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.attachment-drop--disabled { border-style: solid; cursor: not-allowed; }
.attachment-drop--disabled > span { color: var(--muted); }
.modal-footer { padding: 13px 23px; display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line); background: #fafbfc; }
.toast-region { position: fixed; z-index: 100; right: 22px; bottom: 22px; display: grid; gap: 8px; }
.toast { min-width: 260px; max-width: 380px; padding: 12px 14px; display: flex; align-items: center; gap: 10px; color: #fff; border-radius: 10px; background: var(--navy-900); box-shadow: var(--shadow-md); font-size: 9px; animation: toast-in .2s ease; }
.toast::before { content: '✓'; width: 21px; height: 21px; display: grid; place-items: center; color: #fff; border-radius: 50%; background: var(--mint); font-size: 8px; }
.toast.is-error::before { content: '!'; background: var(--red); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.skeleton { position: relative; overflow: hidden; background: #eef1f4; }
.skeleton::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent, rgba(255,255,255,.7), transparent); transform: translateX(-100%); animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }

/* Bidzaar brand layer */
::selection { color: #111; background: rgba(255, 0, 103, .26); }
body { background: #f7f7f7; }
.brand-wordmark { width: 90px; height: 21px; }
.brand--light { color: var(--ink); }
.brand--light small { color: var(--muted); }
.brand--light .brand-product { border-color: var(--line-strong); }
.btn--primary { background: var(--brand-pink-dark); box-shadow: 0 7px 18px rgba(217, 0, 88, .2); }
.btn--primary:hover { background: #b9004b; box-shadow: 0 10px 24px rgba(185, 0, 75, .25); }
.badge { border-radius: 999px; }
.badge--new { color: var(--brand-blue-dark); background: var(--brand-blue-soft); }
.badge--progress { color: #a40043; background: var(--brand-pink-soft); }
.badge--external { color: var(--brand-blue-dark); background: var(--brand-blue-soft); }
.badge--channel, .badge--neutral { color: #55555d; background: #f0f0f0; }
.priority--p3::before { background: var(--brand-blue); }
.field > span:first-child { color: #4e4e55; }
.field input, .field select, .field textarea { border-radius: 10px; background: #fff; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(22, 73, 218, .11);
}
.field input[type="checkbox"], .field input[type="radio"] { accent-color: var(--brand-pink-dark); }

/* Login — one expressive brand surface, calm form */
.login-screen { background: #fff; }
.login-brand {
  isolation: isolate;
  color: var(--ink);
  background:
    radial-gradient(circle at 16% 78%, rgba(22, 73, 218, .08) 0 2px, transparent 3px) 0 0 / 24px 24px,
    #f5f5f5;
}
.login-brand::before {
  z-index: -1;
  width: 640px;
  height: 610px;
  right: -235px;
  bottom: -295px;
  top: auto;
  border: 0;
  border-radius: 154px 72px 142px 42px;
  background: var(--brand-pink);
  box-shadow: none;
  transform: rotate(-8deg);
}
.login-brand::after {
  z-index: -1;
  left: auto;
  right: 10%;
  top: 9%;
  width: 122px;
  height: 62px;
  border-radius: 36px 16px 34px 14px;
  background: var(--brand-blue);
  transform: rotate(6deg);
}
.login-brand .brand-wordmark { width: 120px; height: 28px; }
.login-pitch { max-width: 600px; padding-bottom: 190px; }
.login-pitch h1 { color: #111; font-weight: 700; letter-spacing: -.045em; }
.login-pitch > p:not(.eyebrow) { color: #4e4e55; }
.login-features { gap: 9px; }
.login-features span {
  padding: 9px 12px;
  color: #111;
  border: 1px solid #dedede;
  border-radius: 999px;
  background: rgba(255, 255, 255, .85);
  box-shadow: 0 5px 16px rgba(17, 17, 17, .04);
}
.login-features b { color: var(--brand-pink-dark); }
.login-orbit { right: 6%; bottom: 7%; width: min(440px, 60%); }
.orbit-card {
  color: #111;
  border-color: #e0e0e0;
  border-radius: 16px 9px 16px 9px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 16px 38px rgba(17, 17, 17, .14);
  backdrop-filter: blur(10px);
}
.orbit-card small { color: #6d6d74; }
.orbit-card--two { color: #fff; border: 0; background: var(--brand-blue); }
.orbit-card--two small { color: rgba(255, 255, 255, .72); }
.login-footnote { color: #6e6e75; }
.login-panel { border-left: 1px solid var(--line); }
.login-card h2 { font-size: 32px; font-weight: 700; }
.demo-role { border-radius: 14px; }
.demo-role:hover { border-color: #c7c7c7; background: #f7f7f7; }
.demo-role.is-selected {
  border-color: var(--brand-blue);
  background: var(--brand-blue-soft);
  box-shadow: 0 0 0 2px rgba(22, 73, 218, .06);
}
.demo-role i { background: var(--brand-blue); }
.password-wrap button { color: var(--brand-blue); }
.login-note span { color: var(--brand-pink); }

/* Shell */
.sidebar {
  color: #fff;
  border-right: 0;
  background: #111;
  box-shadow: inset -1px 0 rgba(255, 255, 255, .04);
}
.sidebar-top { padding-inline: 4px; }
.sidebar .brand { width: 100%; min-width: 0; color: #fff; gap: 9px; }
.sidebar .brand-product { min-width: 0; flex: 1 1 auto; border-color: #3b3b3f; }
.sidebar .brand small { color: #acacac; font-size: 6px; white-space: normal; }
.sidebar .brand small span { display: block; white-space: nowrap; }
.sidebar .icon-btn { color: #fff; border-color: #3b3b3f; background: #1a1a1a; }
.main-nav p { color: #74747b; }
.main-nav button { color: #c7c7c7; border-radius: 12px; }
.main-nav button:hover { color: #fff; background: #1f1f22; }
.main-nav button.is-active { color: #111; background: var(--brand-pink); }
.main-nav button.is-active .nav-icon { color: #111; }
.main-nav em { color: #d0d0d0; background: #2a2a2d; }
.main-nav button.is-active em { color: #fff; background: #111; }
.system-health { border: 1px solid #2d2d30; background: #1a1a1d; }
.system-health b, .user-menu b { color: #fff; }
.system-health small, .user-menu small { color: #8f8f96; }
.user-menu { border-top-color: #313136; }
.logout-button { color: #8f8f96; }
.logout-button:hover { color: #ff75ac; }
.workspace { background: #f7f7f7; }
.topbar { background: rgba(255, 255, 255, .96); border-bottom-color: #e7e7e7; }
.crumbs span { color: var(--brand-pink-dark); font-weight: 700; }
.global-search { border-color: #e0e0e0; border-radius: 999px; background: #f5f5f5; }
.global-search:focus-within {
  color: var(--brand-blue);
  border-color: rgba(22, 73, 218, .6);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(22, 73, 218, .08);
}
.global-search kbd { border-color: #dedede; border-radius: 999px; }
.view-container { background: #f7f7f7; }
.page-heading h1 { color: #111; font-size: 26px; font-weight: 700; letter-spacing: -.03em; }

/* Dashboard */
.overview-hero {
  min-height: 196px;
  border: 0;
  border-radius: 28px 18px 28px 18px;
  background: #111;
  box-shadow: none;
}
.overview-hero::before {
  right: -80px;
  top: -190px;
  width: 390px;
  height: 390px;
  border: 0;
  border-radius: 50%;
  background: var(--brand-blue);
  box-shadow: 0 0 0 58px rgba(22, 73, 218, .08);
  opacity: .36;
}
.overview-hero::after {
  content: '';
  position: absolute;
  left: 43%;
  bottom: -42px;
  width: 122px;
  height: 78px;
  border-radius: 44px 20px 42px 14px;
  background: var(--brand-pink);
  transform: rotate(-7deg);
}
.overview-hero h1 { font-size: 29px; }
.overview-hero p { color: rgba(255, 255, 255, .68); }
.hero-kpis {
  padding: 17px 10px;
  color: #111;
  border-radius: 28px 14px 28px 12px;
  background: var(--brand-pink);
  box-shadow: 0 18px 42px rgba(255, 0, 103, .18);
}
.hero-kpi { border-left-color: rgba(17, 17, 17, .18); }
.hero-kpi span { color: rgba(17, 17, 17, .68); font-weight: 700; }
.metric-card, .panel {
  border-color: #e0e0e0;
  border-radius: 16px;
  box-shadow: none;
}
.metric-card { transition: border-color .16s ease, transform .16s ease; }
.metric-card:hover { border-color: #c7c7c7; transform: translateY(-1px); }
.metric-icon { color: var(--brand-pink-dark); border-radius: 10px; background: var(--brand-pink-soft); }
.panel-header button { color: var(--brand-blue); }
.attention-item:hover { background: #f7f7f7; }
.activity-item::before { background: var(--brand-pink); box-shadow: 0 0 0 4px var(--brand-pink-soft); }

/* Queue and ticket */
.summary-pill { border-color: #e0e0e0; border-radius: 999px; }
.queue-toolbar { border-color: #e0e0e0; border-radius: 16px; box-shadow: none; }
.filter-tab { border-radius: 999px; }
.filter-tab.is-active { color: #fff; background: var(--brand-blue); }
.select-control { border-color: #dedede; border-radius: 999px; background-color: #fff; }
.queue-layout { border-color: #dedede; border-radius: 16px; box-shadow: none; }
.ticket-card:hover { background: #f7f7f7; }
.ticket-card.is-active { background: var(--brand-pink-soft); }
.ticket-card.is-active::before { width: 4px; background: var(--brand-pink); }
.ticket-id { color: var(--brand-blue); }
.ticket-detail-actions .btn--handoff { color: var(--brand-blue-dark); background: var(--brand-blue-soft); }
.thread { background: #f7f7f7; }
.message-bubble { border-color: #e0e0e0; border-radius: 4px 14px 14px 14px; }
.message--agent .message-bubble { border-color: #cfdbff; background: var(--brand-blue-soft); }
.composer-tab { border-radius: 999px; }
.composer-tab.is-active { color: var(--brand-blue); background: var(--brand-blue-soft); }
.composer-box { border-radius: 12px; }
.composer-box:focus-within { border-color: var(--brand-blue); box-shadow: 0 0 0 3px rgba(22, 73, 218, .08); }
.composer-tools label:hover, .composer-tools button:hover { color: var(--brand-blue); background: var(--brand-blue-soft); }
.file-chip::before { color: var(--brand-blue); }
.sla-panel { border-radius: 12px; background: #f5f5f5; }
.sla-panel.is-paused { background: var(--brand-blue-soft); }
.sla-panel.is-paused .sla-track i { background: var(--brand-blue); }
.external-handoff-card { border-color: #cfdbff; border-radius: 12px; background: var(--brand-blue-soft); }
.external-handoff-icon, .external-handoff-state { color: var(--brand-blue-dark); background: #dce5ff; }

/* Analytics, catalog and team */
.chart-legend span:nth-child(2) i, .volume-day i:nth-child(2) { background: var(--brand-blue); }
.donut { background: conic-gradient(var(--brand-pink) 0 34%, var(--brand-blue) 34% 57%, #111 57% 75%, var(--amber) 75% 89%, #acacac 89%); }
.category-legend div:nth-child(2) i { background: var(--brand-blue); }
.category-legend div:nth-child(3) i { background: #111; }
.catalog-adminbar { border-color: #cbd7ff; background: var(--brand-blue-soft); }
.catalog-layout .panel-header .btn { border-radius: 999px; }
.catalog-layout .panel-header .btn--primary { border-color: var(--brand-pink-dark); background: var(--brand-pink-dark); }
.catalog-category-row { border-radius: 12px; }
.catalog-category-row.is-active, .catalog-category.is-active { color: var(--brand-blue); background: var(--brand-blue-soft); }
.catalog-category { border-radius: 12px; }
.catalog-category:hover { background: #f5f5f5; }
.catalog-inline-action, .service-card-edit, .service-card-delete { border-radius: 10px; }
.catalog-inline-action:hover, .service-card-edit:hover { color: var(--brand-pink-dark); border-color: #ffb5d3; }
.catalog-add-category { color: var(--brand-pink-dark); border-color: #ff9fc5; border-radius: 12px; background: var(--brand-pink-soft); }
.service-card { border-color: #e0e0e0; border-radius: 16px; }
.service-card:hover { border-color: #c7c7c7; box-shadow: 0 12px 28px rgba(17, 17, 17, .08); }
.service-icon { color: var(--brand-pink-dark); border-radius: 12px; background: var(--brand-pink-soft); }
.service-card footer b { color: var(--brand-blue); }
.team-card { transition: border-color .16s ease, transform .16s ease; }
.team-card:hover { border-color: #c7c7c7; transform: translateY(-1px); }
.permission-chips span { border-radius: 999px; background: #f0f0f0; }

/* Dialogs and system feedback */
.modal { border: 1px solid rgba(255, 255, 255, .22); border-radius: 24px; box-shadow: 0 30px 90px rgba(17, 17, 17, .28); }
.modal::backdrop { background: rgba(17, 17, 17, .62); }
.modal-header { border-bottom-color: #e5e5e5; }
.modal-header h2 { font-size: 22px; }
.modal-footer { border-top-color: #e5e5e5; background: #f7f7f7; }
.permission-fieldset { border-radius: 14px; }
.permission-fieldset.is-automatic { background: #f7f7f7; }
.permission-check { border-radius: 12px; }
.permission-check input { accent-color: var(--brand-pink-dark); }
.permission-check:has(input:checked) { border-color: #bdcbff; background: var(--brand-blue-soft); }
.access-switch { border-radius: 14px; background: #f7f7f7; }
.access-switch input { accent-color: var(--brand-pink-dark); }
.journal-entry { border-radius: 14px; }
.journal-entry-icon { color: var(--brand-blue); border-radius: 11px; background: var(--brand-blue-soft); }
.attachment-drop { border-radius: 14px; background: #f7f7f7; }
.attachment-drop > span { color: var(--brand-blue); }
.toast { border-radius: 14px; background: #111; }
.toast::before { color: #111; background: var(--brand-pink); }

/* Comfortable density: readable at 100% browser zoom */
body { font-size: 14px; line-height: 1.45; }
.eyebrow { font-size: 12px; line-height: 1.35; }
.brand small { font-size: 10px; line-height: 1.35; }
.sidebar .brand small { font-size: 9px; }
.btn { min-height: 42px; font-size: 14px; }
.btn--large { min-height: 52px; font-size: 15px; }
.badge { min-height: 27px; padding-inline: 9px; font-size: 12px; }
.priority { font-size: 12px; }
.empty-state h3 { font-size: 18px; }
.empty-state p { font-size: 13px; }

/* Login and forms */
.login-features span, .orbit-card b { font-size: 13px; line-height: 1.4; }
.login-features b, .orbit-card small, .login-footnote, .demo-role small, .login-note {
  font-size: 11px;
  line-height: 1.4;
}
.demo-role { min-height: 76px; padding: 11px 12px; }
.demo-role b { font-size: 13px; line-height: 1.35; }
.field > span:first-child { font-size: 12px; line-height: 1.4; }
.field input, .field select, .field textarea { min-height: 46px; font-size: 14px; line-height: 1.5; }
.field textarea { padding-block: 12px; }
.field > small { font-size: 11px; line-height: 1.45; }
.password-wrap button, .form-error { font-size: 12px; line-height: 1.4; }

/* Sidebar and top bar */
.main-nav p { font-size: 11px; line-height: 1.4; }
.main-nav button { min-height: 46px; font-size: 14px; line-height: 1.35; }
.main-nav em { min-width: 24px; height: 22px; font-size: 11px; }
.system-health b, .user-menu b { font-size: 12px; line-height: 1.35; }
.system-health small, .user-menu small, .logout-button { font-size: 11px; line-height: 1.4; }
.crumbs, .global-search input { font-size: 12px; line-height: 1.4; }
.global-search { height: 42px; }
.global-search kbd { font-size: 10px; }
.page-heading p:not(.eyebrow) { font-size: 12px; line-height: 1.5; }

/* Dashboard */
.overview-hero p { font-size: 13px; line-height: 1.6; }
.hero-kpi span { font-size: 11px; line-height: 1.4; }
.metric-card-head span:first-child { font-size: 12px; line-height: 1.4; }
.metric-value small, .metric-card > small { font-size: 11px; line-height: 1.4; }
.panel-header { min-height: 66px; }
.panel-header h2 { font-size: 16px; line-height: 1.3; }
.panel-header p { font-size: 12px; line-height: 1.45; }
.panel-header button { font-size: 12px; line-height: 1.35; }
.attention-item { min-height: 88px; }
.attention-main strong { font-size: 13px; line-height: 1.4; }
.attention-main small, .sla-mini span, .assignee-mini span { font-size: 11px; line-height: 1.4; }
.assignee-mini .avatar { font-size: 10px; }
.office-row span, .office-row strong { font-size: 12px; line-height: 1.4; }
.activity-item p { font-size: 12px; line-height: 1.5; }
.activity-item small { font-size: 11px; line-height: 1.4; }

/* Queue and conversation */
.summary-pill { min-height: 42px; padding-inline: 14px; font-size: 12px; }
.summary-pill b { font-size: 16px; }
.queue-toolbar { padding: 11px; }
.filter-tab { min-height: 40px; padding-inline: 15px; font-size: 12px; }
.select-control { height: 40px; padding-inline: 12px 31px; font-size: 12px; }
.queue-layout { height: calc(100dvh - 280px); min-height: 520px; }
.ticket-list-head { min-height: 56px; padding-inline: 18px; }
.ticket-list-head span { font-size: 12px; }
.ticket-card { min-height: 142px; padding: 17px 18px; gap: 9px; }
.ticket-id { font-size: 12px; }
.ticket-time { font-size: 11px; }
.ticket-card h3 { font-size: 14px; line-height: 1.4; }
.ticket-card p { margin-top: -2px; font-size: 11px; line-height: 1.4; }
.ticket-card-foot .avatar { width: 27px; height: 27px; font-size: 10px; }
.ticket-card-foot small, .sla-chip { font-size: 11px; line-height: 1.35; }
.sla-chip::before { font-size: 13px; }
.ticket-detail-head { padding: 20px 23px 18px; }
.ticket-detail-actions .btn { min-height: 38px; padding-inline: 13px; font-size: 12px; }
.ticket-detail h2 { margin-block: 12px 9px; font-size: 22px; }
.requester-line { font-size: 11px; line-height: 1.4; }
.requester-line .avatar { width: 27px; height: 27px; font-size: 10px; }
.ticket-detail-body { grid-template-columns: minmax(0, 1fr) 300px; }
.thread { padding: 21px 23px; }
.thread-date { font-size: 11px; line-height: 1.4; }
.message { grid-template-columns: 34px minmax(0, 1fr); gap: 11px; }
.message .avatar { width: 34px; height: 34px; font-size: 10px; }
.message-meta b { font-size: 12px; line-height: 1.35; }
.message-meta span { font-size: 11px; line-height: 1.35; }
.message-bubble { padding: 12px 14px; font-size: 13px; line-height: 1.6; }
.message--internal .message-meta::after { padding: 3px 7px; font-size: 11px; }
.file-chip { font-size: 11px; line-height: 1.4; }
.event-line { font-size: 11px; line-height: 1.45; }
.event-line::before { width: 21px; height: 21px; font-size: 10px; }
.composer { padding: 14px 18px 16px; }
.composer-tab { padding: 7px 10px; font-size: 11px; }
.composer-box textarea { min-height: 82px; padding: 12px 13px 7px; font-size: 13px; line-height: 1.55; }
.composer-attachment-unavailable { min-height: 36px; padding-inline: 9px; font-size: 11px; }
.composer-attachment-picker { width: 36px !important; height: 36px !important; min-height: 36px; padding: 0 !important; flex: 0 0 36px; font-size: 11px; }
.composer-file b, .composer-files-clear { font-size: 11px; }
.composer-file small { font-size: 10px; }
.composer-actions .btn { min-height: 36px; padding-inline: 13px; font-size: 11px; }
.ticket-sidebar { padding: 20px 18px; }
.ticket-sidebar h3 { font-size: 11px; line-height: 1.4; }
.property { margin-bottom: 14px; }
.property > span { font-size: 11px; line-height: 1.35; }
.property > b, .property > div { font-size: 12px; line-height: 1.4; }
.property select { min-height: 39px; font-size: 12px; }
.person-property .avatar { width: 30px; height: 30px; font-size: 10px; }
.person-property b { font-size: 11px; line-height: 1.35; }
.person-property small { font-size: 11px; line-height: 1.35; }
.sla-panel { padding: 13px; }
.sla-panel-top span, .sla-panel small { font-size: 11px; line-height: 1.4; }
.sla-panel-top b { font-size: 11px; line-height: 1.35; }
.external-handoff-top b { font-size: 11px; line-height: 1.35; }
.external-handoff-top small, .external-handoff-state, .external-handoff-card footer {
  font-size: 11px;
  line-height: 1.4;
}
.external-handoff-card p { font-size: 11px; line-height: 1.5; }
.watchers .avatar { width: 29px; height: 29px; font-size: 10px; }
.watchers button { width: 29px; height: 29px; }

/* Analytics */
.chart-legend span, .category-legend div { font-size: 12px; line-height: 1.4; }
.chart-labels, .donut span { font-size: 11px; line-height: 1.35; }
.agent-table th { font-size: 11px; line-height: 1.4; }
.agent-table td { font-size: 12px; line-height: 1.45; }
.agent-table th, .agent-table td { padding: 12px 9px; }

/* Catalog and team */
.catalog-adminbar b { font-size: 13px; line-height: 1.35; }
.catalog-adminbar span { font-size: 12px; line-height: 1.5; }
.catalog-category { min-height: 60px; }
.catalog-category b { font-size: 13px; line-height: 1.35; }
.catalog-category small { font-size: 11px; line-height: 1.4; }
.catalog-category em { font-size: 12px; }
.catalog-add-category { min-height: 46px; font-size: 12px; }
.service-card { min-height: 172px; }
.service-card h3 { font-size: 15px; line-height: 1.35; }
.service-card p { font-size: 12px; line-height: 1.55; }
.service-card footer { font-size: 11px; line-height: 1.4; }
.service-card footer b { font-size: 12px; }
.catalog-empty p { font-size: 12px; line-height: 1.5; }
.catalog-instruction-preview { margin: 10px 16px 4px; padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid #d8e1ff; border-radius: 12px; background: var(--brand-blue-soft); }
.catalog-instruction-preview > b { flex: 0 0 auto; font-size: 12px; line-height: 1.4; }
.catalog-instruction-preview > div { min-width: 0; display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 7px; }
.catalog-instruction-preview a { max-width: 320px; padding: 6px 9px; color: var(--brand-blue-dark); border: 1px solid #c5d2fb; border-radius: 999px; background: #fff; font-size: 11px; font-weight: 800; line-height: 1.35; overflow-wrap: anywhere; }
.catalog-instruction-preview a:hover { border-color: var(--brand-blue); text-decoration: underline; }
.catalog-instruction-preview.is-empty span { color: var(--muted); font-size: 11px; line-height: 1.4; }
.team-result-count { font-size: 11px; line-height: 1.4; }
.team-card .person-property b { font-size: 14px; line-height: 1.35; }
.team-card .person-property small { font-size: 11px; line-height: 1.4; }
.team-card > p { min-height: 46px; font-size: 12px; line-height: 1.55; }
.permission-chips span, .team-card footer, .team-action-note { font-size: 11px; line-height: 1.4; }

/* Dialogs, permissions and feedback */
.modal { width: min(740px, calc(100vw - 32px)); }
.modal--compact { width: min(640px, calc(100vw - 32px)); }
.input-with-suffix em { font-size: 11px; }
.permission-fieldset legend { font-size: 13px; line-height: 1.35; }
.permission-fieldset > p { font-size: 11px; line-height: 1.5; }
.permission-check span { font-size: 12px; line-height: 1.45; }
.access-switch b { font-size: 12px; line-height: 1.35; }
.access-switch small { font-size: 11px; line-height: 1.4; }
.category-instructions { min-width: 0; margin: 0; padding: 14px; border: 1px solid var(--line-strong); border-radius: 14px; background: #f7f7f7; }
.category-instructions legend { padding: 0 6px; color: var(--ink); font-size: 13px; font-weight: 800; line-height: 1.35; }
.category-instructions > p { margin: 0 0 12px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.category-instruction-rows { display: grid; gap: 9px; }
.category-instruction-row { min-width: 0; padding: 10px; display: grid; grid-template-columns: minmax(150px, .75fr) minmax(240px, 1.25fr) 38px; align-items: end; gap: 9px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.category-instruction-row .field { min-width: 0; }
.category-instruction-row input { width: 100%; min-width: 0; }
.category-instruction-remove { width: 38px; height: 39px; display: grid; place-items: center; color: var(--red); border: 1px solid #f1c7cd; border-radius: 10px; background: var(--red-soft); font-size: 18px; font-weight: 700; }
.category-instruction-remove:hover { color: #fff; border-color: var(--red); background: var(--red); }
.category-instructions-actions { margin-top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.category-instructions-actions .btn { min-height: 38px; }
.category-instructions-actions [role="status"] { color: var(--subtle); font-size: 11px; font-weight: 700; line-height: 1.4; }
.journal-entry-main b { font-size: 13px; line-height: 1.35; }
.journal-entry-main p { font-size: 12px; line-height: 1.5; }
.journal-entry-main small, .journal-entry time { font-size: 11px; line-height: 1.4; }
.handoff-intro, .demo-warning p { font-size: 12px; line-height: 1.55; }
.attachment-drop b, .toast { font-size: 12px; line-height: 1.45; }
.attachment-drop small { font-size: 11px; line-height: 1.4; }

/* Business-owner routing */
.field-label-row { min-height: 22px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.field-label-row label { color: #4e4e55; font-size: 12px; font-weight: 800; line-height: 1.4; }
.field-link-button { padding: 2px 0; border: 0; color: var(--brand-blue); background: transparent; font-size: 11px; font-weight: 800; line-height: 1.4; }
.field-link-button:hover { color: var(--brand-pink); text-decoration: underline; text-underline-offset: 3px; }
.field--readonly input { color: #55555d; border-color: #dedede; background: #f5f5f5; cursor: default; }
.field--readonly input:focus { border-color: #dedede; box-shadow: none; }
.modal.modal--owner-directory { width: min(1040px, calc(100vw - 32px)); }
.owner-directory-body { padding-top: 18px; }
.owner-directory-layout { min-height: 460px; display: grid; grid-template-columns: minmax(280px, .82fr) minmax(390px, 1.18fr); gap: 14px; }
.owner-directory-section { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.owner-directory-editor { background: #fafafa; }
.owner-directory-section-head { min-height: 40px; margin-bottom: 14px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.owner-directory-section-head h3 { margin: 0; font-size: 15px; line-height: 1.35; letter-spacing: -.015em; }
.owner-directory-section-head p { margin: 4px 0 0; color: var(--subtle); font-size: 11px; line-height: 1.4; }
.owner-directory-section-head .btn { min-height: 34px; padding-inline: 12px; flex: 0 0 auto; font-size: 11px; }
.owner-directory-list { max-height: 518px; padding-right: 3px; display: grid; align-content: start; gap: 8px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #cfcfd3 transparent; }
.owner-directory-empty { min-height: 190px; padding: 24px; display: grid; place-items: center; color: var(--subtle); border: 1px dashed var(--line-strong); border-radius: 13px; background: #fafafa; font-size: 12px; line-height: 1.5; text-align: center; }
.owner-directory-card { width: 100%; padding: 12px 13px; display: grid; gap: 9px; color: var(--ink); border: 1px solid var(--line); border-radius: 13px; background: #fff; text-align: left; transition: border-color .15s ease, box-shadow .15s ease, opacity .15s ease; }
.owner-directory-card:hover { border-color: #c7c7c7; box-shadow: var(--shadow-sm); }
.owner-directory-card.is-selected { border-color: #bdcbff; box-shadow: 0 0 0 3px rgba(22, 73, 218, .07); }
.owner-directory-card.is-inactive { opacity: .63; }
.owner-directory-card-head, .owner-directory-card-main, .owner-directory-card-footer { min-width: 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.owner-directory-card-title { min-width: 0; display: flex; flex-direction: column; }
.owner-directory-card-title b, .owner-directory-card-main b { font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; }
.owner-directory-card-title small, .owner-directory-card-main small, .owner-directory-card-meta { margin-top: 3px; color: var(--subtle); font-size: 11px; line-height: 1.45; overflow-wrap: anywhere; }
.owner-directory-card-meta { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 10px; }
.owner-directory-card-meta span { min-width: 0; overflow-wrap: anywhere; }
.owner-directory-card-status { min-height: 22px; padding: 3px 7px; display: inline-flex; align-items: center; flex: 0 0 auto; color: #19775f; border-radius: 999px; background: var(--mint-soft); font-size: 10px; font-weight: 800; white-space: nowrap; }
.owner-directory-card.is-inactive .owner-directory-card-status { color: #66666e; background: #eeeeef; }
.owner-directory-card-actions { display: flex; align-items: center; gap: 6px; }
.owner-directory-card-actions button, .owner-directory-edit { min-height: 30px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--ink); background: #fff; font-size: 10px; font-weight: 800; }
.owner-directory-card-actions button:hover, .owner-directory-edit:hover { color: var(--brand-pink); border-color: var(--brand-pink); }
.owner-directory-card-actions button.is-danger { color: #a3213c; border-color: #f0c4ce; background: #fff7f9; }
.owner-directory-card-actions button.is-danger:hover { color: #fff; border-color: #b42342; background: #b42342; }
.owner-directory-form { max-height: none !important; display: block !important; }
.owner-directory-form .form-grid { gap: 12px; }
.owner-directory-form textarea { min-height: 84px; }
.owner-directory-form-actions { margin-top: 15px; padding-top: 14px; display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line); }

/* Analytics controls */
.analytics-heading { align-items: flex-start; }
.analytics-heading > div:first-child { min-width: 260px; }
.analytics-toolbar { max-width: 760px; justify-content: flex-end; flex-wrap: wrap; }
.analytics-period-field { display: grid; gap: 4px; }
.analytics-period-field > span,
.analytics-custom-range label > span {
  color: var(--subtle);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
}
.analytics-period-field .select-control { min-width: 190px; height: 42px; font-size: 12px; }
.analytics-custom-range { display: flex; align-items: flex-end; gap: 7px; }
.analytics-custom-range label { display: grid; gap: 4px; }
.analytics-custom-range input {
  min-height: 42px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  font-size: 12px;
}
.analytics-custom-range > span { padding-bottom: 11px; color: var(--subtle); }
.analytics-loading, .analytics-error { min-height: 280px; }
.analytics-loading .empty-state, .analytics-error .empty-state { min-height: 278px; }
.analytics-error .empty-state > span { color: var(--red); background: #fff0f2; }
.chart-labels span { min-width: 0; flex: 1; overflow: hidden; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.chart-labels span:empty { display: none; }

/* Ticket status actions and answer templates */
.quick-replies { position: relative; }
.composer-box { overflow: visible; }
.composer-box textarea { border-radius: 11px 11px 0 0; }
.composer-actions { border-radius: 0 0 11px 11px; }
.quick-replies-menu {
  position: absolute;
  z-index: 35;
  padding: 7px;
  display: grid;
  gap: 3px;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(17, 17, 17, .16);
}
.quick-replies-menu[hidden] { display: none; }
.composer-tools .quick-replies-toggle {
  width: auto;
  min-width: 146px;
  height: 34px;
  padding: 0 10px;
  display: flex;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 11px;
  font-weight: 800;
}
.quick-replies-menu {
  position: fixed;
  left: 0;
  bottom: auto;
  width: min(370px, calc(100vw - 48px));
  max-height: min(560px, calc(100dvh - 120px));
  padding: 0;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0;
  overflow: hidden;
}
.quick-replies-menu-head { min-height: 56px; padding: 9px 10px 11px 13px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--line); }
.quick-replies-menu-head strong { min-width: 0; color: var(--subtle); font-size: 10px; line-height: 1.3; letter-spacing: .08em; text-transform: uppercase; }
.quick-replies-menu-head-actions { min-width: 0; display: flex; align-items: center; flex: 0 0 auto; gap: 7px; }
.composer-tools .quick-replies-menu-head .quick-reply-new {
  width: auto;
  height: 30px;
  min-height: 30px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  color: var(--brand-blue-dark);
  border: 1px solid #cfdbff;
  border-radius: 8px;
  background: var(--brand-blue-soft);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}
.quick-replies-archived {
  min-height: 30px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}
.composer-tools .quick-replies-menu .quick-replies-archived { width: auto; height: 30px; justify-content: flex-start; border-radius: 7px; }
.composer-tools .quick-replies-menu .quick-replies-archived:hover { color: var(--ink); background: #f5f5f5; }
.composer-tools .quick-replies-menu input[type="checkbox"] { width: 15px; height: 15px; display: block; flex: 0 0 auto; accent-color: var(--brand-blue); }
.quick-replies-list { min-height: 0; padding: 7px; display: grid; align-content: start; gap: 10px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.quick-reply-section { min-width: 0; display: grid; gap: 3px; }
.quick-reply-section h4 { margin: 2px 7px 3px; display: flex; align-items: center; justify-content: space-between; color: var(--subtle); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; }
.quick-reply-section h4 span { min-width: 20px; text-align: right; }
.quick-reply-row { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: stretch; border-radius: 9px; }
.quick-reply-row:focus-within { box-shadow: 0 0 0 2px rgba(22, 73, 218, .14); }
.composer-tools .quick-reply-use {
  width: 100%;
  height: auto;
  min-height: 52px;
  padding: 8px 9px;
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 3px;
  border-radius: 8px;
  text-align: left;
}
.quick-reply-use b { max-width: 100%; color: var(--ink); font-size: 12px; line-height: 1.35; overflow-wrap: anywhere; }
.quick-reply-use small { max-width: 100%; color: var(--subtle); font-size: 11px; line-height: 1.4; display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow-wrap: anywhere; }
.composer-tools .quick-reply-use:hover b { color: var(--brand-blue); }
.composer-tools .quick-reply-use:disabled { cursor: default; opacity: .62; }
.quick-reply-actions { padding: 5px 5px 5px 1px; display: flex; align-items: flex-start; gap: 2px; }
.composer-tools .quick-reply-actions button { width: 30px; height: 30px; display: grid; place-items: center; color: var(--subtle); border-radius: 7px; font-size: 14px; }
.composer-tools .quick-reply-actions button:hover { color: var(--brand-blue); background: var(--brand-blue-soft); }
.quick-reply-status { margin-top: 2px; padding: 2px 6px; color: #66666e; border-radius: 999px; background: #eeeeef; font-size: 9px; font-weight: 800; }
.quick-reply-empty, .quick-reply-loading { margin: 0; padding: 10px 9px; color: var(--subtle); border: 1px dashed var(--line-strong); border-radius: 8px; background: #fafafa; font-size: 11px; line-height: 1.45; }
.quick-reply-loading { margin-bottom: 3px; color: var(--brand-blue-dark); border-style: solid; border-color: #cfdbff; background: var(--brand-blue-soft); }
.reply-template-form-grid textarea { min-height: 170px; resize: vertical; }
.resolve-confirmation { padding: 14px; display: grid; grid-template-columns: 36px minmax(0, 1fr); align-items: center; gap: 12px; border: 1px solid #cfe7dd; border-radius: 12px; background: #f2fbf7; }
.resolve-confirmation > span { width: 36px; height: 36px; display: grid; place-items: center; color: #08775d; border-radius: 50%; background: #d9f5e9; font-size: 18px; font-weight: 900; }
.resolve-confirmation b { display: block; color: #08775d; font-size: 12px; }
.resolve-confirmation p { margin: 4px 0 0; color: var(--ink); font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
.modal--ticket-resolve .handoff-intro { margin: 14px 0 0; }
.handoff-delivery-fields { min-width: 0; display: grid; grid-template-columns: minmax(0, .72fr) minmax(0, 1.28fr); align-items: start; gap: 15px; }
.handoff-delivery-fields .field { min-width: 0; align-content: start; }
.handoff-delivery-fields input, .handoff-delivery-fields select { min-width: 0; }
.smtp-settings-card { max-width: 900px; margin-bottom: 16px; padding: 22px; }
.smtp-settings-head { margin-bottom: 20px; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.smtp-settings-head h2, .smtp-test-card h2 { margin: 0; font-size: 18px; }
.smtp-settings-head p, .smtp-test-card > div > p { margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.smtp-settings-form { display: grid; gap: 18px; }
.smtp-settings-group { min-width: 0; margin: 0; padding: 0; border: 0; }
.smtp-settings-group + .smtp-settings-group { padding-top: 4px; }
.smtp-settings-group legend { margin: 0 0 14px; padding: 0; color: var(--ink); font-size: 16px; font-weight: 900; }
.smtp-settings-group .form-grid { gap: 13px; }
.smtp-encryption-state { min-height: 46px; padding: 0 13px; display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 10px; background: #fafafa; font-size: 12px; font-weight: 700; }
.smtp-encryption-state input, .smtp-enable-control input { width: 18px; height: 18px; flex: 0 0 auto; accent-color: var(--brand-blue); }
.smtp-enabled { min-height: 64px; padding: 13px 15px; display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fafafa; }
.smtp-enabled input { width: 19px; height: 19px; flex: 0 0 auto; accent-color: var(--brand-pink-dark); }
.smtp-enabled span { display: grid; gap: 4px; }
.smtp-enabled b { font-size: 13px; }
.smtp-enabled small { color: var(--muted); font-size: 11px; }
.smtp-secret-note { padding: 14px 16px; color: #46536a; border: 1px solid #cfdbff; border-radius: 12px; background: var(--brand-blue-soft); }
.smtp-secret-note b { font-size: 12px; }
.smtp-secret-note p { margin: 6px 0 0; font-size: 11px; line-height: 1.55; }
.smtp-secret-note code { padding: 1px 4px; border-radius: 4px; background: rgba(255,255,255,.75); font-size: 10px; }
.smtp-password-input { position: relative; display: block; }
.smtp-password-input input { width: 100%; padding-right: 46px; }
.smtp-password-input button { position: absolute; top: 50%; right: 6px; width: 34px; height: 34px; transform: translateY(-50%); color: var(--muted); border: 0; border-radius: 8px; background: transparent; cursor: pointer; }
.smtp-password-input button:hover, .smtp-password-input button:focus-visible { color: var(--brand-blue); background: var(--brand-blue-soft); }
.smtp-clear-password { margin-top: 10px; display: inline-flex; align-items: center; gap: 8px; color: #8d2037; font-size: 11px; font-weight: 800; }
.smtp-clear-password input { width: 17px; height: 17px; accent-color: var(--brand-pink-dark); }
.smtp-settings-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.smtp-enable-control { min-height: 42px; display: inline-flex; align-items: center; gap: 9px; font-size: 12px; font-weight: 800; }
.smtp-test-inline { margin-top: 22px; padding-top: 18px; display: flex; align-items: end; justify-content: space-between; gap: 24px; border-top: 1px solid var(--line); }
.smtp-test-inline h3 { margin: 0; font-size: 15px; }
.smtp-test-inline p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.smtp-test-card { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.smtp-test-form { width: min(100%, 470px); display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px; }
.smtp-test-form .btn { min-height: 46px; }
.smtp-test-history { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.smtp-test-history-head { margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.smtp-test-history-head h3 { margin: 0; font-size: 15px; }
.smtp-test-history-empty { padding: 14px 16px; color: var(--muted); border: 1px dashed var(--line); border-radius: 12px; font-size: 12px; }
.smtp-test-history-list { display: grid; gap: 8px; }
.smtp-test-history-item { min-width: 0; padding: 12px 14px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 16px; border: 1px solid var(--line); border-left-width: 4px; border-radius: 12px; background: #fff; }
.smtp-test-history-item.is-success { border-left-color: #13a47a; }
.smtp-test-history-item.is-error { border-left-color: var(--danger); }
.smtp-test-history-item.is-warning { border-left-color: #d58a00; }
.smtp-test-history-item.is-progress, .smtp-test-history-item.is-pending { border-left-color: var(--brand-blue); }
.smtp-test-history-main { min-width: 0; display: grid; gap: 4px; }
.smtp-test-history-main b { overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.smtp-test-history-main span { color: var(--muted); font-size: 11px; line-height: 1.45; }
.smtp-test-history-meta { display: grid; justify-items: end; gap: 2px; white-space: nowrap; font-size: 10px; }
.smtp-test-history-meta strong { color: var(--ink); font-size: 11px; }
.smtp-test-history-meta span, .smtp-test-history-meta time { color: var(--muted); }

/* Responsive */
@media (max-width: 1400px) {
  .ticket-detail-body { grid-template-columns: minmax(0,1fr) 280px; }
}

@media (max-width: 1320px) {
  .view-container { min-width: 0; padding-inline: 20px; }
  .queue-toolbar { align-items: stretch; flex-direction: column; }
  .filter-tabs { width: 100%; overflow-x: auto; scrollbar-width: none; }
  .filter-tabs::-webkit-scrollbar { display: none; }
  .filter-tab { flex: 0 0 auto; }
  .filter-controls { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filter-controls .select-control { width: 100%; min-width: 0; }
  .queue-layout { max-width: 100%; grid-template-columns: 300px 10px minmax(0,1fr); }
  .ticket-detail-body { grid-template-columns: minmax(0,1fr) 250px; }
  .composer-tools { flex: 1 1 auto; overflow: visible; }
  .composer-actions > .btn { flex: 0 0 auto; white-space: nowrap; }
}

@media (max-width: 1180px) {
  :root { --sidebar: 218px; }
  .view-container { padding-inline: 22px; }
  .topbar { padding-inline: 22px; }
  .ticket-detail-body { grid-template-columns: minmax(0,1fr) 250px; }
  .queue-layout { grid-template-columns: 280px 10px minmax(0,1fr); }
  .dashboard-grid { grid-template-columns: minmax(0,1.35fr) minmax(260px,.65fr); }
}

@media (max-width: 980px) {
  .login-screen { grid-template-columns: 1fr; }
  .login-brand { min-height: 320px; padding: 34px 44px; }
  .login-pitch { padding: 54px 0 26px; }
  .login-pitch h1 { font-size: 42px; }
  .login-pitch > p:not(.eyebrow) { margin-block: 18px; }
  .login-orbit { display: none; }
  .login-panel { padding: 42px; }
  .mobile-only { display: inline-grid !important; }
  .app { display: block; }
  .sidebar { position: fixed; left: 0; transform: translateX(-102%); width: 260px; transition: transform .2s ease; box-shadow: 16px 0 35px rgba(18,31,54,.15); }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar-backdrop { position: fixed; z-index: 25; inset: 0; display: none; background: rgba(12,21,39,.35); }
  .sidebar-backdrop.is-open { display: block; }
  .topbar { height: 64px; }
  .crumbs { display: none; }
  .topbar-actions { margin-left: auto; }
  .global-search { width: min(46vw, 300px); }
  .overview-hero { grid-template-columns: 1fr; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-side { grid-template-columns: 1fr 1fr; }
  .queue-layout { height: auto; min-height: 720px; display: block; overflow: hidden; }
  .ticket-list-panel { height: 720px; border-right: 0; }
  .queue-resizer { display: none; }
  .ticket-detail-panel { position: fixed; z-index: 40; inset: 0; display: none; background: #fff; }
  .ticket-detail-panel.is-mobile-open { display: block; }
  .ticket-detail-body { grid-template-columns: minmax(0,1fr) 280px; }
  .conversation { border-left: 0; }
  .analytics-grid .metric-card { grid-column: span 6; }
  .chart-panel, .chart-panel--small, .chart-panel--half { grid-column: span 12; }
  .team-toolbar { grid-template-columns: 1fr 1fr; }
  .global-search--team { grid-column: 1 / -1; }
  .team-grid { grid-template-columns: repeat(2,1fr); }
  .owner-directory-layout--page { grid-template-columns: 1fr; }
  .owner-directory-layout--page .owner-directory-list { max-height: 320px; }
}

.filter-tab {
  gap: 7px;
}

.filter-tab-count {
  display: inline-grid;
  place-items: center;
  min-width: 21px;
  height: 21px;
  padding: 0 6px;
  border-radius: 999px;
  background: #edf1f7;
  color: #596273;
  font-style: normal;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.queue-data-warning {
  margin: -2px 0 10px;
  padding: 8px 12px;
  border: 1px solid #f3d58a;
  border-radius: 10px;
  background: #fff8e6;
  color: #78580d;
  font-size: 11px;
  line-height: 1.4;
}

.filter-tab.is-active .filter-tab-count {
  background: rgba(255, 255, 255, .22);
  color: inherit;
}

.composer-owner-note {
  margin: 0;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: #fff7ed;
  color: #9a3412;
  font-size: 12px;
}

.admin-cleanup-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
  padding: 18px 20px;
  border-color: #fecaca;
  background: #fff7f7;
}

.admin-cleanup-panel h2,
.admin-cleanup-panel p {
  margin: 0;
}

.admin-cleanup-panel p {
  max-width: 780px;
  margin-top: 6px;
  color: var(--muted);
}

.btn--danger {
  border-color: #dc2626;
  background: #dc2626;
  color: #fff;
}

@media (max-width: 720px) {
  .admin-cleanup-panel {
    align-items: stretch;
    flex-direction: column;
  }
  .login-brand { min-height: 285px; padding: 28px 25px; }
  .login-pitch { padding-top: 42px; }
  .login-pitch h1 { font-size: 35px; }
  .login-pitch > p:not(.eyebrow), .login-features { display: none; }
  .login-panel { padding: 32px 20px; }
  .demo-roles { grid-template-columns: 1fr; }
  .demo-role { min-height: 68px; }
  .topbar { padding-inline: 14px; }
  .topbar .btn--primary { width: 38px; padding: 0; font-size: 0; }
  .topbar .btn--primary span { font-size: 16px; }
  .global-search { width: calc(100vw - 122px); }
  .global-search kbd { display: none; }
  .view-container { padding: 20px 14px 28px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .page-heading h1 { font-size: 21px; }
  .analytics-toolbar { width: 100%; justify-content: flex-start; }
  .analytics-period-field { min-width: min(100%, 240px); }
  .analytics-period-field .select-control { width: 100%; }
  .analytics-custom-range { width: 100%; flex-wrap: wrap; }
  .analytics-custom-range label { min-width: 145px; flex: 1; }
  .analytics-custom-range input { width: 100%; }
  .metric-grid { grid-template-columns: repeat(2,1fr); }
  .overview-hero { padding: 24px 22px; }
  .hero-kpis { margin-top: 7px; }
  .hero-kpi { padding-inline: 10px; }
  .hero-kpi strong { font-size: 20px; }
  .dashboard-side { grid-template-columns: 1fr; }
  .attention-item { grid-template-columns: minmax(0,1fr) 95px; }
  .attention-item .assignee-mini { display: none; }
  .queue-summary { width: 100%; overflow-x: auto; }
  .queue-toolbar { align-items: stretch; flex-direction: column; }
  .filter-tabs { overflow-x: auto; }
  .filter-tabs { scrollbar-width: none; }
  .filter-tabs::-webkit-scrollbar { display: none; }
  .filter-controls { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); }
  .select-control { width: 100%; }
  .queue-layout { min-height: 680px; }
  .ticket-list-panel { height: 680px; }
  .ticket-detail-panel { position: fixed; z-index: 40; inset: 0; display: none; background: #fff; }
  .ticket-detail-panel.is-mobile-open { display: block; }
  .ticket-detail-body { grid-template-columns: 1fr; }
  .ticket-sidebar { display: none; }
  .conversation { border: 0; }
  .ticket-card { min-height: 132px; padding: 15px; }
  .ticket-detail-head { padding: 18px 15px; }
  .ticket-detail h2 { font-size: 20px; }
  .thread { padding: 18px 15px; }
  .composer-actions { align-items: flex-end; gap: 8px; }
  .composer-tools { min-width: 0; flex-wrap: wrap; }
  .quick-replies-menu { position: fixed; left: 14px; right: 14px; bottom: 84px; width: auto; max-height: calc(100dvh - 104px); }
  .analytics-grid { gap: 10px; }
  .analytics-grid .metric-card { grid-column: span 6; }
  .catalog-layout { grid-template-columns: 1fr; }
  .catalog-categories { display: flex; overflow-x: auto; }
  .catalog-category-row { min-width: 210px; flex: 0 0 auto; }
  .catalog-category { min-width: 175px; }
  .catalog-category-row .catalog-category { min-width: 0; }
  .catalog-heading-actions { width: 100%; justify-content: flex-start; }
  .catalog-search { width: 100%; }
  .catalog-adminbar { align-items: stretch; flex-direction: column; }
  .catalog-adminbar-actions { width: 100%; }
  .catalog-adminbar-actions .btn { flex: 1; }
  .catalog-layout .panel-header { min-height: 0; padding-block: 14px; align-items: flex-start; flex-direction: column; }
  .catalog-layout .panel-header > .service-card-head-actions { width: 100%; justify-content: flex-start; }
  .catalog-instruction-preview { margin-inline: 12px; align-items: flex-start; flex-direction: column; }
  .catalog-instruction-preview > div { justify-content: flex-start; }
  .catalog-instruction-preview a { max-width: 100%; }
  .service-grid { grid-template-columns: 1fr; }
  .catalog-delete-footer .btn { flex: 1 1 190px; }
  .team-toolbar { grid-template-columns: 1fr; }
  .global-search--team { grid-column: auto; }
  .team-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .handoff-delivery-fields { grid-template-columns: 1fr; }
  .smtp-settings-card { padding: 16px; }
  .smtp-settings-head, .smtp-test-card { align-items: stretch; flex-direction: column; }
  .smtp-settings-actions, .smtp-test-inline { align-items: stretch; flex-direction: column; }
  .smtp-enable-control { width: 100%; }
  .smtp-test-form { width: 100%; grid-template-columns: 1fr; }
  .smtp-test-history-item { grid-template-columns: 1fr; gap: 8px; }
  .smtp-test-history-meta { justify-items: start; white-space: normal; }
  .field--wide { grid-column: auto; }
  .category-instructions { grid-column: auto; }
  .category-instruction-row { position: relative; grid-template-columns: minmax(0, 1fr); padding-right: 56px; }
  .category-instruction-remove { position: absolute; top: 10px; right: 10px; }
  .category-instructions-actions { align-items: stretch; flex-direction: column; }
  .category-instructions-actions .btn { width: 100%; }
  .ticket-classification-steps { grid-template-columns: 1fr; }
  .field-label-row { align-items: flex-start; flex-direction: column; gap: 4px; }
  .modal.modal--owner-directory { width: calc(100vw - 20px); max-height: calc(100vh - 20px); }
  .modal--owner-directory .modal-frame { max-height: calc(100vh - 20px); }
  .modal--owner-directory .modal-header, .modal--owner-directory .modal-footer { padding-inline: 16px; }
  .modal--owner-directory .modal-body { padding-inline: 14px; }
  .owner-directory-layout { min-height: 0; grid-template-columns: 1fr; }
  .owner-directory-section { padding: 13px; }
  .owner-directory-list { max-height: 260px; }
  .owner-directory-form-actions { align-items: stretch; flex-direction: column-reverse; }
  .owner-directory-form-actions .btn { width: 100%; }
  .permission-checks { grid-template-columns: 1fr; }
  .journal-toolbar { align-items: stretch; flex-direction: column; }
  .journal-entry { grid-template-columns: 34px minmax(0,1fr); }
  .journal-entry time { grid-column: 2; }
}

@media (max-width: 450px) {
  .login-brand { min-height: 245px; }
  .login-pitch h1 { font-size: 30px; }
  .login-footnote { display: none; }
  .metric-grid { grid-template-columns: 1fr; }
  .hero-kpis { gap: 4px; }
  .hero-kpi { padding-inline: 7px; }
  .hero-kpi span { font-size: 11px; }
  .analytics-grid .metric-card { grid-column: span 12; }
  .ticket-detail-head { padding-inline: 15px; }
  .ticket-detail-kicker { align-items: flex-start; flex-direction: column; }
  .ticket-detail-actions { width: 100%; max-width: none; flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; }
  .ticket-detail-actions .btn { min-height: 36px; padding-inline: 9px; font-size: 11px; white-space: nowrap; }
  .thread { padding-inline: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
