:root {
  --bg: #f5f7f6;
  --surface: #ffffff;
  --surface-2: #eef4f1;
  --ink: #18231f;
  --muted: #65736e;
  --line: #dbe4df;
  --green: #237b5b;
  --green-dark: #14563e;
  --rose: #b84d65;
  --amber: #b8761c;
  --blue: #2e6da4;
  --shadow: 0 18px 48px rgba(19, 38, 31, 0.09);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  display: grid;
  grid-template-columns: 260px 1fr;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.locked {
  overflow: hidden;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: none;
  place-items: center;
  padding: 20px;
  background:
    linear-gradient(90deg, rgba(16, 37, 29, 0.86), rgba(16, 37, 29, 0.52)),
    url("assets/florist-banner.png") center / cover;
}

.login-screen.active {
  display: grid;
}

.login-card {
  width: min(420px, 100%);
  display: grid;
  gap: 12px;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.login-card h1 {
  font-size: 28px;
}

.login-card p {
  color: var(--muted);
  line-height: 1.5;
}

.login-brand {
  margin-bottom: 4px;
}

.login-error {
  min-height: 20px;
  color: var(--rose);
  font-size: 13px;
  font-weight: 700;
}

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

button {
  cursor: pointer;
}

.sidebar {
  min-height: 100vh;
  background: #10251d;
  color: #eef8f3;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #f4f1e8;
  color: #14563e;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 21px;
}

.brand strong,
.brand span {
  display: block;
}

.brand span,
.eyebrow {
  color: var(--muted);
  font-size: 12px;
}

.sidebar .brand span {
  color: #abc2b8;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav-item {
  border: 0;
  border-radius: 8px;
  padding: 12px 13px;
  text-align: left;
  color: #dbe9e2;
  background: transparent;
}

.nav-item:hover,
.nav-item.active {
  background: #1e3b30;
  color: #ffffff;
}

.subscription-badge {
  margin-top: auto;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 14px;
  color: #d6e6de;
  line-height: 1.5;
}

.subscription-badge strong {
  display: block;
  color: #ffffff;
}

.app {
  min-width: 0;
  padding: 24px;
}

.app-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 22px;
  padding: 18px 0 2px;
  color: var(--muted);
  font-size: 12px;
}

.sales-footer {
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

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

h1 {
  margin-bottom: 0;
  font-size: 30px;
}

h2 {
  font-size: 20px;
}

h3 {
  font-size: 16px;
  margin-bottom: 0;
}

.topbar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
}

.ghost-button,
.small-button,
.primary-button,
.danger-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 38px;
  padding: 0 13px;
  background: var(--surface);
  color: var(--ink);
}

.primary-button {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
  font-weight: 700;
}

.primary-button:hover {
  background: var(--green-dark);
}

.danger-button {
  color: #9d2235;
}

.small-button {
  min-height: 32px;
  padding: 0 10px;
}

.file-button input {
  display: none;
}

.sync-badge {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.sync-badge.blue {
  background: #e7f1fb;
  border-color: #cfe2f4;
  color: var(--blue);
}

.sync-badge.warn {
  background: #fff4df;
  border-color: #f3dfb4;
  color: var(--amber);
}

.sync-badge.danger {
  background: #ffe8ec;
  border-color: #f1c7d0;
  color: var(--rose);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.hero {
  min-height: 280px;
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
  background: #13231d;
}

.hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(9, 21, 16, 0.76), rgba(9, 21, 16, 0.16));
}

.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 560px;
  padding: 34px;
  color: #ffffff;
}

.hero-copy .eyebrow {
  color: #cde5d8;
}

.hero-copy h2 {
  font-size: 34px;
  line-height: 1.12;
  margin-bottom: 12px;
}

.hero-copy p {
  color: #e5eee9;
  line-height: 1.6;
}

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

.metric {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

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

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
}

.content-grid,
.module-layout,
.subscription-layout,
.report-grid,
.admin-grid {
  display: grid;
  gap: 16px;
}

.content-grid {
  grid-template-columns: 1.1fr 0.9fr;
}

.module-layout {
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  align-items: start;
}

.subscription-layout {
  grid-template-columns: minmax(280px, 430px) 1fr;
  align-items: start;
}

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

.admin-grid {
  grid-template-columns: minmax(280px, 420px) minmax(240px, 320px) 1fr;
  align-items: start;
}

.wide-panel {
  grid-column: span 1;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

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

.form.compact {
  margin-top: 14px;
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

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

textarea {
  min-height: 84px;
  resize: vertical;
}

.search {
  max-width: 220px;
}

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

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

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

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  background: #f7faf8;
}

td {
  font-size: 14px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 8px;
  padding: 0 9px;
  background: var(--surface-2);
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 700;
}

.tag.warn {
  background: #fff4df;
  color: var(--amber);
}

.tag.danger {
  background: #ffe8ec;
  color: var(--rose);
}

.tag.blue {
  background: #e7f1fb;
  color: var(--blue);
}

.list {
  display: grid;
  gap: 10px;
}

.list-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.list-item p {
  margin-bottom: 4px;
  color: var(--muted);
}

.empty {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

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

.price-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.price-card.highlight {
  border-color: var(--green);
  box-shadow: var(--shadow);
}

.price-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.price-card strong {
  display: block;
  font-size: 25px;
  margin: 10px 0;
}

.price-card p,
.sales-copy p {
  color: var(--muted);
  line-height: 1.55;
}

.sales-copy p:last-child {
  margin-bottom: 0;
}

.bar-list {
  display: grid;
  gap: 14px;
}

.bar-row {
  display: grid;
  gap: 7px;
}

.bar-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.bar-meta strong {
  color: var(--ink);
}

.bar-track {
  height: 9px;
  overflow: hidden;
  border-radius: 8px;
  background: var(--surface-2);
}

.bar-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.action-stack {
  display: grid;
  gap: 10px;
}

.category-manager {
  display: grid;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 9px;
  background: var(--surface-2);
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 700;
}

.chip button {
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 8px;
  background: #ffffff;
  color: var(--rose);
  line-height: 1;
}

.chip button:disabled {
  cursor: not-allowed;
  color: var(--muted);
  opacity: 0.55;
}

.sales-page {
  display: block;
  background: var(--bg);
}

.sales-site {
  min-height: 100vh;
}

.sales-hero {
  min-height: 86vh;
  position: relative;
  display: grid;
  align-items: end;
  overflow: hidden;
  padding: 28px;
}

.sales-hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sales-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(9, 21, 16, 0.78), rgba(9, 21, 16, 0.22));
}

.sales-hero-copy {
  position: relative;
  z-index: 1;
  max-width: 760px;
  color: #fff;
  padding-bottom: 36px;
}

.sales-hero-copy .eyebrow {
  color: #cde5d8;
}

.sales-hero-copy h1 {
  font-size: clamp(42px, 7vw, 88px);
  line-height: 0.96;
  margin-bottom: 16px;
}

.sales-hero-copy p {
  max-width: 620px;
  color: #eef6f2;
  font-size: 19px;
  line-height: 1.55;
}

.sales-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: none;
  margin-top: 8px;
}

.sales-section {
  max-width: 1120px;
  margin: 0 auto;
  padding: 44px 24px;
}

@media (max-width: 1100px) {
  body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
    position: static;
  }

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

  .subscription-badge {
    margin-top: 0;
  }

  .metric-grid,
  .content-grid,
  .module-layout,
  .subscription-layout,
  .pricing,
  .report-grid,
  .admin-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  body {
    padding-bottom: 74px;
  }

  .app,
  .sidebar {
    padding: 16px;
  }

  .sidebar {
    gap: 14px;
  }

  .sidebar .brand,
  .subscription-badge {
    display: none;
  }

  .nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 8;
    display: flex;
    gap: 0;
    overflow-x: auto;
    padding: 8px;
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 -10px 30px rgba(19, 38, 31, 0.08);
  }

  .nav-item {
    flex: 0 0 auto;
    min-width: 86px;
    padding: 10px;
    color: var(--ink);
    text-align: center;
  }

  .nav-item:hover,
  .nav-item.active {
    background: var(--green);
    color: #fff;
  }

  .topbar,
  .panel-heading,
  .app-footer,
  .list-item {
    align-items: stretch;
    flex-direction: column;
  }

  .nav,
  .metric-grid,
  .content-grid,
  .module-layout,
  .subscription-layout,
  .report-grid,
  .admin-grid,
  .pricing,
  .split {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: 360px;
  }

  .hero-copy {
    padding: 24px;
  }

  .hero-copy h2 {
    font-size: 28px;
  }

  .search {
    max-width: none;
  }

  .sales-hero {
    min-height: 78vh;
    padding: 20px;
  }

  .sales-hero-copy p {
    font-size: 16px;
  }
}
