:root {
  --forest-950: #082c25;
  --forest-900: #0c392f;
  --forest-800: #124a3e;
  --forest-700: #1b6252;
  --mint-500: #32c8a2;
  --mint-200: #b8f0df;
  --cream: #f4f4ec;
  --paper: #fbfbf7;
  --white: #fff;
  --ink: #17342d;
  --muted: #6d7f78;
  --line: #dce3dd;
  --line-dark: #cad5ce;
  --red: #b64242;
  --amber: #b3731d;
  --blue: #2473a5;
  --shadow: 0 22px 60px rgba(15, 52, 44, .12);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--cream); color: var(--ink); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body { margin: 0; min-height: 100vh; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.login-layout { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 1.08fr) minmax(420px, .92fr); }
.login-story { position: relative; overflow: hidden; padding: 52px 64px; background: var(--forest-950); color: var(--white); display: flex; flex-direction: column; justify-content: space-between; }
.login-story::before { content: ""; position: absolute; width: 580px; height: 580px; right: -210px; bottom: -160px; border: 1px solid rgba(94, 222, 187, .2); border-radius: 50%; box-shadow: 0 0 0 80px rgba(94, 222, 187, .035), 0 0 0 160px rgba(94, 222, 187, .025); }
.login-story::after { content: ""; position: absolute; width: 180px; height: 180px; right: 15%; top: 16%; background: radial-gradient(circle, rgba(50, 200, 162, .24), transparent 68%); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--forest-950); font-size: 18px; letter-spacing: -.02em; }
.brand img { width: 42px; height: 42px; }
.brand strong { color: var(--forest-700); font-weight: 650; }
.brand--light { color: #fff; position: relative; z-index: 1; }
.brand--light strong { color: var(--mint-500); }
.login-story__copy { position: relative; z-index: 1; max-width: 600px; padding: 80px 0; }
.login-story h1 { font-family: Georgia, "Times New Roman", serif; font-size: clamp(54px, 6.3vw, 96px); line-height: .94; letter-spacing: -.055em; margin: 18px 0 28px; font-weight: 400; }
.login-story__copy > p:last-child { max-width: 500px; color: #bbccc6; font-size: 18px; line-height: 1.7; }
.eyebrow { margin: 0 0 8px; color: var(--forest-700); font-size: 11px; line-height: 1.2; font-weight: 750; letter-spacing: .14em; text-transform: uppercase; }
.login-story .eyebrow { color: var(--mint-500); }
.login-story__status { position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; color: #b9cbc5; font-size: 13px; }
.login-story__status span, .environment-pill i { width: 7px; height: 7px; display: inline-block; border-radius: 50%; background: var(--mint-500); box-shadow: 0 0 0 5px rgba(50, 200, 162, .12); }
.login-panel { background: var(--paper); display: grid; place-items: center; padding: 48px; }
.login-card { width: min(100%, 430px); }
.login-card h2 { margin: 8px 0 10px; font-family: Georgia, "Times New Roman", serif; font-size: 42px; font-weight: 400; letter-spacing: -.035em; }
.muted { color: var(--muted); line-height: 1.6; }
form { display: grid; gap: 17px; }
.login-card form { margin-top: 32px; }
label { color: #39564e; font-size: 12px; font-weight: 700; letter-spacing: .02em; display: grid; gap: 8px; }
label small { color: var(--muted); font-weight: 500; }
input, select, textarea { width: 100%; border: 1px solid var(--line-dark); border-radius: 8px; background: var(--white); color: var(--ink); padding: 12px 13px; outline: none; transition: border .15s, box-shadow .15s; }
textarea { resize: vertical; min-height: 104px; }
input:focus, select:focus, textarea:focus { border-color: var(--forest-700); box-shadow: 0 0 0 3px rgba(27, 98, 82, .1); }
.button { appearance: none; border: 1px solid transparent; border-radius: 7px; padding: 11px 16px; display: inline-flex; align-items: center; justify-content: center; gap: 18px; font-weight: 700; font-size: 13px; text-decoration: none; transition: transform .15s, background .15s, border .15s; }
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .5; transform: none; cursor: not-allowed; }
.button--primary { background: var(--forest-900); color: #fff; }
.button--primary:hover { background: var(--forest-800); }
.button--secondary { border-color: var(--line-dark); background: #fff; color: var(--forest-900); }
.button--ghost { border-color: var(--line); color: var(--forest-800); background: transparent; }
.button--danger { border-color: #e7bcbc; color: var(--red); background: #fff7f7; }
.button--small { padding: 8px 11px; font-size: 12px; }
.button--wide { width: 100%; justify-content: space-between; margin-top: 4px; padding: 13px 15px; }
.text-button, .back-link { padding: 0; border: 0; color: var(--forest-700); background: transparent; font-size: 12px; font-weight: 700; }
.auth-links { display: flex; justify-content: space-between; margin-top: 20px; }
.form-error { min-height: 18px; margin: 0; color: var(--red); font-size: 12px; }
.form-message { margin: 0; color: var(--forest-700); line-height: 1.5; font-size: 12px; }
.back-link { margin-bottom: 38px; }

.app-layout { min-height: 100vh; display: grid; grid-template-columns: 252px minmax(0, 1fr); }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 252px; padding: 25px 18px 18px; color: #d3e1dc; background: var(--forest-950); display: flex; flex-direction: column; z-index: 20; }
.sidebar .brand { padding: 0 10px 26px; color: #fff; }
.sidebar .brand strong { color: var(--mint-500); }
.side-nav { flex: 1; overflow-y: auto; padding-top: 6px; }
.nav-group { margin-bottom: 22px; }
.nav-group > span { display: block; margin: 0 11px 8px; color: #759188; font-size: 9px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.nav-item { width: 100%; padding: 10px 11px; border: 0; border-radius: 7px; color: #b8cac4; background: transparent; display: flex; align-items: center; gap: 11px; text-align: left; font-size: 12px; font-weight: 650; }
.nav-item > span { min-width: 0; flex: 1; }
.nav-item:hover { background: rgba(255,255,255,.045); color: #fff; }
.nav-item.active { color: #fff; background: rgba(50, 200, 162, .12); }
.nav-item i { width: 25px; height: 25px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.12); border-radius: 6px; color: var(--mint-500); font-style: normal; font-size: 11px; }
.nav-item.active i { border-color: rgba(50,200,162,.3); background: rgba(50,200,162,.08); }
.nav-notification-badge { min-width: 22px; height: 22px; padding: 0 6px; display: inline-grid; place-items: center; border-radius: 99px; color: var(--forest-950); background: var(--mint-500); font-size: 9px; line-height: 1; }
.sidebar-foot { display: grid; grid-template-columns: 35px minmax(0,1fr) 28px; align-items: center; gap: 9px; padding: 16px 8px 0; border-top: 1px solid rgba(255,255,255,.09); }
.avatar { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 50%; background: #1d5b4e; color: #fff; font-size: 11px; font-weight: 800; }
.sidebar-foot strong, .sidebar-foot span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-foot strong { color: #f8fbf9; font-size: 11px; }
.sidebar-foot span { margin-top: 3px; color: #829c93; font-size: 9px; text-transform: capitalize; }
.icon-button { border: 0; background: transparent; color: #8fa59e; font-size: 17px; }
.workspace { grid-column: 2; min-width: 0; min-height: 100vh; }
.topbar { height: 102px; padding: 24px clamp(24px, 4vw, 56px); border-bottom: 1px solid var(--line); background: rgba(251, 251, 247, .92); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 10; backdrop-filter: blur(10px); }
.topbar h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 27px; font-weight: 400; letter-spacing: -.025em; }
.topbar-actions { display: flex; align-items: center; gap: 13px; }
.notification-button { position: relative; width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--forest-700); background: var(--paper); }
.notification-button > span { font-size: 9px; }
.notification-button > strong { position: absolute; top: -5px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; display: grid; place-items: center; border: 2px solid var(--paper); border-radius: 99px; color: var(--forest-950); background: var(--mint-500); font-size: 8px; line-height: 1; }
.environment-pill { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); font-size: 10px; font-weight: 700; }
.environment-pill i { width: 5px; height: 5px; box-shadow: none; }
.mobile-menu { display: none; border: 0; background: transparent; color: var(--forest-900); font-size: 20px; }
.content { padding: 34px clamp(24px, 4vw, 56px) 72px; max-width: 1640px; margin: 0 auto; }
.loading { min-height: 300px; display: grid; place-items: center; align-content: center; gap: 15px; color: var(--muted); font-size: 12px; }
.loading span { width: 26px; height: 26px; border: 2px solid var(--line); border-top-color: var(--mint-500); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.view-head { margin-bottom: 25px; display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.view-head h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 30px; font-weight: 400; letter-spacing: -.035em; }
.view-head p { margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.action-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 24px; }
.metric-card { min-height: 138px; padding: 20px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); display: flex; flex-direction: column; justify-content: space-between; }
.metric-card--dark { background: var(--forest-900); color: #fff; border-color: var(--forest-900); }
.metric-card__top { display: flex; justify-content: space-between; gap: 14px; color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.metric-card--dark .metric-card__top { color: #9db5ad; }
.metric-card__icon { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 6px; background: #edf3ee; color: var(--forest-700); }
.metric-card--dark .metric-card__icon { background: rgba(50,200,162,.12); color: var(--mint-500); }
.metric-card strong { display: block; margin-top: 15px; font-family: Georgia, "Times New Roman", serif; font-size: 34px; font-weight: 400; letter-spacing: -.03em; }
.metric-card small { color: var(--muted); }
.metric-card--dark small { color: #9db5ad; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.panel { border: 1px solid var(--line); border-radius: 10px; background: var(--paper); overflow: hidden; }
.panel + .panel { margin-top: 18px; }
.panel__head { min-height: 62px; padding: 16px 19px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.panel__head h3 { margin: 0; font-size: 13px; }
.panel__head p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.panel__body { padding: 19px; }
.panel--flush .panel__body { padding: 0; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 11px; }
th { padding: 11px 15px; color: var(--muted); background: #f3f5f1; text-align: left; font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
td { padding: 13px 15px; border-top: 1px solid var(--line); vertical-align: middle; }
tbody tr:hover { background: #f8faf6; }
td strong { color: var(--forest-900); }
td small { display: block; margin-top: 3px; color: var(--muted); }
.table-link { padding: 0; border: 0; color: var(--forest-700); background: none; font-weight: 750; text-align: left; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 7px; border-radius: 99px; background: #edf3ee; color: var(--forest-700); font-size: 9px; font-weight: 800; text-transform: capitalize; white-space: nowrap; }
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge--active, .badge--success, .badge--resolved, .badge--2fa_enabled { background: #e8f7ef; color: #217350; }
.badge--waiting, .badge--pending_customer, .badge--pending_support, .badge--pending, .badge--provisioning, .badge--awaiting_provisioning, .badge--high { background: #fff4de; color: var(--amber); }
.badge--failed, .badge--urgent, .badge--disabled, .badge--suspended { background: #fceaea; color: var(--red); }
.badge--open { background: #e9f2fa; color: var(--blue); }
.badge--closed, .badge--cancelled, .badge--2fa_disabled { background: #edf0ed; color: #63736d; }
.empty { padding: 55px 24px; text-align: center; color: var(--muted); }
.empty strong { display: block; margin-bottom: 7px; color: var(--forest-800); }
.list { display: grid; }
.list-row { padding: 14px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.list-row:first-child { padding-top: 0; }
.list-row:last-child { padding-bottom: 0; border-bottom: 0; }
.list-row strong, .list-row small { display: block; }
.list-row strong { font-size: 11px; }
.list-row small { margin-top: 5px; color: var(--muted); font-size: 10px; }

.product-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.product-card { min-height: 280px; padding: 22px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); display: flex; flex-direction: column; }
.product-card__top { display: flex; justify-content: space-between; gap: 12px; }
.product-card__category { color: var(--forest-700); font-size: 9px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.product-card h3 { margin: 15px 0 7px; font-family: Georgia, "Times New Roman", serif; font-size: 24px; font-weight: 400; letter-spacing: -.025em; }
.product-card p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.specs { display: flex; flex-wrap: wrap; gap: 6px; margin: 18px 0; }
.specs span { padding: 5px 7px; border: 1px solid var(--line); border-radius: 5px; color: #49645c; font-size: 9px; }
.product-card__foot { margin-top: auto; padding-top: 18px; border-top: 1px solid var(--line); display: flex; align-items: end; justify-content: space-between; gap: 12px; }
.price { font-family: Georgia, "Times New Roman", serif; font-size: 27px; color: var(--forest-900); }
.price small { font-family: inherit; font-size: 12px; color: var(--muted); }

.split-view { display: grid; grid-template-columns: minmax(260px, .72fr) minmax(420px, 1.28fr); border: 1px solid var(--line); border-radius: 10px; background: var(--paper); min-height: 580px; overflow: hidden; }
.split-list { border-right: 1px solid var(--line); overflow-y: auto; max-height: 72vh; }
.split-list__head { padding: 17px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--paper); z-index: 1; }
.queue-filters { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 5px; }
.queue-filters button { padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: transparent; color: var(--muted); font-size: 9px; font-weight: 700; }
.queue-filters button:hover, .queue-filters button.active { border-color: #b9d2c1; background: #eaf4ed; color: var(--forest-800); }
.split-item { width: 100%; padding: 15px 17px; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; color: var(--ink); }
.split-item:hover, .split-item.active { background: #f0f5f0; }
.split-item.active { box-shadow: inset 3px 0 var(--mint-500); }
.split-item__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.split-item strong { font-size: 11px; }
.split-item p { margin: 7px 0 0; color: var(--muted); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.split-item__tags { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 5px; }
.ticket-workspace-nav { margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.ticket-workspace-nav > div { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 10px; }
.ticket-workspace-nav > div span { font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.ticket-workspace-nav > div strong { color: var(--forest-700); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; }
.ticket-workspace { min-width: 0; min-height: 620px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); overflow: hidden; box-shadow: 0 14px 38px rgba(20, 49, 41, .07); }
.ticket-workspace .conversation { min-height: 620px; }
.ticket-workspace .conversation__head { align-items: flex-start; }
.ticket-workspace .conversation__head > div:first-child { min-width: 0; }
.ticket-workspace .conversation__head > .action-row { justify-content: flex-end; }
.ticket-workspace .messages { min-height: 310px; max-height: 48vh; }
.source-chip, .queue-chip, .category-chip, .sla-pill, .child-case-label { display: inline-flex; align-items: center; padding: 4px 7px; border-radius: 99px; font-size: 8px; line-height: 1; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.source-chip--email { background: #e7f0fa; color: #285f8e; }
.source-chip--portal { background: #e6f3ec; color: #28644a; }
.source-chip--contact { background: #f1eafa; color: #694493; }
.queue-chip { background: #fff0cf; color: #8a5a13; }
.category-chip { background: #edf0ed; color: #53645d; }
.sla-pill--met { background: #e8f7ef; color: #217350; }
.sla-pill--pending { background: #fff4de; color: #8a5a13; }
.sla-pill--breached { background: #fceaea; color: var(--red); }
.case-line { margin-bottom: 6px; display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.case-number { color: var(--forest-700); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; font-weight: 850; letter-spacing: .04em; white-space: nowrap; }
.child-case-label { background: #e7f0fa; color: #285f8e; }
.parent-case-link { padding: 0; border: 0; background: none; color: var(--blue); font-size: 9px; font-weight: 750; }
.conversation { display: flex; flex-direction: column; min-width: 0; }
.conversation__head { min-height: 74px; padding: 17px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.conversation__head h3 { margin: 0; font-size: 14px; }
.conversation__head p { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.ticket-context { margin-top: 7px; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; color: var(--muted); font-size: 9px; }
.assignment-pill { padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px; background: #f4f5f2; color: var(--muted); font-size: 9px; font-weight: 750; white-space: nowrap; }
.assignment-pill--mine { border-color: #c6dfcf; background: #eaf6ee; color: #276247; }
.case-notice { padding: 10px 20px; border-bottom: 1px solid #efdbb5; background: #fff8e9; color: #76561d; font-size: 10px; line-height: 1.5; }
.case-notice--locked { border-color: #e8c5c5; background: #fceaea; color: #8b3434; }
.messages { flex: 1; padding: 22px; overflow-y: auto; max-height: calc(72vh - 155px); background: #f7f8f4; }
.message { max-width: 75%; margin-bottom: 15px; }
.message--mine { margin-left: auto; }
.message__meta { margin: 0 5px 5px; color: var(--muted); font-size: 9px; display: flex; gap: 8px; }
.message--mine .message__meta { justify-content: flex-end; }
.message__bubble { padding: 11px 13px; border: 1px solid var(--line); border-radius: 4px 10px 10px 10px; background: #fff; font-size: 11px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.message--mine .message__bubble { border-color: var(--forest-800); border-radius: 10px 4px 10px 10px; background: var(--forest-800); color: #fff; }
.message--internal .message__bubble { border-style: dashed; background: #fff8e9; color: #76561d; }
.message--typing { max-width: 220px; }
.typing-bubble { width: 58px; min-height: 38px; display: flex; align-items: center; justify-content: center; gap: 5px; border: 1px solid var(--line); border-radius: 4px 10px 10px 10px; background: #fff; }
.typing-bubble i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: chat-typing 1s infinite ease-in-out; }
.typing-bubble i:nth-child(2) { animation-delay: .14s; }
.typing-bubble i:nth-child(3) { animation-delay: .28s; }
@keyframes chat-typing { 0%, 60%, 100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-3px); opacity: 1; } }
.ticket-composers { padding: 14px; border-top: 1px solid var(--line); background: #f7f8f4; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ticket-composers--customer { grid-template-columns: 1fr; }
.ticket-composer { padding: 13px; border: 1px solid; border-radius: 9px; }
.ticket-composer--public { border-color: #c6dfcf; background: #eff8f1; }
.ticket-composer--internal { border-color: #e7cd9b; background: #fff8e9; }
.ticket-composer__head { min-height: 42px; display: flex; align-items: start; justify-content: space-between; gap: 10px; }
.ticket-composer__head strong, .ticket-composer__head small { display: block; }
.ticket-composer__head strong { color: var(--forest-900); font-size: 11px; }
.ticket-composer--internal .ticket-composer__head strong { color: #76561d; }
.ticket-composer__head small { margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.ticket-composer form { margin-top: 10px; gap: 9px; }
.ticket-composer textarea { min-height: 74px; max-height: 150px; resize: vertical; background: rgba(255, 255, 255, .92); font-size: 11px; }
.ticket-composer .button { justify-self: start; }
.audience-label { flex: 0 0 auto; padding: 4px 7px; border-radius: 99px; font-size: 8px; line-height: 1.2; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.audience-label--customer { background: #d9eee0; color: #246044; }
.audience-label--staff { background: #f4dfb9; color: #76561d; }
.composer { padding: 14px; border-top: 1px solid var(--line); display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; }
.composer textarea { min-height: 42px; max-height: 120px; resize: none; }
.conversation-empty { height: 100%; display: grid; place-items: center; color: var(--muted); text-align: center; padding: 40px; }

.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.field-grid .span-2 { grid-column: 1/-1; }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filter-row input, .filter-row select { width: auto; min-width: 180px; padding: 8px 10px; font-size: 11px; }
.customer-directory-head { align-items: center; flex-wrap: wrap; }
.customer-directory-head .filter-row { flex: 1 1 650px; }
.customer-directory-head .filter-row input { flex: 1 1 260px; }
.directory-count { color: var(--muted); font-size: 10px; white-space: nowrap; }
.directory-pagination { padding: 14px 16px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: flex-end; gap: 12px; color: var(--muted); font-size: 10px; }
.report-controls { margin-bottom: 18px; }
.report-form { display: grid; grid-template-columns: minmax(190px, 1fr) minmax(190px, 1fr) auto; align-items: end; gap: 14px; }
.report-form .button { min-height: 42px; }
.json-field { min-height: 130px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; }
.notice { padding: 13px 15px; border: 1px solid #d5e5da; border-radius: 8px; background: #eff8f1; color: #37624f; font-size: 11px; line-height: 1.6; }
.notice--warning { border-color: #efdbb5; background: #fff8e9; color: #76561d; }
.code { padding: 3px 5px; border-radius: 4px; background: #edf0ed; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; overflow-wrap: anywhere; }
.mfa-setup { margin: 20px 0; display: grid; grid-template-columns: 180px 1fr; align-items: center; gap: 22px; }
.mfa-setup img { width: 180px; height: 180px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.manual-secret { display: block; margin-top: 12px; padding: 10px; border-radius: 6px; background: #edf0ed; font-size: 12px; letter-spacing: .08em; overflow-wrap: anywhere; user-select: all; }
.recovery-codes { margin: 16px 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.recovery-codes code { padding: 8px 10px; border: 1px solid var(--line); border-radius: 5px; background: #fff; font-size: 11px; text-align: center; user-select: all; }
.credential-block { margin: 18px 0 0; padding: 16px; border-radius: 8px; background: var(--forest-900); color: #e8f7ef; font: 11px/1.7 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; overflow-wrap: anywhere; user-select: all; }
.bar-list { display: grid; gap: 13px; }
.bar-row__label { margin-bottom: 6px; display: flex; justify-content: space-between; color: var(--muted); font-size: 10px; }
.bar { height: 6px; border-radius: 10px; background: #e7ece7; overflow: hidden; }
.bar span { height: 100%; display: block; border-radius: inherit; background: var(--mint-500); }

.agent-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.agent-card { padding: 20px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.agent-card__head { display: flex; align-items: center; gap: 11px; }
.agent-card__head > div:nth-child(2) { min-width: 0; flex: 1; }
.agent-card__head h3 { margin: 0; color: var(--forest-900); font-size: 13px; }
.agent-card__head p { margin: 4px 0 0; color: var(--muted); font-size: 9px; overflow-wrap: anywhere; }
.agent-avatar { width: 40px; height: 40px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: var(--forest-900); color: #fff; font-size: 11px; font-weight: 800; }
.agent-card__coverage { margin: 17px 0; padding: 12px; border-radius: 7px; background: #f0f5f0; }
.agent-card__coverage strong, .agent-card__coverage span { display: block; }
.agent-card__coverage strong { color: var(--forest-800); font-size: 10px; }
.agent-card__coverage span { margin-top: 4px; color: var(--muted); font-size: 9px; }
.agent-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.agent-stats div { min-height: 64px; padding: 11px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.agent-stats div:nth-child(2n) { border-right: 0; }
.agent-stats div:nth-last-child(-n+2) { border-bottom: 0; }
.agent-stats strong, .agent-stats span { display: block; }
.agent-stats strong { color: var(--forest-900); font-family: Georgia, "Times New Roman", serif; font-size: 22px; font-weight: 400; }
.agent-stats span { margin-top: 3px; color: var(--muted); font-size: 8px; text-transform: uppercase; letter-spacing: .05em; }
.agent-card__activity { margin: 14px 0 0; color: var(--muted); font-size: 9px; line-height: 1.5; }

.modal-backdrop { position: fixed; inset: 0; z-index: 50; padding: 25px; background: rgba(3, 20, 16, .64); display: grid; place-items: center; }
.modal { width: min(620px, 100%); max-height: calc(100vh - 50px); overflow-y: auto; position: relative; padding: 29px; border-radius: 12px; background: var(--paper); box-shadow: var(--shadow); }
.modal--wide { width: min(940px, 100%); }
.modal h2 { margin: 5px 40px 8px 0; font-family: Georgia, "Times New Roman", serif; font-size: 30px; font-weight: 400; }
.modal-close { position: absolute; top: 18px; right: 19px; width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--muted); font-size: 20px; }
.modal form { margin-top: 24px; }
.content-markdown { min-height: 320px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; line-height: 1.65; }
.checkbox-field { align-self: end; min-height: 46px; display: flex; align-items: center; gap: 10px; padding-bottom: 11px; }
.checkbox-field input { width: auto; margin: 0; }
.content-preview { margin: 22px 0; padding: 22px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); }
.content-preview__body { color: var(--ink); font-size: 13px; line-height: 1.75; }
.content-preview__body h2, .content-preview__body h3 { margin: 22px 0 8px; font-family: Georgia, "Times New Roman", serif; font-weight: 400; }
.content-preview__body h2 { font-size: 26px; }
.content-preview__body h3 { font-size: 21px; }
.content-preview__body p, .content-preview__body ul, .content-preview__body ol, .content-preview__body blockquote { margin: 0 0 14px; }
.content-preview__body blockquote { padding: 10px 15px; border-left: 3px solid var(--forest-500); background: var(--paper); }
.notification-summary { margin: 20px 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.notification-summary button { padding: 14px; display: grid; gap: 3px; border: 1px solid var(--line); border-radius: 9px; color: var(--forest-900); background: #fff; text-align: left; }
.notification-summary strong { font-family: Georgia, "Times New Roman", serif; font-size: 26px; font-weight: 400; }
.notification-summary span { color: var(--muted); font-size: 10px; }
.notification-list { display: grid; gap: 8px; }
.notification-item { width: 100%; padding: 13px; display: grid; gap: 4px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: #fff; text-align: left; }
.notification-item:hover { border-color: var(--forest-700); background: #f7faf7; }
.notification-item__type { color: var(--forest-700); font-size: 8px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.notification-item strong { font-size: 11px; }
.notification-item small { color: var(--muted); font-size: 9px; }
.notification-item p { margin: 3px 0 0; color: #4f645d; font-size: 10px; line-height: 1.5; }
.toast-region { position: fixed; right: 20px; bottom: 20px; z-index: 80; display: grid; gap: 8px; }
.toast { min-width: 260px; max-width: 390px; padding: 13px 15px; border-radius: 8px; color: #fff; background: var(--forest-900); box-shadow: var(--shadow); font-size: 11px; animation: toast-in .2s ease; }
.toast--error { background: #812e2e; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 1100px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .agent-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ticket-workspace .conversation__head { flex-direction: column; align-items: stretch; }
  .ticket-workspace .conversation__head > .action-row { justify-content: flex-start; }
}

@media (max-width: 800px) {
  .login-layout { grid-template-columns: 1fr; }
  .login-story { min-height: 290px; padding: 28px; }
  .login-story__copy { padding: 40px 0 20px; }
  .login-story h1 { font-size: 48px; }
  .login-story__copy > p:last-child { font-size: 14px; }
  .login-panel { padding: 42px 24px; }
  .sidebar { transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  .app-layout.menu-open .sidebar { transform: translateX(0); }
  .app-layout { grid-template-columns: 1fr; }
  .workspace { grid-column: 1; }
  .mobile-menu { display: block; }
  .topbar { height: 84px; padding: 18px 22px; }
  .topbar > div:first-of-type { margin-right: auto; margin-left: 12px; }
  .topbar h1 { font-size: 22px; }
  .environment-pill { display: none; }
  .content { padding: 24px 18px 55px; }
  .grid-2, .split-view { grid-template-columns: 1fr; }
  .split-list { border-right: 0; border-bottom: 1px solid var(--line); max-height: 260px; }
  .conversation { min-height: 520px; }
  .field-grid { grid-template-columns: 1fr; }
  .field-grid .span-2 { grid-column: auto; }
  .mfa-setup { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .metric-grid, .product-grid, .agent-grid, .grid-3 { grid-template-columns: 1fr; }
  .metric-card { min-height: 115px; }
  .view-head { align-items: start; flex-direction: column; }
  .topbar-actions .button { display: none; }
  .login-card h2 { font-size: 36px; }
  .message { max-width: 90%; }
  .ticket-composers { grid-template-columns: 1fr; }
  .ticket-composer .button { width: 100%; }
  .ticket-workspace-nav { align-items: stretch; flex-direction: column; }
  .ticket-workspace-nav .button { width: 100%; }
  .ticket-workspace-nav > div { justify-content: space-between; }
  .report-form { grid-template-columns: 1fr; }
  .recovery-codes { grid-template-columns: 1fr; }
  .notification-summary { grid-template-columns: 1fr; }
  .modal-backdrop { padding: 10px; }
  .modal { max-height: calc(100dvh - 20px); padding: 24px 18px; }
}

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