:root {
  color-scheme: light;
  --ink: #18211c;
  --muted: #6f7a72;
  --paper: #f3f5f0;
  --surface: #fff;
  --forest: #164d3b;
  --forest-dark: #0c3427;
  --mint: #dff3e5;
  --lime: #bfe66e;
  --line: #dfe5df;
  --amber: #d98734;
  --danger: #9d4138;
  --shadow: 0 18px 45px rgb(24 47 35 / 7%);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--paper); }
body { margin: 0; color: var(--ink); font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.kicker { margin: 0; color: #34725c; font-size: 10px; font-weight: 850; letter-spacing: .16em; }

.brand-lockup { display: flex; align-items: center; gap: 11px; font-size: 18px; }
.brand-mark { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 12px; background: var(--forest); color: white; font-family: Georgia, serif; box-shadow: inset 0 -6px 13px rgb(0 0 0 / 16%); }

.login-page { display: grid; min-height: 100vh; grid-template-columns: minmax(0, 1.15fr) minmax(430px, .85fr); background: var(--paper); }
.login-copy { position: relative; display: flex; flex-direction: column; justify-content: center; padding: clamp(50px, 8vw, 120px); overflow: hidden; color: white; background: var(--forest-dark); }
.login-copy::after { position: absolute; width: 430px; height: 430px; right: -160px; bottom: -190px; border: 80px solid rgb(191 230 110 / 10%); border-radius: 50%; content: ""; }
.login-copy .brand-lockup { position: absolute; top: 48px; left: clamp(50px, 8vw, 120px); }
.login-copy .brand-mark { color: var(--forest-dark); background: var(--lime); }
.login-copy .kicker { color: var(--lime); }
.login-copy h1 { max-width: 720px; margin: 18px 0; font-family: Georgia, "Songti SC", serif; font-size: clamp(45px, 5.3vw, 78px); font-weight: 500; line-height: 1.06; letter-spacing: -.055em; }
.login-copy > p:not(.kicker) { max-width: 670px; color: rgb(255 255 255 / 65%); font-size: 15px; line-height: 1.9; }
.logic-strip { z-index: 1; display: flex; max-width: 690px; align-items: center; gap: 10px; margin-top: 35px; padding: 14px 17px; border: 1px solid rgb(255 255 255 / 10%); border-radius: 14px; background: rgb(255 255 255 / 5%); }
.logic-strip span, .logic-strip b { padding: 7px 10px; border-radius: 8px; background: rgb(255 255 255 / 8%); font-size: 12px; }
.logic-strip b { color: var(--lime); }
.logic-strip i { color: var(--lime); font-style: normal; }
.logic-strip em { margin-left: auto; color: rgb(255 255 255 / 55%); font-size: 11px; font-style: normal; }
.login-card { display: flex; width: min(430px, calc(100% - 70px)); flex-direction: column; justify-content: center; margin: auto; }
.login-card h2 { margin: 12px 0 5px; font-size: 32px; letter-spacing: -.04em; }
.login-card > p.muted { margin: 0 0 32px; font-size: 13px; }
.secure-note { padding-left: 20px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.secure-note::before { margin-left: -18px; margin-right: 7px; color: #4a9b72; content: "●"; }

form { display: grid; gap: 16px; }
label { display: grid; gap: 7px; color: #38443c; font-size: 12px; font-weight: 750; }
label em { margin-left: 5px; color: #8a948d; font-size: 10px; font-style: normal; font-weight: 500; }
input, textarea, select { width: 100%; border: 1px solid #d7ded8; border-radius: 11px; outline: 0; background: #fbfcfa; color: var(--ink); transition: .18s ease; }
input, select { height: 44px; padding: 0 12px; }
textarea { padding: 11px 12px; line-height: 1.6; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--forest); background: white; box-shadow: 0 0 0 3px rgb(22 77 59 / 9%); }
.primary { display: flex; height: 47px; align-items: center; justify-content: space-between; padding: 0 16px; border: 0; border-radius: 11px; background: var(--forest); color: white; font-weight: 800; }
.primary:hover { background: var(--forest-dark); transform: translateY(-1px); }
.primary:disabled { cursor: wait; opacity: .62; transform: none; }

.app-shell { display: grid; width: 100%; min-width: 0; min-height: 100vh; grid-template-columns: 230px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; display: flex; min-width: 0; height: 100vh; flex-direction: column; padding: 26px 18px 20px; border-right: 1px solid #dce2dc; background: #edf0ea; }
.portal-badge { width: max-content; margin-top: 14px; padding: 5px 9px; border-radius: 99px; background: #dce9df; color: var(--forest); font-size: 9px; font-weight: 850; letter-spacing: .08em; }
.workspace-chip { display: grid; gap: 4px; margin: 34px 0 24px; padding: 13px; border: 1px solid #d9dfd9; border-radius: 12px; background: rgb(255 255 255 / 52%); }
.workspace-chip span { font-size: 13px; font-weight: 800; }
.workspace-chip small { color: var(--muted); font-size: 10px; }
nav { display: grid; gap: 5px; }
.nav-item { display: flex; height: 42px; align-items: center; gap: 10px; padding: 0 12px; border: 0; border-radius: 10px; background: transparent; color: #59635c; font-size: 12px; font-weight: 700; text-align: left; }
.nav-item .nav-icon { display: inline-grid; width: 18px; color: #7a857d; place-items: center; font-size: 15px; }
.nav-item .nav-label { font: inherit; }
.nav-item:hover { background: rgb(255 255 255 / 60%); color: var(--forest); }
.nav-item.active { background: var(--forest); color: white; box-shadow: 0 7px 16px rgb(22 77 59 / 14%); }
.nav-item.active .nav-icon { color: var(--lime); }
.sidebar-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding: 13px 7px 0; border-top: 1px solid #d8ded8; font-size: 11px; }
.sidebar-foot span { max-width: 115px; overflow: hidden; font-weight: 750; text-overflow: ellipsis; }
.ghost { border: 0; background: transparent; color: var(--muted); font-size: 11px; }
.ghost:hover { color: var(--danger); }

.content { width: 100%; min-width: 0; padding: 0 clamp(24px, 4vw, 58px) 60px; }
.content-header { display: flex; min-height: 90px; align-items: center; justify-content: space-between; border-bottom: 1px solid #dfe4df; }
.content-header h1 { margin: 5px 0 0; font-size: 22px; letter-spacing: -.035em; }
.online { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.online b { font-weight: 650; }
.online span { width: 8px; height: 8px; border: 2px solid white; border-radius: 50%; background: #3ea66b; box-shadow: 0 0 0 3px rgb(62 166 107 / 17%); }
.notice { display: flex; align-items: center; gap: 14px; margin: 22px 0; padding: 11px 14px; border-left: 3px solid var(--amber); border-radius: 0 10px 10px 0; background: #f9f1e5; color: #74614c; font-size: 11px; line-height: 1.5; }
.notice b { flex: 0 0 auto; color: #6a4827; }
.view { display: none; }
.view.active { display: block; }

.hero-card { position: relative; display: flex; min-height: 230px; align-items: center; justify-content: space-between; padding: clamp(30px, 5vw, 58px); overflow: hidden; border-radius: 22px; background: var(--forest-dark); color: white; box-shadow: var(--shadow); }
.hero-card h2 { max-width: 700px; margin: 12px 0; font-family: Georgia, "Songti SC", serif; font-size: clamp(33px, 4vw, 54px); font-weight: 500; letter-spacing: -.05em; }
.hero-card p:last-child { max-width: 680px; margin: 0; color: rgb(255 255 255 / 60%); font-size: 13px; line-height: 1.8; }
.hero-card .kicker { color: var(--lime); }
.signal-orbit { position: relative; flex: 0 0 180px; height: 180px; margin-right: 25px; border: 1px solid rgb(191 230 110 / 20%); border-radius: 50%; }
.signal-orbit::before, .signal-orbit::after { position: absolute; inset: 22px; border: 1px solid rgb(191 230 110 / 22%); border-radius: 50%; content: ""; }
.signal-orbit::after { inset: 50px; }
.signal-orbit span { position: absolute; inset: 76px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 26px var(--lime); }
.signal-orbit i, .signal-orbit b { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: white; }
.signal-orbit i { top: 19px; left: 48px; }.signal-orbit b { right: 27px; bottom: 43px; }

.metrics { display: grid; gap: 14px; margin: 18px 0; }
.metrics.four { grid-template-columns: repeat(4, 1fr); }
.metrics.four.three { grid-template-columns: repeat(3, 1fr); }
.metrics article { display: grid; min-height: 120px; align-content: center; gap: 4px; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.metrics span { color: var(--muted); font-size: 10px; }
.metrics strong { font-size: 29px; letter-spacing: -.04em; }.metrics small { color: #909991; font-size: 9px; }
.two-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.card { border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
.flow-card, .status-card { padding: 24px; }
.card-heading { display: flex; align-items: center; justify-content: space-between; }
.card-heading.padded { padding: 22px 24px; }
.card-heading h3 { margin: 5px 0 0; font-size: 18px; letter-spacing: -.025em; }
.account-flow { display: flex; align-items: center; gap: 9px; margin: 24px 0 17px; }
.account-flow > * { padding: 9px 11px; border-radius: 9px; }
.account-flow b { background: #eef1ed; font-family: Consolas, monospace; }.account-flow i { padding: 0; color: var(--forest); font-style: normal; }.account-flow span { display: grid; gap: 2px; background: var(--mint); color: var(--forest); font-family: Consolas, monospace; font-size: 12px; font-weight: 800; }.account-flow small { color: #6b8c79; font-family: inherit; font-size: 8px; }
.flow-card > p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.8; }
.status-card ul { display: grid; gap: 15px; margin: 24px 0 0; padding: 0; list-style: none; color: #465249; font-size: 11px; }
.status-card li { display: flex; align-items: center; gap: 9px; }.status-card li span { width: 7px; height: 7px; border-radius: 50%; background: #52a978; box-shadow: 0 0 0 4px #e8f5ec; }

.storage-card { width: 100%; overflow: hidden; }
.storage-heading { padding: 24px 28px; border-bottom: 1px solid var(--line); }
.storage-content { padding: 30px 28px 26px; }
.storage-summary { display: grid; grid-template-columns: 175px minmax(0, 1fr); gap: 34px; align-items: center; }
.storage-percentage { display: grid; gap: 3px; }
.storage-percentage strong { color: var(--forest-dark); font-size: clamp(42px, 5vw, 62px); letter-spacing: -.06em; line-height: 1; }
.storage-percentage span { color: var(--muted); font-size: 10px; font-weight: 750; }
.storage-meter-panel { display: grid; gap: 11px; }
.storage-meter { width: 100%; height: 14px; overflow: hidden; border-radius: 99px; background: #e7ece7; box-shadow: inset 0 1px 3px rgb(23 55 41 / 9%); }
.storage-meter > span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #64bd7f, var(--forest)); transition: width .45s ease; }
.storage-scale { display: flex; justify-content: space-between; gap: 16px; color: var(--muted); font-size: 10px; }
.storage-stats { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 28px; border: 1px solid var(--line); border-radius: 13px; background: #fafcf9; }
.storage-stats > div { display: grid; gap: 6px; min-width: 0; padding: 17px 20px; }
.storage-stats > div + div { border-left: 1px solid var(--line); }
.storage-stats span { color: var(--muted); font-size: 9px; }
.storage-stats strong { overflow: hidden; font-size: 20px; letter-spacing: -.025em; text-overflow: ellipsis; white-space: nowrap; }
.storage-foot { display: flex; align-items: center; gap: 8px; margin-top: 17px; color: var(--muted); font-size: 10px; }
.storage-foot b { color: #34704f; font-size: 10px; }
.storage-foot small { margin-left: auto; color: #909991; font-size: 9px; }
.storage-status-dot { width: 8px; height: 8px; border-radius: 50%; background: #52a978; box-shadow: 0 0 0 4px #e8f5ec; }
.storage-card[data-level="warning"] .storage-meter > span { background: linear-gradient(90deg, #efc36a, var(--amber)); }
.storage-card[data-level="warning"] .storage-status-dot { background: var(--amber); box-shadow: 0 0 0 4px #faeddc; }
.storage-card[data-level="warning"] .storage-foot b { color: #8a592b; }
.storage-card[data-level="critical"] .storage-meter > span { background: linear-gradient(90deg, #d87a6f, var(--danger)); }
.storage-card[data-level="critical"] .storage-status-dot { background: var(--danger); box-shadow: 0 0 0 4px #f8e5e2; }
.storage-card[data-level="critical"] .storage-foot b { color: var(--danger); }
.storage-unavailable { display: grid; min-height: 260px; color: var(--muted); place-content: center; gap: 8px; text-align: center; }
.storage-unavailable b { color: var(--ink); font-size: 16px; }
.storage-unavailable span { font-size: 10px; }

.section-grid { display: grid; grid-template-columns: minmax(320px, 370px) minmax(0, 1fr); gap: 18px; align-items: start; }
.form-card { padding: 24px; }.form-card .card-heading { margin-bottom: 23px; }.step { color: #ccd3cd; font-family: Georgia, serif; font-size: 28px; }
.lines-page-layout { display: grid; width: 100%; min-width: 0; gap: 18px; }
.lines-page-layout > * { min-width: 0; }
.line-import-card { width: 100%; max-width: none; }
.line-import-form { min-width: 0; }
.line-import-fields { display: grid; min-width: 0; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 12px; align-items: end; }
.line-import-fields > label { min-width: 0; }
.line-tenant-field { grid-column: span 2; }
.line-server-field { grid-column: span 3; }
.line-location-field { grid-column: span 2; }
.line-concurrency-field { grid-column: span 1; }
.line-password-field { grid-column: span 2; }
.line-accounts-field { grid-column: span 2; }
.line-accounts-field textarea { min-height: 44px; height: 44px; padding-block: 7px; resize: vertical; }
.line-import-footer { display: grid; min-width: 0; grid-template-columns: minmax(0, 1fr) 180px; gap: 14px; align-items: stretch; }
.line-import-footer .rule-box { display: flex; align-items: center; }
.line-import-footer .primary { width: 100%; height: auto; min-height: 47px; }
.password-card { width: min(520px, 100%); margin: 0 auto; }
.settings-card { width: min(650px, 100%); margin: 0 auto; }
.form-intro { margin: -8px 0 22px; color: var(--muted); font-size: 11px; line-height: 1.7; }
.setting-switch { display: flex; min-height: 74px; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 13px; background: #fafcf9; cursor: pointer; }
.setting-switch > span { display: grid; gap: 5px; }
.setting-switch b { color: var(--ink); font-size: 13px; }
.setting-switch small { color: var(--muted); font-size: 10px; font-weight: 500; line-height: 1.5; }
.setting-switch input { position: relative; flex: 0 0 42px; width: 42px; height: 24px; margin: 0; padding: 0; border: 0; border-radius: 99px; appearance: none; background: #cdd5cf; box-shadow: none; cursor: pointer; }
.setting-switch input::after { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: white; box-shadow: 0 2px 5px rgb(0 0 0 / 18%); content: ""; transition: .18s ease; }
.setting-switch input:checked { background: var(--forest); }
.setting-switch input:checked::after { transform: translateX(18px); }
.setting-switch input:focus-visible { outline: 3px solid rgb(22 77 59 / 18%); outline-offset: 2px; }
.monitor-duration { display: flex; min-height: 68px; align-items: center; justify-content: space-between; gap: 20px; padding: 12px 16px; border: 1px dashed var(--line); border-radius: 12px; background: #fbfcfa; }
.monitor-duration > span:first-child { display: grid; gap: 5px; }
.monitor-duration b { color: var(--ink); font-size: 12px; }
.monitor-duration small { color: var(--muted); font-size: 10px; font-weight: 500; }
.duration-input { display: flex; flex: 0 0 auto; align-items: center; gap: 7px; }
.duration-input input { width: 92px; height: 40px; text-align: center; }
.duration-input em { color: var(--muted); font-size: 11px; font-style: normal; }
.monitor-credentials { display: grid; gap: 7px; padding: 14px 16px; border-left: 3px solid var(--lime); border-radius: 0 11px 11px 0; background: #f0f7ed; color: var(--muted); font-size: 10px; }
.monitor-credentials b { color: var(--forest); font-size: 12px; }
.monitor-credentials code { margin-left: 4px; color: var(--forest-dark); font-weight: 800; }
.monitor-credentials small { margin-top: 3px; line-height: 1.6; }
.field-row { display: grid; grid-template-columns: minmax(0, 1fr) 90px; gap: 10px; }
.rule-box { padding: 12px; border-left: 3px solid var(--lime); border-radius: 0 9px 9px 0; background: #f0f7ed; color: var(--muted); font-size: 10px; line-height: 1.65; }
.table-card { min-height: 460px; overflow: hidden; }.wide-card { width: 100%; }
.toolbar { display: flex; align-items: center; gap: 10px; }.toolbar select { width: 150px; height: 34px; font-size: 10px; }
.lines-heading { gap: 18px; }
.line-bulk-toolbar { flex-wrap: wrap; justify-content: flex-end; }
.bulk-select-control { display: flex; width: max-content; max-width: 100%; align-items: center; gap: 6px; color: var(--muted); font-size: 9px; cursor: pointer; }
.bulk-select-control input:disabled + span { opacity: .55; }
.bulk-select-control input, .line-select { width: 16px; height: 16px; margin: 0; padding: 0; border-radius: 4px; accent-color: var(--forest); }
.batch-button { height: 34px; padding: 0 11px; border: 1px solid #cfe0d4; border-radius: 8px; background: #edf6ef; color: var(--forest); font-size: 9px; font-weight: 800; white-space: nowrap; }
.batch-button:hover, .batch-button.has-selection { border-color: var(--forest); background: var(--forest); color: white; }
.batch-button span { display: inline-grid; min-width: 18px; height: 18px; margin-left: 4px; padding: 0 5px; border-radius: 99px; background: rgb(255 255 255 / 70%); color: var(--forest); place-items: center; }
.batch-delete-button { min-height: 34px; padding: 0 11px; border: 1px solid #e7c9c4; border-radius: 8px; background: #fff7f5; color: var(--danger); font-size: 9px; font-weight: 800; white-space: nowrap; }
.batch-delete-button:not(:disabled):hover, .batch-delete-button.has-selection { border-color: var(--danger); background: var(--danger); color: white; }
.batch-delete-button:disabled { cursor: not-allowed; opacity: .48; }
.batch-delete-button span { display: inline-grid; min-width: 18px; height: 18px; margin-left: 4px; padding: 0 5px; border-radius: 99px; background: rgb(255 255 255 / 76%); color: var(--danger); place-items: center; }
.batch-delete-button.delete-all { border-style: dashed; }
.detail-toolbar { flex-wrap: wrap; justify-content: flex-end; }
.detail-search { display: flex; align-items: center; gap: 7px; }
.detail-search input { width: 230px; height: 34px; border-radius: 9px; font-size: 10px; }
.search-button { height: 34px; padding: 0 12px; border: 0; border-radius: 8px; background: var(--forest); color: white; font-size: 10px; font-weight: 800; }
.search-button:hover { background: var(--forest-dark); }
.text-button { border: 0; background: transparent; color: var(--forest); font-size: 10px; font-weight: 800; }.text-button:hover { text-decoration: underline; }
.mini-metrics { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0 24px 20px; border: 1px solid var(--line); border-radius: 12px; }
.mini-metrics div { display: grid; gap: 3px; padding: 11px 14px; }.mini-metrics div + div { border-left: 1px solid var(--line); }.mini-metrics span { color: var(--muted); font-size: 9px; }.mini-metrics b { font-size: 18px; }
.table-scroll { position: relative; min-height: 310px; overflow-x: auto; border-top: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: 11px; }
th { padding: 12px 14px; background: #f7f9f5; color: #7e8880; font-size: 9px; letter-spacing: .05em; text-align: left; text-transform: uppercase; white-space: nowrap; }
td { padding: 15px 14px; border-top: 1px solid #edf0ed; vertical-align: middle; }
.selection-column { width: 42px; padding-right: 4px; text-align: center; }
tbody tr:hover { background: #fbfcfa; }
.cell-stack { display: grid; gap: 3px; }.cell-stack span, .cell-stack small { color: var(--muted); font-size: 9px; }.mono { font-family: "Cascadia Code", Consolas, monospace; font-weight: 800; }
.tag { display: inline-block; margin: 2px; padding: 5px 7px; border-radius: 7px; background: var(--mint); color: var(--forest); font-family: Consolas, monospace; font-size: 10px; font-weight: 800; }
.credential { display: flex; align-items: center; gap: 5px; white-space: nowrap; }.secret-label { color: var(--muted); font-size: 8px; }.credential-secret { padding: 3px 6px; border: 1px solid #dbe6de; border-radius: 6px; background: #f7faf7; color: var(--forest-dark); font-family: "Cascadia Code", Consolas, monospace; font-size: 10px; font-weight: 800; user-select: all; }.credential button { border: 0; background: transparent; color: #6c7c72; font-size: 8px; font-weight: 750; }.credential button:hover { color: var(--forest); text-decoration: underline; }
.status-pill { display: inline-block; padding: 4px 7px; border-radius: 99px; background: #e6f5ea; color: #34704f; font-size: 9px; font-weight: 800; }.direction-in { background: #e8f0fa; color: #37608b; }.direction-out { background: #f8ecdd; color: #8a592b; }
.danger-button, .edit-button, .listen-button { border: 0; background: transparent; font-size: 10px; font-weight: 800; }.danger-button { color: var(--danger); }.danger-button:disabled { opacity: .5; }.edit-button { color: var(--forest); }.listen-button { padding: 7px 10px; border-radius: 8px; background: var(--forest); color: white; }.listen-button:disabled { opacity: .5; }
.line-actions { display: flex; min-width: 210px; align-items: center; gap: 8px; flex-wrap: wrap; }
.line-actions > button { margin: 0; }
.lines-list-card { width: 100%; min-width: 0; }
.line-list-shell { position: relative; min-width: 0; min-height: 240px; padding: 0 24px 24px; overflow: hidden; border-top: 1px solid var(--line); }
.line-card-list { display: grid; min-width: 0; gap: 12px; padding-top: 16px; }
.line-card { display: grid; min-width: 0; gap: 12px 14px; padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: #fbfcfa; grid-template-columns: 28px minmax(135px, 1fr) minmax(215px, 1.3fr) minmax(240px, 1.4fr) minmax(140px, .85fr); grid-template-areas: "select identity route employees policy" "select actions actions actions actions"; transition: border-color .18s ease, box-shadow .18s ease; }
.line-card:hover { border-color: #c8d4ca; box-shadow: 0 8px 22px rgb(24 47 35 / 6%); }
.line-card:has(.line-select:checked) { border-color: var(--forest); background: #f5faf6; box-shadow: 0 0 0 2px rgb(22 77 59 / 8%); }
.line-card-select { display: flex; grid-area: select; align-items: flex-start; justify-content: center; padding-top: 3px; }
.line-card-identity { display: grid; min-width: 0; grid-area: identity; align-content: start; gap: 5px; }
.line-card-identity b, .line-card-identity small { overflow-wrap: anywhere; }
.line-card-identity small, .line-card-policy small { color: var(--muted); font-size: 9px; line-height: 1.5; }
.line-card-label { color: #849087; font-size: 8px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.line-card-route { display: grid; min-width: 0; grid-area: route; grid-template-columns: minmax(85px, .7fr) minmax(130px, 1.3fr); gap: 10px; }
.line-card-route > div { display: grid; min-width: 0; align-content: start; gap: 6px; }
.line-card-route code { overflow-wrap: anywhere; }
.line-card-upstream .upstream-credential { min-width: 0; flex-wrap: wrap; white-space: normal; }
.line-card-upstream .credential-secret { min-width: 0; max-width: 100%; overflow-wrap: anywhere; white-space: normal; }
.line-card .sip-endpoint { white-space: normal; overflow-wrap: anywhere; }
.line-card-employees { display: grid; min-width: 0; grid-area: employees; align-content: start; gap: 5px; }
.line-card-employees .credential { min-width: 0; max-width: 100%; }
.line-card-employees .tag { flex: 0 1 auto; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.line-card-employees .credential-secret { flex: 0 1 auto; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.line-card-policy { display: grid; min-width: 0; grid-area: policy; align-content: start; gap: 5px; }
.line-card .line-actions { min-width: 0; padding-top: 10px; border-top: 1px dashed var(--line); grid-area: actions; }
.copy-login-button { margin: 2px 4px 2px 0; padding: 6px 8px; border: 1px solid #cfe0d4; border-radius: 7px; background: #edf6ef; color: var(--forest); font-size: 9px; font-weight: 800; white-space: nowrap; }.copy-login-button:hover { border-color: var(--forest); background: #e4f2e8; }.copy-login-button:disabled { cursor: not-allowed; opacity: .58; }
.sip-endpoint { color: var(--forest-dark); font-family: "Cascadia Code", Consolas, monospace; font-size: 10px; font-weight: 800; white-space: nowrap; user-select: all; }
.sip-port-pending { display: inline-block; padding: 4px 7px; border-radius: 7px; background: #fff0dc; color: #8a592b; font-size: 9px; font-weight: 800; white-space: nowrap; }
.tenant-port-note { display: flex; gap: 10px; margin: 0 24px 20px; padding: 11px 14px; border-radius: 10px; background: #edf5ef; color: var(--muted); font-size: 10px; line-height: 1.6; }.tenant-port-note b { flex: 0 0 auto; color: var(--forest); }
.table-actions { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.empty { position: absolute; inset: 0; display: grid; color: #919a93; place-items: center; font-size: 11px; }.empty.hidden { display: none; }
.listen-guide { display: flex; gap: 10px; margin: 0 24px 20px; padding: 12px 14px; border-radius: 10px; background: #edf5ef; color: var(--muted); font-size: 10px; line-height: 1.6; }.listen-guide b { flex: 0 0 auto; color: var(--forest); }.listen-guide code { color: var(--forest-dark); font-weight: 800; }
.live-refresh-note { color: #4b8d69; font-size: 9px; font-weight: 750; white-space: nowrap; }
.active-account { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.active-account > span { width: 7px; height: 7px; border-radius: 50%; background: #39a86b; box-shadow: 0 0 0 4px rgb(57 168 107 / 12%); }
.active-account b { font-family: "Cascadia Code", Consolas, monospace; font-size: 11px; }
.recording-player { width: 420px; height: 36px; }
.recording-cell { display: flex; align-items: center; gap: 9px; white-space: nowrap; }.recording-cell small { color: var(--muted); font-size: 9px; }
.call-route { display: grid; gap: 5px; min-width: 150px; }.transfer-path { color: var(--amber); font-size: 9px; font-weight: 750; white-space: nowrap; }
.waiting-audio-card { display: grid; gap: 11px; padding: 16px; border: 1px dashed var(--line); border-radius: 12px; background: #fbfcfa; }
.waiting-audio-card > span { display: grid; gap: 5px; }.waiting-audio-card b { color: var(--ink); font-size: 12px; }.waiting-audio-card small { color: var(--muted); font-size: 10px; font-weight: 500; line-height: 1.6; }
.waiting-audio-card input[type="file"] { width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; background: white; font-size: 10px; }
.waiting-audio-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }.waiting-audio-actions .compact { width: auto; height: 38px; padding: 0 14px; }.waiting-audio-actions small { margin-left: auto; }
.waiting-audio-preview { width: min(420px, 100%); height: 36px; }
.audit-action { color: var(--forest); font-family: Consolas, monospace; font-size: 10px; font-weight: 800; }
.login-history-note { display: flex; align-items: center; gap: 9px; margin: 0 24px 20px; padding: 11px 14px; border-radius: 10px; background: #edf5ef; color: var(--muted); font-size: 10px; line-height: 1.6; }
.login-status-dot { flex: 0 0 7px; width: 7px; height: 7px; border-radius: 50%; background: #39a86b; box-shadow: 0 0 0 4px rgb(57 168 107 / 12%); }
.login-history-scroll { min-height: 330px; }
.login-ip { color: var(--forest-dark); font-family: "Cascadia Code", Consolas, monospace; font-size: 10px; font-weight: 750; white-space: nowrap; }
.login-history-footer { display: flex; min-height: 62px; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.login-history-footer .secondary { width: auto; height: 36px; padding: 0 15px; }


.modal-backdrop { position: fixed; inset: 0; z-index: 30; display: grid; padding: 22px; background: rgb(9 29 21 / 48%); backdrop-filter: blur(3px); place-items: center; }
.modal-card { width: min(460px, 100%); max-height: calc(100vh - 44px); overflow-y: auto; padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: 0 28px 80px rgb(0 0 0 / 24%); }
.modal-card .card-heading { margin-bottom: 22px; }
.modal-close { width: 34px; height: 34px; border: 0; border-radius: 9px; background: #eef1ed; color: var(--muted); font-size: 20px; line-height: 1; }
.modal-close:hover { color: var(--danger); }
.modal-actions { display: grid; grid-template-columns: 110px 1fr; gap: 10px; margin-top: 4px; }
.credentials-modal { width: min(650px, 100%); }
.bulk-credentials-modal { width: min(1120px, 100%); }
.bulk-password-panel { display: grid; grid-template-columns: minmax(230px, 1fr) max-content max-content; align-items: end; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fafcf9; }
.bulk-password-panel .secondary.compact { width: auto; height: 44px; padding: 0 15px; }
.bulk-password-panel .password-visibility { height: 44px; align-self: end; }
.bulk-credentials-summary { display: flex; align-items: center; justify-content: space-between; gap: 14px; color: var(--muted); font-size: 10px; }
.bulk-credentials-summary b { color: var(--forest); font-size: 11px; }
.bulk-credentials-scroll { max-height: min(48vh, 520px); overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
.bulk-credentials-scroll table { min-width: 850px; }
.bulk-credentials-scroll th { position: sticky; top: 0; z-index: 1; }
.bulk-credentials-scroll td { min-width: 150px; padding: 10px; }
.bulk-credentials-scroll td:first-child { min-width: 115px; }
.bulk-credentials-scroll input { height: 38px; min-width: 145px; border-radius: 8px; font-family: "Cascadia Code", Consolas, monospace; font-size: 10px; }
.credential-edit-context { margin: -8px 0 18px; padding: 10px 12px; border-radius: 9px; background: #f3f6f2; color: var(--muted); font-size: 10px; line-height: 1.6; }
.credential-edit-context b { color: var(--ink); }
.credential-edit-context code { color: var(--forest-dark); font-weight: 800; }
.credential-pair-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.credential-pair { display: grid; min-width: 0; gap: 12px; margin: 0; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fafcf9; }
.credential-pair legend { padding: 0 7px; color: var(--forest); font-size: 11px; font-weight: 850; }
.password-visibility { display: flex; width: max-content; max-width: 100%; align-items: center; gap: 8px; cursor: pointer; }
.password-visibility input { flex: 0 0 17px; width: 17px; height: 17px; margin: 0; padding: 0; accent-color: var(--forest); }
.password-visibility span { color: var(--muted); font-size: 10px; font-weight: 650; }
.secondary { height: 47px; border: 1px solid var(--line); border-radius: 11px; background: #f8faf7; color: var(--muted); font-weight: 750; }
.secondary:hover { border-color: #b9c4bc; color: var(--ink); }
.danger-modal { border-color: #e8c6c1; }
.danger-notice { margin-bottom: 16px; padding: 12px 14px; border-left: 3px solid var(--danger); border-radius: 0 9px 9px 0; background: #fff2f0; color: #7c3731; font-size: 10px; line-height: 1.7; }
.danger-primary { height: 47px; border: 0; border-radius: 11px; background: var(--danger); color: white; font-weight: 800; }
.danger-primary:disabled { cursor: not-allowed; opacity: .42; }
.danger-primary:not(:disabled):hover { background: #7f3029; }
.bulk-delete-modal { width: min(650px, 100%); }
.bulk-delete-summary { margin: -8px 0 14px; color: var(--ink); font-size: 12px; font-weight: 750; line-height: 1.7; }
.bulk-delete-preview { display: flex; max-width: 100%; max-height: min(24vh, 180px); margin-bottom: 16px; padding: 12px; overflow-y: auto; border: 1px solid #ead8d4; border-radius: 10px; background: #fffafa; flex-wrap: wrap; gap: 7px; }
.bulk-delete-preview code { max-width: 100%; padding: 5px 8px; border-radius: 7px; background: #f7e8e5; color: #7c3731; font-size: 10px; font-weight: 800; overflow-wrap: anywhere; }
.bulk-delete-confirm { display: flex; min-width: 0; align-items: flex-start; gap: 10px; margin: 0 0 18px; padding: 12px; border: 1px solid #ead8d4; border-radius: 10px; background: #fffafa; cursor: pointer; }
.bulk-delete-confirm input { flex: 0 0 17px; width: 17px; height: 17px; margin: 1px 0 0; padding: 0; accent-color: var(--danger); }
.bulk-delete-confirm span { min-width: 0; color: #6d3b36; font-size: 10px; font-weight: 650; line-height: 1.6; overflow-wrap: anywhere; }
.bulk-delete-all-confirm { display: grid; min-width: 0; gap: 8px; margin: 0 0 18px; }
.bulk-delete-all-confirm span { color: #6d3b36; font-size: 10px; line-height: 1.6; }
.bulk-delete-all-confirm b { color: var(--danger); }
.bulk-delete-all-confirm input { width: 100%; min-width: 0; border-color: #d8a9a2; }

body.customer-portal {
  --forest: #28577a;
  --forest-dark: #17364f;
  --mint: #e2eff8;
  --lime: #9bd8f3;
  --line: #d9e3eb;
  --paper: #f3f7fa;
  --shadow: 0 18px 45px rgb(32 70 98 / 7%);
}
.customer-portal .sidebar { border-color: #d7e2ea; background: #eaf1f6; }
.customer-portal .portal-badge { background: #d8eaf5; color: #28577a; }
.customer-portal .workspace-chip { border-color: #d4e0e8; background: rgb(255 255 255 / 64%); }
.customer-portal .hero-card { background: linear-gradient(135deg, #17364f, #28577a); }
.customer-portal .notice { border-left-color: #5c9fc7; background: #e9f3f9; color: #506b7c; }
.customer-portal .notice b { color: #28577a; }
.customer-portal .rule-box { background: #eaf4f9; }
.customer-portal .setting-switch { background: #f7fafc; }
.customer-portal .monitor-duration { background: #f7fafc; }
.customer-portal .monitor-credentials { background: #eaf4f9; }
.customer-portal .waiting-audio-card { background: #f7fafc; }
.customer-portal .line-card { background: #f8fbfd; }
.customer-portal .line-card:has(.line-select:checked) { border-color: var(--forest); background: #f0f7fb; }
.customer-portal th { background: #f3f7fa; }

.toast { position: fixed; right: 24px; bottom: 24px; z-index: 40; max-width: 410px; padding: 13px 16px; border-radius: 11px; background: var(--forest-dark); color: white; font-size: 11px; line-height: 1.5; box-shadow: 0 15px 38px rgb(0 0 0 / 20%); opacity: 0; pointer-events: none; transform: translateY(8px); transition: .2s; }.toast.visible { opacity: 1; transform: none; }.toast.error { background: #76332d; }

@media (max-width: 1300px) {
  .line-import-fields { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .line-tenant-field { grid-column: span 2; }.line-server-field { grid-column: span 4; }.line-location-field { grid-column: span 2; }.line-concurrency-field { grid-column: span 1; }.line-password-field { grid-column: span 3; }.line-accounts-field { grid-column: span 6; }
  .line-card { grid-template-columns: 28px repeat(2, minmax(0, 1fr)); grid-template-areas: "select identity route" "select employees policy" "select actions actions"; }
}

@media (max-width: 1050px) {
  .metrics.four, .metrics.four.three { grid-template-columns: repeat(2, 1fr); }
  .section-grid { grid-template-columns: 1fr; }
  .form-card { max-width: none; }
  .signal-orbit { display: none; }
}

@media (max-width: 780px) {
  .login-page { grid-template-columns: 1fr; }.login-copy { min-height: 48vh; padding: 90px 30px 35px; }.login-copy .brand-lockup { top: 28px; left: 30px; }.login-copy h1 { font-size: 41px; }.logic-strip { display: none; }.login-card { width: calc(100% - 48px); padding: 45px 0; }
  .app-shell { grid-template-columns: minmax(0, 1fr); }.sidebar { position: static; height: auto; padding: 16px; }.portal-badge { margin-top: 10px; }.workspace-chip { margin: 15px 0; }nav { display: flex; width: 100%; min-width: 0; overflow-x: auto; }.nav-item { flex: 0 0 auto; }.sidebar-foot { margin-top: 15px; }.content { padding: 0 16px 40px; }.content-header { min-height: 76px; }.online { display: none; }.notice { align-items: flex-start; flex-direction: column; gap: 4px; }.hero-card { min-height: 210px; padding: 28px; }.metrics.four, .metrics.four.three, .two-columns { grid-template-columns: 1fr; }.table-card { min-height: 420px; }.table-scroll table { min-width: 680px; }
  .details-heading { align-items: flex-start; flex-direction: column; gap: 16px; }.detail-toolbar { width: 100%; justify-content: flex-start; }.detail-search { width: 100%; }.detail-search input { width: min(230px, 100%); }.recording-player { width: 340px; }.waiting-audio-actions small { width: 100%; margin-left: 0; }
  .storage-heading { padding: 20px; }.storage-content { padding: 24px 20px 20px; }.storage-summary { grid-template-columns: 1fr; gap: 20px; }.storage-stats > div { padding: 14px 10px; }.storage-stats strong { font-size: 16px; }.storage-foot { align-items: flex-start; flex-wrap: wrap; }.storage-foot small { width: 100%; margin-left: 16px; }
  .lines-heading { align-items: flex-start; flex-direction: column; }.line-bulk-toolbar { width: 100%; justify-content: flex-start; }
  .line-bulk-toolbar select { flex: 1 1 145px; max-width: 100%; }.bulk-select-control { flex: 1 1 100%; }.batch-delete-button { max-width: 100%; }
  .line-import-fields { grid-template-columns: 1fr; }.line-import-fields > label { grid-column: 1; }.line-import-footer { grid-template-columns: 1fr; }.line-import-footer .primary { min-height: 47px; }
  .line-list-shell { padding: 0 14px 14px; }.line-card { grid-template-columns: 24px minmax(0, 1fr); grid-template-areas: "select identity" "route route" "employees employees" "policy policy" "actions actions"; }.line-card-route { grid-template-columns: 1fr; }.line-card .line-actions { padding-top: 12px; }
  .modal-backdrop { padding: 12px; }.modal-card { max-height: calc(100vh - 24px); padding: 20px; }.credential-pair-grid { grid-template-columns: 1fr; }.bulk-password-panel { grid-template-columns: 1fr; align-items: stretch; }.bulk-password-panel .secondary.compact { width: 100%; }.bulk-password-panel .password-visibility { height: auto; }.bulk-credentials-summary { align-items: flex-start; flex-direction: column; gap: 5px; }.bulk-credentials-scroll { max-height: 46vh; }
}

@media (max-width: 430px) {
  .storage-stats { grid-template-columns: 1fr; }
  .storage-stats > div + div { border-top: 1px solid var(--line); border-left: 0; }
  .modal-actions { grid-template-columns: 1fr; }
}
