/* Client portal (Portal/Default.aspx) – same look as the staff Clients page */
:root {
  --bg: #f4f5f7; --card: #fff; --ink: #1c1f24; --muted: #6b7280; --line: #e6e8ec; --line2: #d7dbe2;
  --accent: #0f766e; --accent-soft: #e6f4f2; --accent-dark: #115e59;
  --amber-soft: #fef3c7; --red: #dc2626; --red-soft: #fee2e2; --green-soft: #d1fae5; --grey-soft: #eef0f3;
  --radius: 12px; --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.45 "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--accent); }
.pt-loading { padding: 80px; text-align: center; color: var(--muted); }
.muted { color: var(--muted); }

.btn { border: 1px solid var(--line2); background: #fff; border-radius: 8px; padding: 7px 12px; font-weight: 600; font-size: 13px; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--grey-soft); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-dark); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--grey-soft); color: var(--ink); }
.btn.danger { color: var(--red); }
.btn.sm { padding: 4px 9px; font-size: 12px; border-radius: 6px; }
.btn[disabled] { opacity: .5; cursor: default; }
.chip { display: inline-block; font-size: 11px; font-weight: 600; line-height: 1; padding: 4px 8px; border-radius: 999px; background: var(--grey-soft); color: var(--muted); }
.chip.green { background: var(--green-soft); color: #065f46; }
.chip.amber { background: var(--amber-soft); color: #92400e; }

/* ---- login / password ---- */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth .card { width: min(400px, 100%); background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; }
.auth img { height: 44px; display: block; margin: 0 auto 14px; }
.auth h1 { font-size: 18px; text-align: center; margin: 0 0 4px; }
.auth p.sub { text-align: center; color: var(--muted); margin: 0 0 20px; font-size: 13px; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.field label { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.field input { border: 1px solid var(--line2); border-radius: 8px; padding: 9px 11px; background: #fff; width: 100%; }
.field input:focus, .grid input:focus, .grid select:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.auth .btn.primary { width: 100%; padding: 10px; font-size: 14px; margin-top: 6px; }
.auth .err { background: var(--red-soft); color: #991b1b; border-radius: 8px; padding: 8px 10px; font-size: 13px; margin-bottom: 12px; }
.auth .foot { text-align: center; margin-top: 14px; font-size: 12px; color: var(--muted); }

/* ---- app ---- */
.top { background: var(--card); box-shadow: var(--shadow); }
.top .in { max-width: 1180px; margin: 0 auto; display: flex; align-items: center; gap: 14px; padding: 10px 18px; }
.top img { height: 30px; }
.top .who { flex: 1; min-width: 0; }
.top .who b { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .who span { font-size: 12px; color: var(--muted); }
.main { max-width: 1180px; margin: 16px auto; padding: 0 18px 30px; display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 14px; align-items: start; }
.panel { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.doms h2 { font-size: 14px; margin: 0; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.dom { display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: transparent; padding: 10px 14px; cursor: pointer; }
.dom:hover { background: #f8fafc; }
.dom.on { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.dom b { display: block; font-weight: 600; word-break: break-all; }
.dom span { font-size: 11px; color: var(--muted); }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--ink); font-size: 15px; margin-bottom: 4px; }

.det { padding: 16px 18px; min-height: 300px; }
.det h1 { font-size: 20px; margin: 0; word-break: break-all; }
.det .head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.facts { display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 12px; background: var(--grey-soft); border-radius: 8px; padding: 8px 12px; margin-bottom: 14px; }
.facts b { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-right: 4px; }
.bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 6px 0 10px; }
.bar h3 { margin: 0; font-size: 14px; flex: 1; }
.note { font-size: 12px; color: var(--muted); margin: 10px 0 0; }
.ro-note { background: var(--amber-soft); color: #92400e; border-radius: 8px; padding: 8px 12px; font-size: 13px; margin-bottom: 12px; }

.grid { width: 100%; border-collapse: collapse; font-size: 13px; }
.grid th { text-align: left; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; padding: 6px; border-bottom: 1px solid var(--line2); }
.grid td { padding: 4px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.grid td.c, .grid th.c { text-align: center; }
.grid td.val { font-family: Consolas, Menlo, monospace; font-size: 12px; word-break: break-all; }
.grid input, .grid select { width: 100%; border: 1px solid var(--line2); border-radius: 6px; padding: 5px 7px; background: #fff; font-size: 13px; }
.grid input[data-k="Content"] { font-family: Consolas, Menlo, monospace; font-size: 12px; }
.grid tr.ro td { color: var(--muted); background: #fafafa; }
.grid tr.new td { background: var(--green-soft); }
.grid tr.chg td { background: var(--amber-soft); }
.grid tr.del td { background: var(--red-soft); }
.grid tr.del input, .grid tr.del select { text-decoration: line-through; opacity: .6; }

.savebar { position: sticky; bottom: 0; display: flex; gap: 8px; align-items: center; justify-content: flex-end; background: #fff; border-top: 1px solid var(--line); padding: 10px 0 2px; margin-top: 12px; }
.savebar .status { margin-right: auto; font-size: 12px; color: var(--muted); }
.savebar .status b { color: var(--ink); }

.hist { margin-top: 22px; }
.hist .row { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin-bottom: 8px; }
.hist .row .lh { font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.hist .row .lh b { color: var(--ink); }
.hist .dl { font-family: Consolas, Menlo, monospace; font-size: 12px; word-break: break-all; }
.hist .dl.add { color: #047857; } .hist .dl.rem { color: #b91c1c; } .hist .dl.chg { color: #92400e; }

#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: #111827; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 13px; opacity: 0; pointer-events: none; transition: all .18s; z-index: 100; max-width: 90vw; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.err { background: var(--red); }

@media (max-width: 860px) {
  .main { grid-template-columns: 1fr; }
  .grid thead { display: none; }
  .grid tr { display: grid; grid-template-columns: 90px 1fr; gap: 4px 6px; padding: 8px 0; border-bottom: 1px solid var(--line); }
  .grid td { border: 0; padding: 0; }
  .grid td.val, .grid td[data-l="Value"] { grid-column: 1 / -1; }
}

/* ---- menu, domain search, services ---- */
.nav { display: flex; gap: 2px; margin-right: 6px; }
.nav button { border: 0; background: transparent; padding: 7px 12px; border-radius: 8px; font-weight: 600; color: var(--muted); cursor: pointer; }
.nav button:hover { background: var(--grey-soft); color: var(--ink); }
.nav button.on { background: var(--accent-soft); color: var(--accent-dark); }
.doms .search { padding: 8px 10px; border-bottom: 1px solid var(--line); }
.doms .search input { width: 100%; border: 1px solid var(--line2); border-radius: 8px; padding: 7px 10px; background: #fff; }
.doms .search input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.doms .rows { max-height: calc(100vh - 190px); overflow-y: auto; }
.main.one { grid-template-columns: minmax(0, 1fr); }
.svc .det .bar { margin-top: 18px; }
.svc-grid td.r, .svc-grid th.r { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.svc-grid td { padding: 7px 6px; }
.svc-grid td .muted { font-size: 12px; }
.svc-grid tfoot td { border-bottom: 0; padding-top: 6px; font-size: 13px; }
.svc-grid tfoot tr:first-child td { border-top: 2px solid var(--line2); }
@media (max-width: 860px) {
  .top .in { flex-wrap: wrap; }
  .nav { order: 5; width: 100%; }
  .svc-grid tfoot tr { display: flex; justify-content: space-between; }
}
