:root {
  --ink: #10231d;
  --muted: #66756f;
  --line: #e3e9e6;
  --paper: #ffffff;
  --canvas: #f4f7f5;
  --brand: #087b56;
  --brand-dark: #075c43;
  --brand-soft: #e5f5ef;
  --danger: #b53a3a;
  --danger-soft: #fff0f0;
  --warning: #966b12;
  --shadow: 0 12px 40px rgba(19, 50, 39, .08);
}

* { box-sizing: border-box; }
html { font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ink); background: var(--canvas); }
body { margin: 0; min-height: 100vh; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: var(--brand); }
.hidden { display: none !important; }

.login-view { min-height: 100vh; display: grid; place-items: center; padding: 32px 20px; background:
  radial-gradient(circle at 20% 10%, rgba(22, 147, 105, .18), transparent 28rem),
  linear-gradient(140deg, #f8fbf9 0%, #edf4f0 100%); }
.login-card { width: min(440px, 100%); background: var(--paper); border: 1px solid rgba(8, 123, 86, .12); border-radius: 24px; box-shadow: var(--shadow); padding: 34px; }
.login-brand, .brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.login-brand strong, .brand strong { display: block; font-size: 16px; }
.login-brand small, .brand small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.brand-mark { width: 42px; height: 42px; border-radius: 13px; background: var(--brand); color: white; display: grid; place-items: center; box-shadow: 0 8px 18px rgba(8, 123, 86, .2); }
.brand-mark svg { width: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.login-copy { margin: 42px 0 26px; }
.eyebrow { display: block; color: var(--brand); text-transform: uppercase; letter-spacing: .12em; font-size: 10px; font-weight: 800; margin-bottom: 8px; }
h1, h2, h3, p { margin-top: 0; }
.login-copy h1 { font-size: 28px; letter-spacing: -.04em; margin-bottom: 10px; }
.login-copy p, .section-header p { color: var(--muted); line-height: 1.55; margin-bottom: 0; }
form label { display: grid; gap: 7px; margin-bottom: 18px; font-size: 13px; font-weight: 700; }
input, select { width: 100%; border: 1px solid #d5dfda; background: white; color: var(--ink); border-radius: 10px; padding: 12px 13px; outline: none; transition: .2s; }
input:focus, select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(8, 123, 86, .1); }
label small, .hint { color: var(--muted); font-weight: 400; line-height: 1.45; }
.optional { color: var(--muted); font-weight: 400; }
.button { border: 1px solid transparent; border-radius: 10px; padding: 11px 16px; font-weight: 750; transition: .18s; white-space: nowrap; }
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .6; cursor: wait; transform: none; }
.button.primary { background: var(--brand); color: white; box-shadow: 0 7px 16px rgba(8, 123, 86, .18); }
.button.primary:hover { background: var(--brand-dark); }
.button.ghost { background: white; color: var(--ink); border-color: var(--line); }
.button.danger { background: var(--danger-soft); color: var(--danger); border-color: #f5cccc; }
.button.wide { width: 100%; }
.button.tiny { padding: 7px 10px; font-size: 11px; box-shadow: none; }
.login-help { text-align: center; color: var(--muted); font-size: 12px; margin: 22px 0 0; }
.alert { border-radius: 10px; padding: 12px 14px; margin-bottom: 18px; font-size: 13px; line-height: 1.45; }
.alert.error { color: #912d2d; background: #fff0f0; border: 1px solid #f5cccc; }
.alert.warning { color: #72500c; background: #fff9e7; border: 1px solid #efe1a9; }

.panel-view { min-height: 100vh; display: grid; grid-template-columns: 240px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 22px 16px; background: #0e1d18; color: #dce9e4; display: flex; flex-direction: column; z-index: 20; }
.sidebar .brand { padding: 2px 8px 24px; color: white; }
.sidebar .brand-mark { width: 38px; height: 38px; border-radius: 11px; }
.sidebar .brand small { color: #8ea89e; }
.sidebar nav { display: grid; gap: 5px; }
.nav-item { width: 100%; border: 0; background: transparent; color: #9fb1aa; text-decoration: none; text-align: left; display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 9px; font-size: 13px; font-weight: 650; }
.nav-item:hover { color: white; background: rgba(255,255,255,.05); }
.nav-item.active { color: white; background: rgba(17, 158, 109, .2); }
.nav-icon { width: 18px; text-align: center; font-size: 17px; }
.nav-section { display: block; margin: 22px 12px 7px; color: #60766e; font-size: 9px; font-weight: 850; text-transform: uppercase; letter-spacing: .14em; }
.sidebar-bottom { margin-top: auto; display: grid; gap: 5px; border-top: 1px solid rgba(255,255,255,.08); padding-top: 14px; }
.workspace { min-width: 0; }
.topbar { height: 84px; padding: 0 32px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.9); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 10; backdrop-filter: blur(12px); }
.topbar h1 { margin: 2px 0 0; font-size: 19px; letter-spacing: -.02em; }
.topbar > div:first-of-type > span { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; font-weight: 750; }
.user-chip { display: flex; align-items: center; gap: 10px; }
.user-chip > span { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 10px; background: var(--brand-soft); color: var(--brand); font-weight: 850; }
.user-chip strong, .user-chip small { display: block; font-size: 12px; }
.user-chip small { color: var(--muted); margin-top: 2px; font-size: 10px; }
#main-content { max-width: 1400px; padding: 34px 36px 70px; margin: 0 auto; outline: none; }
.section-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.section-header h2 { font-size: 25px; letter-spacing: -.035em; margin-bottom: 7px; }
.section-header p { max-width: 680px; font-size: 13px; }
.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 22px; }
.metric-card, .card { background: var(--paper); border: 1px solid var(--line); border-radius: 15px; box-shadow: 0 4px 16px rgba(19, 50, 39, .035); }
.metric-card { padding: 22px; }
.metric-card > span, .metric-card small { color: var(--muted); display: block; font-size: 11px; }
.metric-card strong { display: block; font-size: 29px; margin: 12px 0 5px; letter-spacing: -.04em; }
.card { padding: 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 17px; }
.card-head h2 { font-size: 17px; margin: 0; }
.domain-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.domain-card { border: 1px solid var(--line); background: #fbfdfc; border-radius: 12px; padding: 15px; display: flex; align-items: center; gap: 13px; text-align: left; color: inherit; transition: .18s; }
.domain-card:hover { border-color: #9ecdbc; transform: translateY(-1px); box-shadow: 0 7px 18px rgba(19,50,39,.07); }
.domain-symbol, .customer-avatar { width: 38px; height: 38px; flex: 0 0 auto; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-weight: 850; }
.domain-info { min-width: 0; flex: 1; }
.domain-info strong, .domain-info small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.domain-info small { color: var(--muted); margin-top: 4px; font-size: 10px; }
.arrow { color: var(--brand); }
.split { align-items: center; }
.domain-select { border: 0; background: transparent; font-size: 24px; font-weight: 800; letter-spacing: -.03em; padding: 0 35px 0 0; width: auto; max-width: 100%; }
.usage-line { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: -8px 0 18px; font-size: 11px; color: var(--muted); }
.usage-line strong { color: var(--ink); }
.progress { width: min(360px, 45%); height: 5px; border: 0; border-radius: 20px; overflow: hidden; background: #dfe8e4; appearance: none; }
.progress::-webkit-progress-bar { background: #dfe8e4; border-radius: 20px; }
.progress::-webkit-progress-value { background: var(--brand); border-radius: 20px; }
.progress::-moz-progress-bar { background: var(--brand); border-radius: 20px; }
.table-card { padding: 0; overflow: hidden; }
.data-table { min-width: 720px; }
.table-row { display: grid; grid-template-columns: 2fr 1.3fr .7fr 1fr; gap: 18px; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.table-row:last-child { border: 0; }
.table-head { background: #f8faf9; color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; padding-top: 11px; padding-bottom: 11px; }
.mail-address { display: flex; align-items: center; gap: 10px; color: var(--ink); min-width: 0; }
.mail-address strong { overflow: hidden; text-overflow: ellipsis; }
.mini-avatar { width: 28px; height: 28px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 8px; background: var(--brand-soft); color: var(--brand); font-weight: 800; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.empty-state { min-height: 230px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 30px; grid-column: 1 / -1; }
.empty-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; color: var(--brand); background: var(--brand-soft); margin-bottom: 12px; }
.empty-state h3 { font-size: 16px; margin-bottom: 7px; }
.empty-state p { color: var(--muted); font-size: 12px; max-width: 420px; margin-bottom: 17px; }
.customer-list { display: grid; }
.customer-card { display: grid; grid-template-columns: minmax(190px, 1fr) minmax(250px, 2fr) auto auto; align-items: center; gap: 18px; padding: 17px 20px; border-bottom: 1px solid var(--line); }
.customer-card:last-child { border: 0; }
.customer-main { display: flex; align-items: center; gap: 11px; min-width: 0; }
.customer-main strong, .customer-main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.customer-main small { color: var(--muted); font-size: 10px; margin-top: 3px; }
.customer-avatar { width: 34px; height: 34px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 5px; }
.tag { border: 1px solid #cce4db; color: var(--brand-dark); background: #eff9f5; border-radius: 20px; padding: 5px 8px 5px 10px; font-size: 10px; }
.tag-remove { border: 0; background: transparent; color: inherit; padding: 0 2px; font-weight: 900; }
.status { border-radius: 20px; padding: 5px 9px; font-size: 9px; font-weight: 800; }
.status.success { background: var(--brand-soft); color: var(--brand-dark); }
.status.muted-status { background: #edf0ee; color: #65716c; }
.admin-domain-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.admin-domain-card { display: grid; gap: 20px; }
.domain-title { display: flex; align-items: center; gap: 12px; }
.domain-title h3 { font-size: 15px; margin: 0 0 4px; }
.domain-title small { color: var(--muted); }
.domain-meta { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 10px; }
.domain-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.loading { min-height: 300px; display: grid; place-items: center; align-content: center; gap: 12px; color: var(--muted); font-size: 12px; }
.loading span { width: 25px; height: 25px; border: 3px solid #dbe8e3; border-top-color: var(--brand); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

dialog { border: 0; padding: 0; border-radius: 18px; width: min(520px, calc(100% - 28px)); box-shadow: 0 24px 80px rgba(10,30,23,.25); }
dialog::backdrop { background: rgba(6, 20, 15, .55); backdrop-filter: blur(3px); }
.modal { padding: 26px; }
.modal-wide { width: 100%; }
dialog:has(.modal-wide) { width: min(720px, calc(100% - 28px)); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 22px; }
.modal-head h2 { font-size: 21px; margin: 0; }
.close { width: 33px; height: 33px; border: 0; background: #f0f3f1; border-radius: 9px; color: var(--muted); font-size: 20px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; }
.input-suffix { display: flex; align-items: stretch; }
.input-suffix input { border-radius: 10px 0 0 10px; }
.input-suffix span { display: flex; align-items: center; padding: 0 11px; border: 1px solid #d5dfda; border-left: 0; border-radius: 0 10px 10px 0; background: #f4f7f5; color: var(--muted); font-weight: 500; font-size: 12px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 16px; }
.muted { color: var(--muted); font-size: 12px; }
.dns-content { max-height: 55vh; overflow: auto; margin: 0; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: #0f201a; color: #d8f2e8; font: 11px/1.65 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; word-break: break-word; }
.toast-region { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: grid; gap: 8px; }
.toast { max-width: 390px; padding: 12px 15px; border-radius: 10px; color: white; background: #163d30; box-shadow: var(--shadow); font-size: 12px; animation: toast-in .2s ease-out; }
.toast.error { background: #8d3030; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.mobile-only { display: none; }

@media (max-width: 1050px) {
  .customer-card { grid-template-columns: 1fr auto; }
  .customer-card .tag-list { grid-column: 1 / -1; grid-row: 2; }
  .customer-card .row-actions { grid-column: 1 / -1; justify-content: flex-start; }
}
@media (max-width: 760px) {
  .panel-view { display: block; }
  .sidebar { position: fixed; left: -260px; width: 240px; transition: .2s; box-shadow: 20px 0 50px rgba(0,0,0,.2); }
  .sidebar.open { left: 0; }
  .mobile-only { display: grid; }
  .icon-button { border: 0; background: #edf3f0; width: 37px; height: 37px; place-items: center; border-radius: 9px; margin-right: 12px; }
  .topbar { padding: 0 17px; justify-content: flex-start; }
  .user-chip { margin-left: auto; }
  .user-chip div { display: none; }
  #main-content { padding: 24px 16px 50px; }
  .section-header { align-items: flex-start; flex-direction: column; }
  .metric-grid, .domain-grid, .admin-domain-grid { grid-template-columns: 1fr; }
  .table-card { overflow-x: auto; }
  .form-grid { grid-template-columns: 1fr; }
  .login-card { padding: 26px 22px; }
}
