/* ==========================================================================
   РИЭЛТОР.KPI — design tokens
   ========================================================================== */

:root {
  --forest-950: #030f1f;
  --forest-900: #071b32;
  --forest-800: #0d2a49;
  --forest-700: #133a61;
  --lime: #4fc3f7;
  --lime-dim: #d3edfb;
  --cream: #eef3fa;
  --paper: #ffffff;
  --line: #dbe4f0;
  --ink: #0f1c2d;
  --ink-soft: #4b5c72;
  --muted: #8496ac;
  --coral: #e2664a;
  --blue: #4a7fe2;
  --amber: #e2a64a;
  --grad-primary: linear-gradient(135deg, #123a63, #030f1f 78%);
  --shadow-soft: 0 20px 40px -24px rgba(6, 20, 38, 0.32);
  --shadow-card: 0 1px 0 rgba(6, 20, 38, 0.04), 0 12px 30px -20px rgba(6, 20, 38, 0.2);

  --radius-lg: 26px;
  --radius-md: 16px;
  --radius-sm: 11px;

  --font-display: "Unbounded", sans-serif;
  --font-body: "Manrope", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  overflow-x: hidden;
}
html { overflow-x: hidden; max-width: 100%; }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }
::selection { background: var(--lime); color: var(--forest-950); }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

@keyframes reveal {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.reveal { animation: reveal .5s cubic-bezier(.2,.7,.3,1) both; }

/* ==========================================================================
   App shell — full-bleed fluid layout
   ========================================================================== */

.app-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
  width: 100%;
}

/* ---------- Sidebar ---------- */

.rail {
  background: linear-gradient(180deg, var(--forest-950), var(--forest-900) 60%, var(--forest-800));
  color: var(--lime-dim);
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
  gap: 8px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.rail-top { display: flex; align-items: center; gap: 12px; padding: 4px 8px 20px; }
.rail-mark {
  width: 40px; height: 40px; flex-shrink: 0;
  border-radius: 12px;
  background: var(--lime);
  color: var(--forest-950);
  display: flex; align-items: center; justify-content: center;
}
.rail-mark svg { width: 20px; height: 20px; }
.brand-name { font-family: var(--font-display); font-weight: 600; font-size: 15px; color: #fff; letter-spacing: .01em; }
.brand-name span { color: var(--lime); }
.brand-sub { font-size: 11.5px; color: rgba(223, 245, 171, 0.55); margin-top: 2px; }

.rail-nav { display: flex; flex-direction: column; gap: 3px; margin-top: 6px; flex: 1; }
.rail-btn {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  color: rgba(223, 245, 171, 0.72);
  border: none; background: transparent;
  font-size: 13.5px; font-weight: 600;
  transition: background .18s ease, color .18s ease;
}
.rail-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.rail-btn:hover { background: rgba(199, 242, 100, 0.08); color: #fff; }
.rail-btn.active { background: var(--lime); color: var(--forest-950); }

.rail-user {
  display: flex; align-items: center; gap: 10px;
  padding: 10px; border-radius: var(--radius-sm);
  margin-top: 8px;
  transition: background .18s ease;
}
.rail-user:hover, .rail-user.active { background: rgba(199, 242, 100, 0.1); }
.rail-user img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0; border: 2px solid rgba(199,242,100,.3); }
.rail-user-info { min-width: 0; }
.rail-user-info .name { font-size: 13px; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail-user-info .role { font-size: 11px; color: rgba(223, 245, 171, 0.55); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.rail-logout {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  color: rgba(223, 245, 171, 0.5); font-size: 12.5px; font-weight: 600;
  margin-top: 2px;
}
.rail-logout:hover { color: var(--coral); background: rgba(226,102,74,.08); }
.rail-logout svg { width: 16px; height: 16px; }

.rail-btn-admin { color: var(--lime); }

/* Elements only relevant to the mobile off-canvas drawer; hidden on desktop */
.mobile-menu-btn {
  display: none; width: 40px; height: 40px; border-radius: 50%;
  background: var(--paper); border: 1px solid var(--line); color: var(--ink-soft);
  align-items: center; justify-content: center; flex-shrink: 0;
}
.mobile-menu-btn svg { width: 19px; height: 19px; }
.rail-close { display: none; }
.rail-overlay { display: none; }

/* ---------- Main ---------- */

.main {
  width: 100%;
  min-width: 0;
  padding: 30px clamp(20px, 3vw, 48px) 60px;
}

.topbar {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 20px; flex-wrap: wrap;
  margin-bottom: 26px;
}
.topbar-title { display: flex; align-items: flex-start; gap: 12px; }
.topbar-title h1 { font-family: var(--font-display); font-size: 22px; margin: 0 0 4px; font-weight: 600; }
.topbar-title p { margin: 0; color: var(--muted); font-size: 13.5px; }
.topbar-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.agent-filter {
  display: flex; align-items: center; gap: 8px;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: 999px; padding: 8px 14px;
  color: var(--ink-soft);
}
.agent-filter svg { width: 15px; height: 15px; }
.agent-filter select { border: none; background: transparent; font-size: 13px; font-weight: 600; color: var(--ink); outline: none; }

.topbar-badge {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 600; color: var(--ink-soft);
  background: var(--paper); border: 1px solid var(--line);
  padding: 8px 14px; border-radius: 999px;
}
.dot-live { width: 7px; height: 7px; border-radius: 50%; background: #45c46a; box-shadow: 0 0 0 3px rgba(69,196,106,.18); }

.rail-btn { position: relative; }
.nav-badge {
  position: absolute; right: 10px; top: 8px;
  background: var(--coral); color: #fff; font-size: 10px; font-weight: 800;
  min-width: 16px; height: 16px; border-radius: 999px; display: flex; align-items: center; justify-content: center; padding: 0 4px;
}

.icon-btn {
  position: relative; width: 40px; height: 40px; border-radius: 50%;
  background: var(--paper); border: 1px solid var(--line); color: var(--ink-soft);
  display: flex; align-items: center; justify-content: center;
}
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn:hover { background: var(--cream); }

.notif-wrap { position: relative; }
.notif-dot {
  position: absolute; top: -3px; right: -3px;
  background: var(--coral); color: #fff; font-size: 10px; font-weight: 800;
  min-width: 16px; height: 16px; border-radius: 999px; display: flex; align-items: center; justify-content: center; padding: 0 3px;
  border: 2px solid var(--cream);
}
.notif-dropdown {
  display: none; position: absolute; top: calc(100% + 10px); right: 0;
  width: 320px; max-height: 380px; overflow-y: auto;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-md);
  box-shadow: 0 20px 45px -18px rgba(13,40,24,.35); z-index: 90;
}
.notif-dropdown.open { display: block; }
.notif-head { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; padding: 14px 16px 8px; }
.notif-empty { padding: 20px 16px; color: var(--muted); font-size: 13px; text-align: center; }
.notif-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 16px; }
.notif-item:hover { background: var(--cream); }
.notif-ico { width: 26px; height: 26px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 13px; flex-shrink: 0; background: var(--cream); }
.notif-ico-warn { background: #fbe4de; }
.notif-ico-soon { background: #faf0dd; }
.notif-ico-team { background: var(--lime-dim); }
.notif-title { font-size: 12.5px; font-weight: 700; }
.notif-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

.btn-primary {
  display: flex; align-items: center; gap: 8px;
  background: var(--grad-primary); color: var(--lime);
  border: none; padding: 11px 18px; border-radius: 999px;
  font-size: 13.5px; font-weight: 700;
  box-shadow: var(--shadow-soft);
  transition: transform .15s ease, background .15s ease;
}
.btn-primary svg { width: 15px; height: 15px; }
.btn-primary:hover { transform: translateY(-1px); background: var(--forest-800); }
.btn-secondary {
  background: var(--paper); border: 1px solid var(--line); color: var(--ink);
  padding: 11px 18px; border-radius: 999px; font-weight: 700; font-size: 13.5px;
}
.btn-sm { padding: 9px 16px; font-size: 12.5px; }
.btn-block { width: 100%; justify-content: center; margin-top: 18px; }

/* Flash messages */
.flash-stack { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.flash { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 600; }
.flash-success { background: var(--lime-dim); color: var(--forest-900); }
.flash-error { background: #fbe4de; color: #9a3a24; }

/* ==========================================================================
   KPI cards
   ========================================================================== */

.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}
.kpi-card {
  background: var(--paper); border-radius: var(--radius-md);
  padding: 20px 20px 18px; box-shadow: var(--shadow-card);
  border: 1px solid var(--line);
}
.kpi-card.kpi-accent { background: var(--grad-primary); border-color: var(--forest-950); }
.kpi-card.kpi-accent .kpi-label { color: rgba(223,245,171,.6); }
.kpi-card.kpi-accent .kpi-value { color: var(--lime); }
.kpi-card.kpi-accent .kpi-sub { color: rgba(223,245,171,.75); }

.kpi-label { font-size: 12.5px; color: var(--muted); font-weight: 600; margin-bottom: 10px; }
.kpi-value { font-family: var(--font-display); font-size: 24px; font-weight: 600; letter-spacing: -.01em; }
.kpi-sub { font-size: 12px; color: var(--muted); margin-top: 8px; font-weight: 600; }
.kpi-sub.positive { color: #2f9e5b; }
.kpi-sub.negative { color: var(--coral); }

/* ==========================================================================
   Grid layouts / cards
   ========================================================================== */

.grid-row {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
  align-items: stretch;
}
.grid-row-b {
  display: grid;
  grid-template-columns: 1fr 1.7fr;
  gap: 16px;
  margin-bottom: 16px;
}

.card {
  background: var(--paper); border-radius: var(--radius-lg);
  border: 1px solid var(--line); box-shadow: var(--shadow-card);
  padding: 22px;
  min-width: 0;
}
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 10px; }
.card-title { font-family: var(--font-display); font-size: 15px; font-weight: 600; margin: 0; }
.card-head-actions { display: flex; gap: 6px; }
.card-link { font-size: 12.5px; font-weight: 700; color: var(--forest-700); }
.chip { font-size: 11px; font-weight: 700; color: var(--muted); background: var(--cream); padding: 5px 10px; border-radius: 999px; }

.chart-wrap-lg { height: 280px; }

/* Funnel */
.funnel { display: flex; flex-direction: column; gap: 13px; }
.funnel-row { display: grid; grid-template-columns: 110px 1fr 30px; align-items: center; gap: 10px; }
.funnel-label { font-size: 12px; font-weight: 600; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.funnel-track { height: 10px; background: var(--cream); border-radius: 999px; overflow: hidden; }
.funnel-fill { height: 100%; border-radius: 999px; min-width: 4px; transition: width .5s ease; }
.funnel-count { font-size: 12.5px; font-weight: 700; text-align: right; }
.funnel-fill.stage-0 { background: #8fb8f0; }
.funnel-fill.stage-1 { background: #6fa8e8; }
.funnel-fill.stage-2 { background: var(--amber); }
.funnel-fill.stage-3 { background: #e28a4a; }
.funnel-fill.stage-4 { background: #45c46a; }
.funnel-fill.stage-5 { background: var(--coral); }

/* Mini list (upcoming viewings) */
.mini-list { display: flex; flex-direction: column; gap: 4px; }
.mini-row { display: flex; align-items: center; gap: 12px; padding: 10px 6px; border-radius: var(--radius-sm); }
.mini-row:hover { background: var(--cream); }
.mini-time { font-size: 12.5px; font-weight: 700; width: 48px; flex-shrink: 0; }
.mini-time small { display: block; font-weight: 600; color: var(--muted); font-size: 10.5px; }
.mini-avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.mini-info { min-width: 0; }
.mini-name { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-sub { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Tables */
.table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.data-table td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table-lg td, .data-table-lg th { padding: 13px 12px; }

.table-person { display: flex; align-items: center; gap: 10px; }
.table-person img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.table-person span { font-weight: 700; }
.contact-cell small { display: block; color: var(--muted); font-size: 11.5px; }

.badge { display: inline-block; padding: 5px 11px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.badge-stage-0 { background: #e6effb; color: #2f5fa8; }
.badge-stage-1 { background: #e6effb; color: #2f5fa8; }
.badge-stage-2 { background: #faf0dd; color: #96700f; }
.badge-stage-3 { background: #fbe8de; color: #a04c1f; }
.badge-stage-4 { background: var(--lime-dim); color: var(--forest-900); }
.badge-stage-5 { background: #fbe4de; color: #9a3a24; }

.status-select, .stage-select { border: 1px solid var(--line); background: var(--cream); border-radius: 8px; padding: 6px 9px; font-size: 12px; font-weight: 600; color: var(--ink); outline: none; }

.empty-state { text-align: center; padding: 30px 10px; color: var(--muted); font-size: 13px; font-weight: 600; }

/* Leaderboard */
.deals-section { margin-top: 8px; }
.deals-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.deals-head h2 { font-family: var(--font-display); font-size: 17px; font-weight: 600; margin: 0; }
.deals-head .count { font-size: 12.5px; color: var(--muted); font-weight: 600; margin-left: 8px; }

.leaderboard { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.leader-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: 16px; box-shadow: var(--shadow-card);
}
.leader-card.featured { background: var(--grad-primary); border-color: var(--forest-950); color: #fff; }
.leader-card.featured .leader-pos, .leader-card.featured .leader-deals { color: rgba(223,245,171,.6); }
.leader-rank { font-family: var(--font-display); font-size: 16px; font-weight: 700; color: var(--muted); width: 20px; }
.leader-card.featured .leader-rank { color: var(--lime); }
.leader-avatar { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.leader-info { flex: 1; min-width: 0; }
.leader-name { font-weight: 700; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.leader-pos { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.leader-stats { text-align: right; flex-shrink: 0; }
.leader-revenue { font-weight: 700; font-size: 13px; }
.leader-deals { font-size: 11px; color: var(--muted); }

/* ==========================================================================
   Filters bar
   ========================================================================== */

.filters-bar { margin-bottom: 16px; }
.filters-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.search-field {
  display: flex; align-items: center; gap: 9px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 999px;
  padding: 10px 16px; flex: 1; min-width: 220px;
}
.search-field svg { width: 15px; height: 15px; color: var(--muted); flex-shrink: 0; }
.search-field input { border: none; outline: none; background: transparent; font-size: 13.5px; width: 100%; }
.filters-form select {
  background: var(--paper); border: 1px solid var(--line); border-radius: 999px;
  padding: 10px 14px; font-size: 13px; font-weight: 600; outline: none;
}

/* ==========================================================================
   Objects grid
   ========================================================================== */

.objects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 18px;
}
.object-card {
  background: var(--paper); border-radius: var(--radius-lg); border: 1px solid var(--line);
  box-shadow: var(--shadow-card); overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease; cursor: pointer;
}
.object-card:hover { transform: translateY(-3px); box-shadow: 0 20px 40px -20px rgba(6,20,38,.28); }
.object-photo { position: relative; height: 170px; }
.object-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.object-status {
  position: absolute; top: 12px; left: 12px;
  font-size: 10.5px; font-weight: 700; padding: 5px 10px; border-radius: 999px;
  background: rgba(255,255,255,.92); color: var(--ink);
}
.object-status.status-Активный { color: #2f9e5b; }
.object-status.status-Показы { color: #2f5fa8; }
.object-status.status-Бронь { color: #96700f; }
.object-status.status-Продан { color: var(--muted); }
.object-status.status-Снят-с-продажи { color: var(--coral); }
.object-dealtype {
  position: absolute; top: 12px; right: 12px;
  font-size: 10.5px; font-weight: 700; padding: 5px 10px; border-radius: 999px;
  background: var(--grad-primary); color: var(--lime);
}
.object-body { padding: 16px; }
.object-price { font-family: var(--font-display); font-size: 18px; font-weight: 600; }
.object-price small { font-size: 11px; color: var(--muted); font-weight: 500; }
.object-title { font-size: 13.5px; font-weight: 700; margin-top: 6px; }
.object-address { font-size: 12px; color: var(--muted); margin-top: 2px; }
.object-specs { display: flex; gap: 10px; flex-wrap: wrap; font-size: 11.5px; color: var(--ink-soft); font-weight: 600; margin-top: 10px; }
.object-specs span::after { content: '·'; margin-left: 10px; color: var(--line); }
.object-specs span:last-child::after { content: ''; }
.object-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); gap: 8px; }
.object-agent { display: flex; align-items: center; gap: 7px; min-width: 0; }
.object-agent img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.object-agent span { font-size: 11.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ==========================================================================
   Kanban board
   ========================================================================== */

.kanban {
  display: grid;
  grid-template-columns: repeat(6, minmax(220px, 1fr));
  gap: 14px;
  align-items: start;
  overflow-x: auto;
  padding-bottom: 8px;
}
.kanban-col {
  background: rgba(255,255,255,.5);
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
  padding: 12px;
  min-height: 200px;
  transition: background .15s ease, border-color .15s ease;
}
.kanban-col.drag-over { background: var(--lime-dim); border-color: var(--lime); border-style: solid; }
.kanban-col-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; font-weight: 700; margin-bottom: 12px; padding: 0 2px;
}
.stage-head-0, .stage-head-1 { color: #2f5fa8; }
.stage-head-2 { color: #96700f; }
.stage-head-3 { color: #a04c1f; }
.stage-head-4 { color: #1f7a42; }
.stage-head-5 { color: #9a3a24; }
.kanban-count { background: var(--paper); border-radius: 999px; padding: 2px 8px; font-size: 11px; border: 1px solid var(--line); }
.kanban-cards { display: flex; flex-direction: column; gap: 10px; min-height: 40px; }
.deal-kcard {
  background: var(--paper); border-radius: var(--radius-sm); border: 1px solid var(--line);
  box-shadow: var(--shadow-card); padding: 13px; cursor: grab;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}
.deal-kcard:active { cursor: grabbing; }
.deal-kcard.dragging { opacity: .35; }
.kanban-drag-ghost {
  position: fixed; z-index: 500; pointer-events: none;
  box-shadow: 0 24px 50px -16px rgba(6,20,38,.45);
  border-radius: var(--radius-sm);
  transform: scale(1.03) rotate(1deg);
  opacity: .96;
}
.deal-kcard-move {
  margin-top: 10px; display: flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); background: var(--cream); border-radius: 999px;
  padding: 6px 10px; font-size: 11.5px; font-weight: 700; color: var(--ink-soft);
  outline: none;
}
.deal-kcard-amount { font-family: var(--font-display); font-size: 14.5px; font-weight: 600; }
.deal-kcard-prop { font-size: 12px; color: var(--ink-soft); margin-top: 4px; font-weight: 600; }
.deal-kcard-client { display: flex; align-items: center; gap: 7px; margin-top: 9px; }
.deal-kcard-client img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; }
.deal-kcard-client span { font-size: 12px; font-weight: 600; }
.deal-kcard-agent { font-size: 10.5px; color: var(--muted); margin-top: 6px; font-weight: 600; }
.deal-kcard-commission { font-size: 10.5px; color: var(--forest-700); margin-top: 6px; font-weight: 700; }
.deal-kcard-docs { display: flex; gap: 10px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.deal-kcard-docs a { font-size: 10.5px; font-weight: 700; color: var(--forest-700); }
.deal-kcard-docs a:hover { text-decoration: underline; }

/* ==========================================================================
   Calendar / booking list
   ========================================================================== */

.day-tabs { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.day-tab {
  border: 1px solid var(--line); background: var(--paper);
  border-radius: var(--radius-sm); padding: 9px 16px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 12.5px; min-width: 68px;
}
.day-tab .num { font-weight: 700; display: flex; align-items: center; gap: 5px; }
.day-tab .wd { color: var(--muted); font-size: 11px; }
.day-tab .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--coral); display: inline-block; }
.day-tab.active { background: var(--grad-primary); border-color: var(--forest-950); color: var(--lime); }
.day-tab.active .wd { color: rgba(223,245,171,.6); }

.booking-list-full { display: flex; flex-direction: column; gap: 2px; }
.booking-row-full {
  display: grid; grid-template-columns: 90px 1.3fr 1.3fr auto auto;
  align-items: center; gap: 14px; padding: 13px 10px;
  border-bottom: 1px solid var(--line);
  animation: reveal .4s ease both;
}
.booking-row-full:last-child { border-bottom: none; }
.booking-time { font-size: 13px; font-weight: 700; }
.booking-time small { display: block; color: var(--muted); font-weight: 600; font-size: 11px; }
.booking-person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.booking-person img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.booking-person .who .name, .booking-object .name { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.booking-person .who .tag, .booking-object .tag { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.booking-agent { font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.booking-status { font-size: 11px; font-weight: 700; color: #2f5fa8; background: #e6effb; padding: 5px 11px; border-radius: 999px; white-space: nowrap; }

/* ==========================================================================
   Client portal
   ========================================================================== */

.portal-main { max-width: 900px; }
.portal-section { margin-bottom: 30px; }
.portal-h2 { font-family: var(--font-display); font-size: 17px; font-weight: 600; margin: 0 0 14px; }
.portal-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card); padding: 20px; margin-bottom: 12px;
}
.portal-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.portal-card-title { font-family: var(--font-display); font-size: 14.5px; font-weight: 600; }
.portal-card-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.portal-card-amount { font-family: var(--font-display); font-size: 17px; font-weight: 600; white-space: nowrap; }
.portal-card-amount small { font-size: 11px; color: var(--muted); font-weight: 500; }
.portal-docs { display: flex; gap: 8px; margin-top: 16px; }

.stage-track { display: flex; align-items: flex-start; gap: 4px; margin: 18px 0 6px; overflow-x: auto; padding-bottom: 4px; }
.stage-step { flex: 1; min-width: 90px; text-align: center; position: relative; }
.stage-step::before {
  content: ''; position: absolute; top: 6px; left: -50%; width: 100%; height: 2px; background: var(--line); z-index: 0;
}
.stage-step:first-child::before { display: none; }
.stage-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--line); margin: 0 auto 8px; position: relative; z-index: 1; border: 2px solid var(--paper); }
.stage-step.done .stage-dot { background: var(--forest-700); }
.stage-step.done::before { background: var(--forest-700); }
.stage-step.current .stage-dot { background: var(--lime); box-shadow: 0 0 0 4px var(--lime-dim); }
.stage-label { font-size: 10.5px; font-weight: 700; color: var(--muted); }
.stage-step.done .stage-label, .stage-step.current .stage-label { color: var(--ink); }
.stage-rejected { color: var(--coral); font-weight: 700; font-size: 12.5px; margin-top: 8px; }

.portal-viewing-row { display: flex; align-items: center; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.portal-viewing-row:last-child { border-bottom: none; }
.portal-viewing-date { font-size: 13px; font-weight: 700; width: 90px; flex-shrink: 0; }
.portal-viewing-date small { display: block; color: var(--muted); font-weight: 600; font-size: 11px; }

/* ==========================================================================
   Tasks
   ========================================================================== */

.task-tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.task-tab {
  display: flex; align-items: center; gap: 7px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 999px;
  padding: 9px 16px; font-size: 12.5px; font-weight: 700; color: var(--ink-soft);
}
.task-tab span { background: var(--cream); border-radius: 999px; padding: 2px 8px; font-size: 11px; }
.task-tab.active { background: var(--grad-primary); border-color: var(--forest-950); color: var(--lime); }
.task-tab.active span { background: rgba(255,255,255,.15); color: var(--lime); }
.task-tab-danger { color: var(--coral); }

.task-list { display: flex; flex-direction: column; gap: 8px; }
.task-row {
  display: flex; align-items: flex-start; gap: 14px;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-md);
  box-shadow: var(--shadow-card); padding: 14px 18px;
}
.task-row.task-overdue { border-color: #f3c4b6; background: #fff7f5; }
.task-row.task-done { opacity: .6; }
.task-row.task-done .task-title { text-decoration: line-through; }

.check-btn {
  width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line);
  background: var(--paper); flex-shrink: 0; margin-top: 2px;
  display: flex; align-items: center; justify-content: center; font-size: 13px; color: #fff;
}
.check-btn:hover { border-color: var(--forest-700); }
.check-btn.checked { background: var(--forest-700); border-color: var(--forest-700); }

.task-main { flex: 1; min-width: 0; }
.task-title { font-size: 13.5px; font-weight: 700; }
.task-meta { display: flex; gap: 5px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); margin-top: 4px; font-weight: 600; }
.task-type-badge { background: var(--cream); border-radius: 999px; padding: 2px 9px; }
.task-notes { font-size: 12px; color: var(--ink-soft); margin-top: 6px; }
.task-due { text-align: right; flex-shrink: 0; }
.task-due-date { font-size: 12.5px; font-weight: 700; }
.task-due-time { font-size: 11px; color: var(--muted); }

/* ==========================================================================
   Object detail page
   ========================================================================== */

.detail-hero { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 16px; }
.detail-photo { position: relative; border-radius: var(--radius-lg); overflow: hidden; min-height: 320px; }
.detail-photo img { width: 100%; height: 100%; object-fit: cover; display: block; position: absolute; inset: 0; }
.detail-info {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card); padding: 24px;
}
.detail-price { font-family: var(--font-display); font-size: 26px; font-weight: 600; }
.detail-price small { font-size: 13px; color: var(--muted); font-weight: 500; }
.detail-address { font-size: 13.5px; color: var(--muted); margin-top: 4px; margin-bottom: 18px; }
.detail-actions { margin-top: 20px; }
.doc-cell { display: flex; gap: 6px; }

/* ==========================================================================
   Rentals / leases
   ========================================================================== */

.lease-list { display: flex; flex-direction: column; gap: 14px; }
.lease-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card); padding: 18px 20px; overflow: hidden;
}
.lease-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.lease-title { font-family: var(--font-display); font-size: 14.5px; font-weight: 600; }
.lease-address { font-size: 12px; color: var(--muted); margin-top: 2px; }
.lease-status { font-size: 11px; font-weight: 700; padding: 6px 12px; border-radius: 999px; white-space: nowrap; }
.status-lease-Активна { background: var(--lime-dim); color: var(--forest-900); }
.status-lease-Ожидает-продления { background: #faf0dd; color: #96700f; }
.status-lease-Завершена { background: var(--cream); color: var(--muted); }
.status-lease-Расторгнута { background: #fbe4de; color: #9a3a24; }

.lease-body { display: grid; grid-template-columns: repeat(4, 1fr) auto; gap: 16px; align-items: start; }
.lease-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 700; margin-bottom: 6px; }
.lease-value { font-size: 13px; font-weight: 700; }
.lease-sub-value { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.lease-tenant { display: flex; align-items: center; gap: 8px; }
.lease-tenant img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.lease-tenant .name { font-size: 13px; font-weight: 700; }
.lease-tenant .sub { font-size: 11px; color: var(--muted); }
.lease-col-actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }

.lease-payments { max-height: 0; overflow: hidden; transition: max-height .3s ease; margin-top: 0; }
.lease-payments.open { max-height: 600px; overflow-y: auto; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }

/* Team / invite */
.invite-box { display: flex; align-items: center; gap: 12px; }
.invite-code {
  font-family: monospace; font-size: 18px; font-weight: 700; letter-spacing: .08em;
  background: var(--grad-primary); color: var(--lime); padding: 12px 20px; border-radius: var(--radius-sm);
}
.invite-hint { font-size: 12.5px; color: var(--muted); margin-top: 12px; }
.invite-hint a { color: var(--forest-700); font-weight: 700; }

.pending-list { display: flex; flex-direction: column; gap: 4px; }
.pending-row { display: flex; align-items: center; gap: 12px; padding: 12px 6px; border-bottom: 1px solid var(--line); }
.pending-row:last-child { border-bottom: none; }
.pending-row img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.pending-info { flex: 1; }
.pending-info .name { font-size: 13.5px; font-weight: 700; }
.pending-info .sub { font-size: 11.5px; color: var(--muted); }
.pending-actions { display: flex; gap: 8px; }

.target-form { display: flex; gap: 6px; }
.target-form input {
  width: 110px; border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; font-size: 12.5px;
  background: var(--cream); outline: none;
}

/* ==========================================================================
   Showcase (in-app links page)
   ========================================================================== */

.link-box { display: flex; gap: 8px; align-items: center; }
.link-box input {
  flex: 1; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 14px;
  background: var(--cream); font-size: 13px; font-family: monospace; color: var(--ink-soft);
}
.showcase-stats { display: flex; gap: 24px; margin-top: 16px; }
.showcase-stats div { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.showcase-stats span { display: block; font-family: var(--font-display); font-size: 20px; font-weight: 600; color: var(--ink); }
.how-list { display: flex; flex-direction: column; gap: 10px; }
.how-item { font-size: 13px; color: var(--ink-soft); }
.how-item b { color: var(--forest-700); margin-right: 4px; }

/* ==========================================================================
   Reports
   ========================================================================== */

.period-form { align-items: center; }
.inline-label { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; color: var(--ink-soft); }
.inline-label input { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 10px; background: var(--paper); font-size: 13px; }
.report-export { display: flex; gap: 8px; }
.report-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
.report-stats .rs-value { font-family: var(--font-display); font-size: 17px; font-weight: 600; }
.report-stats .rs-value.negative { color: var(--coral); }
.report-stats .rs-label { font-size: 11px; color: var(--muted); font-weight: 600; margin-top: 2px; }
.report-more { font-size: 11.5px; color: var(--muted); margin-top: 10px; text-align: center; }

/* ==========================================================================
   Public storefront (no login)
   ========================================================================== */

.storefront-body { margin: 0; background: var(--cream); }
.storefront-header { background: var(--grad-primary); color: #fff; padding: 18px clamp(20px, 4vw, 60px); }
.storefront-header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; max-width: 1400px; margin: 0 auto; }
.storefront-brand { display: flex; align-items: center; gap: 12px; }
.storefront-company { font-family: var(--font-display); font-size: 15px; font-weight: 600; }
.storefront-city { font-size: 12px; color: rgba(223,245,171,.6); }
.agent-bar { display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,.08); padding: 8px 16px 8px 8px; border-radius: 999px; }
.agent-bar img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.agent-bar .name { font-size: 12.5px; font-weight: 700; }
.agent-bar .sub { font-size: 11px; color: rgba(223,245,171,.6); }

.storefront-hero { padding: 40px clamp(20px, 4vw, 60px) 20px; max-width: 1400px; margin: 0 auto; }
.storefront-hero h1 { font-family: var(--font-display); font-size: 26px; font-weight: 600; margin: 0 0 10px; }
.storefront-hero p { color: var(--ink-soft); font-size: 14px; max-width: 640px; margin: 0; }

.storefront-main { max-width: 1400px; margin: 0 auto; padding: 0 clamp(20px, 4vw, 60px) 60px; }
.catalog-filters { margin-bottom: 8px; }
.price-input { width: 110px; border: 1px solid var(--line); border-radius: 999px; padding: 10px 14px; font-size: 13px; background: var(--paper); }
.catalog-count { font-size: 12.5px; color: var(--muted); font-weight: 600; margin: 14px 0 16px; }

.storefront-footer { text-align: center; padding: 30px; color: var(--muted); font-size: 12px; }

/* ==========================================================================
   Modals
   ========================================================================== */

.modal-overlay {
  display: none; position: fixed; inset: 0; background: rgba(10, 31, 20, 0.5);
  align-items: center; justify-content: center; z-index: 100; padding: 20px;
  backdrop-filter: blur(2px);
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--paper); border-radius: var(--radius-lg); padding: 24px;
  width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,.35);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.modal-head h3 { font-family: var(--font-display); font-size: 17px; margin: 0; font-weight: 600; }
.modal-head button { border: none; background: var(--cream); width: 30px; height: 30px; border-radius: 50%; font-size: 14px; color: var(--ink-soft); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid.form-grid-1 { grid-template-columns: 1fr; }
.form-grid label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--ink-soft); }
.form-grid .span-2 { grid-column: span 2; }
.form-grid input, .form-grid select, .form-grid textarea {
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px;
  font-size: 13.5px; font-weight: 500; color: var(--ink); outline: none; background: var(--cream);
  font-family: inherit;
}
.form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus { border-color: var(--forest-700); background: var(--paper); }
.form-grid input:disabled { color: var(--muted); }
.form-grid textarea { resize: vertical; }

/* ==========================================================================
   Documents tab: types, templates, editor, preview
   ========================================================================== */

.doc-type-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-filter, .chip-filter-btn {
  border: 1px solid var(--line); background: var(--cream); border-radius: 999px;
  padding: 7px 14px; font-size: 12.5px; font-weight: 700; color: var(--ink-soft);
}
.chip-filter.active, .chip-filter-btn.active { background: var(--forest-900); color: #fff; border-color: var(--forest-900); }
.chip-filter-wrap { display: inline-flex; align-items: center; gap: 0; padding: 0; overflow: hidden; }
.chip-filter-wrap .chip-filter-btn { border-radius: 999px 0 0 999px; border-right: none; }
.chip-remove {
  border: 1px solid var(--line); border-left: none; background: var(--cream); color: var(--coral);
  border-radius: 0 999px 999px 0; padding: 7px 10px; font-size: 11px; font-weight: 700;
}

.doc-template-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.doc-template-card {
  border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--cream);
  padding: 16px; display: flex; flex-direction: column; gap: 10px;
}
.doc-template-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.doc-template-name { font-weight: 700; font-size: 14.5px; }
.doc-template-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.doc-template-sub { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.doc-template-record select { width: 100%; }
.doc-template-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 4px; }
.doc-danger { color: var(--coral); }

.doc-editor-modal { max-width: 980px; }
.doc-editor-layout { display: grid; grid-template-columns: 1fr 260px; gap: 20px; align-items: start; }
.doc-editor-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
#tpl-body { font-family: 'Courier New', monospace; font-size: 13px; line-height: 1.5; }

.doc-preview-block { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 14px; }
.doc-preview-controls { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.doc-preview-controls select { flex: 1; min-width: 180px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 9px 10px; background: var(--cream); font-size: 12.5px; }
.doc-preview-pane {
  background: var(--paper); border: 1px dashed var(--line); border-radius: var(--radius-sm);
  padding: 14px; font-size: 13px; white-space: pre-wrap; line-height: 1.6; color: var(--ink-soft);
  max-height: 220px; overflow-y: auto;
}

.doc-editor-sidebar { border-left: 1px solid var(--line); padding-left: 18px; }
.doc-editor-sidebar-title { font-weight: 700; font-size: 13px; margin-bottom: 4px; }
.doc-editor-hint { font-size: 11.5px; color: var(--muted); margin: 0 0 12px; }
.doc-field-group { margin-bottom: 14px; }
.doc-field-group-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); margin-bottom: 6px; }
.doc-field-chip {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%;
  border: 1px solid var(--line); background: var(--cream); border-radius: var(--radius-sm);
  padding: 7px 10px; margin-bottom: 5px; text-align: left;
}
.doc-field-chip:hover { border-color: var(--forest-700); background: var(--lime-dim); }
.doc-field-chip:disabled { opacity: .5; }
.doc-field-chip code { font-size: 11px; color: var(--forest-700); font-weight: 700; }
.doc-field-chip span { font-size: 11px; color: var(--muted); }

.doc-editor-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.doc-editor-footer-actions { display: flex; gap: 8px; }

@media (max-width: 760px) {
  .doc-editor-layout { grid-template-columns: 1fr; }
  .doc-editor-sidebar { border-left: none; border-top: 1px solid var(--line); padding-left: 0; padding-top: 14px; }
  .doc-editor-row { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Profile / personal cabinet
   ========================================================================== */

.profile-hero {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card); padding: 22px; margin-bottom: 20px;
}
.profile-avatar { width: 68px; height: 68px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.profile-hero-info h2 { font-family: var(--font-display); font-size: 18px; margin: 0 0 4px; font-weight: 600; }
.profile-hero-info p { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.profile-target { margin-left: auto; min-width: 240px; }
.target-label { font-size: 11.5px; font-weight: 700; color: var(--muted); margin-bottom: 7px; }
.target-track { height: 9px; background: var(--cream); border-radius: 999px; overflow: hidden; }
.target-fill { height: 100%; background: linear-gradient(90deg, var(--lime), #8fd94a); border-radius: 999px; transition: width .5s ease; }
.target-nums { font-size: 11.5px; font-weight: 700; margin-top: 7px; color: var(--ink-soft); }

/* ==========================================================================
   Toast
   ========================================================================== */

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(120%);
  background: var(--grad-primary); color: #fff; padding: 13px 20px; border-radius: 999px;
  display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 700;
  box-shadow: var(--shadow-soft); z-index: 200; transition: transform .3s cubic-bezier(.2,.8,.3,1);
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast svg { width: 15px; height: 15px; color: var(--lime); }

/* ==========================================================================
   Login page
   ========================================================================== */

.login-body { margin: 0; background: var(--cream); }
.login-shell { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }
.login-side {
  background: linear-gradient(160deg, var(--forest-950), var(--forest-800));
  color: #fff; padding: 60px clamp(30px, 5vw, 80px);
  display: flex; flex-direction: column; justify-content: center; gap: 18px;
}
.login-mark { margin-bottom: 8px; }
.login-side h1 { font-family: var(--font-display); font-size: 30px; margin: 0; font-weight: 600; }
.login-side h1 span { color: var(--lime); }
.login-side p { color: rgba(223,245,171,.75); font-size: 14.5px; max-width: 420px; line-height: 1.6; margin: 0; }
.login-points { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-direction: column; gap: 10px; }
.login-points li { display: flex; align-items: center; gap: 10px; font-size: 13.5px; font-weight: 600; color: #fff; }
.login-points li::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--lime); flex-shrink: 0; }

.login-form-wrap { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.login-card { width: 100%; max-width: 420px; }
.login-card h2 { font-family: var(--font-display); font-size: 21px; margin: 0 0 6px; font-weight: 600; }
.login-sub { color: var(--muted); font-size: 13px; margin: 0 0 20px; }
.login-form { display: flex; flex-direction: column; gap: 14px; margin-bottom: 26px; }
.login-form label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--ink-soft); }
.login-form input {
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px;
  font-size: 14px; outline: none; background: var(--paper);
}
.login-form input:focus { border-color: var(--forest-700); }

.mode-tabs { display: flex; gap: 6px; background: var(--cream); padding: 4px; border-radius: 999px; margin-bottom: 20px; }
.mode-tab { flex: 1; border: none; background: transparent; padding: 9px; border-radius: 999px; font-size: 12.5px; font-weight: 700; color: var(--ink-soft); }
.mode-tab.active { background: var(--grad-primary); color: var(--lime); }
.login-form label + label { margin-top: 0; }
#company-fields, #agent-fields { display: flex; flex-direction: column; gap: 14px; }
.login-switch { text-align: center; font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.login-switch a { color: var(--forest-700); font-weight: 700; }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1180px) {
  .grid-row { grid-template-columns: 1fr; }
  .grid-row-b { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .lease-body { grid-template-columns: 1fr 1fr; }
  .lease-col-actions { grid-column: span 2; flex-direction: row; align-items: center; justify-content: flex-start; }
  .detail-hero { grid-template-columns: 1fr; }
  .detail-photo { min-height: 260px; }
}

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }

  .mobile-menu-btn { display: flex; }

  .rail {
    position: fixed; top: 0; left: 0; height: 100vh; width: min(78vw, 290px);
    flex-direction: column; align-items: stretch; padding: 18px 14px;
    overflow-y: auto; overflow-x: hidden;
    transform: translateX(-105%);
    transition: transform .28s cubic-bezier(.2,.8,.3,1);
    z-index: 160;
    box-shadow: 20px 0 50px -20px rgba(0,0,0,.4);
  }
  .rail.open { transform: translateX(0); }

  .rail-overlay {
    display: block; position: fixed; inset: 0; background: rgba(3, 15, 31, .55);
    z-index: 150; opacity: 0; pointer-events: none;
    transition: opacity .28s ease;
  }
  .rail-overlay.open { opacity: 1; pointer-events: auto; }

  body.sidebar-open { overflow: hidden; }

  .rail-close {
    display: flex; align-items: center; justify-content: center;
    position: absolute; top: 14px; right: 14px;
    width: 32px; height: 32px; border-radius: 50%;
    background: rgba(255,255,255,.08); color: rgba(223,245,171,.85);
    border: none; font-size: 14px;
  }
  .rail-top { padding: 4px 34px 20px 8px; margin-right: 0; position: relative; }
  .brand-sub { display: block; }
  .rail-nav { flex-direction: column; flex: 1; }
  .rail-btn span { display: inline; }
  .rail-user-info, .rail-logout span { display: block; }

  .kanban { grid-template-columns: repeat(6, 240px); }
  .login-shell { grid-template-columns: 1fr; }
  .login-side { display: none; }
}

@media (min-width: 901px) {
  .rail-overlay { display: none !important; }
}

@media (max-width: 620px) {
  .main { padding: 18px 14px 50px; }
  .booking-row-full { grid-template-columns: 1fr; gap: 6px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .profile-target { margin-left: 0; width: 100%; }
  .notif-dropdown { width: calc(100vw - 32px); right: -8px; }
  .modal { padding: 18px; }
  .admin-top { flex-direction: column; align-items: stretch; gap: 12px; }
  .admin-top-nav { justify-content: stretch; }
  .admin-nav-btn { flex: 1; text-align: center; }
}

/* ==========================================================================
   Platform admin panel shell
   ========================================================================== */

.admin-shell { min-height: 100vh; background: var(--cream); }
.admin-top {
  background: linear-gradient(180deg, var(--forest-950), var(--forest-900));
  color: #fff; display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 16px clamp(16px, 3vw, 40px); flex-wrap: wrap;
}
.admin-top-brand { display: flex; align-items: center; gap: 12px; }
.admin-mark { background: var(--lime); }
.admin-top-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.admin-nav-btn {
  padding: 9px 16px; border-radius: 999px; font-size: 13px; font-weight: 700;
  color: rgba(223,245,171,.8); background: rgba(255,255,255,.06);
}
.admin-nav-btn:hover { background: rgba(255,255,255,.12); color: #fff; }
.admin-nav-btn.active { background: var(--lime); color: var(--forest-950); }
.admin-nav-logout:hover { color: var(--coral); }
.admin-main { padding: 26px clamp(16px, 3vw, 40px) 60px; max-width: 1400px; margin: 0 auto; }
