/* ===========================================================================
   shell.css — единая визуальная система Meie Majad.
   Структура, метрики и палитра совпадают с порталом Toolkit.
   =========================================================================== */

:root {
  --bg:          #0a121e;
  --bg-panel:    #101a29;
  --bg-card:     #131f30;
  --line:        #223349;
  --line-soft:   #1a2739;
  --ink:         #e8edf3;
  --ink-dim:     #8fa2b8;
  --ink-faint:   #55708c;
  --accent:      #4f7fc4;
  --accent-soft: rgba(79, 127, 196, 0.12);
  --signal:      #e3ac4c;
  --signal-bg:   rgba(227, 172, 76, 0.10);
  --danger:      #e37f7f;
  --danger-bg:   rgba(227, 127, 127, 0.10);
  --good:        #3ecf8e;
  --good-bg:     rgba(62, 207, 142, 0.12);
  --mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html[data-theme="day"] {
  --bg:          #dde3ea;
  --bg-panel:    #e9edf2;
  --bg-card:     #e2e7ec;
  --line:        #c6cfd9;
  --line-soft:   #d3dae2;
  --ink:         #10151b;
  --ink-dim:     #5b6773;
  --ink-faint:   #8993a0;
  --accent:      #14588f;
  --accent-soft: rgba(20, 88, 143, 0.10);
  --signal:      #8a5a0f;
  --signal-bg:   rgba(191, 129, 0, 0.13);
  --danger:      #a83c3c;
  --danger-bg:   rgba(168, 60, 60, 0.10);
  --good:        #1c6b45;
  --good-bg:     rgba(28, 107, 69, 0.12);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  min-height: 100vh;
  background:
    radial-gradient(1100px 550px at 12% -10%, rgba(127,184,227,.06), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(201,143,224,.04), transparent 55%),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  transition: background-color .25s ease, color .25s ease;
}
.hidden { display: none !important; }

/* ─── Shell ─────────────────────────────────────────────────────────────── */
.app-shell { display: flex; align-items: stretch; min-height: 100vh; }

.sidebar {
  width: 300px; flex: none; padding: 48px 32px;
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  position: sticky; top: 0; align-self: flex-start;
  height: 100vh; overflow-y: auto;
}
.sidebar .kicker {
  font-family: var(--mono); font-size: 11px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-faint);
  display: flex; align-items: center; gap: 8px; margin-bottom: 14px;
}
.sidebar .kicker::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--ink-dim); flex: none;
}
.sidebar h1 { margin: 0 0 10px; font-size: 24px; font-weight: 700; letter-spacing: -.01em; }
.sidebar .intro { margin: 0 0 30px; color: var(--ink-dim); font-size: 13.5px; line-height: 1.6; }

/* ─── Side nav: shared base ──────────────────────────────────────────────── */
.side-nav {
  display: flex; flex-direction: column; gap: 2px;
  margin-bottom: auto; align-self: stretch;
}
.side-nav a, .side-nav button {
  all: unset; box-sizing: border-box; cursor: pointer;
  display: flex; align-items: center; gap: 9px;
  padding: 9px 10px; border-radius: 8px;
  color: var(--ink-dim); font-size: 13.5px; font-weight: 500;
  text-decoration: none;
  transition: background-color .15s, color .15s;
}
.side-nav a svg, .side-nav button svg { width: 16px; height: 16px; flex: none; }
.side-nav a:hover, .side-nav button:hover { background: var(--bg-panel); color: var(--ink); }
.side-nav a.active, .side-nav button.active {
  background: linear-gradient(90deg, var(--accent-soft), var(--bg-panel));
  box-shadow: inset 2px 0 0 var(--accent); color: var(--ink); font-weight: 600;
}
.side-nav a:focus-visible, .side-nav button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ─── Admin property hierarchy nav ──────────────────────────────────────── */
.admin-object-nav { display: flex; flex-direction: column; gap: 0; }
.admin-object-nav .nav-group { display: flex; flex-direction: column; gap: 1px; margin-bottom: 6px; }

/* Property name: bold link → its dashboard */
.admin-object-nav .nav-group-title {
  all: unset; box-sizing: border-box; cursor: pointer;
  display: flex; align-items: center; gap: 9px;
  padding: 9px 10px; border-radius: 8px;
  color: var(--ink); font-size: 13.5px; font-weight: 700;
  text-decoration: none; letter-spacing: -.01em;
  transition: background-color .15s;
}
.admin-object-nav .nav-group-title:hover { background: var(--bg-panel); }
.admin-object-nav .nav-group-title.active {
  background: linear-gradient(90deg, var(--accent-soft), var(--bg-panel));
  box-shadow: inset 2px 0 0 var(--accent);
}

/* Sub-items: lighter, indented with accent border */
.admin-object-nav .nav-sub-item {
  all: unset; box-sizing: border-box; cursor: pointer;
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px 7px 22px; border-radius: 0 8px 8px 0;
  margin-left: 12px; border-left: 1px solid var(--line);
  color: var(--ink-dim); font-size: 12.5px; font-weight: 500;
  text-decoration: none; transition: background-color .15s, color .15s;
}
.admin-object-nav .nav-sub-item:hover { background: var(--bg-panel); color: var(--ink); }
.admin-object-nav .nav-sub-item.active {
  background: var(--bg-panel); color: var(--ink); font-weight: 600;
  border-left-color: var(--accent);
}
.admin-object-nav .nav-separator { height: 1px; background: var(--line); margin: 8px 0; }

/* ─── Side controls ──────────────────────────────────────────────────────── */
.side-controls {
  display: flex; align-items: center; gap: 10px;
  margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line);
}
.side-controls + .side-controls { margin-top: 10px; padding-top: 0; border-top: none; }
.side-user {
  display:inline-flex; align-items:center; gap:8px;
  min-height:30px; padding:6px 12px; border-radius:999px;
  border:1px solid var(--line); background:var(--bg-panel);
  font-family: var(--mono); font-size: 11.5px; color: var(--ink-faint);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: calc(100% - 58px);
}
.side-user::before {
  content: ''; width: 8px; height: 8px; border-radius: 50%; flex: none;
  background: var(--good); box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 18%, transparent);
}


/* ─── Language switch ────────────────────────────────────────────────────── */
.lang-switch {
  display: flex; border: 1px solid var(--line); border-radius: 8px;
  overflow: hidden; background: var(--bg);
  font-family: var(--mono); font-size: 11px;
}
.lang-switch button {
  all: unset; cursor: pointer; padding: 6px 9px; color: var(--ink-faint);
  transition: color .15s, background .15s;
}
.lang-switch button:hover { color: var(--ink); }
.lang-switch button.active { color: var(--ink); background: var(--line); }
.lang-switch .sep { width: 1px; background: var(--line); }

/* ─── Theme toggle ───────────────────────────────────────────────────────── */
.theme-toggle {
  position: relative; width: 46px; height: 24px; border-radius: 999px;
  background: var(--bg); border: 1px solid var(--line);
  cursor: pointer; padding: 0; flex: none;
  -webkit-appearance: none; appearance: none;
  transition: background-color .25s ease, border-color .25s ease;
}
.theme-toggle .tt-icon {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 12px; height: 12px; color: #f0c419; pointer-events: none;
}
.theme-toggle .tt-sun { left: 5px; }
.theme-toggle .tt-moon { right: 5px; }
.theme-toggle .tt-thumb {
  position: absolute; top: 2px; left: 2px; width: 18px; height: 18px;
  border-radius: 50%; background: #ffffff; box-shadow: 0 2px 5px rgba(0,0,0,.4);
  transition: left .22s ease; z-index: 2;
}
html[data-theme="day"] .theme-toggle .tt-thumb { left: 26px; }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.signout-lock {
  all: unset; box-sizing: border-box; cursor: pointer; margin-left: auto;
  width: 42px; height: 42px; border-radius: 12px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--accent); background: var(--bg-panel); border: 1px solid var(--line);
  transition: border-color .18s ease, color .18s ease, background-color .18s ease, transform .18s ease;
}
.signout-lock svg { width: 20px; height: 20px; }
.signout-lock:hover { border-color: var(--accent); color: var(--ink); background: var(--accent-soft); }
.signout-lock:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }


/* ─── Content area ───────────────────────────────────────────────────────── */
.content { flex: 1; min-width: 0; padding: 48px 40px 80px; max-width: 1240px; }
.content-head { margin-bottom: 32px; }
.content-head h2 {
  margin: 0 0 8px;
  font-size: clamp(22px, 3vw, 30px); font-weight: 700; letter-spacing: -.02em;
}
.content-head p { margin: 0; color: var(--ink-dim); font-size: 14.5px; max-width: 60ch; line-height: 1.6; }
h3 { margin: 28px 0 12px; font-size: 15px; font-weight: 650; }

/* ─── Sign-in gate ───────────────────────────────────────────────────────── */
.login-gate {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px; padding: 20px;
  text-align: center; color: var(--ink-dim); font-size: 14px;
}
.login-gate .icon-big {
  width: 48px; height: 48px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); background: var(--bg-panel); color: var(--accent);
}
.login-gate .icon-big svg { width: 24px; height: 24px; }
.login-gate h1 { margin: 6px 0 0; font-size: 22px; font-weight: 700; color: var(--ink); }
.login-gate .addr {
  font-family: var(--mono); font-size: 11px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--ink-faint);
}
.login-gate form { width: min(320px, 100%); margin-top: 8px; text-align: left; }

/* ─── Cards & layout ─────────────────────────────────────────────────────── */
.card {
  background: var(--bg-panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 20px; margin-bottom: 14px;
}
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.cols-narrow { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.cols > .card, .cols-narrow > .card { margin-bottom: 0; }
.eyebrow {
  font-family: var(--mono); font-size: 11px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-faint); margin-bottom: 10px;
}

/* Hint text below checkboxes in tariff cards.
   Same tone as .sidebar .intro — descriptive, not a label. */
.field-hint {
  font-family: var(--sans);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ink-dim);
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
}

/* ─── Meter register ─────────────────────────────────────────────────────── */
.meter { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: end; }
.meter-label { font-size: 14.5px; font-weight: 600; }
.meter-unit { color: var(--ink-faint); font-weight: 400; }
.meter-prev { font-size: 13px; color: var(--ink-dim); margin: 4px 0 8px; }
.meter-prev b { font-family: var(--mono); font-weight: 500; color: var(--ink); }
.register {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg-card); color: var(--ink);
  font: 600 21px/1.2 var(--mono); letter-spacing: .05em;
}
.register:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.register.is-bad { border-color: var(--danger); background: var(--danger-bg); }
.usage { text-align: right; min-width: 120px; }
.usage-value { font: 600 21px/1.2 var(--mono); color: var(--accent); }
.usage-value.is-idle { color: var(--ink-faint); }
.usage-label {
  font-family: var(--mono); font-size: 10px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-faint); margin-top: 6px;
}

/* ─── Controls ───────────────────────────────────────────────────────────── */
label.field { display: block; margin-bottom: 14px; }
label.field > span {
  display: block; margin-bottom: 6px; font-size: 12.5px; font-weight: 500; color: var(--ink-dim);
}
/* Text-like inputs, including <input> without an explicit type.
   The latter defaults to text in HTML, but would otherwise keep the browser's
   native light bevel/border in Chromium. */
input:not([type]), input[type="text"], input[type="password"], input[type="email"],
input[type="number"], input[type="date"], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg-card); color: var(--ink); font: 14px/1.4 var(--sans);
  appearance: none; -webkit-appearance: none;
  box-shadow: none;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent); outline-offset: 1px;
  border-color: var(--line); box-shadow: none;
}
input[type="number"], .num { font-family: var(--mono); }
.btn {
  all: unset; box-sizing: border-box; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--sans); font-size: 13px; font-weight: 600;
  padding: 8px 16px; border-radius: 8px; border: 1px solid var(--line); color: var(--ink);
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #0d1013; }
.btn.primary:hover { opacity: .9; color: #0d1013; }
.btn.danger { color: var(--danger); }
.btn.danger:hover { border-color: var(--danger); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 14px; }
.tick { display: flex; align-items: center; gap: 7px; font-size: 13.5px; cursor: pointer; }
.tick input { width: auto; }

/* ─── Tables ─────────────────────────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th {
  text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line);
  font-family: var(--mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint);
}
td { padding: 8px 10px; border-bottom: 1px solid var(--line-soft); }
tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; font-family: var(--mono); }

/* ─── Status tags ────────────────────────────────────────────────────────── */
.tag {
  display: inline-block; padding: 3px 9px; border-radius: 999px;
  font-family: var(--mono); font-size: 10px; font-weight: 500;
  letter-spacing: .08em; text-transform: uppercase;
}
.tag.draft  { background: var(--signal-bg); color: var(--signal); }
.tag.review { background: var(--accent-soft); color: var(--accent); }
.tag.issued { background: var(--good-bg); color: var(--good); }

/* ─── Notices & toast ────────────────────────────────────────────────────── */
.notice {
  padding: 12px 15px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg-panel); font-size: 13.5px; margin-bottom: 16px;
}
.notice.warn  { background: var(--signal-bg); border-color: var(--signal); color: var(--signal); }
.notice.error { background: var(--danger-bg); border-color: var(--danger); color: var(--danger); }
.notice ul { margin: 6px 0 0; padding-left: 18px; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  padding: 11px 18px; border-radius: 9px;
  background: var(--bg-panel); border: 1px solid var(--accent); color: var(--ink);
  font-size: 13.5px; box-shadow: 0 8px 30px rgba(0,0,0,.35); z-index: 50;
}

/* ─── Month switcher ─────────────────────────────────────────────────────── */
.month-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.month-bar .month-label { font-size: 17px; font-weight: 700; min-width: 170px; text-align: center; letter-spacing: -.01em; }
.month-bar .spacer { flex: 1; }
.month-total { font-family: var(--mono); font-size: 15px; font-weight: 600; color: var(--accent); }
.month-empty { color: var(--ink-faint); font-size: 13px; }

/* ─── Invoice ────────────────────────────────────────────────────────────── */
.invoice { background: var(--bg-panel); border: 1px solid var(--line); border-radius: 12px; padding: 24px; }
.invoice-head { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 22px; }
.invoice-no { font: 600 20px var(--mono); letter-spacing: .04em; }
.invoice-total {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-top: 18px; padding-top: 14px; border-top: 2px solid var(--line);
}
.invoice-total .amount { font: 700 24px var(--mono); }

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .app-shell { flex-direction: column; }
  .sidebar {
    width: 100%; height: auto; position: relative; overflow-y: visible;
    border-right: none; border-bottom: 1px solid var(--line); padding: 28px 24px;
  }
  .side-nav { flex-direction: row; flex-wrap: wrap; margin-bottom: 0; }
  .admin-object-nav { flex-direction: row; flex-wrap: wrap; }
  .content { padding: 32px 24px 60px; }
  .meter { grid-template-columns: 1fr; }
  .usage { text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}


/* ─── Restored sidebar brand lockup ─────────────────────────────────────── */
.brand-lockup { display:flex; align-items:center; gap:12px; padding-bottom:20px; margin-bottom:20px; border-bottom:1px solid var(--line); }
.brand-mark { width:48px; height:48px; flex:none; border:1px solid #31506f; border-radius:12px; display:flex; align-items:center; justify-content:center; color:#69a9e7; font:600 14px var(--mono); letter-spacing:.03em; background:var(--bg); }
.brand-copy { display:flex; flex-direction:column; min-width:0; }
.brand-copy strong { font-size:16px; line-height:1.25; color:var(--ink); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.brand-copy span { display:none; }
.sidebar > .kicker { margin-top:0; }

/* Mail-settings reference: controls sit on the same base surface as the page. */
.card, .notice, .invoice { background:var(--bg); }
input[type="text"], input[type="password"], input[type="email"], input[type="date"], input[type="number"], select, textarea, .register { background:var(--bg); }
.btn { background:var(--bg); }
.btn.primary { background:#3f69ad; border-color:#3f69ad; color:#fff; }
.btn.primary:hover { background:#4b78bf; border-color:#4b78bf; color:#fff; opacity:1; }

/* ─── Account management ────────────────────────────────────────────────── */
.accounts-toolbar { display:flex; align-items:flex-start; gap:16px; margin-bottom:14px; }
.accounts-toolbar .notice { flex:1; margin:0; }
.accounts-toolbar .btn { margin-left:auto; white-space:nowrap; }
.account-management { overflow-x:auto; margin-bottom:18px; }
.accounts-table { min-width:1080px; }
.accounts-table th { padding:10px 10px 9px; }
.accounts-table td { padding:10px; vertical-align:middle; }
.accounts-table .account-name { font:600 13px var(--mono); color:var(--ink); }
.compact-control { min-width:108px; padding:7px 10px; font-size:13px; }
.password-cell { position:relative; min-width:210px; }
.password-cell input { padding:7px 30px 7px 10px; font:12.5px var(--mono); }
.password-cell .password-eye { position:absolute; right:9px; top:50%; transform:translateY(-50%); color:var(--ink-faint); font-size:12px; pointer-events:none; }
.tenancy-inline, .account-actions { display:flex; gap:7px; align-items:center; white-space:nowrap; }
.btn.compact { min-height:31px; padding:6px 12px; font-size:12px; border-radius:8px; justify-content:center; }
.tenancy-inline .btn { min-width:42px; }
#accountForm, #cardForm { max-width:900px; }
#cardForm { scroll-margin-top:24px; }
@media (max-width: 860px) { .brand-lockup { padding-bottom:16px; margin-bottom:16px; } .accounts-toolbar { flex-direction:column; } .accounts-toolbar .btn { margin-left:0; } }


/* r22: account/sidebar corrections */
/* The sidebar must only show the compact MM lockup; login artwork never belongs here. */
.sidebar .pre-auth-logo-frame,
.sidebar .pre-auth-logo,
.sidebar .gate-splash { display:none !important; }
.sidebar .brand-lockup { width:100%; overflow:hidden; }
.sidebar .brand-mark { width:48px; height:48px; min-width:48px; max-width:48px; }
.sidebar .brand-copy strong { display:block; max-width:170px; }

/* Inputs use the exact same base surface as the page, including inputs without an explicit type. */
input:not([type="checkbox"]):not([type="radio"]),
select, textarea, .register { background:var(--bg) !important; color:var(--ink); }
.card, .notice, .invoice { background:var(--bg); }

/* Secondary buttons follow the Mail reference; tenancy labels stay light on both In and Out. */
.btn { background:var(--bg); }
.tenancy-inline .btn, #btnMoveIn, #btnMoveOut,
.tenancy-inline .btn.danger, #btnMoveOut.danger { color:var(--ink) !important; }
.tenancy-inline .btn:hover, #btnMoveIn:hover, #btnMoveOut:hover { color:var(--ink) !important; }


/* r23: sidebar hierarchy, login artwork and input surface corrections */
/* The top brand is the only Meie Majad identity in the sidebar. */
.sidebar-home-brand {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
.sidebar-home-brand:hover .brand-copy strong { color: var(--accent); }

/* Meie Majad is the global switch and should read clearly above regular tabs. */
.admin-object-nav > .nav-global-home {
  font-size: 18px;
  line-height: 1.25;
  font-weight: 700;
  padding: 12px 10px;
  margin-bottom: 8px;
  color: var(--ink);
}

/* The large image logo belongs to neither the authenticated page nor the sign-in gate. */
.pre-auth-logo-frame,
.pre-auth-logo { display: none !important; }

/* Keep browser autofill and populated fields on the same surface as the site. */
input:not([type="checkbox"]):not([type="radio"]),
select,
textarea,
.register {
  background-color: var(--bg) !important;
  color: var(--ink) !important;
  caret-color: var(--ink);
}
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active,
textarea:-webkit-autofill,
select:-webkit-autofill {
  -webkit-text-fill-color: var(--ink) !important;
  caret-color: var(--ink) !important;
  -webkit-box-shadow: 0 0 0 1000px var(--bg) inset !important;
  box-shadow: 0 0 0 1000px var(--bg) inset !important;
  transition: background-color 99999s ease-out 0s;
}

/* tenancy event buttons: light labels on both states */
.tenancy-inline .btn,
.tenancy-inline .btn.danger,
#btnMoveIn,
#btnMoveOut,
#btnMoveOut.danger {
  color: var(--ink) !important;
  -webkit-text-fill-color: var(--ink) !important;
}


/* r24: account note/action placement + stronger day-theme contrast */
.accounts-toolbar {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
}
.accounts-toolbar .accounts-note {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink-dim);
  font-size: 13.5px;
  line-height: 1.5;
}
.accounts-toolbar .btn { margin-left: 0; white-space: nowrap; }

/* Property names are primary navigation anchors: two visual steps larger. */
.admin-object-nav .nav-group-title {
  font-size: 17px;
  line-height: 1.3;
  font-weight: 700;
}

/* Day theme: text must stay clearly readable, including secondary labels. */
html[data-theme="day"] {
  --ink: #000000;
  --ink-dim: #2f3943;
  --ink-faint: #4f5d6a;
}
html[data-theme="day"] .admin-object-nav .nav-group-title {
  color: #000 !important;
}
html[data-theme="day"] .content-head p,
html[data-theme="day"] label.field > span,
html[data-theme="day"] .meter-prev,
html[data-theme="day"] .field-hint,
html[data-theme="day"] .accounts-toolbar .accounts-note,
html[data-theme="day"] .side-nav a,
html[data-theme="day"] .side-nav button,
html[data-theme="day"] .admin-object-nav .nav-sub-item {
  color: #2f3943;
}


/* r24: account helper layout + stronger light-theme contrast */
.accounts-toolbar {
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:10px;
  margin-bottom:14px;
}
.accounts-toolbar .accounts-help {
  margin:0;
  padding:0;
  border:0;
  border-radius:0;
  background:transparent;
  color:var(--ink);
  font-size:13.5px;
  font-weight:500;
}
.accounts-toolbar .btn { margin-left:0; white-space:nowrap; }

/* Property names are deliberately more prominent than their child tabs. */
.admin-object-nav .nav-group-title { font-size:17px; line-height:1.3; font-weight:700; }

html[data-theme="day"] {
  --ink: #05080b;
  --ink-dim: #26313c;
  --ink-faint: #465463;
}
html[data-theme="day"] .admin-object-nav .nav-group-title { color:#000; }
html[data-theme="day"] .content-head p,
html[data-theme="day"] .field-hint,
html[data-theme="day"] .meter-prev,
html[data-theme="day"] .side-nav a,
html[data-theme="day"] .side-nav button,
html[data-theme="day"] th,
html[data-theme="day"] .eyebrow,
html[data-theme="day"] .field > span { color:var(--ink-dim); }


/* r26: use the Toolkit control surface and notification behavior verbatim in spirit. */
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
select,
textarea,
.register {
  width: 100%;
  box-sizing: border-box;
  font-family: var(--sans);
  font-size: 13.5px;
  line-height: 1.4;
  background: var(--bg) !important;
  color: var(--ink) !important;
  border: 1px solid var(--line) !important;
  border-radius: 8px;
  padding: 8px 10px;
  outline: none !important;
  box-shadow: none !important;
  appearance: none;
  -webkit-appearance: none;
}
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus,
select:focus,
textarea:focus,
.register:focus {
  border-color: var(--accent) !important;
  outline: none !important;
  box-shadow: none !important;
}
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus,
select:-webkit-autofill {
  -webkit-text-fill-color: var(--ink) !important;
  caret-color: var(--ink);
  -webkit-box-shadow: 0 0 0 1000px var(--bg) inset !important;
  box-shadow: 0 0 0 1000px var(--bg) inset !important;
  border-color: var(--line) !important;
  transition: background-color 9999s ease-out 0s;
}
.scalable-field {
  min-height: 38px;
  resize: vertical;
  overflow: auto;
}
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  left: auto;
  bottom: auto;
  transform: translateX(28px);
  background: rgba(227,172,76,.18);
  border: 1px solid rgba(227,172,76,.72);
  color: var(--ink);
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-family: var(--sans);
  line-height: 1.4;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 310;
  max-width: min(380px, calc(100vw - 32px));
  text-align: left;
  box-shadow: 0 14px 34px rgba(0,0,0,.28), inset 3px 0 0 #e3ac4c;
}
.toast.show { opacity: 1; transform: translateX(0); }
@media (max-width: 600px) {
  .toast { top: 12px; right: 12px; max-width: calc(100vw - 24px); }
}

/* r27: repair the two-stage sign-in gate. prepareGate() creates a splash and
   a login card dynamically; only one of them may be visible at a time. */
.login-gate .gate-splash {
  width: min(380px, 100%);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 12px;
}
.login-gate .gate-splash .icon-big {
  flex: 0 0 48px;
  margin-right: calc(100% - 48px);
}
.login-gate .gate-copy {
  color: var(--ink-dim);
  line-height: 1.5;
}
.login-gate .gate-open {
  flex: none;
}
.login-gate .gate-controls {
  flex: 0 0 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 2px;
}
.login-gate .gate-controls button {
  min-width: 34px;
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--bg) !important;
  color: var(--ink) !important;
  font: 600 12px var(--sans);
  cursor: pointer;
}
.login-gate .gate-controls button:hover {
  border-color: var(--accent);
  color: var(--accent) !important;
}
.login-gate .gate-theme { font-size: 15px !important; }

.login-gate .gate-card {
  display: none;
  width: min(360px, 100%);
  margin-top: 8px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-panel);
  text-align: left;
}
.login-gate.is-login-open .gate-splash { display: none; }
.login-gate.is-login-open .gate-card { display: block; }
.login-gate .gate-card-heading { margin-bottom: 16px; }
.login-gate .gate-card-heading h1 {
  margin: 0 0 6px;
  font-size: 22px;
}
.login-gate .gate-card-heading p {
  margin: 0;
  color: var(--ink-dim);
  font-size: 13.5px;
  line-height: 1.55;
}
.login-gate .gate-card .field { margin-bottom: 12px; }
.login-gate .gate-card input:not([type="checkbox"]):not([type="radio"]) {
  width: 100%;
  min-height: 38px;
  background: var(--bg) !important;
  background-color: var(--bg) !important;
  color: var(--ink) !important;
  border: 1px solid var(--line) !important;
  -webkit-text-fill-color: var(--ink) !important;
  box-shadow: none !important;
}
.login-gate .gate-card input:not([type="checkbox"]):not([type="radio"]):focus {
  border-color: var(--accent) !important;
  outline: none !important;
  box-shadow: none !important;
}
.login-gate .gate-card input:-webkit-autofill,
.login-gate .gate-card input:-webkit-autofill:hover,
.login-gate .gate-card input:-webkit-autofill:focus,
.login-gate .gate-card input:-webkit-autofill:active {
  -webkit-text-fill-color: var(--ink) !important;
  caret-color: var(--ink) !important;
  -webkit-box-shadow: 0 0 0 1000px var(--bg) inset !important;
  box-shadow: 0 0 0 1000px var(--bg) inset !important;
  border-color: var(--line) !important;
}
.login-gate .gate-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}
.login-gate .gate-actions .btn { min-width: 84px; justify-content: center; }
.login-gate .gate-actions .primary { background: var(--accent) !important; }

@media (max-width: 480px) {
  .login-gate { padding: 18px; }
  .login-gate .gate-card { padding: 16px; }
}

/* r29: canonical two-step login layout.  The splash uses the real Meie Majad
   logo; the credential card is deliberately unbranded and contains only the
   sign-in form.  These rules supersede the r27 emergency layout. */
.login-gate > h1,
.login-gate > .addr,
.login-gate .gate-card > h1,
.login-gate .gate-card > .addr { display: none !important; }

.login-gate .gate-splash {
  width: min(420px, 100%);
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 0;
}
.login-gate .gate-brand {
  width: 190px;
  height: 150px;
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-gate .gate-logo {
  display: block;
  width: 190px;
  height: auto;
  max-height: 150px;
  object-fit: contain;
}
.login-gate .gate-logo-light { display: none; }
html[data-theme="day"] .login-gate .gate-logo-dark { display: none; }
html[data-theme="day"] .login-gate .gate-logo-light { display: block; }

.login-gate .gate-icon-slot {
  width: 100%;
  display: flex;
  justify-content: center;
  margin: 4px 0 18px;
}
.login-gate .gate-splash .icon-big {
  flex: none;
  margin: 0;
  width: 48px;
  height: 48px;
}
.login-gate .gate-main-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: 100%;
}
.login-gate .gate-copy {
  color: var(--ink-dim);
  line-height: 1.5;
  font-size: 14px;
  white-space: nowrap;
}
.login-gate .gate-open {
  min-height: 38px;
  padding-inline: 17px;
}
.login-gate .gate-controls {
  margin-top: 14px;
  flex: none;
  width: auto;
}

.login-gate .gate-card {
  display: none;
  width: min(356px, 100%);
  margin: 0;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--bg-panel);
  text-align: left;
}
.login-gate.is-login-open .gate-splash { display: none !important; }
.login-gate.is-login-open .gate-card { display: block !important; }
.login-gate .gate-card-heading { margin-bottom: 18px; }
.login-gate .gate-card-heading h1 {
  display: block !important;
  margin: 0 0 7px;
  font-size: 20px;
  line-height: 1.2;
}
.login-gate .gate-card-heading p {
  margin: 0;
  font-size: 13.5px;
}
.login-gate .gate-card .field { margin-bottom: 14px; }
.login-gate .gate-card .field > span {
  display: block;
  margin-bottom: 7px;
}
.login-gate .gate-card input:not([type="checkbox"]):not([type="radio"]) {
  min-height: 36px;
  border-radius: 8px;
}
.login-gate .gate-actions {
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}

@media (max-width: 480px) {
  .login-gate .gate-brand { width: 165px; height: 132px; }
  .login-gate .gate-logo { width: 165px; max-height: 132px; }
  .login-gate .gate-main-row { flex-direction: column; gap: 10px; }
  .login-gate .gate-copy { white-space: normal; text-align: center; }
  .login-gate .gate-controls { margin-top: 12px; }
  .login-gate .gate-card { width: min(356px, 100%); padding: 20px; }
}

/* r30: login credential fields must stay on the portal surface and keep
   readable text even when Chromium/password managers autofill them. */
.login-gate .gate-card {
  color-scheme: dark;
}
.login-gate .gate-card input:not([type="checkbox"]):not([type="radio"]) {
  background: #0a121e !important;
  background-color: #0a121e !important;
  color: #e8edf3 !important;
  -webkit-text-fill-color: #e8edf3 !important;
  caret-color: #e8edf3 !important;
  border-color: #31506f !important;
  box-shadow: inset 0 0 0 1000px #0a121e !important;
  -webkit-box-shadow: inset 0 0 0 1000px #0a121e !important;
  color-scheme: dark;
  opacity: 1;
}
.login-gate .gate-card input:not([type="checkbox"]):not([type="radio"])::placeholder {
  color: #71869d !important;
  -webkit-text-fill-color: #71869d !important;
  opacity: 1;
}
.login-gate .gate-card input:not([type="checkbox"]):not([type="radio"]):focus {
  border-color: #78b7e8 !important;
  box-shadow: inset 0 0 0 1000px #0a121e !important;
  -webkit-box-shadow: inset 0 0 0 1000px #0a121e !important;
}
.login-gate .gate-card input:-webkit-autofill,
.login-gate .gate-card input:-webkit-autofill:hover,
.login-gate .gate-card input:-webkit-autofill:focus,
.login-gate .gate-card input:-webkit-autofill:active {
  -webkit-text-fill-color: #e8edf3 !important;
  caret-color: #e8edf3 !important;
  -webkit-box-shadow: inset 0 0 0 1000px #0a121e !important;
  box-shadow: inset 0 0 0 1000px #0a121e !important;
  border-color: #31506f !important;
  transition: background-color 99999s ease-out 0s;
}
html[data-theme="day"] .login-gate .gate-card {
  color-scheme: light;
}
html[data-theme="day"] .login-gate .gate-card input:not([type="checkbox"]):not([type="radio"]) {
  background: #dde3ea !important;
  background-color: #dde3ea !important;
  color: #10151b !important;
  -webkit-text-fill-color: #10151b !important;
  caret-color: #10151b !important;
  border-color: #9aa7b4 !important;
  box-shadow: inset 0 0 0 1000px #dde3ea !important;
  -webkit-box-shadow: inset 0 0 0 1000px #dde3ea !important;
  color-scheme: light;
}
html[data-theme="day"] .login-gate .gate-card input:not([type="checkbox"]):not([type="radio"])::placeholder {
  color: #667585 !important;
  -webkit-text-fill-color: #667585 !important;
}
html[data-theme="day"] .login-gate .gate-card input:-webkit-autofill,
html[data-theme="day"] .login-gate .gate-card input:-webkit-autofill:hover,
html[data-theme="day"] .login-gate .gate-card input:-webkit-autofill:focus,
html[data-theme="day"] .login-gate .gate-card input:-webkit-autofill:active {
  -webkit-text-fill-color: #10151b !important;
  caret-color: #10151b !important;
  -webkit-box-shadow: inset 0 0 0 1000px #dde3ea !important;
  box-shadow: inset 0 0 0 1000px #dde3ea !important;
}

/* r31: login splash stack. The explanatory copy and Sign in button must be
   centered one under another; r29 accidentally kept them in a horizontal row. */
.login-gate .gate-main-row {
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 12px !important;
}
.login-gate .gate-copy {
  width: 100%;
  text-align: center;
  white-space: normal !important;
}
.login-gate .gate-open {
  align-self: center;
  margin: 0;
}

.account-property { display:inline-block; min-width:150px; color:var(--ink); font-weight:600; white-space:nowrap; }

/* r34: property badge house number, periodic-table style */
.brand-mark[data-house-number] {
  position: relative;
  padding: 0 4px 4px 0;
  box-sizing: border-box;
}
.brand-mark[data-house-number]::after {
  content: attr(data-house-number);
  position: absolute;
  right: 6px;
  bottom: 5px;
  font: 600 9px/1 var(--mono);
  letter-spacing: 0;
  color: currentColor;
  opacity: .9;
  pointer-events: none;
}


/* r37: keep client sidebar geometry identical between portal pages. */
.sidebar .brand-lockup { min-height: 69px; box-sizing: border-box; }
.sidebar .kicker { min-height: 16px; }
.sidebar .intro { min-height: 44px; }

/* r37: readable spacing for uploaded document rows and actions. */
.document-list { display: flex; flex-direction: column; gap: 12px; }
.document-item { display:flex; align-items:center; justify-content:space-between; gap:18px; padding:12px 0; border-bottom:1px solid var(--line); }
.document-item:last-child { border-bottom:0; }
.document-item > div:first-child { display:flex; flex-direction:column; gap:5px; min-width:0; }
.document-item b { display:block; line-height:1.35; }
.document-item small { display:block; color:var(--ink-dim); line-height:1.35; overflow-wrap:anywhere; }
.document-item > .row { flex:none; display:flex; align-items:center; gap:8px; }
.document-item .btn { white-space:nowrap; }
@media (max-width:700px) { .document-item { align-items:flex-start; flex-direction:column; } }

html[data-theme="day"] .side-user { color:#334252; background: var(--bg-card); }
