:root {
  --red: #e30613;
  --red-dark: #b0040d;
  --red-light: #fdecec;
  --black: #1a1a1a;
  --gray-900: #1f2328;
  --gray-700: #4b5563;
  --gray-500: #6b7280;
  --gray-200: #e5e7eb;
  --gray-100: #f3f4f6;
  --white: #ffffff;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.07);
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.06);
  --container: 1120px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Cairo", "Segoe UI", Tahoma, sans-serif;
  color: var(--gray-900);
  background: var(--white);
  line-height: 1.7;
}

img {
  max-width: 100%;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  margin: 0;
  padding-inline-start: 1.2em;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 28px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 15px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  white-space: nowrap;
}
.btn:active {
  transform: translateY(1px) scale(0.99);
}
.btn-primary {
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  color: var(--white);
  box-shadow: 0 8px 20px rgba(227, 6, 19, 0.3);
}
.btn-primary:hover {
  box-shadow: 0 10px 26px rgba(227, 6, 19, 0.4);
  transform: translateY(-1px);
}
.btn-outline {
  background: transparent;
  border-color: var(--gray-200);
  color: var(--gray-900);
}
.btn-outline:hover {
  border-color: var(--red);
  color: var(--red);
}
.btn-lg {
  padding: 16px 40px;
  font-size: 16px;
}
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--gray-200);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-logo {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
}
.brand-logo.small {
  width: 44px;
  height: 44px;
}
.brand-text h1 {
  font-size: 18px;
  margin: 0;
  color: var(--gray-900);
}
.brand-text h4 {
  font-size: 16px;
  margin: 0;
  color: var(--white);
}
.brand-text p {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--gray-500);
}
.footer .brand-text p,
.site-footer .brand-text p {
  color: rgba(255, 255, 255, 0.7);
}
.main-nav {
  display: none;
  align-items: center;
  gap: 22px;
  font-weight: 600;
  font-size: 14.5px;
  color: var(--gray-700);
}
.main-nav a.active,
.main-nav a:hover {
  color: var(--red);
}
@media (min-width: 860px) {
  .main-nav {
    display: flex;
  }
}
.auth-area {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.nav-username {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--gray-700);
  white-space: nowrap;
  display: none;
}
@media (min-width: 640px) {
  .nav-username {
    display: inline;
  }
}
.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
}
.btn-xs {
  padding: 6px 12px;
  font-size: 12.5px;
  border-radius: 8px;
}
.btn-block {
  width: 100%;
}

/* Hero */
.hero {
  background: radial-gradient(circle at 100% 0%, var(--red-light), transparent 55%), var(--white);
  padding: 60px 0 40px;
}
.hero-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  align-items: center;
}
@media (min-width: 860px) {
  .hero-inner {
    grid-template-columns: 1.2fr 0.8fr;
  }
}
.badge {
  display: inline-block;
  background: var(--red-light);
  color: var(--red-dark);
  font-weight: 700;
  font-size: 13px;
  padding: 6px 16px;
  border-radius: 999px;
  margin-bottom: 16px;
}
.hero-text h2 {
  font-size: clamp(28px, 4vw, 42px);
  margin: 0 0 16px;
  color: var(--gray-900);
  line-height: 1.35;
}
.hero-text p {
  color: var(--gray-700);
  font-size: 16px;
  max-width: 56ch;
  margin: 0 0 28px;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}
.hero-badge-img {
  display: flex;
  justify-content: center;
}
.hero-badge-img img {
  width: min(280px, 70vw);
  filter: drop-shadow(0 20px 30px rgba(227, 6, 19, 0.18));
}

/* Section titles */
.section-title {
  font-size: clamp(22px, 3vw, 30px);
  text-align: center;
  margin: 0 0 8px;
  color: var(--gray-900);
}
.section-subtitle {
  text-align: center;
  color: var(--gray-500);
  margin: 0 0 36px;
  font-size: 15px;
}

/* Steps */
.steps {
  padding: 60px 0;
  background: var(--gray-100);
}
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}
.step-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 26px 22px;
  box-shadow: var(--shadow-sm);
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.step-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  color: var(--white);
  font-weight: 800;
  margin-bottom: 14px;
}
.step-card h4 {
  margin: 0 0 8px;
  font-size: 17px;
}
.step-card p {
  margin: 0;
  color: var(--gray-500);
  font-size: 14px;
}

/* Terms accordion */
.terms {
  padding: 60px 0;
}
.accordion {
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.accordion-item {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 4px 20px;
  background: var(--white);
  transition: border-color 0.15s ease;
}
.accordion-item[open] {
  border-color: var(--red);
}
.accordion-item summary {
  cursor: pointer;
  list-style: none;
  padding: 16px 0;
  font-weight: 700;
  font-size: 15.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--gray-900);
}
.accordion-item summary::-webkit-details-marker {
  display: none;
}
.accordion-item summary::after {
  content: "+";
  font-size: 22px;
  color: var(--red);
  transition: transform 0.2s ease;
  flex-shrink: 0;
  margin-inline-start: 12px;
}
.accordion-item[open] summary::after {
  transform: rotate(45deg);
}
.accordion-body {
  padding: 0 0 18px;
  color: var(--gray-700);
  font-size: 14.5px;
}
.accordion-body p {
  margin: 0 0 10px;
}
.accordion-body ul {
  margin: 8px 0;
  color: var(--gray-700);
}
.accordion-body li {
  margin-bottom: 6px;
}

/* Application form */
.apply {
  padding: 60px 0 90px;
  background: var(--gray-100);
}
.app-form {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.form-card {
  background: var(--white);
  border: none;
  border-radius: var(--radius);
  padding: 28px 26px;
  box-shadow: var(--shadow-sm);
}
.form-card legend {
  font-weight: 800;
  font-size: 17px;
  color: var(--red-dark);
  padding: 0 8px;
}
.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin-top: 10px;
}
@media (min-width: 640px) {
  .grid-2 {
    grid-template-columns: 1fr 1fr;
  }
}
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.field label {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--gray-700);
}
.optional {
  font-weight: 400;
  color: var(--gray-500);
  font-size: 12.5px;
}
.field input[type="text"],
.field input[type="tel"],
.field input[type="date"],
.field input[type="number"],
.field input[type="url"],
.field select,
.field textarea {
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-family: inherit;
  font-size: 14.5px;
  color: var(--gray-900);
  background: var(--white);
  width: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field textarea {
  resize: vertical;
  line-height: 1.6;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(227, 6, 19, 0.12);
}
.note-hint code {
  background: var(--gray-100);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 11.5px;
  color: var(--red-dark);
  direction: ltr;
  display: inline-block;
}
.field input:invalid:not(:placeholder-shown) {
  border-color: #d97706;
}

.file-field input[type="file"] {
  border: 1.5px dashed var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 13.5px;
  background: var(--gray-100);
  cursor: pointer;
}
.file-field input[type="file"]:focus {
  outline: none;
  border-color: var(--red);
}

.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 6px;
}
.radio-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1.5px solid var(--gray-200);
  border-radius: 999px;
  padding: 10px 18px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-700);
  transition: all 0.15s ease;
}
.radio-pill:has(input:checked) {
  border-color: var(--red);
  background: var(--red-light);
  color: var(--red-dark);
}
.radio-pill input {
  accent-color: var(--red);
}

.hidden {
  display: none !important;
}

.payment-note {
  margin-top: 22px;
  background: var(--red-light);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
}
.payment-note h4 {
  margin: 0 0 10px;
  color: var(--red-dark);
  font-size: 15px;
}
.payment-note ul {
  margin: 0 0 10px;
  color: var(--gray-700);
  font-size: 14px;
}
.payment-note li {
  margin-bottom: 6px;
}
.note-hint {
  margin: 0;
  font-size: 13px;
  color: var(--gray-500);
}

.form-submit {
  text-align: center;
  margin-top: 4px;
}
.form-message {
  margin-top: 16px;
  font-weight: 700;
  font-size: 14.5px;
  min-height: 20px;
}
.form-message.success {
  color: #15803d;
}
.form-message.error {
  color: var(--red-dark);
}

/* Footer */
.site-footer {
  background: var(--black);
  color: rgba(255, 255, 255, 0.85);
  padding: 32px 0;
}
.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  text-align: center;
}
@media (min-width: 640px) {
  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
    text-align: right;
  }
}
.footer-note {
  margin: 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
}
.footer-terms-link {
  font-size: 13.5px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: underline;
}
.footer-terms-link:hover {
  color: var(--red);
}

/* CTA band (homepage) */
.cta-band {
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  padding: 46px 0;
}
.cta-band-inner {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  text-align: center;
}
@media (min-width: 720px) {
  .cta-band-inner {
    flex-direction: row;
    text-align: right;
  }
}
.cta-band-inner h3 {
  margin: 0 0 6px;
  color: var(--white);
  font-size: 24px;
}
.cta-band-inner p {
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 14.5px;
}
.cta-band-inner .btn-primary {
  background: var(--white);
  color: var(--red-dark);
  box-shadow: none;
}
.cta-band-inner .btn-primary:hover {
  background: var(--gray-100);
}

/* Auth pages (login/register) */
.auth-section {
  display: flex;
  justify-content: center;
  padding: 70px 20px 90px;
  background: var(--gray-100);
  min-height: calc(100vh - 260px);
}
.auth-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 36px 32px;
  width: 100%;
  max-width: 440px;
}
.auth-card h2 {
  margin: 0 0 6px;
  font-size: 22px;
  text-align: center;
}
.auth-subtitle {
  text-align: center;
  color: var(--gray-500);
  font-size: 13.5px;
  margin: 0 0 26px;
}
.auth-card form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.auth-card .field input {
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-family: inherit;
  font-size: 14.5px;
  width: 100%;
}
.auth-card .field input:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(227, 6, 19, 0.12);
}
.auth-switch {
  text-align: center;
  margin: 20px 0 0;
  font-size: 13.5px;
  color: var(--gray-700);
}
.auth-switch a {
  color: var(--red);
  font-weight: 700;
}

/* Alerts */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
}
.alert.error {
  background: var(--red-light);
  color: var(--red-dark);
}
.alert.success {
  background: #ecfdf3;
  color: #15803d;
}
.alert.hidden {
  display: none;
}

.gate-message {
  padding: 40px 20px;
}

/* Installment calculator box */
.calc-box {
  margin-top: 22px;
  background: var(--gray-100);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
}
.calc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 14px;
  color: var(--gray-700);
  border-bottom: 1px dashed var(--gray-200);
}
.calc-row:last-of-type {
  border-bottom: none;
}
.calc-row strong {
  color: var(--gray-900);
  font-size: 15.5px;
}
.calc-row-highlight strong {
  color: var(--red-dark);
  font-size: 18px;
}
.calc-hint {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--gray-500);
}

/* Dashboard */
.dashboard {
  padding: 50px 0 90px;
  background: var(--gray-100);
  min-height: calc(100vh - 260px);
}
.dashboard-header {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  background: var(--white);
  border-radius: var(--radius);
  padding: 26px 28px;
  box-shadow: var(--shadow-sm);
}
.dashboard-header h2 {
  margin: 0 0 6px;
}
.status-note {
  margin: 0;
  color: var(--gray-500);
  font-size: 14px;
}
.applications-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
  margin-top: 16px;
}
.app-card {
  background: var(--white);
  border-radius: var(--radius-sm);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
}
.app-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.app-card-head h4 {
  margin: 0;
  font-size: 16px;
}
.app-card-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13.5px;
  color: var(--gray-700);
}
.empty-state {
  color: var(--gray-500);
  font-size: 14px;
  padding: 20px 0;
}

/* Status badges */
.badge-status {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.badge-pending {
  background: #fef3c7;
  color: #92400e;
}
.badge-approved {
  background: #dcfce7;
  color: #15803d;
}
.badge-rejected {
  background: var(--red-light);
  color: var(--red-dark);
}

/* Admin dashboard */
.admin-section {
  padding: 40px 0 90px;
  background: var(--gray-100);
  min-height: calc(100vh - 260px);
}
.section-title-sm {
  font-size: 18px;
  margin: 0 0 16px;
}
.applications-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--gray-700);
}
.applications-filter .radio-pill {
  padding: 8px 14px;
  font-size: 13px;
}
.paid-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 700;
}
.paid-indicator.paid {
  background: #dcfce7;
  color: #15803d;
}
.paid-indicator.unpaid {
  background: var(--gray-200);
  color: var(--gray-500);
}
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--gray-200);
  padding-bottom: 4px;
}
.tab-btn {
  border: none;
  background: transparent;
  padding: 10px 18px;
  border-radius: 999px 999px 0 0;
  font-weight: 700;
  font-size: 14px;
  color: var(--gray-500);
  cursor: pointer;
}
.tab-btn.active {
  background: var(--white);
  color: var(--red-dark);
  box-shadow: var(--shadow-sm);
}
.tab-panel {
  display: none;
}
.tab-panel.active {
  display: block;
}
.table-wrap {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 8px;
  overflow-x: auto;
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  min-width: 640px;
}
.table th,
.table td {
  padding: 12px 14px;
  text-align: right;
  border-bottom: 1px solid var(--gray-100);
  white-space: nowrap;
}
.table th {
  color: var(--gray-500);
  font-weight: 700;
  font-size: 12.5px;
}
.table tbody tr:last-child td {
  border-bottom: none;
}
.actions-cell {
  display: flex;
  gap: 8px;
}
.status-select {
  border: 1.5px solid var(--gray-200);
  border-radius: 8px;
  padding: 6px 10px;
  font-family: inherit;
  font-size: 13px;
}
.muted {
  color: var(--gray-500);
  font-size: 12px;
}
.checkbox-field {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--gray-700);
  margin: 4px 0 18px;
  cursor: pointer;
}
.checkbox-field input {
  width: 18px;
  height: 18px;
  accent-color: var(--red);
  cursor: pointer;
}

/* Terms page profit-rate disclosure note */
.profit-rate-note {
  margin-top: 14px;
  background: var(--red-light);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--red-dark);
}

/* Apply form: field group title + copy/location buttons */
.field-group-title {
  margin: 22px 0 4px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--gray-700);
}
.payment-note li {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.btn-copy {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1.5px solid var(--red);
  background: var(--white);
  color: var(--red-dark);
  font-weight: 700;
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}
.btn-copy:hover {
  background: var(--red);
  color: var(--white);
}
.btn-copy.copied {
  background: #15803d;
  border-color: #15803d;
  color: var(--white);
}

/* Admin: application detail modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  overflow-y: auto;
  z-index: 100;
}
.modal-overlay.hidden {
  display: none;
}
.modal-box {
  background: var(--white);
  border-radius: var(--radius);
  max-width: 760px;
  width: 100%;
  padding: 28px 26px;
  box-shadow: var(--shadow);
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.modal-head h3 {
  margin: 0;
  font-size: 19px;
}
.modal-close {
  border: none;
  background: var(--gray-100);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  color: var(--gray-700);
}
.modal-subtitle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--gray-100);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 14.5px;
}
.modal-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--gray-200);
}
.modal-tab-btn {
  border: none;
  background: transparent;
  padding: 10px 16px;
  font-weight: 700;
  font-size: 13.5px;
  color: var(--gray-500);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.modal-tab-btn.active {
  color: var(--red-dark);
  border-bottom-color: var(--red);
}
.modal-tab-panel {
  display: none;
}
.modal-tab-panel.active {
  display: block;
}
.modal-section-title {
  margin: 0 0 10px;
  font-size: 14px;
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px 18px;
  margin-bottom: 20px;
  font-size: 13.5px;
}
.detail-grid div span {
  display: block;
  color: var(--gray-500);
  font-size: 11.5px;
  margin-bottom: 2px;
}
.detail-grid div strong {
  color: var(--gray-900);
}
.doc-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}
.doc-item {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
}
.doc-item-actions {
  display: flex;
  gap: 6px;
}
.doc-item-actions a {
  font-size: 12px;
  font-weight: 700;
  color: var(--red-dark);
  text-decoration: underline;
}
.modal-danger {
  border-top: 1px solid var(--gray-200);
  padding-top: 16px;
  text-align: left;
}
.btn-danger {
  background: var(--white);
  border: 1.5px solid var(--red-dark);
  color: var(--red-dark);
}
.btn-danger:hover {
  background: var(--red-dark);
  color: var(--white);
}
.btn-link {
  background: none;
  border: none;
  color: var(--red-dark);
  font-weight: 700;
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}
.btn-whatsapp {
  border: none;
  background: #25d366;
  color: var(--white);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-inline-start: 6px;
  vertical-align: middle;
  transition: transform 0.15s ease;
}
.btn-whatsapp:hover {
  transform: scale(1.1);
}
.btn-whatsapp:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* تتبّع الأقساط داخل نافذة تفاصيل الطلب */
.payment-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.payment-stat {
  background: var(--gray-100);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  text-align: center;
}
.payment-stat span {
  display: block;
  font-size: 11.5px;
  color: var(--gray-500);
  margin-bottom: 4px;
}
.payment-stat strong {
  font-size: 17px;
  color: var(--gray-900);
}
.payment-stat strong.positive {
  color: #15803d;
}
.payment-stat strong.negative {
  color: var(--red-dark);
}
.progress-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--gray-200);
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--red), var(--red-dark));
  border-radius: 999px;
  transition: width 0.3s ease;
}
.payment-quick-form {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--gray-200);
}
.payment-quick-form #add-payment-btn {
  display: block;
  width: 100%;
  padding: 12px;
  font-size: 14.5px;
  margin-bottom: 10px;
}
.payment-quick-fields {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
}
.payment-quick-fields .field {
  flex: 1;
  min-width: 120px;
}
.payment-quick-fields .btn-link {
  margin-bottom: 9px;
  white-space: nowrap;
}
.payment-quick-form .field input {
  border: 1.5px solid var(--gray-200);
  border-radius: 8px;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 13px;
  width: 100%;
}
.payment-quick-form .field label {
  font-size: 12px;
  font-weight: 700;
  color: var(--gray-700);
  display: block;
  margin-bottom: 4px;
}
#payment-note-field {
  margin-top: 10px;
}
