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

:root {
  --bg: #f3f6f6;
  --card: #ffffff;
  --ink: #132229;
  --muted: #54656b;
  --line: #d8e0e3;
  --brand: #0f766e;
  --brand-strong: #0b5c56;
  --danger: #b91c1c;
  --warning: #b45309;
  --shadow: 0 16px 30px rgba(17, 38, 49, 0.08);
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Manrope", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 90% -20%, #daf5e7 0%, transparent 42%),
    radial-gradient(circle at -10% 120%, #ffe3c4 0%, transparent 36%),
    var(--bg);
  min-height: 100vh;
}

h1,
h2,
h3,
h4,
.tab {
  font-family: "Sora", "Segoe UI", sans-serif;
  margin: 0;
}

.hidden {
  display: none !important;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.auth-card {
  width: min(460px, 100%);
  background: var(--card);
  padding: 24px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid #ebeff0;
}

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

label {
  display: grid;
  gap: 6px;
  font-size: 0.92rem;
  color: var(--muted);
}

input,
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font: inherit;
  color: var(--ink);
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid color-mix(in srgb, var(--brand), white 55%);
  border-color: var(--brand);
}

.btn {
  border: 1px solid transparent;
  padding: 10px 14px;
  border-radius: 10px;
  font: 700 0.9rem/1 "Sora", "Segoe UI", sans-serif;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn.primary {
  color: #fff;
  background: linear-gradient(145deg, #0f766e, #0d9488);
  box-shadow: 0 12px 24px rgba(15, 118, 110, 0.28);
}

.btn.secondary {
  color: #fff;
  background: linear-gradient(145deg, #2563eb, #1d4ed8);
  box-shadow: 0 10px 18px rgba(37, 99, 235, 0.24);
}

.btn.ghost {
  border-color: #c7d3d8;
  background: #fff;
  color: var(--ink);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(243, 246, 246, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid #d9e4e5;
}

.toolbar-row,
.row {
  display: flex;
  align-items: center;
}

.gap {
  gap: 8px;
}

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

.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 10px;
  scrollbar-width: thin;
}

.tab {
  border: 1px solid #c6d5d7;
  background: #fff;
  color: #11323c;
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 0.84rem;
  white-space: nowrap;
}

.tab.active {
  background: linear-gradient(140deg, #0f766e, #0d9488);
  color: #fff;
  border-color: transparent;
}

.panel {
  display: none;
  animation: fadeIn 0.22s ease;
}

.panel.active {
  display: block;
}

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

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.kpi {
  background: var(--card);
  padding: 14px;
  border-radius: 14px;
  box-shadow: var(--shadow);
  border: 1px solid #e6edf0;
}

.kpi .value {
  font-size: 1.45rem;
  font-weight: 800;
}

.kpi .label {
  color: var(--muted);
  font-size: 0.84rem;
}

.trend-shell {
  display: grid;
  gap: 12px;
}

.trend-status {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.status-chip {
  background: #fff;
  border: 1px solid #dfe8eb;
  border-radius: 12px;
  padding: 10px 12px;
  display: grid;
  gap: 4px;
  box-shadow: 0 6px 12px rgba(20, 39, 46, 0.06);
}

.status-name {
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.trend-bars {
  background: #fff;
  border: 1px solid #dfe8eb;
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 14px 12px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(42px, 1fr));
  gap: 8px;
  align-items: end;
  min-height: 180px;
}

.trend-bar-wrap {
  display: grid;
  gap: 6px;
  align-items: end;
}

.trend-bar {
  width: 100%;
  border-radius: 9px 9px 6px 6px;
  background: linear-gradient(180deg, #0d9488, #0f766e);
  position: relative;
  min-height: 8px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.trend-bar span {
  position: absolute;
  top: -20px;
  font-size: 0.76rem;
  color: #194652;
}

.trend-label {
  text-align: center;
  font-size: 0.75rem;
  color: #42575f;
}

.grid-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  background: var(--card);
  border: 1px solid #e8eef0;
  border-radius: 14px;
  padding: 12px;
  box-shadow: var(--shadow);
}

.grid-form .wide {
  grid-column: 1 / -1;
}

.card-list {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.card-list.compact {
  max-height: 380px;
  overflow: auto;
  border-top: 1px dashed #d8e1e3;
  padding-top: 12px;
}

.item-card {
  background: #fff;
  border: 1px solid #dfe9ec;
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: 0 8px 14px rgba(20, 39, 46, 0.06);
}

.item-card h4 {
  font-size: 0.95rem;
}

.card-actions {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.card-actions .btn {
  padding: 7px 10px;
  font-size: 0.78rem;
}

.meta {
  color: #45555b;
  font-size: 0.82rem;
  margin-top: 5px;
}

.muted {
  color: var(--muted);
  font-size: 0.88rem;
}

.status {
  min-height: 1.3em;
  font-size: 0.88rem;
  padding: 6px 2px;
}

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

.status.warn {
  color: var(--warning);
}

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

.notice {
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: #e8f8f6;
  color: #135f56;
  border: 1px solid #c8ebe6;
}

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

.tile {
  background: #fff;
  border: 1px solid #e3ecef;
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 12px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(180px, 1fr));
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.calendar-day {
  background: #fff;
  border: 1px solid #dce8ea;
  border-radius: 12px;
  min-height: 220px;
  display: grid;
  grid-template-rows: auto 1fr;
}

.calendar-day header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 10px;
  border-bottom: 1px solid #e6eef0;
  font-size: 0.85rem;
}

.calendar-dropzone {
  padding: 10px;
  display: grid;
  gap: 8px;
  align-content: start;
}

.calendar-booking {
  background: #f7fbfc;
  border: 1px solid #d6e6ea;
  border-left: 4px solid #0f766e;
  border-radius: 10px;
  padding: 8px;
  display: grid;
  gap: 5px;
}

.calendar-booking h5 {
  margin: 0;
  font-size: 0.86rem;
}

.calendar-time,
.calendar-meta {
  margin: 0;
  font-size: 0.77rem;
  color: #3f555d;
}

.calendar-open.btn {
  padding: 6px 8px;
  font-size: 0.72rem;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(11, 30, 38, 0.38);
  display: grid;
  place-items: center;
  padding: 16px;
  z-index: 50;
}

.modal-card {
  width: min(860px, 100%);
  max-height: min(90vh, 760px);
  overflow: auto;
  background: #fff;
  border-radius: 14px;
  border: 1px solid #d8e5e9;
  box-shadow: 0 24px 48px rgba(19, 37, 45, 0.2);
  padding: 14px;
}

.modal-code {
  max-height: 70vh;
  overflow: auto;
  font-size: 0.78rem;
  line-height: 1.45;
}

.mono {
  font-family: ui-monospace, "Cascadia Code", monospace;
  background: #f2f6f8;
  padding: 8px;
  border-radius: 8px;
  overflow-wrap: anywhere;
}

.qr {
  width: min(240px, 100%);
  border-radius: 10px;
  border: 1px solid #d8e3e7;
  background: #fff;
  padding: 6px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

  .calendar-grid {
    grid-template-columns: repeat(7, minmax(155px, 1fr));
  }
}

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

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .tabs {
    position: sticky;
    bottom: 0;
    z-index: 19;
    padding: 10px 8px calc(10px + env(safe-area-inset-bottom));
    margin: 8px -8px -10px;
    background: rgba(243, 246, 246, 0.95);
    border-top: 1px solid #d7e2e5;
  }

  .tab {
    font-size: 0.78rem;
    padding: 8px 10px;
  }
}
