:root {
  color-scheme: dark;
  --bg: #080705;
  --surface: #14100b;
  --surface-soft: #20180e;
  --ink: #fff6dd;
  --muted: #bba779;
  --line: #46361f;
  --primary: #d7a83f;
  --primary-ink: #100b04;
  --accent: #f2cf78;
  --danger: #ff7468;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.38);
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: linear-gradient(180deg, #0f0c08 0%, var(--bg) 52%, #050403 100%);
  color: var(--ink);
}

button,
a {
  font: inherit;
}

code {
  direction: ltr;
  display: inline-block;
  padding: 0.1rem 0.35rem;
  border-radius: 5px;
  border: 1px solid var(--line);
  background: #231a0f;
  color: var(--accent);
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px;
  border-left: 1px solid #2f2415;
  background: #050403;
  color: var(--ink);
}

.brand {
  display: grid;
  gap: 9px;
  color: inherit;
  text-decoration: none;
  font-weight: 800;
  margin-bottom: 30px;
}

.brand img {
  width: min(178px, 100%);
  height: auto;
  border: 1px solid #5b431f;
  border-radius: 7px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.38);
}

.brand span {
  color: var(--accent);
  font-size: 0.82rem;
  letter-spacing: 0.12em;
}

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

.nav-link {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #d8c695;
  text-align: right;
  cursor: pointer;
  padding: 0 12px;
}

.nav-link:hover,
.nav-link.active {
  background: #20180e;
  color: #fff7dc;
  border-color: #6f5124;
}

.main {
  padding: 28px;
}

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

.topbar h1 {
  margin: 0;
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  letter-spacing: 0;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.78rem;
}

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

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

.button.primary {
  background: var(--primary);
  color: var(--primary-ink);
  border-color: var(--primary);
}

.button.secondary {
  background: var(--surface-soft);
  color: var(--accent);
}

.button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.report-actions {
  margin: 12px 0;
}

.notice-panel {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
  padding: 16px 18px;
  border: 1px solid #8c6427;
  border-radius: 8px;
  background: #23180c;
  color: #f7df9c;
  line-height: 1.7;
}

.notice-panel.success {
  border-color: #7a612f;
  background: #1d170d;
  color: #f2cf78;
}

.notice-panel.warning {
  border-color: #8c6427;
  background: #23180c;
  color: #f7df9c;
}

.notice-panel strong {
  font-size: 1rem;
}

.notice-panel span {
  color: #cbb783;
}

.notice-panel.success span {
  color: #d9bf73;
}

.message-panel {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  line-height: 1.7;
  font-weight: 800;
}

.message-panel.success {
  border-color: #7a612f;
  background: #1d170d;
  color: var(--accent);
}

.message-panel.error {
  border-color: #8c3b35;
  background: #25100e;
  color: var(--danger);
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
  gap: 24px;
  align-items: stretch;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 26px;
}

.hero-copy h2 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1.05;
  letter-spacing: 0;
}

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

.metric-row {
  display: flex;
  gap: 12px;
  margin-top: 22px;
}

.metric {
  min-width: 120px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.metric strong {
  display: block;
  font-size: 1.9rem;
  color: var(--accent);
}

.metric span {
  color: var(--muted);
  font-size: 0.9rem;
}

.device-board {
  position: relative;
  min-height: 330px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #0c0905;
  overflow: hidden;
}

.device-board::before {
  content: "";
  position: absolute;
  inset: 20px;
  background-image: url("../public/icons/workspace-pattern.svg");
  background-size: cover;
  opacity: 0.68;
}

.device {
  position: absolute;
  background: #080705;
  border: 1px solid #5b431f;
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.45);
}

.device.desktop {
  inset: 46px 46px auto auto;
  width: min(72%, 430px);
  aspect-ratio: 16 / 10;
  border-radius: 8px;
  padding: 18px;
}

.device.desktop span,
.device.phone span {
  display: block;
  height: 8px;
  width: 64px;
  border-radius: 999px;
  background: var(--accent);
  opacity: 0.72;
  margin-bottom: 16px;
}

.screen-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.screen-grid b,
.device.phone b {
  display: block;
  border-radius: 6px;
  background: #2a1f11;
}

.screen-grid b {
  min-height: 58px;
}

.device.phone {
  left: 34px;
  bottom: 34px;
  width: 112px;
  aspect-ratio: 9 / 16;
  border-radius: 20px;
  padding: 18px 12px;
}

.device.phone b {
  height: 28px;
  margin-bottom: 10px;
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 18px;
}

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

.panel.wide {
  max-width: 1180px;
}

.panel h2,
.panel h3 {
  margin-top: 0;
  letter-spacing: 0;
}

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

.panel-title-row h3 {
  margin: 0;
}

.compact-button {
  min-height: 36px;
  padding: 0 12px;
}

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

.progress-pill {
  min-width: 68px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--primary);
  font-weight: 800;
  background: #1a130a;
}

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

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

.task-item {
  width: 100%;
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 12px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #16110a;
  padding: 14px;
  text-align: right;
  cursor: pointer;
}

.task-item:hover {
  border-color: #8a652d;
}

.task-check {
  display: inline-flex;
  width: 26px;
  height: 26px;
  align-items: center;
  justify-content: center;
  border: 1px solid #8a652d;
  border-radius: 50%;
  color: var(--primary);
  font-weight: 900;
}

.task-item strong,
.task-item small {
  display: block;
}

.task-item small {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.6;
}

.task-item.done {
  background: var(--surface-soft);
}

.task-action {
  display: inline-flex;
  margin-top: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #2a1f11;
  color: var(--primary);
  font-size: 0.84rem;
  font-style: normal;
  font-weight: 800;
}

.task-item.done .task-action {
  background: var(--primary);
  color: var(--primary-ink);
}

.steps {
  margin: 0;
  padding-right: 20px;
  color: var(--muted);
  line-height: 2;
}

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

.platform-card,
.deploy-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: #16110a;
}

.platform-card p,
.deploy-grid p {
  color: var(--muted);
  line-height: 1.7;
}

.platform-card span {
  display: inline-block;
  color: var(--primary);
  font-weight: 800;
}

.business-hero {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.8fr);
}

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

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

.status-card {
  min-height: 120px;
  display: grid;
  gap: 8px;
  align-content: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.status-card span,
.status-card small,
.muted {
  color: var(--muted);
  line-height: 1.7;
}

.status-card strong {
  font-size: 1.8rem;
  letter-spacing: 0;
  color: var(--accent);
}

.form-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(320px, 1fr);
  gap: 24px;
  align-items: start;
}

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

.form-card.compact {
  gap: 12px;
}

.form-card label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-weight: 800;
}

.form-card input,
.form-card select,
.form-card textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px 12px;
  background: #0d0a06;
  color: var(--ink);
  font: inherit;
}

.form-card input:focus,
.form-card select:focus,
.form-card textarea:focus {
  border-color: var(--primary);
  outline: 2px solid rgba(215, 168, 63, 0.18);
}

.form-card textarea {
  resize: vertical;
}

.success-note {
  margin: 0;
  color: var(--primary);
  font-weight: 800;
}

.optional-field {
  opacity: 0.6;
}

.request-layout {
  grid-template-columns: minmax(320px, 0.8fr) minmax(0, 1.2fr);
}

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

.request-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #16110a;
}

.request-card strong,
.request-card span {
  display: block;
}

.request-card span {
  color: var(--muted);
  margin-top: 4px;
}

.request-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.request-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.request-actions button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  color: var(--primary);
  cursor: pointer;
  padding: 0 12px;
  font-weight: 800;
}

.status-chip {
  display: inline-flex;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  background: #2a1f11;
  color: var(--primary);
  font-weight: 800;
}

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

.service-grid article,
.payment-box,
.audit-note {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: #16110a;
}

.service-grid p,
.payment-box p,
.audit-note span {
  color: var(--muted);
  line-height: 1.7;
}

.payment-box {
  display: grid;
  gap: 12px;
}

.payment-box .button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.audit-note {
  margin-top: 16px;
  display: grid;
  gap: 6px;
}

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

.inventory-metric {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.inventory-metric span,
.inventory-metric small {
  color: var(--muted);
}

.inventory-metric strong {
  font-size: 1.7rem;
  color: var(--accent);
}

.inventory-browser {
  margin-top: 18px;
}

.customer-balances {
  margin-top: 18px;
}

.inventory-browser-head {
  align-items: flex-start;
}

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

.inventory-controls {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(180px, 0.6fr);
  gap: 12px;
  margin: 16px 0 12px;
}

.customer-results {
  margin-top: 14px;
}

.inline-warning {
  margin: 14px 0;
  padding: 12px 14px;
  border: 1px solid #8c6427;
  border-radius: 8px;
  background: #23180c;
  color: #f7df9c;
  line-height: 1.7;
}

.inventory-controls label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-weight: 800;
}

.inventory-controls input,
.inventory-controls select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px 12px;
  background: #0d0a06;
  color: var(--ink);
  font: inherit;
}

.inventory-controls input:focus,
.inventory-controls select:focus {
  border-color: var(--primary);
  outline: 2px solid rgba(215, 168, 63, 0.18);
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #14100b;
  color: var(--muted);
  cursor: pointer;
  padding: 0 12px;
  font: inherit;
  font-weight: 800;
}

.filter-pill strong {
  color: var(--accent);
}

.filter-pill.active,
.filter-pill:hover {
  border-color: #8a652d;
  background: #2a1f11;
  color: var(--ink);
}

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

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

.inventory-row {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #16110a;
}

.inventory-row-low {
  border-color: #8a652d;
}

.inventory-row-zero,
.inventory-row-out {
  border-color: #765025;
  background: #1d1309;
}

.inventory-row-negative {
  border-color: #8c3b35;
  background: #25100e;
}

.inventory-row span {
  color: var(--muted);
}

.customer-row-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.customer-limit-editor {
  display: grid;
  grid-template-columns: minmax(110px, 0.7fr) minmax(120px, 1fr) auto;
  gap: 8px;
  align-items: end;
  margin-top: 6px;
}

.customer-limit-editor label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.customer-limit-editor input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 10px;
  background: #0d0a06;
  color: var(--ink);
  font: inherit;
}

.mini-button {
  min-height: 38px;
  padding: 0 12px;
}

.customer-detail-panel {
  display: grid;
  gap: 14px;
  margin: 14px 0;
  padding: 14px;
  border: 1px solid #6f5124;
  border-radius: 8px;
  background: #110d08;
}

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

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

.customer-detail-grid article {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #16110a;
}

.customer-detail-grid h4 {
  margin: 0;
}

.detail-list {
  display: grid;
  gap: 8px;
}

.detail-row {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid #332716;
  border-radius: 7px;
  background: #0d0a06;
}

.detail-row span,
.detail-row small {
  color: var(--muted);
}

.ameen-movement {
  margin-top: 18px;
}

.sync-chip {
  display: inline-flex;
  width: fit-content;
  margin: 0 0 10px;
  padding: 7px 10px;
  border-radius: 999px;
  font-weight: 900;
}

.sync-chip.success {
  border: 1px solid #7a612f;
  background: #1d170d;
  color: var(--accent);
}

.sync-chip.warning {
  border: 1px solid #8c6427;
  background: #23180c;
  color: #f7df9c;
}

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

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

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

  .hero-panel,
  .content-grid,
  .task-list.all,
  .platform-grid,
  .deploy-grid,
  .business-hero,
  .form-layout,
  .request-layout,
  .service-grid,
  .inventory-metrics,
  .status-board,
  .status-board.full,
  .inventory-controls,
  .customer-limit-editor,
  .customer-detail-metrics,
  .customer-detail-grid,
  .inventory-list-dense {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 520px) {
  .main,
  .sidebar,
  .hero-panel,
  .panel {
    padding: 16px;
  }

  .metric-row {
    flex-direction: column;
  }

  .device-board {
    min-height: 260px;
  }
}
