:root {
  --emerald: #064E3B; --emerald-2: #065F46; --emerald-soft: #ECFDF5;
  --gold: #FBBF24; --gold-dark: #B45309;
  --bg: #F3F4F6; --card: #FFFFFF; --text: #111827; --muted: #6B7280; --line: #E5E7EB;
  --danger: #B91C1C; --danger-soft: #FEF2F2; --ok: #047857;
  --radius: 14px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  background: var(--bg); color: var(--text); font-size: 16px; line-height: 1.6;
  min-height: 100vh; min-height: 100dvh; overscroll-behavior-y: none;
}
.topbar {
  background: var(--emerald); color: #fff; padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  border-bottom: 4px solid var(--gold); position: sticky; top: 0; z-index: 20;
}
.brand-title { font-weight: 700; font-size: 20px; }
.brand-sub { font-size: 12px; opacity: .85; }
.userbox { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.tabs {
  display: flex; gap: 4px; overflow-x: auto; background: #fff; border-bottom: 1px solid var(--line);
  padding: 6px 8px; position: sticky; top: 64px; z-index: 15;
}
.tab {
  border: 0; background: transparent; padding: 10px 14px; border-radius: 10px; font: inherit;
  color: var(--muted); white-space: nowrap; cursor: pointer; min-height: 44px;
}
.tab.active { background: var(--emerald-soft); color: var(--emerald); font-weight: 600; }
.container { max-width: 960px; margin: 0 auto; padding: 16px; }
.card { background: var(--card); border-radius: var(--radius); padding: 16px; margin-bottom: 12px;
  box-shadow: 0 1px 2px rgba(0,0,0,.05); border: 1px solid var(--line); }
.card h2, .card h3 { margin: 0 0 12px; color: var(--emerald); }
.center { text-align: center; padding: 24px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row > * { flex: 1 1 140px; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
label { display: block; font-weight: 500; margin: 10px 0 4px; font-size: 14px; }
input, select, textarea {
  width: 100%; font: inherit; padding: 11px 12px; border: 1px solid #D1D5DB; border-radius: 10px;
  background: #fff; min-height: 46px;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold); border-color: var(--emerald); }
.btn {
  font: inherit; border: 0; border-radius: 10px; padding: 11px 16px; min-height: 46px; cursor: pointer;
  background: var(--emerald); color: #fff; font-weight: 600;
}
.btn:disabled { opacity: .55; cursor: default; }
.btn-gold { background: var(--gold); color: #3B2A00; }
.btn-ghost { background: transparent; color: inherit; border: 1px solid currentColor; }
.btn-light { background: var(--emerald-soft); color: var(--emerald); }
.btn-danger { background: var(--danger); }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: 14px; }
.btn-block { width: 100%; }
.fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin: 12px 0; }
.fieldset legend { padding: 0 6px; color: var(--emerald); font-weight: 600; }
.list-item { display: block; padding: 12px; border: 1px solid var(--line); border-radius: 12px;
  margin-bottom: 8px; background: #fff; cursor: pointer; text-align: start; width: 100%; font: inherit; }
.list-item:hover { border-color: var(--emerald); }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.st-draft { background: #E5E7EB; color: #374151; }
.st-pending_review { background: #FEF3C7; color: #92400E; }
.st-approved { background: #D1FAE5; color: #065F46; }
.st-returned { background: #FFE4E6; color: #9F1239; }
.st-postponed { background: #E0E7FF; color: #3730A3; }
.st-cancelled { background: #F3F4F6; color: #6B7280; text-decoration: line-through; }
.checklist label { display: flex; align-items: center; gap: 8px; font-weight: 400; margin: 6px 0; }
.checklist input { width: 22px; min-height: 22px; height: 22px; }
.toast { position: fixed; bottom: 16px; left: 16px; right: 16px; max-width: 520px; margin: 0 auto;
  padding: 14px 16px; border-radius: 12px; color: #fff; background: var(--emerald); z-index: 50;
  box-shadow: 0 6px 20px rgba(0,0,0,.2); }
.toast.error { background: var(--danger); }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 40; display: flex;
  align-items: flex-end; justify-content: center; }
.modal-card { background: #fff; width: 100%; max-width: 560px; border-radius: 16px 16px 0 0;
  padding: 16px; max-height: 90dvh; overflow: auto; }
@media (min-width: 700px) { .modal { align-items: center; } .modal-card { border-radius: 16px; } }
.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.file { border: 1px solid var(--line); border-radius: 10px; padding: 6px; text-align: center; font-size: 12px; }
.file img { width: 100%; height: 90px; object-fit: cover; border-radius: 6px; background: #eee; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 4px 12px; font-size: 15px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }
.log { font-size: 13px; border-inline-start: 3px solid var(--gold); padding-inline-start: 10px; margin: 6px 0; }
.err-box { background: var(--danger-soft); color: var(--danger); border-radius: 10px; padding: 10px; margin: 8px 0; }
table.simple { width: 100%; border-collapse: collapse; font-size: 14px; }
table.simple th, table.simple td { border-bottom: 1px solid var(--line); padding: 8px 6px; text-align: start; }
@media (min-width: 700px) { .container { padding: 24px; } .brand-title { font-size: 22px; } }
