@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700;900&display=swap');

:root {
  --color-primary: #F03D79;
  --color-primary-dark: #C4255F;
  --color-secondary: #231F20;
  --color-bg: #FFF5F8;
  --color-surface: #FFFFFF;
  --color-border: #F0DCE4;
  --color-text: #2B2B2B;
  --color-text-muted: #8A7B81;
  --color-success: #3E8E5A;
  --color-danger: #C94B4B;
  --color-warning: #C98A2E;
  --radius: 16px;
  --shadow: 0 2px 10px rgba(43,43,43,0.06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  direction: rtl;
  font-family: 'Tajawal', sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  -webkit-tap-highlight-color: transparent;
}

body { padding-bottom: 76px; }

h1, h2, h3 { margin: 0 0 8px; font-weight: 700; }

/* Keep scrolling and pinch zoom available while preventing double-tap zoom on controls. */
button, a[href] { touch-action: manipulation; }

button {
  font-family: inherit;
  border: none;
  border-radius: 12px;
  padding: 12px 18px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .15s;
}
button:active { opacity: .75; }
button:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary { background: var(--color-primary); color: #fff; }
.btn-secondary { background: var(--color-surface); color: var(--color-text); border: 1px solid var(--color-border); }
.btn-danger { background: var(--color-danger); color: #fff; }
.btn-success { background: var(--color-success); color: #fff; }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 12px; font-size: 13px; border-radius: 10px; }

input, select, textarea {
  font-family: inherit;
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--color-border);
  background: #fff;
  font-size: 15px;
  color: var(--color-text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--color-primary); }

label { display: block; font-size: 13px; color: var(--color-text-muted); margin: 10px 0 4px; font-weight: 500; }

.field { margin-bottom: 4px; }

.card {
  overflow-wrap: anywhere;
  min-width: 0;
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 14px;
}

.row { display: flex; gap: 10px; align-items: center; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.row-between > * { min-width: 0; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }

.muted { color: var(--color-text-muted); font-size: 13px; }
.pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.pill-success { background: #E6F4EC; color: var(--color-success); }
.pill-danger { background: #FBEAEA; color: var(--color-danger); }
.pill-warning { background: #FBF1E2; color: var(--color-warning); }

/* شريط علوي */
.topbar {
  background: var(--color-surface);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.topbar .title { font-size: 18px; font-weight: 900; color: var(--color-primary-dark); }

/* تنقّل سفلي */
.bottom-nav {
  position: fixed;
  bottom: 0; right: 0; left: 0;
  background: var(--color-surface);
  box-shadow: 0 -2px 10px rgba(0,0,0,0.06);
  display: flex;
  z-index: 10;
}
.bottom-nav button {
  flex: 1;
  background: none;
  border-radius: 0;
  padding: 10px 2px;
  font-size: 12px;
  color: var(--color-text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.bottom-nav button.active { color: var(--color-primary-dark); }
.bottom-nav .ic { font-size: 19px; }

main { padding: 14px 14px 10px; max-width: 720px; margin: 0 auto; }

.view { display: none; }
.view.active { display: block; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px 8px; text-align: start; border-bottom: 1px solid var(--color-border); }
th { color: var(--color-text-muted); font-weight: 700; font-size: 12px; }

.list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 4px;
  border-bottom: 1px solid var(--color-border);
}
.list-item:last-child { border-bottom: none; }

.empty-state { text-align: center; color: var(--color-text-muted); padding: 40px 10px; }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4);
  display: flex; align-items: flex-end; justify-content: center;
  z-index: 50;
}
.modal-backdrop.hidden { display: none; }
.modal-sheet {
  background: #fff; width: 100%; max-width: 720px;
  border-radius: 20px 20px 0 0;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  max-height: 88vh; overflow-y: auto;
}

.toast {
  position: fixed; bottom: 86px; right: 50%; transform: translateX(50%);
  background: var(--color-secondary); color: #fff;
  padding: 10px 18px; border-radius: 999px; font-size: 13px;
  z-index: 100; box-shadow: var(--shadow);
}

.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
}
.login-card { width: 100%; max-width: 360px; text-align: center; }
.login-card .logo-circle {
  width: 64px; height: 64px; border-radius: 50%; background: var(--color-primary);
  margin: 0 auto 14px;
}

/* Client care: quiet rose, warm gold, and clear mobile actions. */
.growth-shortcuts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:14px 0}
.growth-shortcut{text-align:start;padding:18px 14px;border:1px solid #ebd5de;background:linear-gradient(150deg,#fff,#fcf3ee);color:#48353f;box-shadow:0 5px 16px #7b455308}
.growth-shortcut strong,.growth-shortcut small{display:block}.growth-shortcut small{font-size:12px;font-weight:400;color:#7b6973;margin-top:5px;line-height:1.6}
.growth-symbol{display:block;color:#a77b41;font-size:25px;margin-bottom:7px}
.growth-hero{margin:14px 0;padding:26px 20px;border-radius:20px;background:linear-gradient(120deg,#513441,#2e2630);color:#fff8f3}
.growth-hero h2{font-size:25px;margin:8px 0}.growth-hero p{font-size:14px;margin-bottom:0;color:#e9d5dc}.growth-eyebrow{font:10px system-ui;letter-spacing:2px;color:#e3bd91}
.growth-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-bottom:16px}.growth-stat{padding:14px 9px;border:1px solid #efdee5;border-radius:14px;background:white;text-align:center}
.growth-stat strong{display:block;font-size:22px;color:#7c475c}.growth-stat small{font-size:11px;color:#77616e}
.growth-tabs{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:18px;padding-bottom:3px}.growth-tab-btn{white-space:nowrap;font-size:12px;padding:10px 11px;background:white;border:1px solid #e8d5df;color:#715c68}.growth-tab-btn.active{background:#513441;color:white;border-color:#513441}
.growth-heading{margin:16px 0 12px}.growth-heading h3{margin:0;font-size:17px}.growth-panel[hidden]{display:none!important}
.growth-program,.growth-campaign{padding:18px;background:#fff;border:1px solid #efdee5;border-radius:16px;margin:12px 0;box-shadow:0 4px 20px #51344106}.growth-program h3,.growth-campaign h3{font-size:17px;margin-bottom:4px}
.growth-detail{font-size:14px;line-height:1.8;color:#73586a;margin:10px 0}.growth-kicker{font-size:11px;letter-spacing:.3px;color:#9c7445;font-weight:700}.growth-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px}.growth-actions button{font-size:12px;padding:9px 12px}
.growth-notice{padding:14px;border-radius:12px;background:#faf2e8;color:#705534;font-size:13px;line-height:1.8;margin:12px 0}
.growth-notice.error,#growth-error{background:#fff0f1;color:#963f4d;padding:14px;border-radius:12px;margin:10px 0}
.growth-progress{height:7px;background:#f0e3e8;border-radius:20px;overflow:hidden;margin:10px 0}.growth-progress>span{display:block;height:100%;background:linear-gradient(90deg,#b98b65,#90566c);border-radius:20px}
.growth-consent{display:flex;gap:8px;align-items:center;line-height:1.7}.growth-consent input{width:auto;flex-shrink:0}
.growth-client{display:block;width:100%;text-align:start;background:#fff;color:var(--color-text);border:1px solid #efdee5;border-radius:12px;padding:16px;margin-top:9px;cursor:pointer}.growth-client-meta{font-size:12px;color:#7b6973;margin-top:5px;font-weight:400}
#growth-winback .growth-client-meta{display:block}#growth-winback .growth-client strong{overflow-wrap:anywhere}
.growth-reward-available{border-inline-start:4px solid #a77b41;padding:12px;margin:12px 0;background:#fffaf6;border-radius:9px}.growth-split{display:grid;grid-template-columns:1fr 1fr;gap:10px}.growth-split>*{min-width:0}.growth-dialog [hidden]{display:none!important}
.growth-modal-copy{font-size:13px;color:#77616e;line-height:1.8}.growth-dialog label{margin-top:12px}.growth-dialog textarea{resize:vertical}.growth-dialog h3{margin-bottom:10px}
.growth-quote{padding:12px;background:#fbf3eb;border-radius:10px;color:#775338;font-size:13px;margin-top:8px}
.growth-quote:empty{display:none}.growth-badge{display:inline-block;background:#f3e9dc;color:#8b642f;border-radius:30px;padding:3px 9px;font-size:11px;font-weight:700}
.growth-history{font-size:13px;line-height:1.8;border-bottom:1px solid #f0e6eb;padding:11px 0}.growth-history:last-child{border:0}
@media(max-width:360px){.growth-shortcuts,.growth-split{grid-template-columns:1fr}.growth-tab-btn{font-size:11px;padding:9px}.growth-stat small{font-size:10px}}

@media print {
  .bottom-nav, .topbar, .no-print { display: none !important; }
  body { padding-bottom: 0; background: #fff; }
}
