* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Tajawal', 'Noto Sans Arabic', 'Segoe UI', Tahoma, sans-serif; }

body {
  background-color: #0b1120;
  color: #f8fafc;
  padding: 15px;
  display: flex;
  justify-content: center;
}

.container { width: 100%; max-width: 480px; margin: 0 auto; }
.screen { width: 100%; }

.app-header { text-align: center; margin-bottom: 20px; }
.app-header h1 { font-size: 1.35rem; font-weight: 800; }

.tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.tab-btn {
  flex: 1; padding: 10px; border-radius: 12px; border: 1px solid #374151;
  background: #111827; color: #9ca3af; font-weight: 700; cursor: pointer; font-size: 0.9rem;
}
.tab-btn.active { background: #059669; color: #fff; border-color: #059669; }

.form-box { display: flex; flex-direction: column; gap: 14px; }

.input-box label { display: block; font-size: 0.8rem; color: #9ca3af; margin-bottom: 4px; }
.input-field {
  width: 100%; background: #0b1120; border: 1px solid #1f2937; color: #fff;
  padding: 12px; border-radius: 12px; text-align: center; font-size: 1.05rem; font-weight: 700; outline: none;
}

.role-pick { display: flex; gap: 10px; }
.role-pick-btn {
  flex: 1; background: #111827; border: 2px solid #374151; border-radius: 14px;
  padding: 16px; color: #fff; font-weight: 800; cursor: pointer; font-size: 1rem;
}
.role-pick-btn.selected { border-color: #059669; background: #06231c; color: #34d399; }

.btn-primary {
  width: 100%; background: #059669; color: #fff; border: none; padding: 14px;
  border-radius: 14px; font-size: 1.05rem; font-weight: 800; cursor: pointer; margin-top: 4px;
}
.btn-primary:active { background: #047857; }

.error-text { color: #f87171; font-size: 0.85rem; text-align: center; min-height: 18px; }
.success-text { color: #34d399; font-size: 0.9rem; text-align: center; margin-top: 10px; min-height: 18px; }
.info-text { color: #fbbf24; font-size: 0.85rem; text-align: center; margin-top: 8px; }

.top-nav-bar {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px;
  background: #1f2937; padding: 8px 14px; border-radius: 12px; font-size: 0.85rem;
}
.btn-switch-role {
  background: #374151; color: #38bdf8; border: none; padding: 5px 10px; border-radius: 8px;
  cursor: pointer; font-weight: 700; font-size: 0.75rem;
}

.section-card {
  background: #111827; border-radius: 20px; padding: 16px; margin-bottom: 16px; border: 1px solid #1f2937;
}
.section-card h2 { font-size: 1.1rem; font-weight: 800; margin-bottom: 15px; text-align: center; }

.today-container { display: flex; flex-direction: column; gap: 16px; width: 100%; }
.main-form-card, .calendar-side-card { width: 100%; margin-bottom: 0 !important; }

.notice-msg {
  font-size: 0.75rem; color: #f59e0b; margin-bottom: 10px; line-height: 1.4;
  background: rgba(245, 158, 11, 0.1); padding: 8px; border-radius: 8px; text-align: center;
}

.calendar-grid-days {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; text-align: center;
}

.day-box {
  background: #1f2937; border-radius: 8px; padding: 8px 2px; display: flex;
  flex-direction: column; align-items: center; justify-content: center; min-height: 50px;
}
.day-box.editable { cursor: pointer; }
.day-box.editable:active { transform: scale(0.95); }
.day-box.today-box { border: 2px solid #38bdf8; }
.day-box.future { opacity: 0.3; }
.day-box .day-num { font-weight: bold; color: #fff; font-size: 0.8rem; }
.day-box .day-tag { font-size: 0.6rem; margin-top: 2px; color: #9ca3af; }

.day-box.present { border: 1px solid #10b981; }
.day-box.present .day-tag { color: #10b981; }
.day-box.absent { border: 1px solid #ef4444; }
.day-box.absent .day-tag { color: #ef4444; }
.day-box.half { border: 1px solid #3b82f6; }
.day-box.half .day-tag { color: #3b82f6; }
.day-box.x2 { background: rgba(16, 185, 129, 0.15); }

.quick-actions { display: flex; gap: 8px; margin: 15px 0; }
.btn-action {
  flex: 1; padding: 10px; border-radius: 10px; border: 1px solid #374151;
  font-size: 0.85rem; font-weight: 700; cursor: pointer; background: #1f2937; color: #9ca3af;
}
.btn-action.active-mult { background: rgba(139, 92, 246, 0.2); border-color: #8b5cf6; color: #c4b5fd; }
.btn-action.active-night { background: rgba(2, 132, 199, 0.2); border-color: #0284c7; color: #7dd3fc; }

.btn-save-main {
  width: 100%; background: #059669; color: #fff; border: none; padding: 14px; border-radius: 14px;
  font-size: 1.05rem; font-weight: 800; cursor: pointer; margin-top: 10px;
}

.net-salary-card {
  background: #06231c; border: 1px solid #059669; border-radius: 16px; padding: 16px;
  text-align: center; margin: 16px 0;
}
.net-salary-title { font-size: 0.85rem; color: #10b981; margin-bottom: 4px; }
.net-salary-amount { font-size: 2rem; font-weight: 900; color: #34d399; }

.summary-list { display: flex; flex-direction: column; gap: 8px; }
.summary-row { display: flex; justify-content: space-between; font-size: 0.85rem; color: #9ca3af; }
.summary-row span:last-child { font-weight: 700; color: #f3f4f6; }
.summary-row.danger span:last-child { color: #f87171; }

@media (min-width: 768px) {
  .container { max-width: 900px; }
  .today-container { flex-direction: row; }
  .main-form-card, .calendar-side-card { flex: 1; width: 50%; }
}

/* ===== إضافات: التجربة/الاشتراك، شرح الأزرار، وتعديل الشهور القديمة ===== */

.sub-banner {
  font-size: 0.75rem; color: #7dd3fc; text-align: center; margin-bottom: 12px;
  background: rgba(2, 132, 199, 0.12); border: 1px solid rgba(2, 132, 199, 0.35);
  padding: 7px 10px; border-radius: 10px;
}

.paywall-steps {
  margin-top: 14px; text-align: right; background: #0b1120; border: 1px solid #1f2937;
  border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 8px;
  font-size: 0.85rem; color: #e5e7eb; line-height: 1.5;
}

/* أيقونة الشرح (i) جنب أزرار 2x والسهرة */
.info-btn {
  width: 30px; height: 30px; flex: 0 0 30px; border-radius: 50%;
  border: 1px solid #38bdf8; background: rgba(56, 189, 248, 0.12);
  color: #38bdf8; font-weight: 800; font-size: 0.8rem; cursor: pointer;
}
.info-btn:active { background: rgba(56, 189, 248, 0.3); }

.info-popup {
  position: fixed; inset: 0; background: rgba(2, 6, 23, 0.8); z-index: 9998;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.info-popup-card {
  background: #111827; border: 1px solid #38bdf8; border-radius: 18px;
  padding: 18px; max-width: 420px; width: 100%;
}
.info-popup-card p { font-size: 0.9rem; line-height: 1.7; color: #f8fafc; text-align: right; }

/* اختيار أيام الشهر القديم */
.day-pick-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px;
  background: #0b1120; border: 1px solid #1f2937; border-radius: 12px; padding: 8px;
}
.day-pick { display: flex; align-items: center; justify-content: center; }
.day-pick input { display: none; }
.day-pick span {
  width: 100%; text-align: center; padding: 6px 0; border-radius: 8px;
  background: #1f2937; color: #9ca3af; font-size: 0.75rem; font-weight: 700; cursor: pointer;
}
.day-pick input:checked + span { background: #059669; color: #fff; }

.edit-req-card {
  background: #0b1120; border: 1px solid #1f2937; border-radius: 14px;
  padding: 12px; margin-top: 10px;
}
.edit-req-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.edit-req-line { font-size: 0.8rem; color: #d1d5db; margin-top: 4px; }
.edit-req-timer { font-size: 0.75rem; color: #fbbf24; margin-top: 8px; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 0.68rem; font-weight: 700; }
.badge-approved { background: #064e3b; color: #34d399; }
.badge-pending { background: #78350f; color: #fbbf24; }
.badge-rejected { background: #7f1d1d; color: #fca5a5; }
.badge-used { background: #1e3a8a; color: #93c5fd; }

.day-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.day-chip {
  padding: 6px 10px; border-radius: 10px; border: 1px solid #38bdf8;
  background: rgba(56, 189, 248, 0.12); color: #7dd3fc; font-size: 0.75rem;
  font-weight: 700; cursor: pointer;
}

.past-editor {
  margin-top: 10px; padding-top: 10px; border-top: 1px dashed #1f2937;
  display: flex; flex-direction: column; gap: 6px;
}
.chk { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; color: #d1d5db; }

/* ===== إضافات v2: الشهور المقفولة + كارت المرتب الجديد ===== */

.month-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-bottom: 12px; background: #111827; border: 1px solid #1f2937;
  border-radius: 12px; padding: 7px 10px;
}
.btn-month {
  background: #1f2937; color: #7dd3fc; border: 1px solid #374151; border-radius: 10px;
  padding: 7px 10px; font-size: 0.75rem; font-weight: 700; cursor: pointer;
}
.btn-month:active { background: #374151; }
#monthBarTitle { font-size: 0.9rem; font-weight: 800; color: #f8fafc; }

.days-sub { font-size: 0.75rem; color: #9ca3af; text-align: center; margin-top: 4px; }
.calc-time { font-size: 0.72rem; color: #9ca3af; margin-bottom: 8px; text-align: center; }

.summary-row.highlight span:last-child { color: #7dd3fc; }
.summary-row.strong { border-top: 1px dashed #1f2937; padding-top: 8px; margin-top: 2px; }
.summary-row.strong span:last-child { color: #34d399; font-size: 0.95rem; }

.info-btn-inline { width: 22px; height: 22px; flex: 0 0 22px; font-size: 0.7rem; margin-inline-start: 6px; vertical-align: middle; }

.day-box.readonly { cursor: default; }
.day-box.readonly:active { transform: none; }

.btn-save-main:disabled, .btn-primary:disabled, .btn-action:disabled {
  opacity: 0.45; cursor: not-allowed;
}

.input-field:disabled { opacity: 0.55; }

.code-input { letter-spacing: 1px; font-size: 0.85rem; direction: ltr; min-height: 90px; resize: none; }
.device-id { font-family: monospace; font-size: 1.6rem; letter-spacing: 4px; color: #34d399; direction: ltr; text-align:center; background:#0b1120; border:1px dashed #059669; border-radius:12px; padding:12px; margin:10px 0; user-select: all; }
.btn-secondary { width:100%; background:#1f2937; color:#7dd3fc; border:1px solid #374151; padding:12px; border-radius:14px; font-weight:800; cursor:pointer; margin-top:8px; font-size:0.95rem; }
.fatal { text-align:center; padding:30px 10px; }

/* شاشة التفعيل */
.pay-card { text-align:center; padding:24px 18px; }
.pay-icon { width:64px; height:64px; margin:0 auto 12px; border-radius:50%; background:rgba(16,185,129,.12); display:flex; align-items:center; justify-content:center; font-size:1.9rem; }
.pay-title { font-size:1.35rem !important; margin-bottom:6px !important; }
.pay-sub { color:#e5e7eb; font-size:1.02rem; margin-bottom:4px; }
.pay-note { color:#9ca3af; font-size:.9rem; margin-bottom:14px; }
.pay-note:empty { display:none; }
.pay-steps { list-style:none; text-align:right; margin:14px 0 18px; padding:0; }
.pay-steps li { display:flex; align-items:center; gap:12px; padding:10px 4px; color:#d1d5db; line-height:1.6; }
.pay-steps .n { flex:0 0 28px; height:28px; border-radius:50%; background:#1f2937; color:#6ee7b7; display:flex; align-items:center; justify-content:center; font-weight:800; font-size:.9rem; }
.pay-btn { display:block; width:100%; margin-top:10px; text-decoration:none; text-align:center; }
.pay-wa { background:#0f766e; }
.pay-error { color:#fca5a5; font-size:.95rem; margin-top:8px; min-height:1.2em; }
.pay-emergency { margin-top:20px; text-align:right; color:#9ca3af; font-size:.9rem; border-top:1px solid #1f2937; padding-top:12px; }
.pay-emergency summary { cursor:pointer; padding:8px 0; color:#6b7280; }
.pay-emergency p { margin:6px 0; }
