/* MeieMajad Nordic — shared light design system and responsive app shell.
   Layered after legacy shell.css and portal.css to protect existing workflows.
   Palette: Navy #1e3a8a · Blue #3b82f6 · Ice #e8f1ff · Canvas #f3f6fa. */
:root {
  --mm-navy:#1e3a8a; --mm-blue:#3b82f6; --mm-ice:#e8f1ff;
  --mm-canvas:#f3f6fa; --mm-white:#fff; --mm-text:#192b44;
  --mm-muted:#65758b; --mm-border:#e0e8f2; --mm-radius:14px;
  --mm-shadow:0 3px 16px rgba(29,62,107,.045);
  --mm-space-1:4px; --mm-space-2:8px; --mm-space-3:12px;
  --mm-space-4:16px; --mm-space-6:24px; --mm-space-8:32px;
}
html[data-theme="day"] {
  --bg:var(--mm-canvas); --bg-panel:#ffffff; --bg-card:#ffffff;
  --line:var(--mm-border); --line-soft:#edf1f7;
  --ink:var(--mm-text); --ink-dim:#52637a; --ink-faint:#728199;
  --accent:#316fe6; --accent-soft:#e9f1ff;
  --good:#157b57; --good-bg:#e9f8f1;
  --signal:#9b690b; --signal-bg:#fff7e6;
  --danger:#bf3c47; --danger-bg:#fff0f1;
  --portal-surface:#fff; --portal-shadow:var(--mm-shadow);
}
html[data-theme="day"] body {
  background:var(--mm-canvas); color:var(--mm-text); color-scheme:light;
  font-size:14px; line-height:1.5;
}
html[data-theme="day"] .app-shell { background:var(--mm-canvas); }
.sidebar {
  --sidebar-width:246px; width:246px; min-width:246px;
  padding:24px 16px 22px; gap:0;
}
html[data-theme="day"] .sidebar {
  background:#fff; border-right:1px solid var(--mm-border);
  box-shadow:2px 0 15px rgba(29,62,107,.025);
}
.sidebar .brand-lockup { min-height:58px; margin:0 0 8px; padding:0 5px 17px; }
.sidebar .brand-mark { width:40px; min-width:40px; max-width:40px; height:40px; font-size:12px; }
html[data-theme="day"] .sidebar .brand-mark {
  border:1px solid #d6e5fc; color:#2563bd; background:#eef5ff;
}
.sidebar .brand-copy strong { font-size:17px; letter-spacing:-.025em; }
.sidebar .kicker { margin:5px 9px 14px; min-height:0; font-family:var(--sans);
  font-size:10px; font-weight:700; letter-spacing:.095em; }
.sidebar .intro { margin:0 9px 12px; min-height:0; }
.sidebar .side-nav { gap:3px; flex-direction:column; }
.sidebar .side-nav a,.sidebar .side-nav button { border-radius:9px; padding:10px 12px;
  font-size:13px; font-weight:550; line-height:1.25; min-height:40px; }
html[data-theme="day"] .sidebar .side-nav a,
html[data-theme="day"] .sidebar .side-nav button { color:#596c83; }
html[data-theme="day"] .sidebar .side-nav a:hover,
html[data-theme="day"] .sidebar .side-nav button:hover { background:#f3f7fd; color:#24466f; }
html[data-theme="day"] .sidebar .side-nav .active { background:#e9f1ff;
  color:#174e9c; box-shadow:none; font-weight:700; }
html[data-theme="day"] .admin-object-nav .nav-sub-item.active {
  background:#e9f1ff; border-left-color:#3979dc; color:#174e9c;
}
html[data-theme="day"] .sidebar .side-controls { border-color:#e7edf5; }
.sidebar .side-controls { padding-top:13px; margin-top:13px; }
.sidebar .side-controls + .side-controls { padding-top:8px; margin-top:0; }
.content { width:100%; max-width:none; padding:0 32px 72px; margin:0 auto; }
.content > section,.content > .cols,.content > .card,
.content > .content-head { max-width:1440px; margin-left:auto; margin-right:auto; }
.mm-topbar { position:relative; display:flex; justify-content:space-between; align-items:center;
  gap:14px; min-height:80px; padding:18px 2px; margin:0 auto 24px; max-width:1440px; }
html[data-theme="day"] .mm-topbar { border-bottom:1px solid #e6edf7; }
.mm-topbar-start { display:flex; align-items:center; gap:12px; min-width:0; }
.mm-topbar-icon { display:flex; align-items:center; justify-content:center; height:40px;width:40px;
  flex:none; border-radius:12px; color:#2467d4; background:var(--mm-ice); }
.mm-topbar-icon svg { width:21px;height:21px; }
.mm-topbar-eyebrow { color:var(--ink-faint); font-size:11px; letter-spacing:.08em;
  font-weight:700; text-transform:uppercase; }
.mm-topbar-title { font-size:17px; font-weight:700; letter-spacing:-.025em; line-height:1.35; }
.mm-topbar-right { display:flex; align-items:center; gap:9px; flex:none; }
.mm-environment { padding:6px 11px; border:1px solid var(--line);
  border-radius:999px; font-size:11px; font-weight:650; color:var(--ink-dim); }
html[data-theme="day"] .mm-environment { background:#fff; }
.mm-menu-button { display:none; align-items:center; justify-content:center; gap:9px;
  min-height:42px; padding:8px 11px; border-radius:10px;
  border:1px solid var(--line); background:var(--bg-panel); color:var(--ink);
  font:600 13px var(--sans); cursor:pointer; }
.mm-menu-button svg { width:19px; height:19px; }
.mm-menu-button:focus-visible,.mm-mobile-backdrop:focus-visible { outline:3px solid var(--accent);outline-offset:2px; }
.mm-mobile-backdrop { display:none; }
.content-head { margin-bottom:19px; }
.content-head h2 { font-size:clamp(23px,2.3vw,30px); line-height:1.2; letter-spacing:-.035em; }
.content-head p { font-size:13.5px; line-height:1.5; max-width:75ch; }
html[data-theme="day"] .card,
html[data-theme="day"] .tk-stat,
html[data-theme="day"] .period-workspace,
html[data-theme="day"] .notice,
html[data-theme="day"] .invoice {
  background:#fff; border:1px solid var(--mm-border);
  box-shadow:var(--mm-shadow); border-radius:var(--mm-radius);
}
html[data-theme="day"] .card { padding:20px; }
html[data-theme="day"] .tk-stat { padding:18px 20px; }
html[data-theme="day"] .tk-stat span { color:#667890; font:600 11px var(--sans);
  letter-spacing:.035em; text-transform:none; }
.tk-stat strong { font-family:var(--sans); letter-spacing:-.025em; }
html[data-theme="day"] .btn { background:#fff; color:#29466d; border:1px solid #d9e4f2;
  border-radius:9px; min-height:36px; font-size:12.5px; box-shadow:none; }
html[data-theme="day"] .btn:hover { background:#f3f7ff; border-color:#8aafe9; color:#1e5fb7; }
html[data-theme="day"] .btn.primary,
html[data-theme="day"] .login-gate .gate-actions .primary { background:#3173e8 !important;
  border-color:#3173e8 !important; color:#fff !important; }
html[data-theme="day"] .btn.primary:hover { background:#2563ce !important; border-color:#2563ce !important; }
html[data-theme="day"] input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
html[data-theme="day"] select,html[data-theme="day"] textarea {
  background:#fff !important; background-color:#fff !important;
  border:1px solid #dbe4f1 !important; color:#20354f !important;
  -webkit-text-fill-color:#20354f !important; border-radius:9px !important;
  min-height:38px;
}
html[data-theme="day"] table { font-variant-numeric:tabular-nums; }
html[data-theme="day"] th { font:650 11px var(--sans); text-transform:none;
  letter-spacing:.015em; color:#667991; border-bottom:1px solid #dfe8f4; background:#f7f9fd; }
html[data-theme="day"] td { border-bottom:1px solid #edf1f7; }
html[data-theme="day"] tbody tr:hover { background:#f7faff; }
html[data-theme="day"] .tag { border-radius:999px; }
html[data-theme="day"] :focus-visible { outline-color:#377ad9; }
html[data-theme="day"] .property-summary-tabs { margin-bottom:20px; }
html[data-theme="day"] .sub-tabs { border-color:#e5ebf4; }
html[data-theme="day"] .login-gate .gate-card { border-color:var(--mm-border); background:#fff; }
html[data-theme="day"] .login-gate .gate-splash { background:transparent; }
@media (min-width:1150px) {
  .content { padding-inline:clamp(30px,3vw,60px); }
}
@media (max-width:1024px) {
  .sidebar { width:224px; min-width:224px; padding-inline:11px; }
  .content { padding-inline:22px; }
  .mm-topbar { margin-bottom:18px; }
}
@media (min-width:761px) and (max-width:860px) {
  .app-shell { display:flex; flex-direction:row; }
  .sidebar { position:sticky; top:0; height:100vh; overflow-y:auto; align-self:flex-start;
    border-right:1px solid var(--line); border-bottom:0; }
  .side-nav,.admin-object-nav { flex-direction:column; flex-wrap:nowrap; }
  .admin-object-nav .nav-utility-links { width:auto;display:flex;grid-template-columns:none; }
  .content { min-width:0; flex:1; }
}
@media (max-width:760px) {
  .app-shell { display:block; }
  .content { width:100%; padding:0 15px 94px; }
  .mm-topbar { position:sticky; top:0; z-index:115; min-height:66px;
    padding:11px 0; margin:0 -15px 20px; padding-left:15px; padding-right:15px; }
  html[data-theme="day"] .mm-topbar { background:rgba(248,250,254,.96); backdrop-filter:blur(14px); }
  .mm-menu-button { display:inline-flex; }
  .mm-topbar-icon,.mm-topbar-eyebrow,.mm-environment { display:none; }
  .mm-topbar-title { font-size:15px; }
  .sidebar { position:fixed; top:0;bottom:0;left:0;z-index:130; height:100dvh;
    width:min(290px,calc(100vw - 56px));min-width:0; max-width:290px;
    padding:24px 16px 22px; overflow-y:auto; transform:translateX(-105%);
    transition:transform .2s ease; box-shadow:none; }
  .mm-nav-open .sidebar { transform:translateX(0); }
  .mm-mobile-backdrop { position:fixed; z-index:125; inset:0;
    width:100%;height:100%;background:rgba(15,33,61,.38); border:0; }
  .mm-nav-open .mm-mobile-backdrop { display:block; }
  .mm-nav-open { overflow:hidden; }
  .content-head h2 { font-size:23px; }
  html[data-theme="day"] .card { padding:16px; }
  .cols,.cols-narrow { grid-template-columns:minmax(0,1fr); }
  .grid2,.grid3 { grid-template-columns:minmax(0,1fr); }
  .tk-stat-grid,.overview-stat-grid-two { grid-template-columns:repeat(2,minmax(0,1fr));gap:10px; }
  .table-scroll { max-width:100%; overflow-x:auto; }
  .mm-topbar-right { gap:4px; }
  .mm-menu-button { white-space:nowrap; }
}
@media (max-width:430px) {
  .tk-stat-grid,.overview-stat-grid-two { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .tk-stat strong { font-size:21px; }
  .mm-topbar { gap:8px; }
}
@media (prefers-reduced-motion:reduce) {
  .sidebar,.mm-topbar { transition:none !important; }
}
