:root {
  --ink: #1B1512;
  --ink-soft: #372C26;
  --red: #A6301F;
  --red-soft: #C24A38;
  --gold: #C79A44;
  --ivory: #F6EFE0;
  --ivory-dim: #EAE0C9;
  --text: #241C17;
  --text-muted: #6B5F52;
  --radius: 10px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font); color: var(--text); background: var(--ivory); -webkit-font-smoothing: antialiased; }

.shell { display: flex; min-height: 100vh; }

/* ---------- Sidebar ---------- */
.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--ink);
  color: var(--ivory);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.brand {
  font-weight: 700;
  font-size: 1.05rem;
  padding: 6px 10px 18px;
  border-bottom: 1px solid var(--gold);
  margin-bottom: 10px;
  letter-spacing: 0.01em;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--ivory);
  opacity: 0.78;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.92rem;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
}
.nav-icon { font-size: 0.95rem; width: 18px; text-align: center; flex-shrink: 0; }
.nav-item:hover { background: var(--ink-soft); opacity: 1; }
.nav-item.active { background: var(--red); font-weight: 600; opacity: 1; }

.context {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--ink-soft);
  font-size: 0.78rem;
  color: var(--gold);
  line-height: 1.6;
}
.context a { color: var(--gold); }

/* ---------- Content ---------- */
.content { flex: 1; padding: 32px 40px; max-width: 780px; animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

h1 { font-size: 1.35rem; margin: 0 0 6px; letter-spacing: -0.01em; }
.subtitle { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 22px; }

/* ---------- Forms ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 0.83rem; font-weight: 600; margin-bottom: 5px; color: var(--ink-soft); }
.field input, .field select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--ivory-dim);
  border-radius: 8px;
  font-size: 0.92rem;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--red-soft);
  box-shadow: 0 0 0 3px rgba(166, 48, 31, 0.12);
}

.btn {
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}
.btn:hover { background: var(--red-soft); }
.btn:active { transform: scale(0.98); }
.btn.secondary { background: transparent; color: var(--ink); border: 1px solid var(--ivory-dim); }
.btn.secondary:hover { background: var(--ivory-dim); }
.btn.danger { background: transparent; color: var(--red); border: 1px solid var(--red-soft); }
.btn.danger:hover { background: #fdf2f0; }

.action-error { color: var(--red); font-size: 0.78rem; margin-top: 8px; }

.new-order-banner {
  background: var(--red);
  color: #fff;
  padding: 12px 18px;
  border-radius: 8px;
  margin-bottom: 18px;
  font-weight: 600;
  font-size: 0.9rem;
  animation: fadeIn 0.2s ease;
}
.new-order-banner button {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  margin-left: 6px;
}
.new-order-banner button:hover { background: rgba(255, 255, 255, 0.32); }

.receipt-overlay {
  position: fixed;
  inset: 0;
  background: rgba(27, 21, 18, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}
.receipt-modal {
  background: #fff;
  border-radius: 10px;
  padding: 18px;
  max-width: 340px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  text-align: center;
}

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; margin-top: 18px; font-size: 0.88rem; }
th, td { text-align: left; padding: 10px; border-bottom: 1px solid var(--ivory-dim); }
th { color: var(--text-muted); font-weight: 600; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.04em; }
tbody tr { transition: background 0.1s ease; }
tbody tr:hover { background: #fff; }

/* ---------- Cards ---------- */
.card {
  background: #fff;
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(27, 21, 18, 0.07), 0 1px 1px rgba(27, 21, 18, 0.04);
}

/* ---------- Pills / badges ---------- */
.pill { display: inline-block; font-size: 0.72rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--ivory-dim); color: var(--ink); }
.pill.synced { background: #DCEBD8; color: #2C5A28; }
.pill.pending { background: #F5E3C6; color: #8A5A17; }

/* ---------- Myanmar customer service requests ---------- */
.service-request-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.service-request-card { display: flex; align-items: center; gap: 14px; background: #fff; border: 1px solid var(--ivory-dim); border-left: 5px solid var(--gold); border-radius: 14px; padding: 16px; margin-bottom: 12px; box-shadow: 0 5px 18px rgba(27, 21, 18, 0.08); animation: fadeIn 0.2s ease; }
.service-request-card.is-new { border-left-color: var(--red); box-shadow: 0 7px 22px rgba(166, 48, 31, 0.14); }
.service-request-icon { width: 46px; height: 46px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; border-radius: 50%; background: #fff6df; font-size: 1.35rem; }
.service-request-body { flex: 1; min-width: 0; }
.service-request-title { font-weight: 700; color: var(--ink); line-height: 1.45; }
.service-request-meta { color: var(--text-muted); font-size: 0.78rem; margin-top: 5px; }
.service-request-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.service-request-actions .btn { padding: 8px 12px; font-size: 0.8rem; }
.service-request-empty { background: rgba(255,255,255,0.72); border: 1px dashed var(--ivory-dim); border-radius: 14px; padding: 58px 20px; text-align: center; color: var(--text-muted); }

/* ---------- States ---------- */
.state-message { color: var(--text-muted); padding: 48px 0; text-align: center; font-size: 0.92rem; }
.state-message.error { color: var(--red); }

/* ---------- Hub setup code display ---------- */
.code-display {
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  background: var(--ivory-dim);
  padding: 16px 18px;
  border-radius: 8px;
  text-align: center;
  margin: 14px 0;
}

/* ---------- QR box ---------- */
.qr-box { text-align: center; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--ivory-dim); }
.qr-box .link-text { word-break: break-all; font-size: 0.8rem; color: var(--text-muted); margin-top: 10px; }
.qr-box .qr-actions { display: flex; gap: 8px; justify-content: center; margin-top: 12px; }

/* ---------- Drag-and-drop upload ---------- */
.drop-zone {
  border: 2px dashed var(--ivory-dim);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  cursor: pointer;
  margin-bottom: 10px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.drop-zone:hover, .drop-zone.drag-active { border-color: var(--red); background: #fdf6f2; }
.drop-zone-status { font-size: 0.78rem; margin-top: 4px; min-height: 1em; }

.login-grid { display: flex; gap: 20px; flex-wrap: wrap; align-items: flex-start; }
.login-grid .card { flex: 1; min-width: 280px; }

/* ---------- Responsive: collapse sidebar to a top scroll bar on phones ---------- */
@media (max-width: 720px) {
  .shell { flex-direction: column; }
  .sidebar {
    width: 100%;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    padding: 10px 12px;
    gap: 4px;
  }
  .brand { display: none; }
  .nav-item { flex-shrink: 0; white-space: nowrap; }
  .context { display: none; }
  .content { padding: 20px; }
  .service-request-header { flex-direction: column; }
  .service-request-card { align-items: flex-start; flex-wrap: wrap; }
  .service-request-actions { width: 100%; justify-content: flex-start; margin-left: 60px; }
}
