﻿:root {
  --bg: #f5f7fb;
  --bg-soft: #eef2f8;
  --panel: #ffffff;
  --line-strong: #1b2433;
  --line: rgba(27, 36, 51, 0.18);
  --line-soft: rgba(27, 36, 51, 0.1);
  --text: #131c2e;
  --muted: #5f6d84;
  --accent: #2d6ee8;
  --accent-soft: rgba(45, 110, 232, 0.12);
  --danger: #bf3f35;
  --ok: #157b52;
  --shadow-sm: 0 4px 16px rgba(18, 30, 52, 0.06);
  --shadow-md: 0 12px 34px rgba(18, 30, 52, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Manrope", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 460px at 85% -120px, rgba(45, 110, 232, 0.08) 0%, transparent 60%),
    radial-gradient(900px 360px at -10% 100%, rgba(27, 36, 51, 0.05) 0%, transparent 65%),
    var(--bg);
}

.hidden {
  display: none !important;
}

.tenant-shell {
  width: 100%;
  min-height: 100vh;
}

.tenant-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}

.kicker {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
}

.tenant-auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: 28px;
  padding: 28px;
}

.tenant-hero {
  padding: 12px;
}

.tenant-hero h1 {
  margin: 12px 0 12px;
  font-family: "Sora", "Segoe UI", sans-serif;
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1.04;
}

.tenant-hero p {
  margin: 0;
  max-width: 58ch;
  line-height: 1.62;
  color: var(--muted);
}

.tenant-login {
  padding: 22px;
  display: grid;
  gap: 10px;
}

.tenant-login h2 {
  margin: 0 0 8px;
  font-family: "Sora", "Segoe UI", sans-serif;
  font-size: 30px;
}

label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
  transition: border-color 160ms, box-shadow 160ms;
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

button {
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  background: var(--accent);
}

button.ghost {
  border-color: var(--line);
  color: var(--text);
  background: #fff;
}

button.danger {
  border-color: rgba(191, 63, 53, 0.28);
  color: var(--danger);
  background: rgba(191, 63, 53, 0.08);
}

.status {
  min-height: 18px;
  margin: 0;
  font-size: 13px;
}

.status.ok {
  color: var(--ok);
}

.status.err {
  color: var(--danger);
}

.tenant-dashboard {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 246px minmax(0, 1fr);
}

.tenant-sidebar {
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 18px 16px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 18px;
}

.tenant-brand h2 {
  margin: 6px 0 0;
  font-family: "Sora", "Segoe UI", sans-serif;
  font-size: 22px;
  line-height: 1.1;
}

.tenant-nav {
  display: grid;
  gap: 7px;
  align-content: start;
}

.nav-item {
  position: relative;
  border: 0;
  background: none;
  color: #3e4e6c;
  text-align: left;
  border-radius: 0;
  padding: 4px 0 4px 12px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
}

.nav-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 5px;
  bottom: 5px;
  width: 2px;
  border-radius: 1px;
  background: transparent;
}

.nav-item:hover {
  color: #16233d;
}

.nav-item.active {
  color: #101a2f;
  font-weight: 700;
}

.nav-item.active::before {
  background: var(--line-strong);
}

.tenant-user {
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
  border-top: 1px solid var(--line-soft);
  padding-top: 12px;
}

.tenant-main {
  padding: 14px;
  display: grid;
  gap: 12px;
}

.tenant-top {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 13px;
  display: grid;
  grid-template-columns: auto minmax(260px, 380px) auto;
  gap: 10px;
  align-items: center;
}

.tenant-title-wrap h3 {
  margin: 4px 0 0;
  font-family: "Sora", "Segoe UI", sans-serif;
  font-size: 21px;
}

.tenant-header-tools {
  justify-self: center;
  width: 100%;
}

.quick-search {
  width: 100%;
}

.quick-search input {
  border-radius: 9px;
  padding-left: 12px;
}

.tenant-top-actions {
  display: flex;
  gap: 8px;
  justify-self: end;
}

.section-panel {
  display: none;
  gap: 10px;
}

.section-panel.active {
  display: grid;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px 10px;
}

.section-head h3 {
  margin: 0;
  font-family: "Sora", "Segoe UI", sans-serif;
  font-size: 18px;
}

.mini-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: #1d2c47;
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 8px;
}

.mini-btn:hover {
  border-color: rgba(27, 36, 51, 0.36);
  background: #f5f7fb;
}

.tenant-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.metric {
  padding: 12px;
}

.metric p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.metric strong {
  display: block;
  margin-top: 6px;
  font-family: "Sora", "Segoe UI", sans-serif;
  font-size: clamp(22px, 2.5vw, 30px);
}

.list-block {
  padding: 12px;
}

.list-block h3 {
  margin: 0 0 8px;
  font-family: "Sora", "Segoe UI", sans-serif;
  font-size: 16px;
}

.inline-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.inline-head h3 {
  margin: 0;
}

.scroll {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fcfdff;
  max-height: 360px;
  overflow: auto;
}

ul {
  margin: 0;
  padding: 8px;
  list-style: none;
}

li {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 9px;
  margin-bottom: 7px;
  font-size: 13px;
  color: var(--text);
  background: #fff;
}

li strong {
  display: block;
  margin-bottom: 2px;
}

li small {
  color: var(--muted);
  line-height: 1.45;
}

.info-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  font-size: 14px;
  line-height: 1.55;
  background: #fff;
}

.tenant-lists {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.tenant-lists.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.section-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 16, 27, 0.42);
  z-index: 90;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 91;
  display: grid;
  place-items: center;
  padding: 14px;
}

.modal-card {
  width: min(560px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-md);
  padding: 14px;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.modal-head h3 {
  margin: 0;
  font-family: "Sora", "Segoe UI", sans-serif;
  font-size: 20px;
}

.icon-close {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  padding: 6px 9px;
  font-size: 12px;
}

.stack {
  display: grid;
  gap: 9px;
}

@media (max-width: 1120px) {
  .tenant-auth {
    grid-template-columns: 1fr;
  }

  .tenant-dashboard {
    grid-template-columns: 1fr;
  }

  .tenant-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    grid-template-rows: auto;
    gap: 12px;
  }

  .tenant-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .nav-item {
    font-size: 13px;
    padding-left: 10px;
  }

  .tenant-top {
    grid-template-columns: 1fr;
  }

  .tenant-header-tools,
  .tenant-top-actions {
    justify-self: stretch;
    width: 100%;
  }

  .tenant-top-actions {
    justify-content: flex-start;
  }

  .tenant-metrics,
  .tenant-lists,
  .tenant-lists.two,
  .section-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .tenant-auth,
  .tenant-main {
    padding: 12px;
  }

  .tenant-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tenant-top-actions {
    flex-wrap: wrap;
  }

  .tenant-top-actions button {
    flex: 1;
    min-width: 120px;
  }
}
