:root {
  --bg: #f7f7f2;
  --ink: #1f1f1f;
  --muted: #6b6b6b;
  --accent: #2b5d3f;
  --card: #ffffff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", "DM Sans", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 12px;
}

input {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #d5d5cf;
  font: inherit;
}

select {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #d5d5cf;
  font: inherit;
  background: #fff;
}

.search-field input {
  margin-top: 0;
}

.container {
  width: min(1100px, 92vw);
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  background: rgba(247, 247, 242, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid #e5e5e0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
}

.brand {
  font-weight: 700;
  letter-spacing: 1px;
}

.nav a {
  margin-left: 16px;
  color: var(--ink);
  text-decoration: none;
}

.hero {
  padding: 72px 0 64px;
  background: linear-gradient(135deg, rgba(247, 247, 242, 0.95), rgba(247, 247, 242, 0.6)),
    url("/images/hero-bg.jpg");
  background-size: cover;
  background-position: center;
  animation: fadeIn 0.8s ease-out;
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 3.5rem);
  margin-bottom: 12px;
}

.hero p {
  margin: 0;
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 32px;
  align-items: center;
}

.hero-media img {
  width: 100%;
  border-radius: 20px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.12);
}

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

.ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 999px;
  text-decoration: none;
  line-height: 1;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.95rem;
}

.hero-meta span {
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  border: 1px solid #e3e3de;
}

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  background: var(--accent);
  color: white;
  border-radius: 999px;
  border: 1px solid transparent;
  text-decoration: none;
  line-height: 1;
}

.section {
  padding: 56px 0;
}

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

.card {
  background: var(--card);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
  animation: floatIn 0.6s ease-out;
}

.card-image {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 12px;
}

.split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  align-items: center;
}

.split.reverse {
  direction: rtl;
}

.split.reverse > * {
  direction: ltr;
}

.media-card img {
  width: 100%;
  border-radius: 20px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

.site-footer {
  padding: 32px 0 48px;
  border-top: 1px solid #e5e5e0;
  color: var(--muted);
}

.admin-page {
  min-height: 100vh;
  padding: 32px 0 48px;
}

.admin-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
  background: #f3f4f0;
}

.admin-sidebar {
  background: #101410;
  color: #e7efe8;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 1px;
}

.brand-dot {
  width: 12px;
  height: 12px;
  background: #4caf6b;
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(76, 175, 107, 0.6);
}

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

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  background: rgba(255, 255, 255, 0.04);
}

.sidebar-link.active,
.sidebar-link:hover {
  background: rgba(76, 175, 107, 0.2);
  color: #d7ffe5;
}

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

.sidebar-logout .ghost {
  width: 100%;
  justify-content: center;
}

.admin-content {
  padding: 24px 32px 48px;
}

.admin-topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.topbar-title h1 {
  margin: 0;
}

.topbar-title p {
  margin: 4px 0 0;
  color: var(--muted);
}

.icon-button {
  background: #fff;
  border: 1px solid #e2e2dc;
  border-radius: 12px;
  padding: 8px 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.admin-main {
  display: grid;
  gap: 20px;
}

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

.stat-card {
  background: #fff;
  border-radius: 20px;
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.08);
}

.stat-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(76, 175, 107, 0.15);
  color: #2b5d3f;
  font-size: 1.2rem;
}

.admin-card {
  background: #fff;
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.08);
}

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

.admin-card-title {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.search-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.search-form.order-filter {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 10px;
  align-items: center;
}

.search-form.order-filter .search-field {
  width: 100%;
}

.search-form.order-filter select {
  width: 180px;
}

.search-form.order-filter .inline-check {
  margin: 0;
}

.search-form.order-filter select,
.search-form.order-filter .ghost {
  height: 40px;
}

.search-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #f7f7f2;
  border: 1px solid #e2e2dc;
  border-radius: 999px;
  padding: 6px 12px;
  min-height: 40px;
}

.search-field input {
  border: none;
  background: transparent;
  padding: 4px 0;
  height: 28px;
}

.search-field input:focus {
  outline: none;
}

.bulk-form {
  display: grid;
  gap: 16px;
}

.bulk-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  background: #f7f7f2;
  border-radius: 16px;
  padding: 12px 16px;
  border: 1px solid #e2e2dc;
}

.bulk-bar select {
  border-radius: 12px;
  padding: 8px 12px;
  border: 1px solid #d5d5cf;
  background: #fff;
  font: inherit;
  height: 40px;
}

@media (max-width: 900px) {
  .search-form.order-filter {
    grid-template-columns: 1fr;
  }

  .search-form.order-filter select,
  .search-form.order-filter .ghost {
    width: 100%;
  }
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
}

.pagination-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pagination-info {
  color: var(--muted);
  font-size: 0.9rem;
}

.pagination-links .ghost {
  padding: 6px 12px;
  height: 32px;
  font-size: 0.9rem;
}

.pagination-links .is-disabled {
  pointer-events: none;
  opacity: 0.45;
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.chart-card {
  background: #f7f7f2;
  border-radius: 18px;
  padding: 16px;
  border: 1px solid #e2e2dc;
}

.analytics-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.demo-form .cta {
  height: 40px;
}

@media (max-width: 900px) {
  .analytics-actions {
    width: 100%;
  }

  .demo-form,
  .demo-form .cta {
    width: 100%;
  }
}

.bulk-bar .inline-check {
  margin: 0;
}

.bulk-bar .ghost {
  height: 40px;
  padding: 8px 16px;
}

.search-form .ghost {
  height: 40px;
  padding: 8px 16px;
}

.form-grid {
  display: grid;
  gap: 12px;
}

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.inline-check input {
  width: auto;
  margin: 0;
}

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

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

.table {
  display: grid;
  gap: 12px;
  margin-bottom: 24px;
}

.table-row {
  display: grid;
  grid-template-columns: 0.5fr 2fr 1fr 2fr;
  gap: 12px;
  align-items: center;
  padding: 16px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.table-row.header {
  background: transparent;
  box-shadow: none;
  font-weight: 700;
}

.table-row small {
  display: block;
  color: var(--muted);
}

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

.actions .ghost {
  align-items: center;
  white-space: nowrap;
}

.actions form {
  margin: 0;
}

.toggle-form {
  display: flex;
  align-items: center;
}

.toggle-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.toggle-switch input {
  opacity: 0;
  width: 42px;
  height: 24px;
  position: absolute;
  margin: 0;
  cursor: pointer;
}

.toggle-slider {
  width: 42px;
  height: 24px;
  background: #d0d5dd;
  border-radius: 999px;
  transition: background 0.2s ease;
  position: relative;
}

.toggle-slider::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s ease;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
  background: #4caf6b;
}

.toggle-switch input:checked + .toggle-slider::after {
  transform: translateX(18px);
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  width: fit-content;
}

.badge.ok {
  background: #e7f6e9;
  color: #1f7a3f;
}

.badge.off {
  background: #fef3f2;
  color: #b42318;
}

.ghost.danger {
  border-color: #b42318;
  color: #b42318;
}

button {
  cursor: pointer;
}

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

  .admin-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    width: 260px;
    z-index: 20;
  }

  .admin-sidebar.open {
    transform: translateX(0);
  }

  .admin-content {
    padding: 20px;
  }

  .table-row {
    grid-template-columns: 1fr;
  }
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(420px, 92vw);
  background: #fff;
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.12);
}

.auth-error {
  color: #b42318;
  background: #fef3f2;
  padding: 10px 12px;
  border-radius: 10px;
}

.order-page {
  padding: 64px 0;
}

.order-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 32px;
  align-items: start;
}

.tracking-grid {
  display: grid;
  gap: 24px;
}

.order-info h1 {
  margin-bottom: 12px;
}

.order-notes {
  padding-left: 18px;
  color: var(--muted);
}

.order-card {
  background: #fff;
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.1);
}

.order-card h2 {
  margin-top: 0;
}

.form-section {
  margin: 16px 0 8px;
}

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

.order-success {
  display: grid;
  place-items: center;
}

.order-id {
  margin: 16px 0;
  padding: 12px 16px;
  border-radius: 12px;
  background: #f7f7f2;
  border: 1px solid #e5e5e0;
}

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

.order-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  font-size: 1.1rem;
}

.table-row span {
  word-break: break-word;
}

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

.dropzone-area {
  border: 1px dashed #cdd6d0;
  border-radius: 16px;
  padding: 16px;
  text-align: center;
  background: #f7f7f2;
  cursor: pointer;
}

.dropzone-area .dropzone-input {
  display: none;
}

.dropzone-content {
  display: grid;
  gap: 6px;
  color: var(--muted);
}

.dropzone-content i {
  font-size: 1.4rem;
  color: #2b5d3f;
}

.dropzone-link {
  color: #2b5d3f;
  text-decoration: underline;
}

.dropzone.dragover .dropzone-area {
  background: #ecf7ef;
  border-color: #4caf6b;
}

.tracking-result {
  display: grid;
  gap: 16px;
}

.timeline {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 12px;
}

.timeline-step {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.timeline-step.active {
  color: var(--ink);
  font-weight: 600;
}

.timeline-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #d0d5dd;
}

.timeline-step.active .timeline-dot {
  background: #4caf6b;
  box-shadow: 0 0 10px rgba(76, 175, 107, 0.5);
}

.credits {
  font-size: 0.85rem;
}

.credits a {
  color: inherit;
}

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

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