* { box-sizing: border-box; margin: 0; padding: 0; }
:root { --teal: #0f766e; --teal-d: #0b5e57; --paper: #f7f5f0; --ink: #1c2420; --muted: #6b7280; --line: #e5e0d8; --amber: #d97706; --red: #b91c1c; --green: #15803d; --card: #fff; }
html { direction: rtl; }
body { font-family: 'IBM Plex Sans Arabic', system-ui, -apple-system, 'Segoe UI', sans-serif; background: var(--paper); color: var(--ink); min-height: 100vh; }
#root { max-width: 640px; margin: 0 auto; min-height: 100vh; background: var(--paper); }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 15px; }
a { color: var(--teal); }
.hidden { display: none !important; }

/* Landing */
.landing { padding: 28px 20px 40px; }
.eyebrow { color: var(--teal); font-weight: 700; font-size: 14px; margin-bottom: 8px; }
.landing h1 { font-size: 30px; line-height: 1.3; margin-bottom: 10px; }
.landing .sub { color: var(--muted); font-size: 16px; line-height: 1.7; margin-bottom: 18px; }
.price-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px; text-align: center; margin-bottom: 18px; box-shadow: 0 2px 10px rgba(0,0,0,.04); }
.price-card .big { font-size: 34px; font-weight: 800; }
.price-card .big span { font-size: 16px; color: var(--muted); font-weight: 400; }
.price-card .trial { color: var(--green); font-weight: 700; margin-top: 4px; }
.price-card .note { color: var(--muted); font-size: 13px; margin-top: 4px; }
.features { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px; }
.feature { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.feature b { display: block; margin-bottom: 4px; }
.feature p { color: var(--muted); font-size: 13px; line-height: 1.6; }
.auth-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.auth-card h2 { font-size: 18px; margin-bottom: 12px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 5px; }
.field input, .field select, .field textarea { width: 100%; padding: 11px 12px; border: 1px solid #d6d0c6; border-radius: 10px; background: #fff; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--teal); border-color: var(--teal); }
.btn { display: block; width: 100%; padding: 13px; border: none; border-radius: 12px; background: var(--teal); color: #fff; font-size: 16px; font-weight: 700; }
.btn:hover { background: var(--teal-d); }
.btn.ghost { background: #fff; color: var(--teal); border: 1px solid var(--teal); }
.btn.danger { background: var(--red); }
.btn.small { width: auto; padding: 8px 14px; font-size: 14px; border-radius: 9px; }
.btn:disabled { opacity: .6; cursor: wait; }
.demo-box { margin-top: 16px; border-top: 1px dashed var(--line); padding-top: 14px; }
.demo-box p { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.demo-row { display: flex; gap: 8px; }
.demo-row .btn { flex: 1; font-size: 14px; padding: 10px; }
.err { color: var(--red); font-size: 14px; margin-top: 8px; min-height: 18px; }
.muted { color: var(--muted); font-size: 13px; }

/* App shell */
.app-header { position: sticky; top: 0; z-index: 20; background: var(--teal); color: #fff; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.app-header h1 { font-size: 18px; }
.app-header .shop-name { font-size: 13px; opacity: .9; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 700; background: #fff; color: var(--teal); white-space: nowrap; }
.pill.trial { background: #fef3c7; color: #92400e; }
.pill.grace { background: #fee2e2; color: var(--red); }
.pill.suspended { background: #fee2e2; color: var(--red); }
.pill.active { background: #dcfce7; color: var(--green); }
.banner { padding: 10px 16px; font-size: 14px; font-weight: 600; }
.banner.amber { background: #fef3c7; color: #92400e; }
.banner.red { background: #fee2e2; color: var(--red); }
.content { padding: 16px 16px 96px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-bottom: 12px; }
.card h3 { font-size: 16px; margin-bottom: 8px; }
.hero { background: linear-gradient(135deg, var(--teal), #14b8a6); color: #fff; border-radius: 16px; padding: 18px; margin-bottom: 12px; }
.hero h2 { font-size: 19px; margin-bottom: 6px; }
.hero p { opacity: .92; font-size: 14px; line-height: 1.7; margin-bottom: 12px; }
.hero .btn { background: #fff; color: var(--teal); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.chip { padding: 7px 12px; border-radius: 20px; border: 1px solid var(--line); background: #fff; font-size: 13px; }
.chip.on { background: var(--teal); color: #fff; border-color: var(--teal); }
.search { width: 100%; padding: 11px 12px; border: 1px solid #d6d0c6; border-radius: 10px; margin-bottom: 10px; background: #fff; }
.order { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-bottom: 10px; }
.order .top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.order .name { font-weight: 800; font-size: 16px; }
.order .phone { color: var(--muted); font-size: 13px; direction: ltr; text-align: right; }
.status-pill { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 20px; white-space: nowrap; }
.st-جديد { background: #e0e7ff; color: #3730a3; }
.st-تجهيز { background: #fef3c7; color: #92400e; }
.st-شحن { background: #dbeafe; color: #1e40af; }
.st-تم-التوصيل { background: #dcfce7; color: var(--green); }
.st-تم-الدفع { background: #d1fae5; color: #065f46; }
.order .items { margin: 8px 0; font-size: 14px; line-height: 1.8; }
.order .meta { font-size: 13px; color: var(--muted); line-height: 1.8; }
.order .money { display: flex; gap: 16px; margin-top: 8px; font-size: 14px; }
.order .money b { font-size: 16px; }
.order .actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.mini { padding: 7px 10px; border-radius: 8px; border: 1px solid var(--line); background: #fff; font-size: 13px; }
.mini.teal { background: var(--teal); color: #fff; border-color: var(--teal); }
.mini.red { color: var(--red); border-color: #fecaca; }
.mini:disabled { opacity: .45; }
.status-flow { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 10px; }
.status-flow .mini { font-size: 12px; padding: 6px 8px; }
.status-flow .mini.cur { background: var(--ink); color: #fff; border-color: var(--ink); }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }

/* Tabs */
.tabs { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 640px; background: #fff; border-top: 1px solid var(--line); display: flex; z-index: 30; }
.tabs button { flex: 1; padding: 12px 2px 14px; background: none; border: none; font-size: 13px; color: var(--muted); }
.tabs button.on { color: var(--teal); font-weight: 800; }

/* Stats */
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.stat .lbl { font-size: 13px; color: var(--muted); }
.stat .val { font-size: 22px; font-weight: 800; margin-top: 2px; }
.stat .val small { font-size: 13px; color: var(--muted); }
.alert-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.alert-row:last-child { border-bottom: none; }
.badge-late { background: #fee2e2; color: var(--red); font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 12px; white-space: nowrap; }
.toggle-row { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.toggle-row .chip.on { background: var(--ink); border-color: var(--ink); }

/* Lists */
.row-item { display: flex; justify-content: space-between; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.row-item:last-child { border-bottom: none; }
.row-item .t { font-weight: 700; }
.row-item .s { font-size: 13px; color: var(--muted); line-height: 1.7; }
.row-item .money2 { text-align: left; white-space: nowrap; }
.row-item .money2 b { display: block; }
.wa-btn { color: #128c7e; border: 1px solid #a7f3d0; background: #ecfdf5; }

/* Sheets / modal */
.sheet-back { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--paper); width: 100%; max-width: 640px; max-height: 88vh; overflow-y: auto; border-radius: 18px 18px 0 0; padding: 18px 16px 28px; }
.sheet h2 { font-size: 18px; margin-bottom: 4px; }
.sheet .sub2 { color: var(--muted); font-size: 13px; margin-bottom: 14px; line-height: 1.7; }
.sheet-close { float: left; background: none; border: none; font-size: 22px; color: var(--muted); }
.modes { display: flex; gap: 6px; margin-bottom: 12px; }
.modes .chip.on { background: var(--ink); border-color: var(--ink); }
.dropzone { border: 2px dashed #c9c2b6; border-radius: 12px; padding: 22px; text-align: center; color: var(--muted); font-size: 14px; margin-bottom: 12px; background: #fff; cursor: pointer; }
.dropzone img { max-width: 100%; border-radius: 8px; margin-top: 8px; }
.uncertain-tag { background: #fef3c7; color: #92400e; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 12px; }
.live-box { background: #f0fdfa; border: 1px solid #99f6e4; border-radius: 12px; padding: 12px; margin: 12px 0; font-size: 14px; line-height: 2; }
.live-box b { float: left; }

/* Paywall */
.paywall { padding: 40px 20px; text-align: center; }
.paywall .lock { font-size: 48px; }
.paywall h1 { font-size: 26px; margin: 12px 0; }
.paywall p { color: var(--muted); line-height: 1.9; margin-bottom: 16px; }
.paywall ul { text-align: right; display: inline-block; line-height: 2; margin-bottom: 20px; }

/* Admin */
.counters { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.counter { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 6px; text-align: center; }
.counter .n { font-size: 22px; font-weight: 800; }
.counter .l { font-size: 12px; color: var(--muted); }
.counter.red .n { color: var(--red); }
.shop-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-bottom: 10px; }
.shop-card .top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.shop-card .nm { font-weight: 800; font-size: 16px; cursor: pointer; color: var(--teal); }
.shop-card .ph { color: var(--muted); font-size: 13px; direction: ltr; text-align: right; }
.shop-card .det { font-size: 13px; color: var(--muted); line-height: 1.9; margin-top: 6px; }
.shop-card .det .over { color: var(--red); font-weight: 700; }
.shop-card .actions { display: flex; gap: 6px; margin-top: 10px; }
.toast { position: fixed; bottom: 84px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 24px; font-size: 14px; z-index: 99; }
@media (max-width: 420px) { .landing h1 { font-size: 25px; } }
