/* =============================================================================
   SmartHomeSewa — Customer Portal CSS
   Dashboard · History · Appointment form · Auth pages
   ============================================================================= */

/* ── PORTAL WRAPPER ─────────────────────────────────────────────────────── */
.scp-wrap {
  background: #f1f5f9;
  min-height: calc(100vh - 108px);
  padding: 0 0 48px;
}

/* ── PORTAL HEADER BAR ──────────────────────────────────────────────────── */
.scp-topbar {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  padding: 0;
  margin-bottom: 32px;
}
.scp-topbar-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.scp-topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.scp-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #0d9488);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 800; color: #fff;
  flex-shrink: 0;
}
.scp-welcome { font-size: .9375rem; font-weight: 700; color: #0f172a; }
.scp-welcome span { color: #2563eb; }
.scp-topbar-nav {
  display: flex; align-items: center; gap: 4px;
  list-style: none; margin: 0; padding: 0;
}
.scp-topbar-nav a {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 14px;
  font-size: .875rem; font-weight: 600; color: #64748b;
  text-decoration: none;
  border-radius: 8px;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.scp-topbar-nav a:hover { background: #f1f5f9; color: #1e293b; }
.scp-topbar-nav a.active { background: #eff6ff; color: #2563eb; }
.scp-topbar-nav .logout-link { color: #ef4444 !important; }
.scp-topbar-nav .logout-link:hover { background: #fef2f2 !important; }

/* ── PORTAL BODY GRID ───────────────────────────────────────────────────── */
.scp-body {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
  align-items: start;
}
.scp-body.no-sidebar { grid-template-columns: 1fr; }

/* ── SIDEBAR ────────────────────────────────────────────────────────────── */
.scp-sidebar {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  overflow: hidden;
  position: sticky;
  top: 80px;
}
.scp-sidebar-user {
  padding: 20px 16px;
  background: linear-gradient(135deg, #0f172a, #1a2744);
  text-align: center;
}
.scp-sidebar-avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #0d9488);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 800; color: #fff;
  margin: 0 auto 10px;
  border: 3px solid rgba(255,255,255,.15);
}
.scp-sidebar-name { font-size: .9375rem; font-weight: 700; color: #fff; margin-bottom: 3px; }
.scp-sidebar-phone { font-size: .8125rem; color: rgba(255,255,255,.5); }
.scp-sidebar-nav { padding: 8px 0; }
.scp-sidebar-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 18px;
  font-size: .875rem; font-weight: 600; color: #374151;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: all .15s;
}
.scp-sidebar-nav a i { width: 16px; text-align: center; color: #94a3b8; transition: color .15s; }
.scp-sidebar-nav a:hover { background: #f8fafc; color: #2563eb; border-left-color: #2563eb; }
.scp-sidebar-nav a:hover i { color: #2563eb; }
.scp-sidebar-nav a.active { background: #eff6ff; color: #2563eb; border-left-color: #2563eb; font-weight: 700; }
.scp-sidebar-nav a.active i { color: #2563eb; }
.scp-sidebar-nav .sep { height: 1px; background: #f1f5f9; margin: 6px 0; }
.scp-sidebar-nav .logout { color: #ef4444; }
.scp-sidebar-nav .logout i { color: #fca5a5; }
.scp-sidebar-nav .logout:hover { background: #fef2f2; border-left-color: #ef4444; }

/* ── PORTAL CONTENT AREA ────────────────────────────────────────────────── */
.scp-content {}

/* Card */
.scp-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 20px;
}
.scp-card:last-child { margin-bottom: 0; }
.scp-card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid #f1f5f9;
  flex-wrap: wrap; gap: 10px;
}
.scp-card-head h2 {
  font-size: 1rem; font-weight: 800; color: #0f172a;
  display: flex; align-items: center; gap: 8px; margin: 0;
}
.scp-card-head h2 i { color: #2563eb; font-size: .9375rem; }
.scp-card-body { padding: 20px 24px; }
.scp-card-body.no-pad { padding: 0; }

/* ── DASHBOARD STATS ────────────────────────────────────────────────────── */
.scp-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.scp-stat {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 20px;
  display: flex; align-items: center; gap: 14px;
  transition: box-shadow .18s, border-color .18s;
}
.scp-stat:hover { box-shadow: 0 4px 16px rgba(0,0,0,.06); border-color: #cbd5e1; }
.scp-stat-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.scp-stat-icon.blue   { background: #eff6ff; color: #2563eb; }
.scp-stat-icon.green  { background: #f0fdf4; color: #16a34a; }
.scp-stat-icon.purple { background: #f5f3ff; color: #7c3aed; }
.scp-stat-icon.amber  { background: #fffbeb; color: #d97706; }
.scp-stat-num  { font-size: 1.625rem; font-weight: 800; color: #0f172a; letter-spacing: -.03em; line-height: 1; }
.scp-stat-label{ font-size: .75rem; color: #94a3b8; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; margin-top: 3px; }

/* ── TABLE ──────────────────────────────────────────────────────────────── */
.scp-table-wrap { overflow-x: auto; }
.scp-table {
  width: 100%; border-collapse: collapse;
  font-size: .875rem;
}
.scp-table th {
  background: #f8fafc;
  font-size: .6875rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: #94a3b8;
  padding: 10px 16px;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap; text-align: left;
}
.scp-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #f1f5f9;
  color: #374151; vertical-align: middle;
  line-height: 1.4;
}
.scp-table tr:last-child td { border-bottom: none; }
.scp-table tr:hover td { background: #f8fafc; }
.scp-table .thumb {
  width: 44px; height: 44px;
  border-radius: 8px; object-fit: cover; display: block;
  background: #eff6ff;
}

/* Badges */
.scp-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 700; padding: 3px 10px;
  border-radius: 100px; white-space: nowrap; text-transform: uppercase; letter-spacing: .06em;
}
.scp-badge.pending  { background: #fffbeb; color: #d97706; }
.scp-badge.active   { background: #f0fdf4; color: #15803d; }
.scp-badge.complete { background: #eff6ff; color: #2563eb; }
.scp-badge.cancel   { background: #fef2f2; color: #dc2626; }
.scp-badge.ongoing  { background: #f0f9ff; color: #0284c7; }
.scp-badge.new      { background: #fdf4ff; color: #9333ea; }

/* Empty state */
.scp-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 48px 24px; color: #94a3b8; text-align: center;
}
.scp-empty i { font-size: 2.5rem; margin-bottom: 12px; color: #e2e8f0; }
.scp-empty p { font-size: .9375rem; margin: 0; }

/* ── TAB NAVIGATION ─────────────────────────────────────────────────────── */
.scp-tabs {
  display: flex; gap: 0;
  border-bottom: 1.5px solid #e2e8f0;
  padding: 0 24px;
  overflow-x: auto;
  scrollbar-width: none;
}
.scp-tabs::-webkit-scrollbar { display: none; }
.scp-tab-btn {
  display: flex; align-items: center; gap: 7px;
  padding: 13px 18px;
  font-size: .875rem; font-weight: 600; color: #94a3b8;
  border: none; background: none; cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1.5px;
  transition: color .15s, border-color .15s;
  white-space: nowrap;
  font-family: 'Plus Jakarta Sans','Inter',sans-serif;
}
.scp-tab-btn:hover { color: #1e293b; }
.scp-tab-btn.active { color: #2563eb; border-bottom-color: #2563eb; }
.scp-tab-btn .count {
  background: #f1f5f9; color: #64748b;
  font-size: 11px; font-weight: 700;
  padding: 2px 7px; border-radius: 100px;
  transition: background .15s, color .15s;
}
.scp-tab-btn.active .count { background: #dbeafe; color: #2563eb; }
.scp-tab-pane { display: none; }
.scp-tab-pane.active { display: block; }

/* ── PAGINATION ─────────────────────────────────────────────────────────── */
.scp-pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 6px; padding: 16px 24px;
  border-top: 1px solid #f1f5f9;
  flex-wrap: wrap;
}
.scp-pagination a, .scp-pagination span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; height: 36px; padding: 0 10px;
  border-radius: 8px; border: 1px solid #e2e8f0;
  font-size: .8125rem; font-weight: 600; color: #374151;
  background: #fff; text-decoration: none;
  transition: all .15s;
}
.scp-pagination a:hover { border-color: #2563eb; color: #2563eb; background: #eff6ff; }
.scp-pagination .current { background: #2563eb; border-color: #2563eb; color: #fff; }

/* ── APPOINTMENT FORM (redesigned) ──────────────────────────────────────── */
.scp-appt-section {
  background: #fff;
  padding: 0;
  margin-bottom: 24px;
}
.scp-appt-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
}
.scp-appt-field { margin-bottom: 0; }
.scp-appt-field.full { grid-column: 1 / -1; }
.scp-appt-field.two  { grid-column: span 2; }
.scp-appt-label {
  display: block; font-size: .6875rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em; color: #374151;
  margin-bottom: 5px;
}
.scp-appt-label .req { color: #ef4444; margin-left: 2px; }
.scp-appt-input {
  width: 100%; background: #f9fafb; border: 1.5px solid #e5e7eb;
  border-radius: 9px; padding: 10px 13px; font-size: .9375rem; color: #1f2937;
  font-family: 'Inter',sans-serif;
  transition: border-color .18s, box-shadow .18s, background .18s; outline: none;
}
.scp-appt-input:focus { border-color: #2563eb; background: #fff; box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.scp-appt-input.is-err { border-color: #ef4444; }
textarea.scp-appt-input { resize: vertical; min-height: 90px; line-height: 1.6; }
.scp-appt-err { font-size: .8125rem; color: #ef4444; margin-top: 3px; display: block; }
/* Captcha in appt form */
.scp-captcha {
  display: flex; align-items: center; gap: 12px;
  background: #f9fafb; border: 1.5px solid #e5e7eb;
  border-radius: 9px; padding: 9px 12px;
}
.scp-captcha.is-err { border-color: #ef4444; }
.scp-captcha img { border-radius: 6px; height: 44px; cursor: pointer; }
.scp-captcha-refresh { background: none; border: none; cursor: pointer; color: #94a3b8; font-size: 11px; padding: 2px 0; display: flex; align-items: center; gap: 3px; font-family:'Inter',sans-serif; transition: color .15s; }
.scp-captcha-refresh:hover { color: #2563eb; }
.scp-captcha-right { flex: 1; }
.scp-captcha-right label { font-size: .6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: #9ca3af; display: block; margin-bottom: 3px; }
.scp-captcha-right input { width: 100%; background: transparent; border: none; outline: none; font-size: .9375rem; color: #1f2937; font-weight: 700; font-family: 'Inter',sans-serif; letter-spacing: .05em; }
.scp-captcha-right input::placeholder { color: #d1d5db; font-weight: 400; letter-spacing: normal; }
/* Fee notice */
.scp-fee { background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; padding: 10px 14px; font-size: .875rem; font-weight: 600; color: #92400e; display: flex; align-items: center; gap: 7px; }
/* Submit btn */
.scp-appt-submit {
  display: flex; align-items: center; gap: 8px; justify-content: center;
  background: #2563eb; color: #fff; font-size: .9375rem; font-weight: 700;
  padding: 12px 28px; border-radius: 10px; border: none; cursor: pointer;
  font-family: 'Plus Jakarta Sans','Inter',sans-serif;
  box-shadow: 0 2px 12px rgba(37,99,235,.3);
  transition: background .18s, transform .15s; letter-spacing: .01em;
}
.scp-appt-submit:hover { background: #1d4ed8; transform: translateY(-1px); }
.scp-appt-submit:disabled { opacity: .6; cursor: default; transform: none; }
/* Honeypot */
.scp-hp { position: absolute; opacity: 0; height: 0; width: 0; overflow: hidden; pointer-events: none; }

/* ── AUTH PAGES (login / register) ─────────────────────────────────────── */
.scp-auth-wrap {
  min-height: calc(100vh - 108px);
  background: #f1f5f9;
  display: flex; align-items: center; justify-content: center;
  padding: 40px 16px;
}
.scp-auth-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  overflow: hidden;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 4px 24px rgba(0,0,0,.06);
}
.scp-auth-header {
  background: linear-gradient(135deg, #0f172a, #1a2744);
  padding: 32px 32px 28px;
  text-align: center;
}
.scp-auth-logo { height: 48px; width: auto; margin: 0 auto 16px; display: block; }
.scp-auth-title { font-size: 1.25rem; font-weight: 800; color: #fff; margin: 0 0 6px; }
.scp-auth-sub { font-size: .875rem; color: rgba(255,255,255,.55); margin: 0; }
.scp-auth-body { padding: 28px 32px 32px; }
.scp-auth-field { margin-bottom: 16px; }
.scp-auth-field label { display: block; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: #374151; margin-bottom: 5px; }
.scp-auth-field label .req { color: #ef4444; }
.scp-auth-input {
  width: 100%; background: #f9fafb; border: 1.5px solid #e5e7eb;
  border-radius: 10px; padding: 11px 14px; font-size: .9375rem; color: #1f2937;
  font-family: 'Inter',sans-serif;
  transition: border-color .18s, box-shadow .18s, background .18s; outline: none;
}
.scp-auth-input:focus { border-color: #2563eb; background: #fff; box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.scp-auth-input.is-err { border-color: #ef4444; }
.scp-auth-err { font-size: .8125rem; color: #ef4444; margin-top: 4px; display: block; }
.scp-auth-input-group { display: flex; gap: 8px; }
.scp-auth-input-group .scp-auth-input { flex: 1; }
.scp-otp-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 11px 16px;
  background: #2563eb; color: #fff; font-size: .8125rem; font-weight: 700;
  border: none; border-radius: 10px; cursor: pointer; white-space: nowrap;
  font-family: 'Plus Jakarta Sans','Inter',sans-serif;
  transition: background .15s;
}
.scp-otp-btn:hover { background: #1d4ed8; }
.scp-auth-submit {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; background: #2563eb; color: #fff; font-size: .9375rem; font-weight: 700;
  padding: 13px; border-radius: 10px; border: none; cursor: pointer;
  font-family: 'Plus Jakarta Sans','Inter',sans-serif;
  box-shadow: 0 2px 12px rgba(37,99,235,.3);
  transition: background .18s, transform .15s; letter-spacing: .01em; margin-top: 4px;
}
.scp-auth-submit:hover { background: #1d4ed8; transform: translateY(-1px); }
.scp-auth-footer { text-align: center; padding: 0 32px 24px; font-size: .875rem; color: #64748b; }
.scp-auth-footer a { color: #2563eb; font-weight: 700; text-decoration: none; }
.scp-auth-alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 10px; padding: 12px 14px; color: #15803d; font-size: .875rem; font-weight: 600; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.scp-auth-alert-error   { background: #fef2f2; border: 1px solid #fecaca; border-radius: 10px; padding: 12px 14px; color: #dc2626; font-size: .875rem; margin-bottom: 16px; }
.scp-divider { display: flex; align-items: center; gap: 12px; margin: 16px 0; color: #94a3b8; font-size: .8125rem; }
.scp-divider::before,.scp-divider::after { content:''; flex:1; height:1px; background:#e2e8f0; }

/* ── RESPONSIVE ─────────────────────────────────────────────────────────── */
@media(max-width:1023px) {
  .scp-body { grid-template-columns: 1fr; }
  .scp-sidebar { position: static; display: none; } /* hidden on mobile, use topbar nav */
}
@media(max-width:767px) {
  .scp-stats { grid-template-columns: 1fr 1fr; }
  .scp-appt-grid { grid-template-columns: 1fr 1fr; }
  .scp-appt-field.full { grid-column: 1 / -1; }
  .scp-appt-field.two  { grid-column: 1 / -1; }
  .scp-topbar-nav a span { display: none; }
}
@media(max-width:479px) {
  .scp-stats { grid-template-columns: 1fr; }
  .scp-appt-grid { grid-template-columns: 1fr; }
  .scp-appt-field.two  { grid-column: 1 / -1; }
}
