:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --text: #172033;
  --muted: #697386;
  --line: #dfe5ee;
  --accent: #f2b705;
  --accent-strong: #c98200;
  --ink: #0d253f;
  --ok: #167a4a;
  --danger: #b42318;
  --shadow: 0 18px 45px rgba(18, 30, 54, 0.09);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  letter-spacing: 0;
}

a {
  color: inherit;
}

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

.app-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 18px;
  background: #0d253f;
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  font-size: 20px;
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sidebar-menu {
  display: contents;
}

.menu-toggle {
  display: none;
  min-height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-radius: 8px;
  padding: 8px 12px;
  font-weight: 800;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #111827;
  border-radius: 8px;
  font-weight: 900;
}

.tenant-pill {
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
}

.tenant-pill strong,
.tenant-pill small {
  display: block;
}

.tenant-pill small {
  color: #c8d3e3;
  margin-top: 4px;
}

nav {
  display: grid;
  gap: 6px;
}

nav a,
.logout {
  color: #d8e1ed;
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 8px;
  font-weight: 650;
  font-size: 14px;
}

nav a:hover,
nav a.active,
.logout:hover {
  background: rgba(255, 255, 255, 0.11);
  color: #fff;
}

.logout {
  margin-top: auto;
}

.main {
  padding: 34px;
  max-width: 1440px;
  width: 100%;
}

.page-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 24px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: 34px;
  line-height: 1.08;
  margin-bottom: 10px;
}

h2 {
  font-size: 20px;
  line-height: 1.2;
}

.page-header p,
.muted {
  color: var(--muted);
}

.toolbox-home {
  display: grid;
  gap: 18px;
}

.toolbox-hero {
  position: relative;
  min-height: min(760px, calc(100vh - 116px));
  display: grid;
  align-items: end;
  overflow: hidden;
  border-radius: 8px;
  padding: clamp(28px, 5vw, 62px);
  background:
    linear-gradient(90deg, rgba(13, 37, 63, 0.94) 0%, rgba(13, 37, 63, 0.84) 46%, rgba(13, 37, 63, 0.18) 72%),
    url("/assets/img/toolbox-home-hero.svg") center right / cover no-repeat;
  color: #fff;
  box-shadow: var(--shadow);
}

.toolbox-hero-copy {
  max-width: 620px;
  padding-bottom: clamp(26px, 8vh, 96px);
}

.toolbox-hero h1 {
  max-width: 640px;
  font-size: clamp(40px, 5vw, 64px);
  line-height: 1;
  margin-bottom: 20px;
  text-shadow: 0 16px 36px rgba(0, 0, 0, 0.26);
}

.toolbox-hero p {
  max-width: 640px;
  color: #dce6f1;
  font-size: 20px;
  line-height: 1.55;
}

.toolbox-hero .button.ghost {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff;
}

.toolbox-status {
  position: absolute;
  left: clamp(24px, 5vw, 62px);
  right: clamp(24px, 5vw, 62px);
  bottom: 24px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 760px;
}

.toolbox-status div {
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 14px 16px;
  background: rgba(12, 22, 34, 0.58);
}

.toolbox-status strong,
.toolbox-status span {
  display: block;
}

.toolbox-status strong {
  font-size: 30px;
  color: var(--accent);
}

.toolbox-status span {
  color: #dce6f1;
  font-size: 13px;
  font-weight: 800;
}

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

.tool-strip a {
  display: flex;
  align-items: center;
  min-height: 58px;
  padding: 14px 16px;
  border-radius: 8px;
  border: 1px solid #c5d0dc;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  font-weight: 850;
  box-shadow: 0 12px 28px rgba(18, 30, 54, 0.08);
}

.toolbox-workbench {
  display: grid;
  grid-template-columns: minmax(260px, 0.45fr) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  padding: 34px 0 20px;
}

.workbench-copy {
  position: sticky;
  top: 28px;
}

.workbench-copy h2 {
  font-size: clamp(30px, 3vw, 46px);
  line-height: 1;
  margin-bottom: 14px;
}

.workbench-copy p {
  color: var(--muted);
  line-height: 1.65;
  font-size: 17px;
}

.tool-drawer {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
  border-radius: 8px;
  background: #243247;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), var(--shadow);
}

.tool-drawer article {
  min-height: 86px;
  display: grid;
  align-content: center;
  gap: 10px;
  padding: 16px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #d7e0ea;
  color: #172033;
  font-weight: 850;
}

.tool-drawer article span {
  width: 34px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 42px 0 0 #b42318, 84px 0 0 #31a36c;
}

.hero {
  min-height: calc(100vh - 68px);
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(380px, 0.75fr);
  gap: 42px;
  align-items: center;
}

.hero-copy h1 {
  font-size: 58px;
  max-width: 760px;
}

.hero-copy p {
  font-size: 19px;
  color: var(--muted);
  max-width: 680px;
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  gap: 12px;
  margin-top: 28px;
  flex-wrap: wrap;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section-heading h2,
.section-heading p {
  margin-bottom: 6px;
}

.hero-board,
.panel,
.auth-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.hero-board {
  padding: 22px;
}

.hero-visual {
  display: grid;
  gap: 16px;
}

.hero-visual img {
  width: 100%;
  display: block;
  border-radius: 8px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background: #fff;
}

.board-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.timeline-row,
.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.timeline-row span,
.list-row div {
  flex: 1;
}

.timeline-row em,
.status {
  font-style: normal;
  background: #eef6ff;
  color: #075985;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.status.danger {
  background: #fff1f0;
  color: var(--danger);
}

.mini-grid,
.metrics-grid,
.feature-grid {
  display: grid;
  gap: 14px;
}

.mini-grid {
  grid-template-columns: repeat(3, 1fr);
  margin-top: 18px;
}

.mini-grid div,
.metric,
.feature-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
}

.mini-grid strong,
.metric strong {
  display: block;
  font-size: 28px;
}

.mini-grid small,
.metric small,
td small,
.list-row small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}

.feature-band {
  padding: 44px 0 24px;
}

.feature-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
  cursor: pointer;
}

.button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #171200;
}

.button.ghost {
  background: transparent;
}

.button.small {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 13px;
}

.metrics-grid {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  margin-bottom: 22px;
}

.metric span {
  color: var(--muted);
  font-size: 13px;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  margin-bottom: 22px;
}

.three-col {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.two-col.wide-left {
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
}

.panel {
  padding: 22px;
  margin-bottom: 22px;
}

.license-panel {
  border-color: #f2b705;
  background: #fffaf0;
}

.compact-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.compact-form .span-2 {
  grid-column: 1 / -1;
}

.onboarding-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.onboarding-step {
  display: grid;
  gap: 8px;
  min-height: 92px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
}

.onboarding-step span {
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  background: #fff4cc;
  color: #7a4d00;
  font-size: 12px;
  font-weight: 800;
}

.onboarding-step.done span {
  background: #dff7e8;
  color: #17633b;
}

.auth-card {
  max-width: 480px;
  margin: 10vh auto;
  padding: 30px;
}

.form {
  display: grid;
  gap: 14px;
}

.stack {
  grid-template-columns: 1fr;
}

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

.booking-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  box-shadow: var(--shadow);
}

label {
  display: grid;
  gap: 7px;
  color: #334155;
  font-size: 13px;
  font-weight: 800;
}

.checkbox-line {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.45;
}

.checkbox-line input {
  width: auto;
  min-height: auto;
  margin-top: 3px;
}

.legal-footer {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 30px;
  color: var(--muted);
  font-size: 13px;
}

.legal-page {
  max-width: 920px;
}

.legal-page p {
  line-height: 1.7;
}

.cookie-banner {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 1000;
  width: min(620px, calc(100vw - 36px));
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.cookie-banner[hidden] {
  display: none;
}

.cookie-banner p {
  margin: 6px 0;
  color: var(--muted);
  line-height: 1.45;
}

.cookie-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  background: #fff;
  min-height: 42px;
}

textarea {
  resize: vertical;
}

.span-2 {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

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

th {
  color: #475569;
  font-size: 12px;
  text-transform: uppercase;
}

.inline-form {
  display: flex;
  gap: 7px;
  align-items: center;
}

.inline-form select {
  min-width: 145px;
}

.price-input {
  max-width: 110px;
}

.flash-stack {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.flash {
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  font-weight: 700;
}

.flash.success {
  border-color: #abefc6;
  background: #ecfdf3;
  color: var(--ok);
}

.flash.error {
  border-color: #fecdca;
  background: #fff1f0;
  color: var(--danger);
}

.booking-hero {
  min-height: calc(100vh - 68px);
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(420px, 0.9fr);
  gap: 42px;
  align-items: center;
}

.booking-hero h1 {
  font-size: 52px;
}

.booking-hero p {
  color: var(--muted);
  font-size: 19px;
  line-height: 1.6;
}

.tenant-contact {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.tenant-contact span,
.copy-link {
  display: inline-flex;
  max-width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-weight: 800;
  overflow-wrap: anywhere;
  text-align: left;
  cursor: pointer;
}

.calendar-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.calendar-nav,
.share-stack {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.share-stack small {
  color: var(--muted);
  font-weight: 800;
}

.calendar-day {
  display: grid;
  gap: 14px;
}

.calendar-card {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr) auto;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.calendar-time {
  display: grid;
  align-content: start;
  gap: 4px;
}

.calendar-time strong {
  font-size: 24px;
}

.calendar-time span,
.calendar-meta,
.appointment-summary span,
.offer-card small {
  color: var(--muted);
}

.calendar-body h3,
.offer-card h3 {
  margin: 0 0 6px;
}

.calendar-body p {
  margin: 0 0 10px;
}

.calendar-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 800;
}

.calendar-status {
  align-self: start;
}

.list-row.stacked {
  display: grid;
  gap: 6px;
}

.appointment-summary {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  margin: 20px 0;
}

.profile-hero {
  min-height: 42vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.42fr);
  gap: 28px;
  align-items: center;
  margin-bottom: 24px;
}

.profile-hero h1 {
  font-size: 52px;
  margin-bottom: 12px;
}

.profile-hero p {
  color: var(--muted);
  font-size: 18px;
}

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

.offer-card {
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.offer-card p {
  color: var(--muted);
  margin: 0;
}

.offer-price {
  display: flex;
  gap: 10px;
  align-items: baseline;
  flex-wrap: wrap;
}

.offer-price strong {
  font-size: 24px;
}

.offer-price.large strong {
  font-size: 42px;
}

.fullcalendar-widget {
  margin: 16px 0 20px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.fc {
  --fc-border-color: var(--line);
  --fc-button-bg-color: var(--ink);
  --fc-button-border-color: var(--ink);
  --fc-button-hover-bg-color: #123655;
  --fc-button-hover-border-color: #123655;
  --fc-today-bg-color: rgba(242, 183, 5, 0.12);
  font-family: inherit;
}

.fc .fc-toolbar-title {
  font-size: 20px;
}

.fc .fc-button {
  border-radius: 8px;
  font-weight: 800;
}

.report-charts canvas {
  max-height: 260px;
}

.portal-map {
  min-height: 320px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.filepond--root {
  font-family: inherit;
}

.filepond--panel-root {
  background: #f8fafc;
  border: 1px dashed #b8c4d4;
}

.dt-container {
  font: inherit;
}

.dt-container .dt-search input,
.dt-container .dt-length select {
  min-height: 38px;
  border-radius: 8px;
  border: 1px solid var(--line);
  padding: 6px 10px;
}

.dt-container .dt-paging .dt-paging-button {
  border-radius: 8px !important;
  font-weight: 800;
}

.swal2-popup {
  border-radius: 10px;
  font-family: inherit;
}

pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: #111827;
  color: #e5e7eb;
  padding: 14px;
  border-radius: 8px;
}

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

  .sidebar {
    position: relative;
    height: auto;
  }

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

  .main {
    padding: 22px;
  }

  .hero,
  .booking-hero,
  .toolbox-workbench,
  .profile-hero,
  .two-col,
  .two-col.wide-left,
  .three-col {
    grid-template-columns: 1fr;
  }

  .calendar-card {
    grid-template-columns: 1fr;
  }

  .calendar-status {
    width: 100%;
  }

  .metrics-grid,
  .feature-grid,
  .tool-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .toolbox-hero {
    min-height: 720px;
    background:
      linear-gradient(180deg, rgba(13, 37, 63, 0.94) 0%, rgba(13, 37, 63, 0.74) 48%, rgba(13, 37, 63, 0.1) 100%),
      url("/assets/img/toolbox-home-hero.svg") center bottom / cover no-repeat;
  }

  .workbench-copy {
    position: static;
  }
}

@media (max-width: 760px) {
  .sidebar {
    padding: 14px;
    gap: 12px;
  }

  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .sidebar-menu {
    display: none;
  }

  body.nav-open .sidebar-menu {
    display: grid;
    gap: 12px;
  }

  nav a,
  .logout,
  .button,
  input,
  select,
  textarea {
    min-height: 46px;
    font-size: 16px;
  }

  .table-wrap {
    margin-inline: -16px;
    padding-inline: 16px;
  }

  .cookie-banner {
    grid-template-columns: 1fr;
  }

  .cookie-actions {
    justify-content: stretch;
  }

  .cookie-actions .button {
    flex: 1 1 160px;
  }
}

@media (max-width: 640px) {
  .main {
    padding: 16px;
  }

  .page-header {
    display: grid;
  }

  h1,
  .hero-copy h1,
  .booking-hero h1,
  .profile-hero h1 {
    font-size: 34px;
  }

  .metrics-grid,
  .feature-grid,
  .tool-strip,
  .tool-drawer,
  .toolbox-status,
  .grid-form,
  .booking-form,
  .mini-grid {
    grid-template-columns: 1fr;
  }

  .toolbox-hero {
    min-height: 780px;
    padding: 22px;
  }

  .toolbox-hero-copy {
    padding-bottom: 0;
  }

  .toolbox-hero p {
    font-size: 17px;
  }

  .toolbox-status {
    position: static;
    margin-top: 22px;
  }

  .sidebar nav {
    grid-template-columns: 1fr;
  }
}
