:root {
    --ink: #212121;
    --muted: #66706b;
    --line: #e7e9e8;
    --surface: #fff;
    --canvas: #f8f8f6;
    --nav: #1c244b;
    --primary: #f88d2b;
    --primary-dark: #e47714;
    --primary-soft: #fff3e8;
    --danger: #b42318;
    --success: #067647;
    --radius: 12px;
    font-family: "Poppins", "Segoe UI", ui-sans-serif, system-ui, sans-serif;
    color: var(--ink);
    background: var(--canvas);
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--canvas); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--primary); }
code { font-size: .9em; }
.topbar { height: 76px; padding: 0 32px; display: flex; align-items: center; justify-content: space-between; color: var(--ink); background: #fff; border-bottom: 3px solid var(--primary); box-shadow: 0 2px 12px rgba(28,36,75,.06); }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--nav); text-decoration: none; font-weight: 700; letter-spacing: -.02em; }
.brand-mark { width: 48px; height: 39px; position: relative; display: inline-block; flex: none; font-family: Arial Black, Arial, sans-serif; font-size: 34px; font-style: italic; font-weight: 900; line-height: 39px; letter-spacing: -16px; }
.brand-mark span:first-child { color: var(--nav); }
.brand-mark span:last-child { position: relative; left: 1px; color: var(--primary); text-shadow: -1px 1px 0 #fff; }
.brand-copy { display: flex; flex-direction: column; line-height: 1.05; }
.brand-copy small { margin-top: 4px; color: #7a807d; font-size: 9px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.brand-name { display: inline-flex; gap: 4px; align-items: baseline; font-size: 16px; letter-spacing: -.04em; }
.brand-name strong { color: var(--nav); font-weight: 800; }
.brand-name em { color: var(--primary); font-style: normal; font-weight: 800; }
.user-menu { display: flex; align-items: center; gap: 20px; color: #5f6864; font-size: 13px; }
.user-menu form { margin: 0; }
.link-button { padding: 7px 11px; border: 1px solid #e1e4e2; border-radius: 7px; color: var(--nav); background: #fff; cursor: pointer; font-size: 12px; font-weight: 650; }
.link-button:hover { text-decoration: underline; }
.app-shell { min-height: calc(100vh - 76px); display: grid; grid-template-columns: 255px minmax(0, 1fr); }
.sidebar { padding: 32px 17px; background: var(--nav); border-right: 0; box-shadow: 5px 0 18px rgba(28,36,75,.07); }
.nav-label { margin: 0 13px 13px; color: #959bb9; font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.nav-item { position: relative; display: grid; grid-template-columns: 10px 1fr; column-gap: 11px; align-items: center; padding: 12px 13px; margin: 5px 0; color: #e6e8f2; text-decoration: none; border-radius: 9px; font-size: 13px; font-weight: 600; }
.nav-item small { grid-column: 2; margin-top: 3px; color: #959bb9; font-size: 10px; font-weight: 400; }
.nav-item:hover { background: rgba(255,255,255,.08); }
.nav-item.active { color: #fff; background: var(--primary); box-shadow: 0 7px 18px rgba(248,141,43,.22); }
.nav-item.active small { color: #fff4ea; }
.nav-dot { width: 7px; height: 7px; border-radius: 99px; background: #747b9e; }
.nav-item.active .nav-dot { background: #fff; box-shadow: 0 0 0 3px rgba(255,255,255,.22); }
.content { width: 100%; max-width: 1500px; padding: 38px 42px 70px; overflow: hidden; }
.page-heading { min-height: 80px; margin-bottom: 24px; display: flex; justify-content: space-between; align-items: end; gap: 24px; }
.page-heading h1 { margin: 4px 0 6px; color: var(--nav); font-size: 30px; font-weight: 700; line-height: 1.2; letter-spacing: -.035em; }
.page-heading p { margin: 0; color: var(--muted); font-size: 14px; }
.eyebrow { color: var(--primary) !important; font-size: 10px !important; font-weight: 750; letter-spacing: .13em; text-transform: uppercase; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 8px 28px rgba(28,36,75,.055); }
.toolbar { display: flex; align-items: center; gap: 8px; padding: 16px; border-bottom: 1px solid var(--line); }
.search { flex: 1; max-width: 420px; }
input, select, textarea { width: 100%; padding: 10px 12px; color: var(--ink); background: #fff; border: 1px solid #cfd4dc; border-radius: 7px; outline: none; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(248,141,43,.15); }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: #d92d20; }
textarea { min-height: 104px; resize: vertical; }
.button { min-height: 39px; display: inline-flex; align-items: center; justify-content: center; padding: 8px 15px; border: 1px solid #d7dad8; border-radius: 8px; color: #39413d; background: #fff; font-weight: 650; font-size: 12px; text-decoration: none; cursor: pointer; white-space: nowrap; }
.button:hover { background: #f9fafb; }
.button-primary { color: #fff; border-color: var(--primary); background: var(--primary); }
.button-primary:hover { background: var(--primary-dark); }
.button-danger { color: #fff; border-color: var(--danger); background: var(--danger); }
.button-danger:hover { background: #912018; }
.button-quiet { border-color: transparent; background: transparent; }
.button-small { min-height: 32px; padding: 5px 11px; }
.button-block { width: 100%; }
.button:disabled { opacity: .5; cursor: not-allowed; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { padding: 12px 16px; color: #626b67; background: #f7f7f5; font-size: 10px; letter-spacing: .08em; text-align: left; text-transform: uppercase; white-space: nowrap; }
td { max-width: 270px; padding: 14px 16px; border-top: 1px solid var(--line); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
tbody tr:hover { background: #fcfcfd; }
.row-actions { width: 1%; text-align: right; }
.empty-state { padding: 55px; color: var(--muted); text-align: center; }
.muted { color: var(--muted); }
.status { display: inline-block; padding: 3px 8px; border-radius: 99px; font-size: 11px; font-weight: 700; }
.status-on { color: #16724c; background: #edf9f2; }
.status-off { color: #b42318; background: #fef3f2; }
.pagination { padding: 14px 16px; display: flex; justify-content: flex-end; align-items: center; gap: 18px; color: var(--muted); border-top: 1px solid var(--line); font-size: 13px; }
.pagination a { font-weight: 650; text-decoration: none; }
.alert { margin: 0 0 20px; padding: 13px 15px; border: 1px solid; border-radius: 8px; font-size: 14px; line-height: 1.5; transition: opacity .25s ease; }
.alert.dismissed { opacity: 0; }
.alert-success { color: #05603a; border-color: #abefc6; background: #ecfdf3; }
.alert-error { color: #912018; border-color: #fecdca; background: #fef3f2; }
.alert-warning { color: #7a2e0e; border-color: #fedf89; background: #fffaeb; }
.technical { display: inline-block; margin-top: 6px; color: #b54708; font-size: 12px; }
.back-link { display: inline-block; margin-bottom: 8px; color: #d96e0d; font-size: 12px; font-weight: 650; text-decoration: none; }
.record-form { padding: 26px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 26px; row-gap: 21px; }
.form-field label:not(.switch) { display: block; margin-bottom: 6px; color: #344054; font-size: 13px; font-weight: 650; }
.form-field small { display: block; margin-top: 5px; color: #667085; font-size: 11px; line-height: 1.45; }
.form-field .field-error { color: #b42318; }
.required { color: #d92d20; }
.forward-builder { grid-column: 1 / -1; margin: 0; padding: 18px 20px 20px; border: 1px solid #fed7b4; border-radius: 10px; background: #fffaf5; }
.forward-builder legend { padding: 0 7px; color: var(--nav); font-size: 13px; font-weight: 700; }
.forward-builder > p { margin: -1px 0 17px; color: var(--muted); font-size: 11px; }
.forward-subtype { max-width: calc(50% - 13px); margin-bottom: 20px; }
.forward-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 26px; }
.forward-fields[data-forward-fields="pstn"] { grid-template-columns: minmax(0, calc(50% - 13px)); }
[hidden] { display: none !important; }
.switch { min-height: 42px; display: flex; align-items: center; gap: 10px; color: #344054; font-size: 13px; font-weight: 650; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; }
.switch span { width: 38px; height: 22px; position: relative; flex: none; border-radius: 99px; background: #d0d5dd; transition: background .15s; }
.switch span::after { content: ""; width: 18px; height: 18px; position: absolute; left: 2px; top: 2px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .15s; }
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus + span { box-shadow: 0 0 0 3px rgba(248,141,43,.18); }
.form-actions { margin: 30px -26px -26px; padding: 18px 26px; display: flex; justify-content: flex-end; gap: 9px; border-top: 1px solid var(--line); background: #fcfcfd; border-radius: 0 0 var(--radius) var(--radius); }
.danger-zone { margin-top: 22px; padding: 20px 22px; display: flex; align-items: center; justify-content: space-between; gap: 25px; border: 1px solid #fecdca; border-radius: var(--radius); background: #fff; }
.danger-zone h2 { margin: 0 0 3px; font-size: 15px; }
.danger-zone p { margin: 0; color: var(--muted); font-size: 12px; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: linear-gradient(135deg, #1c244b 0%, #252f61 48%, #f88d2b 48%, #e47714 100%); }
.login-card { width: min(100%, 430px); padding: 40px; border: 0; border-radius: 18px; background: #fff; box-shadow: 0 24px 70px rgba(10,16,43,.25); }
.login-brand { margin-bottom: 30px; }
.brand-lockup { display: inline-flex; align-items: center; gap: 9px; }
.login-card h1 { margin: 4px 0 8px; color: var(--nav); font-size: 28px; letter-spacing: -.03em; }
.login-card > .muted { margin: 0 0 25px; line-height: 1.55; }
.login-card .alert { margin-top: 20px; }
.login-form { display: grid; gap: 17px; margin-top: 22px; }
.login-form label { color: #344054; font-size: 13px; font-weight: 650; }
.login-form input { margin-top: 6px; }
.captcha-field { min-height: 78px; display: flex; justify-content: center; overflow: hidden; }
.sr-only { width: 1px; height: 1px; position: absolute; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
@media (max-width: 840px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar { padding: 10px 14px; display: flex; gap: 5px; overflow-x: auto; border-right: 0; border-bottom: 0; }
    .nav-label { display: none; }
    .nav-item { min-width: max-content; grid-template-columns: 10px 1fr; }
    .nav-item small { display: none; }
    .content { padding: 28px 20px 60px; }
    .form-grid { grid-template-columns: 1fr; }
    .forward-fields, .forward-fields[data-forward-fields="pstn"] { grid-template-columns: 1fr; }
    .forward-subtype { max-width: none; }
}
@media (max-width: 580px) {
    .topbar { padding: 0 16px; }
    .brand > span:last-child, .user-menu > span { display: none; }
    .page-heading { align-items: stretch; flex-direction: column; }
    .toolbar { align-items: stretch; flex-wrap: wrap; }
    .search { min-width: 100%; }
    .record-form { padding: 20px 16px; }
    .form-actions { margin: 26px -16px -20px; padding: 16px; }
    .danger-zone { align-items: stretch; flex-direction: column; }
}
