/**
 * Noor Water — Customer Panel + Shared Premium UI
 * Mobile-first app panel. Does not affect admin layouts.
 */

/* ── Attractive shared buttons ── */
.btn, .cust-btn, .af-btn {
  min-height: 44px;
  font-family: var(--font-display);
  letter-spacing: -0.01em;
}
.btn-primary, .cust-btn-primary, .af-btn-primary {
  background: linear-gradient(145deg, var(--primary), var(--primary-hover));
  color: #fff !important;
  border: none;
}
.btn-primary:hover, .cust-btn-primary:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}
.btn-lg { min-height: 52px; padding: 15px 28px; font-size: var(--text-base); }
.btn-sm { min-height: 36px; padding: 8px 14px; }

.cust-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: var(--radius-full);
  border: 1.5px solid transparent; font-weight: 700; font-size: var(--text-sm);
  cursor: pointer; font-family: var(--font-display);
  transition: transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease), background var(--duration) var(--ease);
}
.cust-btn-primary { background: linear-gradient(145deg, var(--primary), var(--primary-hover)); color: #fff; }
.cust-btn-outline { background: var(--surface); color: var(--ink); border-color: var(--border); }
.cust-btn-outline:hover { background: var(--surface-2); border-color: var(--primary); color: var(--primary); }
.cust-btn-block { width: 100%; }
.cust-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: var(--space-5);
  box-shadow: var(--shadow-sm);
}

/* ── Auth screens ── */
.auth-screen {
  min-height: 100dvh; display: grid; place-items: center;
  padding: 24px 16px;
  background: #FFFFFF;
}
.auth-card {
  width: min(420px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px 28px;
  box-shadow: var(--shadow-lg);
  animation: nwFadeUp var(--duration-lg) var(--ease);
}
.auth-logo {
  display: flex; justify-content: center; margin-bottom: 20px;
  color: var(--primary); font-size: 36px;
}
.auth-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl); font-weight: 800;
  color: var(--ink); text-align: center; margin: 0 0 6px;
  letter-spacing: -0.02em;
}
.auth-sub {
  text-align: center; color: var(--muted); font-size: var(--text-sm);
  margin: 0 0 24px;
}
.auth-link {
  display: block; text-align: center; margin-top: 18px;
  font-size: var(--text-sm); font-weight: 700; color: var(--primary);
}

@keyframes nwFadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

/* ═══════════════════════════════════════════
   CUSTOMER PANEL SHELL
   ═══════════════════════════════════════════ */
.cp-shell {
  display: flex; min-height: 100dvh;
  background: var(--bg); color: var(--ink);
  font-family: var(--font-sans);
}
.cp-sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.45); backdrop-filter: blur(4px);
  z-index: 300;
}
.cp-sidebar-overlay.open { display: block; }

.cp-sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--cp-sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  z-index: 400;
  transform: translateX(-100%);
  transition: transform var(--duration-lg) var(--ease);
  box-shadow: var(--shadow-lg);
}
.cp-sidebar.open { transform: translateX(0); }

.cp-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 18px 16px;
  font-family: var(--font-display);
  font-weight: 800; font-size: var(--text-lg);
  color: var(--ink); text-decoration: none;
  border-bottom: 1px solid var(--border);
}
.cp-brand-mark {
  width: 36px; height: 36px; border-radius: 12px;
  background: linear-gradient(145deg, var(--secondary), var(--primary));
  color: #fff; display: grid; place-items: center;
}

.cp-nav { flex: 1; overflow-y: auto; padding: 12px 10px; }
.cp-nav-section {
  font-size: 10px; font-weight: 800; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted-light);
  padding: 12px 12px 6px;
}
.cp-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px; border-radius: var(--radius-sm);
  font-size: var(--text-sm); font-weight: 600; color: var(--muted);
  text-decoration: none;
  transition: background var(--duration), color var(--duration), transform var(--duration) var(--ease);
}
.cp-nav-item i, .cp-nav-item [data-lucide] {
  width: 18px; height: 18px; flex-shrink: 0; opacity: 0.85;
}
.cp-nav-item:hover { background: var(--surface-2); color: var(--ink); }
.cp-nav-item.active {
  background: linear-gradient(135deg, var(--primary-light), var(--secondary-light));
  color: var(--primary-dark); font-weight: 700;
}
.cp-nav-badge {
  margin-left: auto; min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: var(--radius-full); background: var(--primary); color: #fff;
  font-size: 11px; font-weight: 800; display: grid; place-items: center;
}

.cp-user-card {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; border-top: 1px solid var(--border);
  background: var(--surface-2);
}
.cp-user-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(145deg, var(--primary), var(--secondary));
  color: #fff; display: grid; place-items: center;
  font-weight: 800; font-size: 14px; flex-shrink: 0;
}
.cp-user-name { font-weight: 700; font-size: var(--text-sm); color: var(--ink); }
.cp-user-email { font-size: 11px; color: var(--muted); max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.cp-main {
  flex: 1; display: flex; flex-direction: column;
  min-width: 0; width: 100%;
}
.cp-topbar {
  position: sticky; top: 0; z-index: 200;
  display: flex; align-items: center; gap: 12px;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 12px;
  background: rgba(255,255,255,0.92); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.cp-topbar-hamburger {
  background: none; border: none; padding: 8px; cursor: pointer;
  color: var(--ink); font-size: 20px; display: grid; place-items: center;
}
.cp-topbar-breadcrumb {
  flex: 1; display: flex; align-items: center; gap: 6px;
  font-size: var(--text-sm); color: var(--muted); min-width: 0;
}
.cp-topbar-breadcrumb a { color: var(--muted); text-decoration: none; font-weight: 600; }
.cp-topbar-breadcrumb .current { color: var(--ink); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-topbar-breadcrumb .sep { font-size: 10px; opacity: 0.5; color: var(--muted); }
.cp-topbar-actions { display: flex; align-items: center; gap: 6px; }
.cp-topbar-icon {
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface);
  display: grid; place-items: center; cursor: pointer; color: var(--muted);
  position: relative; transition: all var(--duration) var(--ease);
}
.cp-topbar-icon:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-light); }
.cp-topbar-dot {
  position: absolute; top: 8px; right: 8px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--danger); border: 2px solid #fff;
}
.cp-topbar-profile {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 10px 4px 4px; border-radius: var(--radius-full);
  border: 1px solid var(--border); background: var(--surface);
  cursor: pointer; position: relative; color: var(--ink);
}
.cp-topbar-profile .avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(145deg, var(--primary), var(--secondary));
  color: #fff; display: grid; place-items: center;
  font-size: 12px; font-weight: 800;
}
.cp-topbar-profile .name { font-size: var(--text-sm); font-weight: 700; display: none; color: var(--ink); }
.cp-topbar-profile .caret { font-size: 10px; color: var(--muted); }

.cp-page {
  flex: 1; padding: 20px 16px 32px;
  max-width: 1100px; width: 100%; margin: 0 auto;
}
.cp-footer {
  padding: 16px; text-align: center;
  font-size: 12px; color: var(--muted);
  border-top: 1px solid var(--border);
}

.cp-page-header {
  display: flex; flex-direction: column; gap: 16px;
  margin-bottom: 24px;
}
.cp-greeting {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 4vw, 1.75rem);
  font-weight: 800; color: var(--ink); margin: 0;
  letter-spacing: -0.02em;
}
.cp-greeting-sub { margin: 4px 0 0; color: var(--muted); font-size: var(--text-sm); }
.cp-page-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Stats */
.cp-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  margin-bottom: 20px;
}
.cp-stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px;
  display: flex; align-items: flex-start; gap: 12px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
  animation: nwFadeUp var(--duration-lg) var(--ease);
}
.cp-stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.cp-stat-icon {
  width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center; flex-shrink: 0; font-size: 16px;
}
.cp-stat-icon.green { background: #DCFCE7; color: #16A34A; }
.cp-stat-icon.blue { background: var(--primary-light); color: var(--primary); }
.cp-stat-icon.purple { background: #EDE9FE; color: #7C3AED; }
.cp-stat-icon.amber { background: #FEF3C7; color: #D97706; }
.cp-stat-label { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.cp-stat-value { font-family: var(--font-display); font-size: var(--text-xl); font-weight: 800; color: var(--ink); letter-spacing: -0.02em; }
.cp-stat-sub { font-size: 11px; color: var(--muted-light); margin-top: 2px; }

.cp-grid-2 {
  display: grid; grid-template-columns: 1fr; gap: 16px;
  margin-bottom: 20px;
}

.cp-delivery-card, .cp-wallet-card, .cp-table-card, .cp-activity-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px;
  box-shadow: var(--shadow-sm);
}
.cp-card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.cp-card-title { font-family: var(--font-display); font-weight: 700; font-size: var(--text-base); color: var(--ink); }
.cp-driver-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.cp-driver-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(145deg, var(--secondary), var(--primary));
  color: #fff; display: grid; place-items: center; font-weight: 800;
}
.cp-driver-name { font-weight: 700; font-size: var(--text-sm); }
.cp-driver-meta { font-size: 12px; color: var(--muted); }
.cp-delivery-status {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--primary-soft); margin-bottom: 14px;
  font-size: var(--text-sm); font-weight: 600;
}
.cp-delivery-status .dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--primary);
  animation: nwPulse 1.6s ease infinite;
}
.cp-delivery-status .eta { margin-left: auto; color: var(--primary-dark); font-weight: 800; }
.cp-delivery-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.cp-wallet-card {
  background: linear-gradient(145deg, var(--primary), var(--secondary-dark));
  color: #fff; border: none;
}
.cp-wallet-label { font-size: 12px; font-weight: 700; opacity: 0.85; text-transform: uppercase; letter-spacing: 0.06em; }
.cp-wallet-balance { font-family: var(--font-display); font-size: 2rem; font-weight: 800; margin: 6px 0; letter-spacing: -0.03em; }
.cp-wallet-sub { font-size: 13px; opacity: 0.85; margin-bottom: 16px; }
.cp-wallet-actions { display: flex; gap: 8px; }
.cp-wallet-actions .btn { background: rgba(255,255,255,0.18); color: #fff; border-color: rgba(255,255,255,0.25); }
.cp-wallet-actions .btn-primary { background: #fff; color: var(--primary-dark) !important; }

.cp-table-card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--border);
}
.cp-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.cp-table th {
  text-align: left; padding: 10px 12px; font-size: 11px;
  font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--muted); border-bottom: 1px solid var(--border);
}
.cp-table td { padding: 14px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.cp-table tr:last-child td { border-bottom: none; }
.cp-table .order-id { font-weight: 800; color: var(--primary); font-variant-numeric: tabular-nums; }
.cp-table .amount { font-weight: 700; font-variant-numeric: tabular-nums; }

.cp-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: var(--radius-full);
  font-size: 11px; font-weight: 700;
}
.cp-badge .dot { width: 6px; height: 6px; border-radius: 50%; }
.cp-badge-delivered { background: #DCFCE7; color: #166534; }
.cp-badge-delivered .dot { background: #16A34A; }
.cp-badge-shipped { background: var(--primary-light); color: var(--primary-dark); }
.cp-badge-shipped .dot { background: var(--primary); }
.cp-badge-pending { background: #FEF3C7; color: #92400E; }
.cp-badge-pending .dot { background: #F59E0B; }
.cp-badge-cancelled { background: #FEE2E2; color: #991B1B; }
.cp-badge-cancelled .dot { background: #DC2626; }

.cp-activity-header { font-family: var(--font-display); font-weight: 700; margin-bottom: 14px; }
.cp-activity-list { display: flex; flex-direction: column; gap: 14px; }
.cp-activity-item { display: flex; gap: 12px; align-items: flex-start; }
.cp-activity-icon {
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; flex-shrink: 0; font-size: 12px;
}
.cp-activity-icon.green { background: #DCFCE7; color: #16A34A; }
.cp-activity-icon.blue { background: var(--primary-light); color: var(--primary); }
.cp-activity-icon.amber { background: #FEF3C7; color: #D97706; }
.cp-activity-text { font-size: var(--text-sm); color: var(--ink); }
.cp-activity-time { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* Order cards (mobile-friendly) */
.cp-order-list { display: flex; flex-direction: column; gap: 12px; }
.cp-order-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
  animation: nwFadeUp var(--duration-lg) var(--ease);
}
.cp-order-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.cp-order-card-top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 10px;
}
.cp-order-meta { display: flex; flex-wrap: wrap; gap: 12px; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.cp-order-meta strong { color: var(--ink); }
.cp-order-card-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Address cards in panel */
.cp-addr-grid { display: grid; gap: 12px; }
.cp-addr-card {
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px;
  transition: border-color var(--duration), box-shadow var(--duration);
}
.cp-addr-card:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.cp-addr-card.is-primary { border-color: var(--primary); background: var(--primary-soft); }
.cp-empty {
  text-align: center; padding: 48px 20px;
  background: var(--surface); border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
}
.cp-empty i, .cp-empty [data-lucide] {
  width: 40px; height: 40px; margin: 0 auto 12px;
  color: var(--muted-light); display: block;
}
.cp-empty p { color: var(--muted); font-size: var(--text-sm); margin-bottom: 16px; }

@keyframes nwPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.2); }
}

.cp-flash {
  padding: 12px 14px; border-radius: var(--radius-sm);
  font-size: var(--text-sm); font-weight: 600; margin-bottom: 16px;
}
.cp-flash-ok { background: #DCFCE7; color: #166534; border: 1px solid #BBF7D0; }
.cp-flash-err { background: #FEE2E2; color: #991B1B; border: 1px solid #FECACA; }

/* Cancel modal */
.cp-modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 500;
  background: rgba(15,23,42,.5); backdrop-filter: blur(6px);
  align-items: flex-end; justify-content: center; padding: 0;
}
.cp-modal-overlay.open { display: flex; }
.cp-modal {
  background: #fff; width: 100%; max-width: 440px;
  border-radius: 16px 16px 0 0; padding: 20px 16px calc(20px + env(safe-area-inset-bottom, 0px));
  box-shadow: var(--shadow-xl); max-height: 90vh; overflow-y: auto;
}
@media (min-width: 640px) {
  .cp-modal-overlay { align-items: center; padding: 16px; }
  .cp-modal { border-radius: 16px; }
}
.cp-modal h3 { font-size: 18px; font-weight: 800; margin: 0 0 6px; }
.cp-modal .cp-modal-sub { font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.cp-reason-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.cp-reason-list label {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; min-height: 48px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: border-color var(--duration), background var(--duration);
}
.cp-reason-list label:has(input:checked) {
  border-color: var(--primary); background: var(--primary-soft);
}
.cp-reason-list input { accent-color: var(--primary); width: 18px; height: 18px; }
.cp-modal textarea {
  width: 100%; min-height: 72px; padding: 12px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-family: inherit; font-size: 14px; resize: vertical;
}
.cp-modal-actions { display: flex; gap: 8px; margin-top: 16px; }
.cp-modal-actions .btn { flex: 1; min-height: 48px; }

/* Customer bottom nav */
.cp-bnav {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 250;
  background: #fff; border-top: 1px solid var(--border);
  padding: 4px 0 calc(4px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -8px 24px rgba(15,23,42,.06);
}
.cp-bnav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; min-height: 52px; padding: 6px 4px;
  font-size: 10px; font-weight: 700; color: var(--muted);
  text-decoration: none; transition: color var(--duration);
}
.cp-bnav a.active { color: var(--primary); }
.cp-bnav a i, .cp-bnav a [data-lucide] { width: 20px; height: 20px; }
.cp-bnav-fab {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: grid; place-items: center; margin-top: -16px;
  box-shadow: 0 6px 16px rgba(37,211,102,.4);
}
.cp-bnav-fab [data-lucide] { width: 20px; height: 20px; color: #fff; }
.cp-bnav-order span:last-child { margin-top: 2px; }

@media (max-width: 899px) {
  .cp-shell.has-cp-bnav .cp-page {
    padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  }
  .cp-shell.has-cp-bnav .cp-footer { display: none; }
  .cp-bnav { display: flex; }
  .cp-topbar-hamburger { display: none; }
  .cp-sidebar { display: none; }
  .cp-sidebar-overlay { display: none !important; }
  .btn, .cp-order-card-actions .btn { min-height: 44px; }
}

/* Desktop */
@media (min-width: 900px) {
  .cp-sidebar {
    position: sticky; transform: none; box-shadow: none; display: flex;
  }
  .cp-sidebar-overlay { display: none !important; }
  .cp-topbar-hamburger { display: none; }
  .cp-topbar-profile .name { display: inline; }
  .cp-page { padding: 28px 28px 40px; }
  .cp-page-header { flex-direction: row; align-items: flex-start; justify-content: space-between; }
  .cp-stats { grid-template-columns: repeat(4, 1fr); gap: 16px; }
  .cp-grid-2 { grid-template-columns: 1.2fr 0.8fr; gap: 20px; }
  .cp-bnav { display: none !important; }
}

/* Checkout CTA visibility boost */
.co-step-actions .btn-primary {
  min-height: 48px;
  font-size: var(--text-sm);
  font-weight: 800;
}
.co-cart {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: none;
  background: var(--surface);
}

/* Quick Add Address modal — mobile full-page handled in order-online blade */
.co-qa-modal .co-map { height: 220px; }
.co-addr-empty {
  text-align: center; padding: 28px 16px;
  border: 2px dashed var(--border); border-radius: var(--radius-lg);
  background: var(--surface-2); margin-bottom: 12px;
}
.co-addr-empty p { color: var(--muted); font-size: var(--text-sm); margin: 8px 0 16px; }
.co-addr-empty .btn { min-height: 48px; font-weight: 800; }
