/* ============================================================
   مُذكِّر — Luxury Dark/Gold Theme
   Design tokens (edit here to retheme the entire app)
   ============================================================ */
:root {
  --bg: #0b0b0d;
  --bg-2: #131318;
  --surface: #181820;
  --surface-2: #1f1f29;
  --line: #2a2a36;
  --text: #efe7d6;
  --text-dim: #a89f8c;
  --muted: #6e6957;
  --gold: #c9a662;
  --gold-2: #e7c987;
  --gold-soft: rgba(201,166,98,.12);
  --gold-line: rgba(201,166,98,.35);
  --danger: #d2685a;
  --danger-soft: rgba(210,104,90,.15);
  --warn: #e0a64a;
  --ok: #6cae8a;
  --shadow: 0 20px 60px rgba(0,0,0,.5);
  --radius: 14px;
  --radius-lg: 22px;
  --transition: .25s cubic-bezier(.4,0,.2,1);
  --font-ar: 'Tajawal', system-ui, sans-serif;
  --font-en: 'Cinzel', serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ar);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

body {
  background:
    radial-gradient(ellipse at top right, rgba(201,166,98,.06), transparent 50%),
    radial-gradient(ellipse at bottom left, rgba(201,166,98,.04), transparent 50%),
    var(--bg);
  padding-bottom: 120px;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; }

.hidden { display: none !important; }

/* ===== Topbar ===== */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  background: rgba(11,11,13,.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo { width: 36px; height: 36px; color: var(--gold); }
.brand-text h1 {
  font-size: 22px; font-weight: 700; color: var(--gold);
  letter-spacing: .5px; line-height: 1;
}
.tagline { font-size: 11px; color: var(--text-dim); letter-spacing: 1px; }
.actions { display: flex; gap: 8px; }

.icon-btn {
  width: 40px; height: 40px; border-radius: 10px;
  display: grid; place-items: center;
  color: var(--text-dim);
  transition: var(--transition);
  border: 1px solid transparent;
}
.icon-btn:hover { color: var(--gold); background: var(--gold-soft); border-color: var(--gold-line); }

/* ===== Hero ===== */
.hero { padding: 24px 20px 8px; }
.hero-card {
  background: linear-gradient(135deg, var(--surface) 0%, var(--bg-2) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  position: relative;
  overflow: hidden;
}
.hero-card::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 80% 20%, rgba(201,166,98,.08), transparent 60%);
  pointer-events: none;
}
.hero-row {
  display: flex; align-items: center; justify-content: space-around;
  position: relative;
}
.hero-stat { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.stat-num {
  font-size: 32px; font-weight: 700; color: var(--gold);
  font-family: var(--font-en);
  line-height: 1;
}
.stat-label { font-size: 12px; color: var(--text-dim); letter-spacing: .5px; }
.hero-divider { width: 1px; height: 40px; background: var(--line); }
.hero-date {
  margin-top: 16px;
  text-align: center;
  font-size: 13px;
  color: var(--text-dim);
  position: relative;
}
.hero-date .dot { color: var(--gold); margin: 0 8px; }

/* ===== Filters ===== */
.filters {
  display: flex; gap: 8px;
  padding: 16px 20px;
  overflow-x: auto;
  scrollbar-width: none;
}
.filters::-webkit-scrollbar { display: none; }
.filter-btn {
  padding: 8px 18px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-dim);
  font-size: 13px; font-weight: 500;
  border: 1px solid var(--line);
  white-space: nowrap;
  transition: var(--transition);
}
.filter-btn:hover { color: var(--text); border-color: var(--gold-line); }
.filter-btn.active {
  background: var(--gold-soft);
  color: var(--gold-2);
  border-color: var(--gold-line);
}

/* ===== Reminders List ===== */
.list-wrap { padding: 8px 20px; }
.reminders { list-style: none; display: flex; flex-direction: column; gap: 12px; }

.reminder {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.reminder::before {
  content: ''; position: absolute; right: 0; top: 0; bottom: 0; width: 3px;
  background: var(--gold);
}
.reminder.priority-high::before { background: var(--warn); }
.reminder.priority-critical::before { background: var(--danger); }
.reminder.overdue { background: linear-gradient(90deg, var(--danger-soft), var(--surface) 60%); }
.reminder:hover { border-color: var(--gold-line); transform: translateY(-1px); }

.reminder-icon {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: var(--gold-soft);
  color: var(--gold-2);
}
.reminder-icon svg { width: 22px; height: 22px; }

.reminder-body { min-width: 0; }
.reminder-title { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 4px; word-break: break-word; }
.reminder-meta { display: flex; flex-wrap: wrap; gap: 8px; font-size: 12px; color: var(--text-dim); }
.reminder-meta .sep { color: var(--gold); }

.reminder-time {
  text-align: left;
  font-family: var(--font-en);
}
.time-badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  background: var(--surface-2);
  color: var(--text-dim);
}
.time-badge.urgent { background: var(--danger-soft); color: var(--danger); }
.time-badge.warn   { background: rgba(224,166,74,.15); color: var(--warn); }
.time-badge.ok     { background: rgba(108,174,138,.15); color: var(--ok); }

/* ===== Empty State ===== */
.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-dim);
}
.empty svg { color: var(--gold); opacity: .5; margin-bottom: 16px; }
.empty h2 { font-size: 18px; color: var(--text); margin-bottom: 6px; }
.empty p { font-size: 13px; }
.empty strong { color: var(--gold); }

/* ===== FAB ===== */
.fab {
  position: fixed;
  bottom: 24px; left: 24px;
  width: 60px; height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-2) 100%);
  color: var(--bg);
  display: grid; place-items: center;
  box-shadow: 0 10px 30px rgba(201,166,98,.4);
  z-index: 40;
  transition: var(--transition);
}
.fab:hover { transform: scale(1.05); box-shadow: 0 14px 40px rgba(201,166,98,.6); }
.fab:active { transform: scale(.95); }

/* ===== Modal ===== */
.modal {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  padding: 16px;
}
.modal-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.modal-card {
  position: relative;
  width: 100%; max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--gold-line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  animation: pop .25s cubic-bezier(.4,0,.2,1);
}
@keyframes pop {
  from { opacity: 0; transform: translateY(20px) scale(.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}
.modal-head h2 { font-size: 18px; color: var(--gold); font-weight: 700; }
.modal-body { padding: 20px 22px; display: flex; flex-direction: column; gap: 16px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field span { font-size: 13px; color: var(--text-dim); font-weight: 500; }
.field input, .field select, .field textarea {
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 15px;
  transition: var(--transition);
  outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--gold);
  background: var(--surface-2);
}
.field textarea { resize: vertical; min-height: 60px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.ocr-row { display: flex; flex-direction: column; gap: 8px; }
.ocr-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  cursor: pointer;
  border: 1px dashed var(--gold-line);
  background: var(--gold-soft);
  color: var(--gold-2);
  padding: 14px;
}
.ocr-btn:hover { background: var(--gold); color: var(--bg); }
.ocr-status {
  font-size: 12px;
  color: var(--gold-2);
  text-align: center;
  padding: 8px;
  background: var(--bg-2);
  border-radius: 8px;
}

.hijri-preview {
  font-size: 13px;
  color: var(--gold-2);
  background: var(--gold-soft);
  border: 1px dashed var(--gold-line);
  padding: 10px 14px;
  border-radius: 10px;
  text-align: center;
  min-height: 40px;
  display: grid; place-items: center;
}

.modal-actions {
  display: flex; gap: 10px; justify-content: flex-end;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  margin-top: 4px;
  padding-top: 16px;
}
.btn {
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 14px; font-weight: 600;
  transition: var(--transition);
  border: 1px solid transparent;
}
.btn.primary {
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  color: var(--bg);
}
.btn.primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(201,166,98,.4); }
.btn.ghost { background: transparent; color: var(--text-dim); border-color: var(--line); }
.btn.ghost:hover { color: var(--text); border-color: var(--gold-line); }
.btn.danger { background: var(--danger-soft); color: var(--danger); border-color: var(--danger); }
.btn.danger:hover { background: var(--danger); color: var(--bg); }

/* ===== Settings rows ===== */
.setting-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.setting-row:last-child { border-bottom: none; }
.setting-row strong { color: var(--text); font-size: 14px; }
.setting-row .muted { font-size: 12px; color: var(--muted); margin-top: 4px; }
.row-gap { display: flex; gap: 8px; }
.badge {
  padding: 4px 12px; border-radius: 999px;
  background: var(--gold-soft); color: var(--gold-2);
  font-size: 12px; border: 1px solid var(--gold-line);
}

/* ===== Toast ===== */
.toast {
  position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%);
  background: var(--surface);
  border: 1px solid var(--gold-line);
  color: var(--text);
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 14px;
  z-index: 200;
  box-shadow: var(--shadow);
  animation: slideUp .3s ease;
}
@keyframes slideUp {
  from { opacity: 0; transform: translate(-50%, 20px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* ===== Footer ===== */
.footer {
  text-align: center;
  padding: 32px 20px 100px;
  border-top: 1px solid var(--line);
  margin-top: 40px;
}
.signature {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--gold-soft);
  color: var(--gold-2);
  border: 1px solid var(--gold-line);
  padding: 8px 18px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 13px;
  transition: var(--transition);
}
.signature:hover { background: var(--gold); color: var(--bg); }
.signature strong { font-weight: 700; }
.copyright { margin-top: 12px; font-size: 11px; color: var(--muted); }

/* ===== Responsive ===== */
@media (max-width: 480px) {
  .topbar { padding: 12px 16px; }
  .brand-text h1 { font-size: 18px; }
  .stat-num { font-size: 26px; }
  .reminder { padding: 14px; gap: 10px; }
  .reminder-icon { width: 40px; height: 40px; }
  .grid-2 { grid-template-columns: 1fr; }
}

/* Escalation row with contact picker */
.esc-row { display:grid; grid-template-columns: 1fr 1fr 44px; gap:6px; align-items:stretch; }
.esc-row input { padding:10px 12px; border-radius:10px; border:1px solid rgba(212,175,55,.2); background:rgba(255,255,255,.02); color:inherit; font:inherit; }
.esc-pick { background:rgba(212,175,55,.12); border:1px solid rgba(212,175,55,.3); border-radius:10px; cursor:pointer; font-size:18px; color:#d4af37; transition:all .2s; }
.esc-pick:hover, .esc-pick:active { background:rgba(212,175,55,.25); transform:scale(1.05); }
@media (max-width:480px) { .esc-row { grid-template-columns: 1fr 1fr 40px; } }

/* International phone with country code dropdown */
.phone-wrap { display:flex; gap:4px; align-items:stretch; }
.cc-select { padding:10px 6px; border-radius:10px; border:1px solid rgba(212,175,55,.2); background:rgba(255,255,255,.02); color:inherit; font:inherit; min-width:78px; max-width:90px; cursor:pointer; }
.cc-select option { background:#0b0b0d; color:#fff; }
.phone-wrap input[type="tel"] { flex:1; min-width:0; }
.esc-row { grid-template-columns: 1fr 1.4fr 44px !important; }
@media (max-width:480px) { .cc-select { min-width:70px; font-size:13px; } .esc-row { grid-template-columns: 1fr 1.3fr 38px !important; } }
