@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap");

:root {
  --bg: #f4f6fb;
  --panel: rgba(255, 255, 255, 0.82);
  --panel-solid: #ffffff;
  --line: #dce4f5;
  --text: #1f2a44;
  --muted: #627091;
  --accent: #4f75f2;
  --accent-2: #ea74ab;
  --accent-soft: #ecf1ff;
  --danger: #d65075;
  --success: #3d9d78;
  --warning: #bd7f19;
  --radius: 18px;
  --shadow: 0 14px 40px rgba(41, 63, 121, 0.12);
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: "Manrope", "Avenir Next", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(1000px 520px at 0% -10%, #e5eeff 0, transparent 60%),
    radial-gradient(900px 480px at 100% -10%, #ffe8f3 0, transparent 58%),
    linear-gradient(180deg, #f8faff 0%, #f4f6fb 100%);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(248, 251, 255, 0.74);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(16px);
}

.brand {
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--text);
}

.tenant-badge,
.user-label {
  margin-left: 10px;
  color: var(--muted);
  font-size: 0.88rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.layout {
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  min-height: calc(100vh - 73px);
}

.layout-full {
  grid-template-columns: minmax(0, 1fr);
}

.sidebar {
  padding: 24px 16px;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar a {
  display: block;
  padding: 12px 14px;
  border-radius: 12px;
  font-weight: 600;
  color: var(--text);
}

.sidebar a:hover {
  background: var(--accent-soft);
  text-decoration: none;
}

.content {
  padding: 24px;
}

.content-inner {
  max-width: 1240px;
  margin: 0 auto;
}

.layout-full .content {
  display: flex;
  justify-content: center;
}

.layout-full .content-inner {
  width: min(980px, 100%);
}

.card,
.stat-card,
.tenant-card,
.table-wrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.card,
.stat-card,
.tenant-card {
  padding: 22px;
}

.card.narrow {
  max-width: 560px;
  margin: 42px auto;
}

.muted {
  color: var(--muted);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-weight: 600;
}

input,
textarea,
select,
button {
  font: inherit;
}

input,
textarea,
select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-solid);
  color: var(--text);
  transition: border-color .18s ease, box-shadow .18s ease;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent);
}

textarea {
  line-height: 1.44;
}

button,
.button-link {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  border-radius: 12px;
  border: 1px solid transparent;
  padding: 11px 16px;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 78%, #93acff));
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 0.01em;
}

button:hover,
.button-link:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.button-link.secondary,
button.secondary,
.ghost-button {
  background: #fff;
  color: var(--accent);
  border-color: var(--line);
}

.ghost-button {
  font-weight: 700;
}

.alert {
  margin-bottom: 18px;
  padding: 13px 14px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-weight: 600;
}

.alert-error {
  background: #fff0f4;
  color: var(--danger);
  border-color: #ffd3df;
}

.alert-success {
  background: #eaf8f2;
  color: var(--success);
  border-color: #cdebdc;
}

.page-head,
.actions-row,
.search-bar {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.page-head h1 {
  margin: 0;
  font-size: clamp(1.5rem, 2.2vw, 2rem);
}

.page-head p {
  margin: 6px 0 0;
}

.tenant-grid,
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
}

.tenant-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: inherit;
}

.tenant-card strong {
  font-size: 1.06rem;
}

.tenant-card:hover {
  text-decoration: none;
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
  transform: translateY(-2px);
}

.stat-card span {
  color: var(--muted);
  font-weight: 600;
}

.stat-card strong {
  display: block;
  margin-top: 6px;
  font-size: clamp(1.4rem, 2.4vw, 1.85rem);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status-active {
  background: #e9f8f1;
  color: var(--success);
}

.status-pending {
  background: #fff5e4;
  color: var(--warning);
}

.status-rejected,
.status-blocked {
  background: #ffeef4;
  color: var(--danger);
}

form.compact {
  gap: 10px;
}

.search-bar input {
  max-width: 420px;
}

.search-bar select {
  max-width: 220px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

thead th {
  position: sticky;
  top: 0;
  background: rgba(251, 253, 255, 0.92);
  z-index: 1;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

tbody tr:nth-child(2n) {
  background: rgba(242, 246, 255, 0.42);
}

tbody tr:last-child td {
  border-bottom: none;
}

.actions-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.actions-inline form {
  margin: 0;
}

.bouquet-thumb-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.bouquet-thumb {
  width: 68px;
  height: 68px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 6px 18px rgba(38, 44, 65, 0.08);
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.bouquet-thumb-link:hover .bouquet-thumb {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(38, 44, 65, 0.14);
}

.bouquet-thumb-empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 68px;
  height: 68px;
  border-radius: 12px;
  border: 1px dashed var(--line);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(242, 246, 255, 0.45);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.checkbox-row {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding-top: 28px;
}

.checkbox-row input[type="checkbox"] {
  width: auto;
  inline-size: 18px;
  block-size: 18px;
}

.auth-hero {
  margin-bottom: 20px;
}

.empty-state {
  text-align: center;
  padding: 38px 22px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.62);
}

.helper {
  font-size: 0.86rem;
  color: var(--muted);
  margin-top: 2px;
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--line);
    flex-direction: row;
    overflow-x: auto;
    padding: 12px 16px;
  }

  .content {
    padding: 16px;
  }
}

@media (max-width: 640px) {
  .topbar {
    padding: 12px 14px;
    flex-wrap: wrap;
  }

  .topbar-actions {
    width: 100%;
    justify-content: space-between;
  }

  .card,
  .stat-card,
  .tenant-card {
    padding: 16px;
  }

  .card.narrow {
    margin: 18px auto;
  }
}
