:root {
  --blue: #1558d6;
  --blue-2: #2677ee;
  --blue-dark: #0c347e;
  --blue-soft: #eaf2ff;
  --green: #16a56a;
  --green-dark: #087b4c;
  --green-soft: #eafaf3;
  --red: #ce4055;
  --red-soft: #fff0f2;
  --orange: #e99820;
  --orange-soft: #fff7e8;
  --ink: #10203b;
  --muted: #6a7c98;
  --line: #dce7f5;
  --surface: #fff;
  --page: #f4f8fd;
  --sidebar: 268px;
  --shadow: 0 18px 55px rgba(25, 62, 117, .1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: Tahoma, Arial, sans-serif; color: var(--ink); background: var(--page); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
img { max-width: 100%; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.text-danger { color: var(--red); }
.text-success { color: var(--green-dark); }
.text-blue { color: var(--blue); }
.nowrap { white-space: nowrap; }
.full { grid-column: 1 / -1; }
.wide { width: 100%; }
.ltr { direction: ltr; text-align: left; }

/* Authentication and installer */
.auth-body {
  min-height: 100vh;
  padding: 28px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 8% 10%, rgba(22, 165, 106, .15), transparent 28%),
    radial-gradient(circle at 94% 88%, rgba(21, 88, 214, .2), transparent 33%),
    linear-gradient(145deg, #f9fbff, #eaf3ff);
}
.auth-shell, .installer-shell {
  width: min(1040px, 100%);
  display: grid;
  grid-template-columns: minmax(320px, .9fr) minmax(380px, 1.1fr);
  min-height: 610px;
  border: 1px solid rgba(220, 231, 245, .92);
  border-radius: 30px;
  overflow: hidden;
  background: rgba(255,255,255,.96);
  box-shadow: 0 32px 90px rgba(17, 55, 116, .16);
}
.installer-shell { width: min(1120px, 100%); }
.auth-brand-panel {
  position: relative;
  padding: 62px 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: #fff;
  background:
    linear-gradient(150deg, rgba(255,255,255,.08), transparent 50%),
    linear-gradient(145deg, #0e43a3, #1667df 62%, #159a69);
  isolation: isolate;
}
.auth-brand-panel::before, .auth-brand-panel::after {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.15);
}
.auth-brand-panel::before { width: 270px; height: 270px; top: -100px; left: -90px; }
.auth-brand-panel::after { width: 170px; height: 170px; bottom: -45px; right: -35px; background: rgba(255,255,255,.05); }
.auth-logo { width: 82px; height: 82px; padding: 8px; margin-bottom: 25px; border-radius: 24px; background: #fff; box-shadow: 0 16px 34px rgba(0,0,0,.18); }
.eyebrow { display: inline-block; margin-bottom: 9px; color: var(--green-dark); font-size: 12px; font-weight: 800; letter-spacing: .4px; }
.auth-brand-panel .eyebrow { color: #c6ffdf; }
.auth-brand-panel h1 { margin: 0 0 14px; font-size: clamp(34px, 5vw, 50px); line-height: 1.18; }
.auth-brand-panel > p { max-width: 500px; margin: 0; color: rgba(255,255,255,.82); font-size: 16px; line-height: 1.9; }
.auth-stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 38px; }
.auth-stat-grid div { padding: 14px; border: 1px solid rgba(255,255,255,.18); border-radius: 16px; background: rgba(255,255,255,.08); backdrop-filter: blur(7px); }
.auth-stat-grid b, .auth-stat-grid span { display: block; }
.auth-stat-grid span { margin-top: 5px; color: rgba(255,255,255,.72); font-size: 12px; }
.feature-pills, .feature-list { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 34px; }
.feature-pills span, .feature-list span { padding: 8px 11px; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; background: rgba(255,255,255,.1); font-size: 12px; }
.feature-list { flex-direction: column; }
.feature-list span { width: max-content; }
.auth-card { padding: 60px 54px; align-self: center; }
.auth-card h2 { margin: 0 0 9px; font-size: 28px; }
.auth-card > .muted { margin: 0 0 24px; line-height: 1.8; font-size: 14px; }
.installer-card { max-height: 92vh; overflow-y: auto; align-self: stretch; }
.wide-card { padding-top: 35px; padding-bottom: 35px; }
.stack-form { display: grid; gap: 17px; margin-top: 24px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
label > span { display: block; margin-bottom: 7px; color: #314560; font-size: 13px; font-weight: 700; }
input, select, textarea {
  width: 100%;
  min-height: 48px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  background: #fbfdff;
  color: var(--ink);
  transition: border-color .2s, box-shadow .2s, background .2s;
}
textarea { min-height: 100px; resize: vertical; line-height: 1.7; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(21,88,214,.1); background: #fff; }
input[type="file"] { padding: 8px; background: var(--blue-soft); }
input[type="checkbox"] { width: 18px; min-height: 18px; accent-color: var(--blue); }
.form-section-title { grid-column: 1 / -1; margin: 12px 0 0; padding-bottom: 9px; border-bottom: 1px solid var(--line); font-size: 15px; color: var(--blue-dark); }
.section-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 25px; }
.section-heading h2 { margin: 0; }
.step-badge { padding: 7px 11px; border-radius: 999px; background: var(--blue-soft); color: var(--blue); font-size: 12px; font-weight: 800; }
.auth-switch { margin: 22px 0 0; text-align: center; color: var(--muted); font-size: 13px; }
.auth-switch a { color: var(--blue); font-weight: 800; text-decoration: none; }
.success-mark { width: 72px; height: 72px; margin: 0 auto 22px; display: grid; place-items: center; border-radius: 50%; background: var(--green-soft); color: var(--green); font-size: 36px; font-weight: 900; }

/* Buttons and feedback */
.btn {
  min-height: 42px;
  padding: 9px 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: 11px;
  cursor: pointer;
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
  transition: transform .15s, box-shadow .2s, opacity .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn.primary { color: #fff; background: linear-gradient(135deg, var(--blue), var(--blue-2)); box-shadow: 0 10px 25px rgba(21,88,214,.2); }
.btn.success { color: #fff; background: linear-gradient(135deg, var(--green), #29be80); box-shadow: 0 10px 24px rgba(22,165,106,.18); }
.btn.soft { color: var(--blue); border-color: #cfe0ff; background: var(--blue-soft); }
.btn.light { color: #3f526e; border-color: var(--line); background: #fff; }
.btn.danger { color: var(--red); border-color: #ffd2d9; background: var(--red-soft); }
.btn.small { min-height: 34px; padding: 6px 10px; font-size: 11px; border-radius: 9px; }
.icon-btn { width: 40px; height: 40px; padding: 0; display: inline-grid; place-items: center; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); background: #fff; cursor: pointer; }
.alert { margin: 17px 0; padding: 13px 15px; border: 1px solid; border-radius: 13px; line-height: 1.7; font-size: 13px; }
.alert.danger { color: #8f2435; border-color: #ffd0d8; background: var(--red-soft); }
.alert.success { color: var(--green-dark); border-color: #bcebd5; background: var(--green-soft); }
.alert.info { color: var(--blue-dark); border-color: #ccdeff; background: var(--blue-soft); }
.alert.warning { color: #835408; border-color: #f7d797; background: var(--orange-soft); }

/* App shell */
.app-body { min-height: 100vh; background: var(--page); }
.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  z-index: 50;
  inset: 0 0 0 auto;
  width: var(--sidebar);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  color: #dbe8ff;
  background:
    radial-gradient(circle at 40px 20px, rgba(41,190,128,.18), transparent 30%),
    linear-gradient(180deg, #0a327a, #0d489f 70%, #0b3b84);
  box-shadow: -12px 0 45px rgba(13,50,113,.15);
  overflow-y: auto;
}
.brand { padding: 2px 9px 18px; display: flex; align-items: center; gap: 11px; border-bottom: 1px solid rgba(255,255,255,.1); }
.brand img { width: 45px; height: 45px; padding: 5px; border-radius: 14px; background: #fff; }
.brand strong, .brand small { display: block; }
.brand strong { color: #fff; font-size: 16px; }
.brand small { margin-top: 3px; color: #a9c6f5; font-size: 10px; }
.org-mini { margin: 15px 5px 9px; padding: 12px; border: 1px solid rgba(255,255,255,.1); border-radius: 14px; background: rgba(255,255,255,.07); }
.org-mini b, .org-mini span { display: block; }
.org-mini b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #fff; font-size: 12px; }
.org-mini span { margin-top: 5px; color: #a9c6f5; font-size: 10px; }
.nav-label { margin: 14px 10px 6px; color: #83a8e3; font-size: 9px; font-weight: 800; }
.side-nav { display: grid; gap: 3px; }
.nav-link { min-height: 41px; padding: 8px 10px; display: flex; align-items: center; gap: 10px; border-radius: 11px; color: #c4d7f7; text-decoration: none; font-size: 12px; font-weight: 700; transition: .18s; }
.nav-link:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav-link.active { color: #fff; background: linear-gradient(90deg, rgba(38,119,238,.8), rgba(31,182,121,.55)); box-shadow: inset 0 0 0 1px rgba(255,255,255,.09); }
.nav-icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; background: rgba(255,255,255,.08); font-size: 14px; }
.sidebar-foot { margin-top: auto; padding: 14px 7px 0; border-top: 1px solid rgba(255,255,255,.1); }
.sidebar-foot .nav-link { color: #ffbec8; }
.main-area { min-height: 100vh; margin-right: var(--sidebar); }
.topbar { position: sticky; top: 0; z-index: 35; height: 70px; padding: 0 25px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid rgba(220,231,245,.85); background: rgba(255,255,255,.9); backdrop-filter: blur(15px); }
.topbar-start, .topbar-actions, .user-chip { display: flex; align-items: center; gap: 10px; }
.menu-toggle { display: none; }
.topbar-title b, .topbar-title span { display: block; }
.topbar-title b { font-size: 15px; }
.topbar-title span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.subscription-pill { padding: 7px 10px; display: flex; align-items: center; gap: 7px; border: 1px solid #bdebd6; border-radius: 999px; color: var(--green-dark); background: var(--green-soft); font-size: 10px; font-weight: 800; }
.subscription-pill.warning { color: #835408; border-color: #f1d18e; background: var(--orange-soft); }
.user-chip { padding: 5px 8px 5px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; }
.user-avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: linear-gradient(135deg, var(--blue), var(--green)); font-size: 12px; font-weight: 900; }
.user-chip b, .user-chip span { display: block; }
.user-chip b { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.user-chip span { margin-top: 2px; color: var(--muted); font-size: 9px; }
.content { width: min(1500px, 100%); margin: 0 auto; padding: 25px 25px 95px; }
.page-head { margin-bottom: 20px; display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.page-head h1 { margin: 0 0 6px; font-size: 24px; }
.page-head p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.head-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }

/* Dashboard and cards */
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card { position: relative; min-height: 132px; padding: 19px; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 10px 35px rgba(25,62,117,.06); }
.stat-card::after { content: ""; position: absolute; width: 86px; height: 86px; left: -28px; bottom: -36px; border-radius: 50%; background: var(--blue-soft); }
.stat-card.green::after { background: var(--green-soft); }
.stat-card.orange::after { background: var(--orange-soft); }
.stat-card.red::after { background: var(--red-soft); }
.stat-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.stat-icon { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 12px; color: var(--blue); background: var(--blue-soft); font-size: 17px; }
.stat-card.green .stat-icon { color: var(--green-dark); background: var(--green-soft); }
.stat-card.orange .stat-icon { color: #a5670b; background: var(--orange-soft); }
.stat-card.red .stat-icon { color: var(--red); background: var(--red-soft); }
.stat-card small { color: var(--muted); font-size: 10px; }
.stat-card strong { display: block; margin-top: 13px; font-size: 22px; }
.stat-card > span { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .75fr); gap: 17px; }
.panel { padding: 19px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 10px 35px rgba(25,62,117,.055); }
.panel + .panel { margin-top: 16px; }
.panel-head { margin-bottom: 15px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel-head h2, .panel-head h3 { margin: 0; font-size: 15px; }
.panel-head p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.panel-head a { color: var(--blue); text-decoration: none; font-size: 11px; font-weight: 800; }
.progress { height: 9px; overflow: hidden; border-radius: 999px; background: #edf2f8; }
.progress > span { height: 100%; display: block; border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--green)); }
.occupancy-number { margin: 12px 0 8px; display: flex; align-items: end; gap: 7px; }
.occupancy-number b { font-size: 34px; color: var(--blue-dark); }
.occupancy-number span { padding-bottom: 5px; color: var(--muted); font-size: 11px; }
.mini-list { display: grid; gap: 9px; }
.mini-item { padding: 10px 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px dashed var(--line); }
.mini-item:last-child { border-bottom: 0; }
.mini-item-main { min-width: 0; display: flex; align-items: center; gap: 10px; }
.mini-avatar { width: 36px; height: 36px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 11px; color: var(--blue); background: var(--blue-soft); font-weight: 900; }
.mini-item b, .mini-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-item b { font-size: 11px; }
.mini-item small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.mini-value { flex: 0 0 auto; text-align: left; }
.mini-value b { color: var(--red); }
.bar-chart { min-height: 220px; padding-top: 20px; display: flex; align-items: end; gap: 10px; border-bottom: 1px solid var(--line); }
.bar-column { flex: 1; min-width: 28px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 7px; }
.bar { width: min(42px, 80%); min-height: 3px; border-radius: 9px 9px 3px 3px; background: linear-gradient(180deg, var(--green), var(--blue)); box-shadow: 0 7px 16px rgba(21,88,214,.14); }
.bar-column b { font-size: 9px; }
.bar-column small { color: var(--muted); font-size: 8px; }

/* Tables and listings */
.toolbar { margin-bottom: 15px; padding: 12px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.toolbar .search-field { flex: 1; min-width: 180px; }
.search-field { position: relative; }
.search-field input { padding-right: 39px; min-height: 42px; }
.search-field::before { content: "⌕"; position: absolute; z-index: 1; right: 14px; top: 9px; color: var(--muted); font-size: 18px; }
.toolbar select, .toolbar input { min-height: 42px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 15px; }
.data-table { width: 100%; border-collapse: collapse; background: #fff; font-size: 11px; }
.data-table th { padding: 12px; text-align: right; white-space: nowrap; color: #526784; background: #f7faff; font-size: 10px; }
.data-table td { padding: 11px 12px; border-top: 1px solid #edf2f8; vertical-align: middle; }
.data-table tbody tr { transition: background .15s; }
.data-table tbody tr:hover { background: #fbfdff; }
.table-main { display: flex; align-items: center; gap: 9px; min-width: 170px; }
.table-thumb { width: 40px; height: 40px; flex: 0 0 auto; object-fit: cover; border-radius: 10px; background: var(--blue-soft); }
.table-thumb.placeholder { display: grid; place-items: center; color: var(--blue); font-size: 17px; }
.table-main b, .table-main small { display: block; }
.table-main small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.actions { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border-radius: 999px; font-size: 9px; font-weight: 800; white-space: nowrap; }
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge.success { color: var(--green-dark); background: var(--green-soft); }
.badge.danger { color: var(--red); background: var(--red-soft); }
.badge.warning { color: #98610c; background: var(--orange-soft); }
.badge.neutral { color: #5d6f89; background: #eef3f8; }
.entity-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.entity-card { overflow: hidden; border: 1px solid var(--line); border-radius: 17px; background: #fff; box-shadow: 0 10px 30px rgba(25,62,117,.05); }
.entity-photo { position: relative; height: 155px; overflow: hidden; display: grid; place-items: center; color: var(--blue); background: linear-gradient(145deg, #ecf4ff, #e5faf1); font-size: 38px; }
.entity-photo img { width: 100%; height: 100%; object-fit: cover; }
.entity-photo .badge { position: absolute; top: 10px; left: 10px; }
.entity-body { padding: 15px; }
.entity-body h3 { margin: 0 0 6px; font-size: 14px; }
.entity-body > p { min-height: 34px; margin: 0 0 12px; color: var(--muted); font-size: 10px; line-height: 1.7; }
.entity-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.entity-meta div { padding: 8px; border-radius: 10px; background: #f7faff; }
.entity-meta small, .entity-meta b { display: block; }
.entity-meta small { color: var(--muted); font-size: 8px; }
.entity-meta b { margin-top: 3px; font-size: 10px; }
.entity-actions { padding: 11px 15px; display: flex; gap: 7px; border-top: 1px solid var(--line); background: #fbfdff; }
.empty-state { padding: 55px 20px; text-align: center; border: 1px dashed #c9d9ed; border-radius: 17px; background: #fff; }
.empty-icon { width: 62px; height: 62px; margin: 0 auto 15px; display: grid; place-items: center; border-radius: 18px; color: var(--blue); background: var(--blue-soft); font-size: 28px; }
.empty-state h3 { margin: 0 0 7px; font-size: 15px; }
.empty-state p { max-width: 420px; margin: 0 auto 17px; color: var(--muted); font-size: 11px; line-height: 1.7; }

/* Forms, tabs and modal */
.filters { margin-bottom: 15px; padding: 13px; display: grid; grid-template-columns: repeat(5, minmax(120px, 1fr)); gap: 10px; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
.filters .btn { align-self: end; }
.tabs { margin-bottom: 15px; padding: 5px; display: flex; gap: 5px; overflow-x: auto; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.tab-button { padding: 8px 13px; border: 0; border-radius: 9px; color: var(--muted); background: transparent; white-space: nowrap; cursor: pointer; font-size: 11px; font-weight: 800; }
.tab-button.active { color: var(--blue); background: var(--blue-soft); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.modal { position: fixed; z-index: 100; inset: 0; padding: 20px; display: none; place-items: center; background: rgba(7,22,47,.55); backdrop-filter: blur(5px); }
.modal.open { display: grid; }
.modal-card { width: min(680px, 100%); max-height: 90vh; overflow-y: auto; border-radius: 20px; background: #fff; box-shadow: 0 35px 90px rgba(0,0,0,.22); animation: modal-in .18s ease-out; }
.modal-card.large { width: min(900px, 100%); }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.modal-head { position: sticky; top: 0; z-index: 2; padding: 17px 20px; display: flex; align-items: center; justify-content: space-between; gap: 15px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); }
.modal-head h2 { margin: 0; font-size: 17px; }
.modal-body { padding: 20px; }
.modal-actions { grid-column: 1 / -1; padding-top: 7px; display: flex; justify-content: flex-end; gap: 8px; }
.help-text { display: block; margin-top: 5px; color: var(--muted); font-size: 9px; line-height: 1.6; }
.summary-strip { margin-bottom: 15px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.summary-item { padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.summary-item small, .summary-item b { display: block; }
.summary-item small { color: var(--muted); font-size: 9px; }
.summary-item b { margin-top: 6px; font-size: 15px; }
.gallery-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.gallery-item { position: relative; aspect-ratio: 1; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: #f4f8fd; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; }
.gallery-overlay { position: absolute; inset: auto 0 0; padding: 22px 9px 8px; display: flex; align-items: end; justify-content: space-between; gap: 5px; color: #fff; background: linear-gradient(transparent, rgba(4,18,42,.8)); font-size: 9px; }
.gallery-overlay button { width: 28px; height: 28px; border: 0; border-radius: 8px; color: #fff; background: rgba(206,64,85,.85); cursor: pointer; }
.upload-zone { margin-bottom: 16px; padding: 22px; border: 2px dashed #bdd2ee; border-radius: 15px; text-align: center; background: #f8fbff; }
.metric-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.metric { padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.metric small, .metric strong { display: block; }
.metric small { color: var(--muted); font-size: 9px; }
.metric strong { margin-top: 7px; font-size: 18px; }
.plan-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.plan-card { padding: 20px; border: 1px solid var(--line); border-radius: 17px; background: #fff; }
.plan-card.featured { border-color: #a8c6fa; box-shadow: 0 14px 35px rgba(21,88,214,.12); }
.plan-card h3 { margin: 0; }
.plan-price { margin: 14px 0; color: var(--blue); font-size: 24px; font-weight: 900; }
.plan-price small { color: var(--muted); font-size: 10px; }
.plan-features { display: grid; gap: 8px; margin: 15px 0; color: #425673; font-size: 10px; }

/* Toast, mobile */
.toast-stack { position: fixed; z-index: 150; top: 18px; left: 18px; width: min(360px, calc(100vw - 36px)); display: grid; gap: 8px; }
.toast { padding: 13px 14px; border: 1px solid; border-radius: 13px; background: #fff; box-shadow: var(--shadow); animation: toast-in .2s ease-out; font-size: 12px; line-height: 1.6; }
.toast.success { color: var(--green-dark); border-color: #bcebd5; background: var(--green-soft); }
.toast.danger { color: #8f2435; border-color: #ffd0d8; background: var(--red-soft); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }
.sidebar-backdrop { display: none; }
.mobile-nav { display: none; }

@media (max-width: 1180px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .entity-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters { grid-template-columns: repeat(3, minmax(120px, 1fr)); }
}

@media (max-width: 900px) {
  .auth-body { padding: 14px; }
  .auth-shell, .installer-shell { grid-template-columns: 1fr; }
  .auth-brand-panel { min-height: 250px; padding: 32px; }
  .auth-brand-panel h1 { font-size: 34px; }
  .auth-logo { width: 65px; height: 65px; margin-bottom: 15px; }
  .auth-card { padding: 35px 28px; }
  .sidebar { transform: translateX(105%); transition: transform .22s ease; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop { position: fixed; z-index: 45; inset: 0; display: block; visibility: hidden; opacity: 0; background: rgba(7,22,47,.5); transition: .2s; }
  .sidebar-backdrop.open { visibility: visible; opacity: 1; }
  .main-area { margin-right: 0; }
  .menu-toggle { display: inline-grid; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .topbar { padding: 0 15px; }
  .content { padding: 20px 15px 92px; }
  .mobile-nav { position: fixed; z-index: 40; right: 10px; bottom: 10px; left: 10px; height: 64px; padding: 7px; display: grid; grid-template-columns: repeat(5, 1fr); border: 1px solid rgba(220,231,245,.9); border-radius: 18px; background: rgba(255,255,255,.94); box-shadow: 0 18px 50px rgba(12,52,126,.18); backdrop-filter: blur(14px); }
  .mobile-nav a, .mobile-nav button { border: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border-radius: 11px; color: var(--muted); background: transparent; text-decoration: none; font-size: 8px; font-weight: 800; }
  .mobile-nav a span, .mobile-nav button span { font-size: 17px; line-height: 1; }
  .mobile-nav a.active { color: var(--blue); background: var(--blue-soft); }
  .metric-row, .summary-strip { grid-template-columns: repeat(2, 1fr); }
  .plan-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .auth-body { display: block; padding: 0; background: #fff; }
  .auth-shell, .installer-shell { min-height: 100vh; border: 0; border-radius: 0; box-shadow: none; }
  .auth-brand-panel { min-height: 215px; padding: 25px 20px; justify-content: flex-start; }
  .auth-brand-panel > p, .auth-stat-grid, .feature-pills { display: none; }
  .auth-brand-panel h1 { font-size: 27px; }
  .auth-card { padding: 28px 20px; }
  .installer-card { max-height: none; }
  .form-grid { grid-template-columns: 1fr; }
  .full, .form-section-title, .modal-actions { grid-column: 1; }
  .page-head { align-items: stretch; flex-direction: column; }
  .head-actions { justify-content: flex-start; }
  .head-actions .btn { flex: 1; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .stat-card { min-height: 118px; padding: 14px; border-radius: 15px; }
  .stat-card strong { font-size: 18px; }
  .entity-grid { grid-template-columns: 1fr; }
  .filters { grid-template-columns: 1fr 1fr; }
  .filters .btn { width: 100%; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .toolbar select { width: 100%; }
  .topbar-title, .subscription-pill { display: none; }
  .user-chip b { max-width: 88px; }
  .modal { padding: 0; align-items: end; }
  .modal-card, .modal-card.large { width: 100%; max-height: 92vh; border-radius: 22px 22px 0 0; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .bar-chart { gap: 5px; }
}

@media print {
  .sidebar, .topbar, .mobile-nav, .no-print, .head-actions, .toolbar, .filters { display: none !important; }
  .main-area { margin: 0; }
  .content { padding: 0; }
  .panel, .table-wrap { box-shadow: none; break-inside: avoid; }
  body { background: #fff; }
}
