:root {
  --bg: #f4f3ef;
  --ink: #101218;
  --muted: #59606a;
  --panel: #ffffff;
  --accent: #e86a33;
  --accent-soft: #f7d9c6;
  --stroke: #e2e4e8;
  --shadow: 0 18px 40px rgba(15, 18, 24, 0.08);
  --radius: 18px;
  --radius-sm: 12px;
  --radius-lg: 26px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Manrope", sans-serif;
  background: radial-gradient(circle at top left, #f6efe9, #f4f3ef 45%, #f1f2f5);
  color: var(--ink);
}

.admin-auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(135deg, #11131b, #1f2430 55%, #151821);
}

.auth-card {
  background: #fff;
  border-radius: 22px;
  padding: 32px;
  width: min(420px, 100%);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-actions {
  margin-top: 8px;
  display: flex;
  justify-content: center;
}

.checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
}

.checkbox-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.auth-card h2 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 22px;
}

.auth-sub {
  color: var(--muted);
  font-size: 14px;
}

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

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.auth-form input {
  border: 1px solid var(--stroke);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
}

.alert {
  background: #ffe9e4;
  color: #9f3a1c;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
}

.admin-chip {
  background: #0b1220;
  color: #f8fafc;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.muted {
  color: var(--muted);
}

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

.sidebar {
  background: #151821;
  color: #e9edf5;
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

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

.brand-mark {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #f5b981, #e86a33);
  color: #111;
  font-weight: 700;
  font-family: "Space Grotesk", sans-serif;
  display: grid;
  place-items: center;
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.brand-title {
  font-family: "Space Grotesk", sans-serif;
  font-size: 18px;
  font-weight: 600;
}

.brand-sub {
  color: #9aa4b2;
  font-size: 12px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nav-link {
  text-decoration: none;
  color: #c9d2de;
  padding: 12px 14px;
  border-radius: 12px;
  transition: all 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  background: rgba(232, 106, 51, 0.18);
  color: #fff;
}

.sidebar-footer {
  margin-top: auto;
}

.status-pill {
  font-size: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f2b04c;
}

.dot.ok {
  background: #5bd16a;
}

.content {
  padding: 32px 36px 48px;
}

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

.page-title {
  font-family: "Space Grotesk", sans-serif;
  font-size: 26px;
  font-weight: 600;
}

.page-subtitle {
  color: var(--muted);
  margin-top: 6px;
}

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

.primary-btn,
.ghost-btn,
.icon-btn {
  border: none;
  border-radius: 12px;
  padding: 10px 16px;
  font-weight: 600;
  cursor: pointer;
  font-family: "Manrope", sans-serif;
  transition: all 0.2s ease;
}

.primary-btn {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow);
}

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

.ghost-btn {
  background: #fff;
  border: 1px solid var(--stroke);
  color: var(--ink);
}

.ghost-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.icon-btn {
  background: transparent;
  color: var(--muted);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 24px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 20px;
}

.stat-card {
  background: var(--panel);
  padding: 18px 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.stat-label {
  color: var(--muted);
  font-size: 13px;
}

.stat-value {
  font-size: 28px;
  font-family: "Space Grotesk", sans-serif;
  margin-top: 8px;
}

.update-row {
  margin: 6px 0 22px;
  color: var(--muted);
  font-size: 13px;
}

.panel {
  background: var(--panel);
  padding: 22px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 22px;
}

.panel.highlight {
  background: linear-gradient(150deg, #fff6ee, #ffffff 55%);
}

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

.panel-header h3 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 18px;
}

.panel-body {
  overflow-x: auto;
}

.badge {
  background: var(--accent-soft);
  color: #7a3a1a;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
}

.badge-success {
  background: rgba(46, 160, 67, 0.16);
  color: #1f7a3a;
}

.badge-warn {
  background: rgba(245, 158, 11, 0.18);
  color: #8a4b12;
}

.badge-danger {
  background: rgba(239, 68, 68, 0.18);
  color: #991b1b;
}

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

.status-actions .ghost-btn {
  padding: 6px 10px;
  font-size: 12px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table.full-table {
  min-width: 100%;
}

.data-table.full-table select,
.data-table.full-table input {
  width: 100%;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
}

.data-table.full-table th,
.data-table.full-table td {
  vertical-align: middle;
}

.data-table.full-table td:last-child {
  width: 100px;
}

.erp-table {
  width: 100%;
  overflow-x: auto;
}

.erp-table textarea,
.panel-body textarea {
  width: 100%;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  padding: 12px;
  font-family: "Manrope", sans-serif;
  font-size: 14px;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 12px 8px;
  border-bottom: 1px solid var(--stroke);
}

.data-table th {
  color: var(--muted);
  font-weight: 600;
}

.finance-hero {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 18px;
}

.finance-value {
  font-size: 32px;
  font-family: "Space Grotesk", sans-serif;
}

.divider {
  height: 1px;
  background: var(--stroke);
  margin: 16px 0;
}

.pill {
  background: #151821;
  color: #fff;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  display: inline-block;
  margin-bottom: 8px;
}

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

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 18, 24, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal.show {
  display: flex;
}

.modal-card {
  background: var(--panel);
  border-radius: var(--radius-lg);
  padding: 20px;
  width: min(560px, 100%);
  box-shadow: var(--shadow);
}

.modal-card.wide {
  width: min(760px, 100%);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.form-grid label {
  display: flex;
  flex-direction: column;
  font-size: 12px;
  color: var(--muted);
  gap: 6px;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
  border: 1px solid var(--stroke);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: "Manrope", sans-serif;
}

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

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.order-items {
  background: #f9f9fb;
  border-radius: var(--radius-sm);
  padding: 14px;
}

.order-items-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.order-item-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 40px;
  gap: 10px;
  margin-bottom: 8px;
}

.order-item-row input,
.order-item-row select {
  border: 1px solid var(--stroke);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
}

.remove-btn {
  background: #ffe5e0;
  color: #b33a1b;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.upload-form {
  display: grid;
  grid-template-columns: 2fr 1fr auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
}

.file-drop {
  border: 1px dashed var(--stroke);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  cursor: pointer;
}

.file-drop input {
  display: none;
}

.thumb {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--stroke);
}

.thumb.placeholder {
  display: grid;
  place-items: center;
  background: #f2f3f6;
  color: var(--muted);
  font-size: 12px;
}

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

.product-card {
  background: #fff;
  border-radius: 16px;
  padding: 14px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.product-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--stroke);
}

.product-card .product-name {
  font-weight: 600;
}

.file-drop.drag {
  border-color: var(--accent);
  background: #fff4ec;
}

@media (max-width: 1024px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: sticky;
    top: 0;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .nav {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .content {
    padding: 20px;
  }
  .grid-3 {
    grid-template-columns: 1fr;
  }
  .grid-2 {
    grid-template-columns: 1fr;
  }
  .upload-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .topbar {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 12px;
  }

  .topbar-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .page-title {
    font-size: 22px;
  }

  .panel {
    padding: 18px;
  }

  .data-table th,
  .data-table td {
    padding: 10px 6px;
    font-size: 13px;
  }

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