:root {
  font-family: "Segoe UI", system-ui, sans-serif;
  color: #17332b;
  background: #f3f6f3;
  font-synthesis: none;
  --ink: #17332b;
  --muted: #52685f;
  --deep: #102722;
  --accent: #226a53;
  --border: #dce5dd;
  --paper: #fff;
  --danger: #9b3232;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 280px; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid #488c76; outline-offset: 3px; }
a { color: inherit; }
h1, h2, h3, p, dl, dd { margin: 0; }
h1 { font-size: clamp(1.85rem, 3vw, 2.7rem); letter-spacing: -.047em; font-weight: 700; line-height: 1.1; }
h2 { font-size: 1.15rem; letter-spacing: -.025em; }
p, dd { overflow-wrap: anywhere; }
[hidden] { display: none !important; }

.skip-link { position: fixed; top: 10px; left: 10px; z-index: 4; background: var(--paper); padding: 10px 15px; border-radius: 6px; transform: translateY(-150%); }
.skip-link:focus { transform: none; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 1.05rem; font-weight: 750; letter-spacing: -.025em; white-space: nowrap; }
.brand-symbol { position: relative; display: inline-grid; width: 34px; height: 34px; flex: none; place-items: center; border-radius: 10px; overflow: hidden; background: #b5e2cd; }
.brand-symbol::before { content: ""; width: 17px; height: 17px; border: 2px solid #15382d; border-radius: 5px; transform: rotate(45deg); }
.brand-symbol::after { content: ""; position: absolute; width: 3px; height: 20px; border-radius: 2px; transform: rotate(45deg); background: #15382d; }
.loading { min-height: 100dvh; display: grid; place-content: center; justify-items: center; gap: 14px; padding: 24px; }
.loading p { color: var(--muted); }

.auth-layout { display: grid; grid-template-columns: minmax(270px, .85fr) minmax(360px, 1.15fr); min-height: 100dvh; }
.auth-brand { position: relative; overflow: hidden; isolation: isolate; display: flex; flex-direction: column; justify-content: space-between; min-height: 520px; padding: clamp(30px, 5vw, 72px); background: var(--deep); color: #f3faf5; }
.auth-brand::before, .auth-brand::after { content: ""; position: absolute; z-index: -1; border: 1px solid #39695a; border-radius: 50%; aspect-ratio: 1; pointer-events: none; }
.auth-brand::before { width: 530px; top: 51%; left: 34%; box-shadow: 0 0 0 45px #255344, 0 0 0 46px #39695a, 0 0 0 95px #1c4035, 0 0 0 96px #39695a, 0 0 0 147px #17352c; }
.auth-brand::after { width: 360px; top: 45%; left: 14%; }
.auth-brand-title { width: min-content; margin-bottom: 24px; font-size: clamp(2.1rem, 4.4vw, 4.6rem); font-weight: 650; line-height: .98; letter-spacing: -.065em; }
.auth-content { display: grid; place-items: center; padding: 42px clamp(24px, 5vw, 80px); background: var(--paper); }
.auth-card { display: grid; gap: 25px; width: min(100%, 405px); }
.auth-card h1 { margin-bottom: 10px; }
.auth-card p { color: var(--muted); line-height: 1.5; }
.auth-card form { display: grid; gap: 18px; }
.auth-card .button-primary { margin-top: 5px; min-height: 46px; }

.layout { display: grid; grid-template-columns: 242px minmax(0, 1fr); min-height: 100dvh; }
.sidebar { background: var(--deep); color: #f6fbf8; display: flex; flex-direction: column; gap: 32px; padding: 29px 20px; }
.sidebar .brand { margin-left: 7px; align-self: flex-start; }
.sidebar-nav { display: grid; gap: 5px; }
.nav-button { border: none; background: transparent; color: #dcece4; border-radius: 8px; padding: 10px 12px; text-align: left; font-weight: 650; overflow-wrap: anywhere; }
.nav-button:hover, .nav-button[aria-current="page"] { background: #244438; color: #fff; }
.nav-button[aria-current="page"] { cursor: default; }
.sidebar-footer { display: grid; gap: 6px; margin-top: auto; }
.user-email { color: #bed3c8; font-size: .84rem; padding: 0 12px 7px; overflow-wrap: anywhere; }
.main { width: min(100%, 1380px); padding: 48px clamp(24px, 4vw, 60px) 60px; display: grid; align-content: start; gap: 23px; outline: none; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; }
.page-head div { min-width: 0; }
.page-head h1 { overflow-wrap: anywhere; }
.page-head p { margin-top: 8px; color: var(--muted); line-height: 1.45; }
.page-head .button { flex-shrink: 0; }
.breadcrumb { width: max-content; border: none; background: none; color: var(--accent); padding: 0; font-weight: 650; }
.breadcrumb:hover { text-decoration: underline; }

.summary { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.card { background: var(--paper); border: 1px solid var(--border); border-radius: 12px; }
.summary-card { padding: 19px 20px; }
.summary-card dl { display: flex; flex-wrap: wrap; gap: 16px 26px; margin-top: 11px; }
.summary-card dt, .credential dt { font-size: .79rem; color: var(--muted); margin-bottom: 4px; }
.summary-card dd { font-weight: 630; }
.stacked-card { min-width: 0; }
.card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.status-line { color: var(--muted); font-size: .9rem; }
.status-line-error { color: var(--danger); }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .93rem; }
th { padding: 12px 17px; font-size: .78rem; font-weight: 650; color: var(--muted); background: #f8faf8; white-space: nowrap; }
td { padding: 13px 17px; border-top: 1px solid #e9efe9; overflow-wrap: anywhere; }
tbody tr:first-child td { border-top: 0; }
tbody tr:hover { background: #fcfdfc; }
.number { font-weight: 750; font-variant-numeric: tabular-nums; }
.sip-user, .credential-value { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }
.sip-user { font-size: .84rem; color: #416755; }
.actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 6px; }
.actions-column { text-align: right; }
.tag { display: inline-flex; align-items: center; gap: 6px; border-radius: 15px; padding: 4px 7px; white-space: nowrap; font-size: .77rem; font-weight: 650; color: #3c554b; background: #eff3ee; }
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 100%; background: currentColor; }
.tag-green { color: #17523b; background: #def3e6; }
.tag-wait { color: #684c17; background: #faf0d8; }
.empty { padding: 35px 20px; text-align: center; }
.empty p { color: var(--muted); margin: 7px 0 14px; }

.button { min-height: 36px; border: 1px solid transparent; border-radius: 8px; padding: 8px 13px; font-weight: 650; display: inline-flex; align-items: center; justify-content: center; gap: 6px; line-height: 1.25; text-align: center; text-decoration: none; }
.button-primary { background: var(--accent); color: #fff; }
.button-primary:hover:not(:disabled) { background: #19543f; }
.button-secondary { color: var(--ink); background: #fff; border-color: #cfdcd1; }
.button-secondary:hover:not(:disabled) { background: #f1f6f1; }
.button-text { color: var(--accent); background: transparent; }
.button-text:hover:not(:disabled) { background: #ebf4ed; }
.button-small { font-size: .83rem; padding: 6px 8px; min-height: 32px; }
.button-danger { color: #fff; background: #a33737; }
.button-danger:hover:not(:disabled) { background: #852222; }
.text-danger { color: var(--danger); }

.field { display: grid; gap: 6px; align-content: start; }
.field label { font-weight: 650; font-size: .91rem; }
.field input:not([type=checkbox]) { min-width: 0; min-height: 42px; padding: 8px 11px; border: 1px solid #cbd8ce; background: #fff; color: var(--ink); border-radius: 7px; }
.field input[readonly] { background: #f1f5f1; }
.field small { color: var(--muted); line-height: 1.35; }
.toggle-field { display: flex; flex-direction: row; align-items: center; gap: 8px; }
.toggle-field input { width: 18px; height: 18px; accent-color: var(--accent); }
.form-error { color: var(--danger); font-size: .9rem; font-weight: 600; }

dialog { width: min(calc(100% - 28px), 500px); max-height: calc(100dvh - 28px); margin: auto; padding: 0; border: 1px solid var(--border); border-radius: 14px; color: var(--ink); box-shadow: 0 18px 80px #0b211b38; }
dialog::backdrop { background: #10272275; }
.dialog-pane { display: grid; gap: 17px; padding: 23px; }
.dialog-top { display: grid; grid-template-columns: 1fr auto; align-items: start; gap: 8px 16px; }
.dialog-top h2 { font-size: 1.36rem; align-self: center; }
.dialog-top p { grid-column: 1 / -1; color: var(--muted); line-height: 1.45; }
.close-dialog { background: transparent; border: 0; width: 34px; height: 34px; border-radius: 6px; font-size: 1.5rem; color: var(--muted); }
.close-dialog:hover { background: #edf3ee; }
.dialog-form, .credential { display: grid; gap: 13px; }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding-top: 5px; }
.credential { border-radius: 8px; background: #f1f6f1; padding: 13px; }
.credential-value { font-size: .91rem; font-weight: 600; }
.notice { position: fixed; right: 20px; bottom: 20px; z-index: 3; max-width: min(420px, calc(100% - 40px)); color: #fff; background: var(--deep); border: 1px solid #4a7464; border-radius: 9px; box-shadow: 0 12px 34px #12241a2a; padding: 12px 16px; font-weight: 600; font-size: .9rem; }

@media (max-width: 980px) {
  .layout { grid-template-columns: 186px minmax(0, 1fr); }
  .sidebar { padding: 24px 13px; }
  .main { padding: 35px 23px; }
}

@media (max-width: 720px) {
  .auth-layout { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .auth-brand { min-height: 0; padding: 24px; gap: 26px; }
  .auth-brand-title { width: auto; margin-bottom: 0; }
  .auth-brand::before { left: 56%; top: -125px; }
  .auth-brand::after { left: 49%; top: -110px; }
  .auth-content { align-items: start; padding: 32px 24px 44px; }
  .layout { grid-template-columns: 1fr; }
  .sidebar { gap: 12px; padding: 13px 15px; }
  .sidebar .brand { margin-left: 0; }
  .sidebar-nav, .sidebar-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
  .sidebar-nav:empty { display: none; }
  .sidebar-footer { align-self: end; justify-content: flex-end; }
  .nav-button { padding: 7px 9px; font-size: .87rem; }
  .user-email { margin-right: auto; padding: 0 8px 0 0; }
  .main { padding: 26px 15px 40px; gap: 16px; }
  .page-head { align-items: flex-start; }
  .page-head h1 { font-size: 1.9rem; }
  .summary { grid-template-columns: 1fr; gap: 10px; }
  .summary-card { padding: 14px; }
  table, tbody { display: block; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  tbody tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; padding: 14px; }
  tbody tr + tr { border-top: 1px solid var(--border); }
  td { display: grid; justify-items: start; gap: 4px; border: 0; padding: 0; }
  td::before { content: attr(data-label); color: var(--muted); font-family: "Segoe UI", system-ui, sans-serif; font-size: .74rem; font-weight: 550; }
  td[data-label="Usuário SIP"], td[data-label="Acesso"], td:last-child { grid-column: 1 / -1; }
  td:last-child::before { display: none; }
  td .actions { justify-content: flex-start; }
}

@media (max-width: 380px) {
  .page-head { flex-wrap: wrap; }
  .page-head .button { width: 100%; }
  .dialog-pane { padding: 16px; }
}
