:root {
  --bg: #eef3ea;
  --bg-soft: #f8fbf5;
  --ink: #1d2a32;
  --muted: #607380;
  --line: rgba(36, 59, 77, 0.12);
  --sidebar: #17324a;
  --sidebar-2: #244c66;
  --teal: #1f8a8a;
  --teal-deep: #0d6770;
  --gold: #f2b544;
  --coral: #ea695d;
  --green: #4fa66f;
  --blue: #56a5df;
  --white: #ffffff;
  --shadow: 0 22px 48px rgba(17, 40, 58, 0.12);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at top right, rgba(242, 181, 68, 0.28), transparent 22%),
    radial-gradient(circle at bottom left, rgba(31, 138, 138, 0.22), transparent 25%),
    linear-gradient(140deg, #eff5ef 0%, #f9fbf7 46%, #edf2ee 100%);
  font-family: "Segoe UI Variable", "Trebuchet MS", "Gill Sans", sans-serif;
}

body.login-gated {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

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

.sidebar {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent),
    linear-gradient(180deg, var(--sidebar) 0%, var(--sidebar-2) 100%);
  color: var(--white);
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 0;
  height: 100vh;
}

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

.brand-mark {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: linear-gradient(135deg, #f2b544, #f49d37);
  color: #17324a;
  display: grid;
  place-items: center;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.brand-block h1,
.topbar h2,
.hero-copy h3,
.panel h3 {
  margin: 0;
  font-family: Cambria, Georgia, serif;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.sidebar .eyebrow {
  color: rgba(255, 255, 255, 0.68);
}

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

.side-nav a {
  padding: 14px 16px;
  border-radius: 16px;
  color: rgba(255, 255, 255, 0.82);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: transform 180ms ease, background 180ms ease, color 180ms ease;
}

.side-nav a:hover,
.side-nav a.active {
  color: var(--white);
  background: rgba(255, 255, 255, 0.12);
  transform: translateX(4px);
}

.sidebar-card {
  margin-top: auto;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 18px;
  display: grid;
  gap: 8px;
}

.sidebar-card strong,
.admin-pill strong,
.stat-card strong,
.summary-card strong,
.customer-card b,
.trend-card strong,
.mini-metrics strong {
  font-family: Cambria, Georgia, serif;
}

.sidebar-card span,
.admin-pill span,
.stat-card span,
.hero-copy p,
.stack-list span,
.table-wrap,
.mini-list,
.summary-card span,
.trend-card b,
.mini-metrics span {
  color: var(--muted);
}

.sidebar-card strong,
.sidebar-card span {
  color: var(--white);
}

.main-content {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

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

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

.search-box {
  min-width: 320px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(36, 59, 77, 0.09);
  border-radius: 18px;
  padding: 10px 14px;
  display: grid;
  gap: 6px;
  box-shadow: var(--shadow);
}

.search-box span {
  font-size: 0.74rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.search-box input {
  border: 0;
  background: transparent;
  outline: none;
  color: var(--ink);
}

.admin-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.72);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #17324a, #1f8a8a);
  color: var(--white);
  display: grid;
  place-items: center;
  font-weight: 700;
}

.hero-panel,
.panel {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.68);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.hero-panel {
  border-radius: 30px;
  padding: 28px;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.95fr);
  gap: 24px;
}

.hero-actions,
.cta-stack,
.payment-options {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

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

.info-card {
  min-height: 176px;
  padding: 20px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(36, 59, 77, 0.1);
  display: flex;
  flex-direction: column;
  gap: 10px;
  justify-content: space-between;
}

.info-card strong {
  display: block;
  font-family: Cambria, Georgia, serif;
  font-size: 1.35rem;
  color: var(--ink);
}

.info-card span {
  color: var(--muted);
  line-height: 1.6;
  font-size: 0.92rem;
}

.action-card {
  background: linear-gradient(135deg, rgba(31, 138, 138, 0.12), rgba(242, 181, 68, 0.14));
}

.action-card .hero-actions {
  margin-top: 6px;
}

.primary-btn,
.secondary-btn,
.chip {
  border: 0;
  border-radius: 16px;
  padding: 13px 18px;
  cursor: pointer;
  transition: transform 180ms ease, filter 180ms ease;
}

.primary-btn {
  background: linear-gradient(135deg, var(--teal), var(--teal-deep));
  color: var(--white);
}

.secondary-btn {
  background: rgba(19, 50, 74, 0.08);
  color: var(--ink);
}

.compact {
  padding: 12px 16px;
}

.primary-btn:hover,
.secondary-btn:hover,
.chip:hover,
.toggle:hover {
  transform: translateY(-1px);
  filter: brightness(1.02);
}

.full {
  width: 100%;
  justify-content: center;
  text-align: center;
}

.hero-stat-stack {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.stat-card {
  padding: 20px;
  border-radius: 24px;
  color: var(--white);
  min-height: 150px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.stat-card p,
.stat-card span {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
}

.stat-card strong {
  font-size: 2rem;
}

.coral { background: linear-gradient(145deg, #e46358, #f18767); }
.amber { background: linear-gradient(145deg, #ef9d25, #f2c252); }
.green { background: linear-gradient(145deg, #3d9d66, #7dc56b); }
.blue { background: linear-gradient(145deg, #448ed2, #6bb6eb); }

.content-grid {
  display: grid;
  gap: 20px;
}

.dashboard-grid,
.inventory-grid,
.customers-grid,
.reports-grid {
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

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

.panel {
  border-radius: 26px;
  padding: 22px;
  animation: rise 520ms ease both;
}

.panel-large { grid-column: span 8; }
.panel-wide { grid-column: span 12; }
.dashboard-grid > .panel:not(.panel-large):not(.panel-wide),
.inventory-grid > .panel:not(.panel-wide),
.customers-grid > .panel:not(.panel-large):not(.panel-wide),
.reports-grid > .panel:not(.panel-large):not(.panel-wide) {
  grid-column: span 4;
}

.billing-grid > .panel-large { grid-column: span 8; }
.billing-grid > .panel-accent,
.billing-grid > .panel:not(.panel-large):not(.panel-accent) { grid-column: span 4; }

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
}

.tag,
.text-link {
  color: var(--teal-deep);
  font-size: 0.85rem;
  font-weight: 600;
}

.bar-chart {
  height: 260px;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  align-items: end;
  gap: 16px;
  padding-top: 20px;
}

.bar {
  height: var(--h);
  background: linear-gradient(180deg, #2f94a0 0%, #1b5360 100%);
  border-radius: 18px 18px 8px 8px;
  position: relative;
  min-height: 90px;
}

.bar span {
  position: absolute;
  bottom: -30px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.84rem;
  color: var(--muted);
}

.donut-wrap {
  display: grid;
  gap: 18px;
  justify-items: center;
}

.donut-chart {
  position: relative;
  width: 170px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(var(--teal) 0 68%, var(--gold) 68% 87%, var(--coral) 87% 100%);
  display: grid;
  place-items: center;
}

.donut-chart::before {
  content: "";
  width: 112px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
}

.donut-center {
  position: absolute;
  text-align: center;
  font-family: Cambria, Georgia, serif;
  font-size: 1.7rem;
  color: var(--ink);
}

.donut-center span {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  font-family: "Segoe UI Variable", "Trebuchet MS", sans-serif;
}

.mini-list,
.stack-list,
.product-pills,
.toggle-grid {
  margin: 0;
  padding: 0;
  list-style: none;
}

.mini-list {
  width: 100%;
  display: grid;
  gap: 10px;
}

.dot {
  width: 10px;
  height: 10px;
  display: inline-block;
  border-radius: 50%;
  margin-right: 10px;
}

.dot.teal { background: var(--teal); }
.dot.gold { background: var(--gold); }
.dot.coral { background: var(--coral); }

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

.stack-list li,
.toggle-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
}

.stack-list strong,
.toggle-row span,
.customer-card strong {
  font-weight: 700;
}

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

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

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

th {
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.status {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.status.good {
  background: rgba(79, 166, 111, 0.14);
  color: #227447;
}

.status.hold {
  background: rgba(242, 181, 68, 0.18);
  color: #8b5d00;
}

.status.alert {
  background: rgba(234, 105, 93, 0.15);
  color: #ab3025;
}

.summary-card {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.summary-card div {
  display: flex;
  justify-content: space-between;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px 16px;
}

.grand-row {
  background: linear-gradient(135deg, rgba(31, 138, 138, 0.12), rgba(242, 181, 68, 0.16)) !important;
}

.chip {
  background: #eef4f5;
  color: var(--ink);
}

.chip.active {
  background: var(--teal);
  color: var(--white);
}

.product-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.product-pills li {
  padding: 11px 14px;
  border-radius: 14px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
}

.mini-metrics,
.trend-grid,
.customer-cards {
  display: grid;
  gap: 14px;
}

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

.mini-metrics div,
.trend-card,
.customer-card {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px;
}

.mini-metrics strong,
.trend-card strong {
  display: block;
  font-size: 1.6rem;
  margin-bottom: 6px;
}

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

.customer-card {
  display: grid;
  gap: 10px;
}

.line-chart {
  position: relative;
  height: 240px;
  border-radius: 24px;
  margin-top: 16px;
  background:
    linear-gradient(to bottom, rgba(36, 59, 77, 0.05) 1px, transparent 1px) 0 0 / 100% 25%,
    linear-gradient(to right, rgba(36, 59, 77, 0.04) 1px, transparent 1px) 0 0 / 16.6% 100%;
}

.line-chart::after {
  content: "";
  position: absolute;
  left: 8%;
  right: 10%;
  top: 20%;
  bottom: 18%;
  background: linear-gradient(180deg, rgba(31, 138, 138, 0.18), transparent);
  clip-path: polygon(0% 50%, 14% 34%, 30% 41%, 46% 8%, 62% 16%, 78% 0%, 100% 10%, 100% 100%, 0% 100%);
}

.line-chart span {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 16px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--teal);
  border: 3px solid rgba(255, 255, 255, 0.88);
  box-shadow: 0 10px 16px rgba(31, 138, 138, 0.18);
}

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

.toggle {
  width: 58px;
  height: 32px;
  border-radius: 999px;
  border: 0;
  background: #cad6dd;
  padding: 4px;
  position: relative;
  cursor: pointer;
}

.toggle i {
  display: block;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--white);
  transition: transform 180ms ease;
}

.toggle.on {
  background: var(--teal);
}

.toggle.on i {
  transform: translateX(26px);
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(340px, 440px);
  gap: 28px;
  padding: 34px;
  align-items: stretch;
}

.login-showcase,
.login-panel {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow);
  border-radius: 30px;
  backdrop-filter: blur(10px);
}

.login-showcase {
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background:
    radial-gradient(circle at top right, rgba(242, 181, 68, 0.24), transparent 30%),
    linear-gradient(135deg, rgba(23, 50, 74, 0.96), rgba(31, 138, 138, 0.88));
  color: var(--white);
}

.login-showcase .eyebrow,
.login-showcase p {
  color: rgba(255, 255, 255, 0.78);
}

.login-showcase h1 {
  margin: 0 0 18px;
  font-size: clamp(2.2rem, 3vw, 4rem);
  line-height: 1.04;
  font-family: Cambria, Georgia, serif;
}

.login-showcase p {
  max-width: 50ch;
  line-height: 1.8;
}

.login-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.login-badges span {
  padding: 11px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.login-panel {
  padding: 26px;
  display: grid;
  align-content: center;
  gap: 22px;
}

.login-brand {
  color: var(--ink);
}

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

.login-form label {
  display: grid;
  gap: 8px;
}

.login-form span {
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.login-form input {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  background: var(--bg-soft);
  outline: none;
}

.demo-note {
  display: grid;
  gap: 6px;
  padding: 16px;
  border-radius: 18px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
}

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

.invoice-shell {
  min-height: 100vh;
  padding: 26px;
  display: grid;
  gap: 18px;
}

.invoice-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.invoice-paper {
  max-width: 980px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 28px;
  padding: 34px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.72);
}

.invoice-head,
.invoice-customer,
.invoice-footer-grid {
  display: flex;
  justify-content: space-between;
  gap: 18px;
}

.invoice-head h1 {
  margin: 0 0 8px;
  font-family: Cambria, Georgia, serif;
}

.invoice-head span,
.invoice-customer span,
.invoice-note span {
  display: block;
  color: var(--muted);
  line-height: 1.7;
}

.invoice-meta {
  text-align: right;
  display: grid;
  gap: 6px;
}

.invoice-customer,
.invoice-footer-grid {
  margin: 24px 0;
}

.invoice-total-box {
  min-width: 280px;
  display: grid;
  gap: 10px;
}

.invoice-total-box div {
  display: flex;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.is-blurred {
  filter: blur(8px);
  pointer-events: none;
  user-select: none;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(11, 22, 30, 0.24);
  z-index: 20;
}

.auth-modal {
  width: min(460px, 100%);
  padding: 32px;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 30px 60px rgba(10, 26, 39, 0.24);
  text-align: center;
}

.auth-badge {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #17324a, #1f8a8a);
  color: var(--white);
  font-family: Cambria, Georgia, serif;
  font-size: 1.6rem;
  font-weight: 700;
}

.auth-modal h2 {
  margin: 0 0 10px;
  font-size: 2.1rem;
  font-family: Cambria, Georgia, serif;
}

.auth-copy {
  margin: 0 0 22px;
  color: var(--muted);
  line-height: 1.7;
}

.auth-form {
  display: grid;
  gap: 14px;
  text-align: left;
}

.auth-form label {
  display: grid;
  gap: 8px;
}

.auth-form span {
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.auth-form input {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  background: #f7faf7;
  outline: none;
}

.auth-error {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(234, 105, 93, 0.14);
  color: #ab3025;
  font-weight: 600;
  text-align: center;
}

.demo-creds {
  margin-top: 18px;
  padding: 16px;
  border-radius: 18px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  display: grid;
  gap: 6px;
}

.demo-creds span {
  color: var(--muted);
}

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

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

  .hero-panel,
  .topbar,
  .topbar-actions,
  .customer-cards,
  .toggle-grid {
    grid-template-columns: 1fr;
  }

  .topbar,
  .topbar-actions {
    display: grid;
  }

  .search-box {
    min-width: 0;
  }

  .invoice-head,
  .invoice-customer,
  .invoice-footer-grid {
    flex-direction: column;
  }

  .panel-large,
  .dashboard-grid > .panel:not(.panel-wide),
  .inventory-grid > .panel:not(.panel-wide),
  .customers-grid > .panel:not(.panel-wide),
  .reports-grid > .panel:not(.panel-wide),
  .billing-grid > .panel:not(.panel-wide) {
    grid-column: span 12;
  }
}

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

  .sidebar {
    padding: 18px 16px;
  }

  .hero-panel,
  .panel {
    padding: 18px;
    border-radius: 22px;
  }

  .hero-info-grid {
    grid-template-columns: 1fr;
  }

  .hero-stat-stack,
  .mini-metrics,
  .toggle-grid {
    grid-template-columns: 1fr;
  }

  .login-shell {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .invoice-shell,
  .invoice-paper {
    padding: 16px;
  }

  .invoice-toolbar {
    justify-content: stretch;
    flex-direction: column;
  }

  .auth-modal {
    padding: 24px 18px;
    border-radius: 24px;
  }

  .stat-card strong {
    font-size: 1.6rem;
  }
}
