/* ==========================================================================
   Milvanta Profile & Account Management Stylesheet
   Matches milvanta.in/profile layout and design specifications
   ========================================================================== */

/* Main Container Layout */
.profile-page-main {
  min-height: calc(100vh - 460px);
  padding: 10px 0 60px;
}

.profile-content-container {
  max-width: 920px;
  margin: 0 auto;
}

/* Page Title Typography */
.profile-page-title {
  font-family: var(--serif, "Cormorant Garamond", Georgia, serif);
  font-size: 2.85rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.02em;
  margin: 0 0 24px 0;
  line-height: 1.15;
}

/* Navigation Tabs Bar */
.profile-tabs-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  background: #f1f5f9;
  padding: 6px;
  border-radius: 9999px;
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}

.profile-tabs-bar::-webkit-scrollbar {
  display: none;
}

.profile-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 20px;
  border-radius: 9999px;
  border: 1px solid transparent;
  background: transparent;
  color: #64748b;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: inherit;
}

.profile-tab-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
}

.profile-tab-btn:hover {
  color: #0f172a;
  background: rgba(255, 255, 255, 0.6);
}

.profile-tab-btn.active {
  background: #ffffff;
  color: #0f172a;
  font-weight: 600;
  border-color: #e2e8f0;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05);
}

/* Top Account Overview Card */
.account-overview-card {
  background: #ffffff;
  border: 1px solid #eef2f6;
  border-radius: 20px;
  padding: 28px 32px;
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.04);
  margin-bottom: 28px;
}

.account-overview-top {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 24px;
}

.account-user-avatar {
  width: 60px;
  height: 60px;
  min-width: 60px;
  border-radius: 50%;
  background: #0d2137;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(13, 33, 55, 0.2);
}

.account-user-details {
  display: flex;
  flex-direction: column;
}

.account-user-name {
  font-size: 1.55rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  line-height: 1.2;
}

.account-user-phone {
  font-size: 0.95rem;
  color: #64748b;
  margin: 4px 0 0;
  font-weight: 400;
}

/* Action Buttons Pill Row inside Card */
.account-actions-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.account-action-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #1e293b;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.account-action-pill svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
}

.account-action-pill:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.05);
}

.account-action-pill.logout-pill {
  color: #dc2626;
  border-color: #fee2e2;
  background: #ffffff;
  margin-left: auto;
}

.account-action-pill.logout-pill:hover {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #b91c1c;
}

/* Content Tab Panels */
.tab-panel {
  display: none;
  animation: fadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.tab-panel.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Section Card Container */
.profile-section-card {
  background: #ffffff;
  border: 1px solid #eef2f6;
  border-radius: 18px;
  padding: 24px 28px;
  box-shadow: 0 4px 18px -2px rgba(15, 23, 42, 0.03);
  margin-bottom: 22px;
}

.section-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.section-subtitle {
  font-size: 0.88rem;
  color: #64748b;
  margin: 4px 0 0;
}

/* 1. Profile Information Grid */
.profile-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.info-item {
  background: #f8fafc;
  border: 1px solid #edf2f7;
  border-radius: 12px;
  padding: 16px 18px;
}

.info-item-label {
  font-size: 0.76rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin-bottom: 6px;
}

.info-item-value {
  font-size: 1rem;
  font-weight: 600;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-badge-active {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* 2. Orders Cards List */
.orders-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.order-card {
  background: #ffffff;
  border: 1px solid #eef2f6;
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.03);
  transition: all 0.2s ease;
}

.order-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 6px 20px -2px rgba(15, 23, 42, 0.06);
}

.order-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 10px;
}

.order-id-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.order-id {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
}

.order-date {
  font-size: 0.82rem;
  color: #64748b;
}

.order-status-pill {
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.order-status-pill.delivered {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.order-status-pill.out_for_delivery {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
}

.order-status-pill.confirmed {
  background: #fefce8;
  color: #b45309;
  border: 1px solid #fde68a;
}

.order-items-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.order-item-detailed-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: #f8fafc;
  border: 1px solid #eef2f6;
  border-radius: 12px;
  transition: all 0.15s ease;
}

.order-item-detailed-row:hover {
  background: #f1f5f9;
  border-color: #e2e8f0;
}

.order-item-thumb-box {
  width: 58px;
  height: 58px;
  border-radius: 10px;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.order-item-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.order-item-content {
  flex: 1;
  min-width: 0;
}

.order-item-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.order-item-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.order-item-line-total {
  font-size: 0.98rem;
  font-weight: 800;
  color: #0f172a;
  flex-shrink: 0;
}

.order-item-specs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
  font-size: 0.8rem;
  color: #64748b;
}

.order-item-spec-badge {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #334155;
}

.order-item-spec-qty {
  color: #475569;
}

.order-item-spec-qty strong {
  color: #0f172a;
}

.order-item-spec-unit {
  color: #64748b;
}

/* Order Delivery & Bill Details Card */
.order-delivery-bill-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 16px;
  margin: 14px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.order-destination-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.82rem;
  color: #475569;
  padding-bottom: 10px;
  border-bottom: 1px dashed #cbd5e1;
}

.order-info-line {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.order-info-icon {
  font-size: 0.9rem;
  flex-shrink: 0;
}

.order-info-text strong {
  color: #0f172a;
}

.order-bill-summary-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.bill-metric {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.bill-metric-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #64748b;
}

.bill-metric-val {
  font-size: 0.92rem;
  font-weight: 700;
  color: #0f172a;
}

.bill-metric-val.total-price {
  font-size: 1.05rem;
  font-weight: 800;
  color: #0a3d66;
}

.bill-payment-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
  border-radius: 9999px;
  padding: 3px 10px;
  font-size: 0.75rem;
  font-weight: 700;
}

.payment-check-icon {
  font-weight: 800;
}

.order-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid #f1f5f9;
  flex-wrap: wrap;
  gap: 12px;
}

.order-total-group {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.order-total-label {
  font-size: 0.82rem;
  color: #64748b;
}

.order-total-amount {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0a3d66;
}

.order-actions-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.btn-order-details {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  color: #0a3d66;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-order-details:hover {
  background: #f8fafc;
  border-color: #0a3d66;
}

.address-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #0a3d66;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 8px 18px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.address-add-btn:hover {
  background: #072d4c;
}

.btn-reorder {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f8fafc;
  color: #1e293b;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-reorder:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

/* 3. Saved Addresses Section */
.addresses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
}

.address-card {
  background: #ffffff;
  border: 1px solid #eef2f6;
  border-radius: 16px;
  padding: 22px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.03);
  transition: all 0.2s ease;
}

.address-card.is-default {
  border-color: #2563eb;
  background: #fafcff;
}

.address-tag-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.address-tag {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 9999px;
  background: #f1f5f9;
  color: #475569;
}

.address-default-badge {
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 9999px;
}

.address-recipient {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 4px;
}

.address-phone {
  font-size: 0.85rem;
  color: #64748b;
  margin: 0 0 8px;
}

.address-text {
  font-size: 0.9rem;
  line-height: 1.5;
  color: #334155;
  margin: 0 0 16px;
}

.address-card-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
}

.address-card-btn {
  background: transparent;
  border: none;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  color: #2563eb;
  padding: 4px 6px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.address-card-btn:hover {
  background: #eff6ff;
}

.address-card-btn.delete-btn {
  color: #dc2626;
  margin-left: auto;
}

.address-card-btn.delete-btn:hover {
  background: #fef2f2;
}

/* 4. Subscription Management Section */
.subscription-banner {
  background: linear-gradient(135deg, #0a3d66 0%, #1e4b75 100%);
  color: #ffffff;
  border-radius: 16px;
  padding: 24px 28px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.subscription-banner-text h3 {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 6px;
}

.subscription-banner-text p {
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.88);
  margin: 0;
  max-width: 580px;
  line-height: 1.5;
}

.subscription-cards-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 20px;
}

/* ===================================================
   MODERN SUBSCRIPTION HERO CARD
   =================================================== */
.subscription-hero-card {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 4px 20px -4px rgba(10, 38, 64, 0.05);
  display: flex;
  flex-direction: column;
  gap: 20px;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.subscription-hero-card.is-paused {
  border-color: #fde68a;
  background: #fffdf5;
}

/* 1. Top Identity Row */
.sub-hero-top {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.sub-hero-media {
  flex-shrink: 0;
}

.sub-hero-img {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  object-fit: cover;
  border: 1.5px solid #e2e8f0;
  background: #f8fafc;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.sub-hero-info {
  flex: 1;
  min-width: 240px;
}

.sub-hero-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.sub-badge-status {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 9999px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.sub-badge-status.active {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.sub-badge-status.paused {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.sub-badge-qty {
  font-size: 0.72rem;
  font-weight: 800;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  padding: 3px 10px;
  border-radius: 9999px;
}

.sub-badge-plan {
  font-size: 0.72rem;
  font-weight: 700;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
  padding: 3px 10px;
  border-radius: 9999px;
}

.sub-hero-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #0a3d66;
  margin: 0 0 4px;
  line-height: 1.25;
}

.sub-hero-slot {
  font-size: 0.84rem;
  color: #64748b;
  margin: 0;
}

.sub-hero-top-action {
  flex-shrink: 0;
}

.btn-sub-quick-toggle {
  padding: 7px 16px;
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1.5px solid;
}

.btn-sub-quick-toggle.pause {
  background: #ffffff;
  color: #b45309;
  border-color: #fde68a;
}

.btn-sub-quick-toggle.pause:hover {
  background: #fffbeb;
  border-color: #f59e0b;
}

.btn-sub-quick-toggle.resume {
  background: #059669;
  color: #ffffff;
  border-color: #059669;
}

.btn-sub-quick-toggle.resume:hover {
  background: #047857;
}

/* 2. Three Metric Quick-Glance Tiles Grid */
.sub-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.sub-metric-tile {
  background: #f8fafc;
  border: 1px solid #eef2f6;
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
  transition: border-color 0.2s ease;
}

.sub-metric-tile:hover {
  border-color: #cbd5e1;
}

.sub-metric-header {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sub-metric-icon {
  font-size: 0.95rem;
}

.sub-metric-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #64748b;
  text-transform: uppercase;
}

.sub-metric-val {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.3;
}

.sub-metric-val.text-active {
  color: #0369a1;
}

.sub-metric-val.text-paused {
  color: #b45309;
}

.sub-metric-unit {
  font-size: 0.82rem;
  font-weight: 600;
  color: #64748b;
}

.sub-metric-sub {
  font-size: 0.78rem;
  color: #64748b;
  line-height: 1.4;
}

.sub-address-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.sub-addr-truncate {
  font-size: 0.92rem;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 170px;
  display: inline-block;
}

.sub-rider-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.sub-action-link {
  background: none;
  border: none;
  color: #0284c7;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  flex-shrink: 0;
}

.sub-action-link:hover {
  color: #0369a1;
}

/* 3. Streamlined Ergonomic Action Bar */
.sub-hero-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid #f1f5f9;
}

.sub-hero-actions-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-sub-pill {
  padding: 9px 16px;
  border-radius: 10px;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  border: 1px solid;
}

.btn-pause-secondary {
  background: #ffffff;
  color: #334155;
  border-color: #cbd5e1;
}

.btn-pause-secondary:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

.btn-resume-primary {
  background: #059669;
  color: #ffffff;
  border-color: #059669;
}

.btn-resume-primary:hover {
  background: #047857;
}


.btn-vacation-pill {
  background: #fffbeb;
  color: #b45309;
  border-color: #fde68a;
}

.btn-vacation-pill:hover {
  background: #fef3c7;
  border-color: #f59e0b;
}

.btn-view-cal-pill {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.btn-view-cal-pill:hover {
  background: #bae6fd;
  border-color: #7dd3fc;
  color: #0284c7;
}

.btn-sub-cancel-link {
  background: none;
  border: none;
  color: #ef4444;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 10px;
  transition: color 0.2s;
  text-decoration: underline;
}

.btn-sub-cancel-link:hover {
  color: #b91c1c;
}

/* ===================================================
   TOMORROW'S DROP QUICK-SKIP STRIP
   =================================================== */
.sub-tomorrow-strip {
  background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 100%);
  border: 1.5px solid #86efac;
  border-radius: 16px;
  padding: 14px 20px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.06);
}

.sub-tomorrow-strip.is-paused {
  background: linear-gradient(135deg, #fff7ed 0%, #ffffff 100%);
  border-color: #fdba74;
}

.sub-tomorrow-main {
  flex: 1;
  min-width: 250px;
}

.sub-tomorrow-lead {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.sub-tomorrow-lead-badge {
  font-size: 0.68rem;
  font-weight: 800;
  color: #059669;
  background: #dcfce7;
  padding: 2px 8px;
  border-radius: 9999px;
  letter-spacing: 0.04em;
}

.sub-tomorrow-strip.is-paused .sub-tomorrow-lead-badge {
  color: #c2410c;
  background: #ffedd5;
}

.sub-tomorrow-title {
  font-size: 0.95rem;
  color: #0f172a;
}

.sub-tomorrow-date {
  font-size: 0.9rem;
  font-weight: 700;
  color: #0a3d66;
}

.sub-tomorrow-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.82rem;
}

.sub-tomorrow-status-tag.scheduled {
  color: #059669;
  font-weight: 700;
}

.sub-tomorrow-status-tag.paused {
  color: #dc2626;
  font-weight: 700;
}

.sub-tomorrow-status-tag.checking {
  color: #0284c7;
  font-weight: 700;
}

.sub-tomorrow-status-tag.pending {
  color: #d97706;
  font-weight: 700;
}

.sub-tomorrow-status-tag.ended,
.sub-tomorrow-status-tag.cancelled,
.sub-tomorrow-status-tag.not-started {
  color: #64748b;
  font-weight: 700;
}

.sub-tomorrow-items-text {
  color: #475569;
  font-weight: 600;
}

.btn-tomorrow-toggle-action {
  padding: 9px 18px;
  border-radius: 10px;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-tomorrow-toggle-action.skip {
  background: #ffffff;
  color: #b91c1c;
  border: 1.5px solid #fca5a5;
}

.btn-tomorrow-toggle-action.skip:hover {
  background: #fef2f2;
  border-color: #ef4444;
}

.btn-tomorrow-toggle-action.resume {
  background: #059669;
  color: #ffffff;
  border: 1.5px solid #059669;
}

.btn-tomorrow-toggle-action.resume:hover {
  background: #047857;
}

.btn-tomorrow-toggle-action.disabled,
.btn-tomorrow-toggle-action:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: #f1f5f9;
  color: #94a3b8;
  border: 1px solid #cbd5e1;
}

.sub-tomorrow-cutoff-msg {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Visual 7-Day Morning Delivery Strip */
.morning-calendar-card {
  background: #ffffff;
  border: 1px solid #eef2f6;
  border-radius: 16px;
  padding: 22px;
  margin-top: 20px;
}

/* Monthly Calendar Grid Styles */
.monthly-calendar-container {
  width: 100%;
}

.monthly-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(46px, 1fr));
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
}

.month-cal-weekday {
  text-align: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  padding: 8px 0 4px;
  letter-spacing: 0.5px;
}

.month-cal-day-cell {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  min-height: 74px;
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  box-sizing: border-box;
}

.month-cal-day-cell:hover {
  border-color: #0284c7;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.08);
}

.month-cal-day-cell.is-selected {
  border-color: #0a3d66;
  border-width: 2px;
  background: #f8fafc;
  box-shadow: 0 0 0 3px rgba(10, 61, 102, 0.12);
}

.month-cal-day-cell.is-today {
  border-color: #0284c7;
  background: #f0f9ff;
}

.month-cal-day-cell.is-other-month {
  opacity: 0.35;
  background: #f8fafc;
  pointer-events: none;
}

.month-cal-day-num {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
}

.month-cal-day-cell.is-today .month-cal-day-num {
  color: #0284c7;
  font-weight: 800;
}

.month-cal-day-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 6px;
  text-align: center;
  white-space: nowrap;
  width: 94%;
  box-sizing: border-box;
  text-overflow: ellipsis;
  overflow: hidden;
}

.badge-delivered {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.badge-scheduled {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.badge-today {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.badge-paused {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.badge-none {
  color: #94a3b8;
  font-size: 0.65rem;
}

.calendar-days-track {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.calendar-day-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 6px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.calendar-day-box.is-today {
  border-color: #2563eb;
  background: #eff6ff;
}

.calendar-day-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
}

.calendar-day-num {
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f172a;
}

.calendar-status-dot {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 9999px;
  background: #ecfdf5;
  color: #047857;
  margin-top: 4px;
}

/* Responsive Media Queries */
@media (max-width: 860px) {
  .profile-header-inner {
    padding: 10px 16px;
  }
  
  .profile-nav-links {
    display: none;
  }
  
  .profile-page-title {
    font-size: 2.2rem;
  }
  
  .account-overview-card {
    padding: 22px 20px;
  }

  .calendar-days-track {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 640px) {
  /* Page Container & Layout */
  .profile-page-main {
    padding: 12px 14px 60px;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  .profile-content-container {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .profile-page-title {
    font-size: 1.85rem;
    margin: 0 0 16px 0;
    line-height: 1.2;
  }

  /* Scrollable Pill Navigation Bar */
  .profile-tabs-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 5px;
    margin-bottom: 20px;
    border-radius: 9999px;
    box-sizing: border-box;
  }

  .profile-tabs-bar::-webkit-scrollbar {
    display: none;
  }

  .profile-tab-btn {
    flex-shrink: 0;
    padding: 9px 16px;
    font-size: 0.86rem;
    gap: 6px;
    min-height: 40px;
    box-sizing: border-box;
  }

  .profile-tab-btn svg {
    width: 15px;
    height: 15px;
  }

  /* Account Overview Card */
  .account-overview-card {
    padding: 18px 16px;
    border-radius: 16px;
    margin-bottom: 20px;
  }

  .account-overview-top {
    gap: 14px;
    margin-bottom: 16px;
  }

  .account-user-avatar {
    width: 52px;
    height: 52px;
    min-width: 52px;
    font-size: 1.35rem;
  }

  .account-user-name {
    font-size: 1.35rem;
  }

  .account-user-phone {
    font-size: 0.88rem;
  }

  .account-actions-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
  }

  .account-action-pill {
    padding: 10px 12px;
    font-size: 0.84rem;
    justify-content: center;
    min-height: 42px;
    box-sizing: border-box;
    text-align: center;
  }

  .account-action-pill.logout-pill {
    grid-column: 1 / -1;
    margin-left: 0;
    justify-content: center;
    width: 100%;
  }

  /* Section Cards */
  .profile-section-card {
    padding: 18px 16px;
    border-radius: 16px;
    margin-bottom: 20px;
  }

  .section-header-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 18px;
  }

  .section-header-row > div {
    width: 100%;
  }

  .section-title {
    font-size: 1.15rem;
  }

  .section-subtitle {
    font-size: 0.82rem;
    line-height: 1.45;
  }

  .section-header-row .address-add-btn,
  .section-header-row .btn-sub-pause,
  .section-header-row .address-card-btn {
    align-self: flex-start;
    white-space: nowrap;
    padding: 9px 18px;
    font-size: 0.84rem;
    min-height: 38px;
  }

  /* 1. Profile Information Grid */
  .profile-info-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .info-item {
    padding: 12px 14px;
    border-radius: 10px;
  }

  .info-item-value {
    font-size: 0.95rem;
    word-break: break-word;
    flex-wrap: wrap;
    gap: 6px;
  }

  /* 2. Orders Cards List */
  .order-card {
    padding: 16px;
    border-radius: 14px;
  }

  .order-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding-bottom: 12px;
    margin-bottom: 12px;
  }

  .order-id-group {
    width: 100%;
  }

  .order-id {
    font-size: 0.98rem;
    white-space: nowrap;
    word-break: keep-all;
  }

  .order-date {
    font-size: 0.78rem;
  }

  .order-item-detailed-row {
    padding: 10px;
    gap: 10px;
    border-radius: 10px;
  }

  .order-item-thumb-box {
    width: 50px;
    height: 50px;
    min-width: 50px;
    border-radius: 8px;
  }

  .order-item-heading {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }

  .order-item-title {
    font-size: 0.88rem;
    white-space: normal;
    line-height: 1.35;
  }

  .order-item-line-total {
    font-size: 0.92rem;
    color: #0a3d66;
  }

  .order-item-specs {
    gap: 6px;
    font-size: 0.78rem;
  }

  .order-delivery-bill-card {
    padding: 10px 12px;
    margin: 12px 0;
  }

  .order-destination-info {
    font-size: 0.78rem;
    line-height: 1.4;
  }

  .order-bill-summary-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .bill-payment-tag {
    grid-column: 1 / -1;
    justify-content: center;
    padding: 4px 10px;
    font-size: 0.74rem;
  }

  .order-card-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding-top: 12px;
  }

  .order-total-group {
    justify-content: space-between;
    width: 100%;
  }

  .order-actions-group {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 8px;
  }

  .btn-order-details,
  .btn-reorder {
    width: 100%;
    min-height: 42px;
    justify-content: center;
    font-size: 0.88rem;
    padding: 10px 14px;
    box-sizing: border-box;
  }

  /* 3. Saved Addresses Section */
  .addresses-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .address-card {
    padding: 16px;
    border-radius: 14px;
  }

  .address-recipient {
    font-size: 1rem;
  }

  .address-text {
    font-size: 0.85rem;
    line-height: 1.45;
  }

  .address-card-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 10px;
  }

  .address-card-btn {
    padding: 6px 12px;
    min-height: 38px;
    font-size: 0.82rem;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
  }

  /* 4. Subscription Section */
  .subscription-banner {
    flex-direction: column;
    align-items: stretch;
    padding: 20px 16px;
    border-radius: 16px;
    gap: 14px;
  }

  .subscription-banner-text h3 {
    font-size: 1.2rem;
  }

  .subscription-banner-text p {
    font-size: 0.85rem;
    line-height: 1.45;
  }

  .subscription-banner .account-action-pill {
    width: 100%;
    justify-content: center;
    min-height: 42px;
    box-sizing: border-box;
  }

  .subscription-cards-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  /* Modern Hero Card Responsive Styles */
  .subscription-hero-card {
    padding: 16px;
    border-radius: 16px;
  }

  .sub-hero-top {
    gap: 12px;
  }

  .sub-hero-img {
    width: 60px;
    height: 60px;
    border-radius: 12px;
  }

  .sub-hero-title {
    font-size: 1.15rem;
  }

  .sub-metrics-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .sub-metric-tile {
    padding: 10px 12px;
  }

  .sub-metric-tile:last-child {
    grid-column: 1 / -1;
  }

  .sub-addr-truncate {
    max-width: 220px;
  }

  .sub-hero-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .sub-hero-actions-left {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 8px;
  }

  .btn-sub-pill {
    width: 100%;
    justify-content: center;
    padding: 10px 14px;
  }

  .btn-sub-cancel-link {
    text-align: center;
    width: 100%;
  }

  .sub-tomorrow-strip {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 14px 16px;
  }

  .btn-tomorrow-toggle-action {
    width: 100%;
    text-align: center;
    padding: 10px 16px;
  }

  /* Morning Delivery Schedule Calendar Strip */
  .morning-calendar-card {
    padding: 16px 14px;
    border-radius: 14px;
  }

  /* Dedicated Monthly Delivery Calendar Mobile Styles */
  .monthly-calendar-grid {
    grid-template-columns: repeat(7, minmax(36px, 1fr));
    gap: 4px;
  }

  .month-cal-weekday {
    font-size: 0.7rem;
    padding: 4px 0 2px;
  }

  .month-cal-day-cell {
    min-height: 58px;
    padding: 6px 2px;
    border-radius: 8px;
  }

  .month-cal-day-num {
    font-size: 0.85rem;
  }

  .month-cal-day-badge {
    font-size: 0.58rem;
    padding: 1px 2px;
    letter-spacing: -0.2px;
    width: 98%;
  }

  .calendar-card-header {
    flex-direction: column;
    align-items: stretch !important;
    gap: 12px !important;
  }

  .calendar-nav-controls {
    width: 100%;
    justify-content: space-between;
    gap: 6px !important;
  }

  .cal-selected-day-card {
    padding: 14px 12px !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }

  .cal-selected-day-card .btn-pause-day,
  .cal-selected-day-card .btn-resume-day {
    width: 100%;
    text-align: center;
  }

  .sub-calendar-selector {
    gap: 6px !important;
  }

  .sub-calendar-selector .sub-tab-pill {
    font-size: 0.78rem !important;
    padding: 5px 10px !important;
  }

  .calendar-days-track {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    scroll-snap-type: x mandatory;
  }

  .calendar-days-track::-webkit-scrollbar {
    display: none;
  }

  .calendar-day-box {
    flex: 0 0 calc((100% - 24px) / 4);
    min-width: 70px;
    scroll-snap-align: start;
    padding: 10px 4px;
    border-radius: 10px;
    box-sizing: border-box;
  }

  .calendar-day-name {
    font-size: 0.72rem;
  }

  .calendar-day-num {
    font-size: 1rem;
  }

  .calendar-status-dot {
    font-size: 0.68rem;
    padding: 2px 4px;
  }

  /* Modals on Mobile View */
  .modal-overlay {
    align-items: center;
    justify-content: center;
    padding: 12px;
    box-sizing: border-box;
  }

  .account-panel:not(.subscription-modal-panel),
  .order-details-panel {
    width: 100% !important;
    max-width: 480px !important;
    max-height: calc(100dvh - 32px) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    padding: 22px 16px 20px !important;
    border-radius: 18px !important;
    box-sizing: border-box;
  }

  .order-modal-delivery-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .modal-form-two-col {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  /* Form inputs mobile styling to prevent iOS auto-zoom */
  .account-panel input,
  .account-panel select,
  .account-panel textarea {
    font-size: 16px !important;
    min-height: 44px;
    box-sizing: border-box;
  }

  .account-panel .modal-close {
    width: 36px;
    height: 36px;
    font-size: 1.4rem;
  }

  .account-panel button[type="submit"],
  .account-panel .primary-cart,
  #closeOrderModalBtn,
  #orderModalReorderBtn {
    min-height: 44px;
    font-size: 0.92rem;
  }
}

@media (max-width: 360px) {
  .profile-page-main {
    padding: 10px 8px 50px;
  }

  .account-overview-card,
  .profile-section-card,
  .order-card,
  .address-card,
  .subscription-card {
    padding: 14px 12px;
  }

  .account-actions-row {
    grid-template-columns: 1fr;
  }

  .profile-tab-btn {
    padding: 8px 12px;
    font-size: 0.8rem;
  }

  .calendar-day-box {
    flex: 0 0 calc((100% - 16px) / 3);
    min-width: 64px;
  }
}

/* ===================================================
   ENHANCED ORDER TYPE BADGES & SUBSCRIPTION CUSTOM DAYS
   =================================================== */
.order-type-badge-row {
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.order-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 9999px;
  letter-spacing: 0.2px;
}

.order-type-badge.badge-sub-continuous {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.order-type-badge.badge-sub-custom {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.order-type-badge.badge-store-order {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.btn-order-view-sub {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #eff6ff;
  color: #0284c7;
  border: 1px solid #bae6fd;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-order-view-sub:hover {
  background: #dbeafe;
  border-color: #0284c7;
}

.badge-custom-day {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.badge-plan-ended {
  background: #f1f5f9;
  color: #94a3b8;
  border: 1px solid #e2e8f0;
}

.custom-days-progress-box {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 12px;
  padding: 12px 14px;
  margin-top: 12px;
}

/* ===================================================
   PHASE 1: ORDER FILTERS, RENEW PLAN & INVOICE PRINTING
   =================================================== */
.order-filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
}

.order-filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 9999px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #475569;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: inherit;
}

.order-filter-pill:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a;
}

.order-filter-pill.active {
  background: #0a3d66;
  color: #ffffff;
  border-color: #0a3d66;
  box-shadow: 0 2px 6px rgba(10, 61, 102, 0.2);
}

.order-filter-pill span {
  font-size: 0.78rem;
  opacity: 0.9;
}

/* Renew / Extend Subscription Plan Button */
.btn-renew-sub {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #047857;
  color: #ffffff;
  border: 1px solid #047857;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.btn-renew-sub:hover {
  background: #065f46;
  border-color: #065f46;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(4, 120, 87, 0.25);
}

/* Print Invoice Button */
.btn-print-invoice {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  font-size: 0.86rem;
  font-weight: 700;
  color: #0a3d66;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.btn-print-invoice:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
}

.cal-vacation-btn:hover {
  background: #fef3c7 !important;
  border-color: #f59e0b !important;
}

/* Printable Tax Invoice Styles */
@media print {
  body * {
    visibility: hidden;
  }
  #orderDetailsModal,
  #orderDetailsModal .account-panel,
  #orderDetailsModal .account-panel * {
    visibility: visible !important;
  }
  #orderDetailsModal {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    padding: 20px;
    background: #ffffff !important;
  }
  #orderDetailsModal .modal-close,
  #orderDetailsModal #closeOrderModalBtn,
  #orderDetailsModal #orderModalPrintBtn,
  #orderDetailsModal #orderModalReorderBtn {
    display: none !important;
  }
  #orderDetailsModal .account-panel {
    box-shadow: none !important;
    border: 1px solid #000 !important;
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* ===================================================
   PHASE 2: DOORSTEP INSTRUCTIONS, ALERTS & REPUTATION
   =================================================== */
.sub-low-balance-alert {
  margin-top: 12px;
  padding: 12px 14px;
  background: #fff7ed;
  border: 1.5px solid #fdba74;
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}


.drop-option-label {
  transition: all 0.2s ease;
}

.drop-option-label:hover {
  background: #f8fafc !important;
  border-color: #94a3b8 !important;
}

.drop-option-label.active {
  background: #eff6ff !important;
  border-color: #0284c7 !important;
}

.sub-addr-change-btn:hover,
.sub-instruction-change-btn:hover {
  color: #0369a1 !important;
}

/* ===================================================
   RESPONSIVE MODAL SYSTEM & SUBSCRIPTION MODAL PANEL
   Fixes modal adjustment and clipping across all screen sizes
   =================================================== */

/* Ensure overlay allows vertical scrolling and centers without clipping */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 24, 38, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: clamp(12px, 3vh, 24px) clamp(10px, 2vw, 16px);
  box-sizing: border-box;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal-overlay.hidden {
  display: none !important;
}

/* Universal safe max-height for all account panels */
.account-panel {
  margin: auto;
  box-sizing: border-box;
  max-height: calc(100dvh - 32px);
}

/* Dedicated Subscription Modal Panel */
.subscription-modal-panel {
  width: 100% !important;
  max-width: 520px !important;
  max-height: min(92vh, 760px) !important;
  max-height: min(92dvh, 760px) !important;
  display: flex !important;
  flex-direction: column !important;
  background: #ffffff !important;
  border-radius: 20px !important;
  box-shadow: 0 25px 50px -12px rgba(10, 38, 64, 0.28), 0 0 0 1px rgba(10, 38, 64, 0.08) !important;
  padding: 0 !important;
  overflow: hidden !important;
  position: relative;
  margin: auto;
}

/* Fixed Header */
.sub-modal-header {
  flex-shrink: 0;
  padding: 20px 22px 14px;
  border-bottom: 1px solid #f1f5f9;
  position: relative;
  background: #ffffff;
}

.sub-modal-header .modal-kicker {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #0284c7;
  margin: 0 0 4px;
  text-transform: uppercase;
}

.sub-modal-header h2 {
  font-size: 1.35rem !important;
  color: #0a3d66 !important;
  margin: 0 0 4px !important;
  line-height: 1.25;
}

.sub-modal-header .sub-modal-desc {
  font-size: 0.82rem;
  color: #64748b;
  margin: 0;
  line-height: 1.4;
  padding-right: 32px;
}

.sub-modal-header .modal-close {
  position: absolute;
  top: 16px;
  right: 18px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #475569;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  line-height: 1;
}

.sub-modal-header .modal-close:hover {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fca5a5;
}

/* Form Container */
.sub-modal-form {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow: hidden !important;
  margin: 0;
}

/* Scrollable Body */
.sub-modal-body {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
}

.sub-modal-body::-webkit-scrollbar {
  width: 6px;
}

.sub-modal-body::-webkit-scrollbar-track {
  background: #f8fafc;
}

.sub-modal-body::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.sub-modal-body::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Compact Milk Type Cards */
.profile-milk-type-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.profile-milk-type-grid .sub-type-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 8px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  background: #ffffff;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
}

.profile-milk-type-grid .sub-type-card.active {
  border-color: #0a3d66 !important;
  background: #eff6ff !important;
  box-shadow: 0 4px 12px rgba(10, 61, 102, 0.08);
}

/* Dropdown pack size */
.sub-pack-size-select {
  width: 100%;
  padding: 9px 12px;
  font-size: 0.9rem;
  font-weight: 700;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  background: #ffffff;
  color: #0a3d66;
  cursor: pointer;
}

/* Fixed Footer with Price & Buttons */
.sub-modal-footer {
  flex-shrink: 0;
  padding: 12px 22px 16px;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  box-shadow: 0 -4px 16px rgba(10, 38, 64, 0.05);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sub-modal-price-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px 12px;
}

.sub-modal-plan-label {
  font-size: 0.8rem;
  color: #475569;
  font-weight: 600;
  display: block;
}

.sub-modal-savings-tag {
  font-size: 0.72rem;
  color: #059669;
  font-weight: 700;
  display: inline-block;
  margin-top: 2px;
}

.sub-modal-total-amt {
  font-size: 1.3rem;
  font-weight: 800;
  color: #0a3d66;
  line-height: 1;
}

.sub-modal-daily-rate {
  font-size: 0.76rem;
  color: #64748b;
  font-weight: 600;
  text-align: right;
  display: block;
  margin-bottom: 2px;
}

.sub-modal-actions-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.sub-modal-actions-row .primary-cart {
  flex: 1 1 auto;
  justify-content: center;
  border: none;
  cursor: pointer;
  padding: 11px 16px;
  min-height: 44px;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: 10px;
  white-space: nowrap;
}

.sub-modal-actions-row .btn-sub-pause {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 10px;
  font-weight: 600;
  min-width: 80px;
  text-align: center;
}

/* Mobile Media Query Overrides */
@media (max-width: 640px) {
  .modal-overlay {
    padding: 8px !important;
  }

  .subscription-modal-panel {
    width: 100% !important;
    max-width: 100% !important;
    max-height: calc(100dvh - 16px) !important;
    max-height: calc(100vh - 16px) !important;
    border-radius: 16px !important;
    margin: auto;
  }

  .sub-modal-header {
    padding: 12px 14px 10px;
  }

  .sub-modal-header h2 {
    font-size: 1.15rem !important;
  }

  .sub-modal-header .sub-modal-desc {
    font-size: 0.76rem;
    line-height: 1.35;
  }

  .sub-modal-body {
    padding: 10px 14px;
    gap: 10px;
  }

  .sub-modal-footer {
    padding: 10px 14px 12px;
    gap: 8px;
  }

  .sub-modal-price-bar {
    padding: 6px 10px;
  }

  .sub-modal-total-amt {
    font-size: 1.2rem;
  }

  .sub-modal-actions-row {
    gap: 8px;
  }

  .sub-modal-actions-row .primary-cart {
    padding: 10px 12px;
    min-height: 40px;
    font-size: 0.88rem;
  }

  .sub-modal-actions-row .btn-sub-pause {
    min-height: 40px;
    padding: 0 12px;
    font-size: 0.84rem;
    min-width: 70px;
  }
}




/* Phase 7: Lucide-Style Inline SVG Calendar Status Badges */
.cal-icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  box-sizing: border-box;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.cal-icon-badge svg {
  display: block;
}

.cal-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.badge-scheduled {
  background: #e0f2fe;
  color: #0284c7;
  border: 1px solid #bae6fd;
}

.badge-delivered {
  background: #dcfce7;
  color: #16a34a;
  border: 1px solid #bbf7d0;
}

.badge-today {
  background: #fef3c7;
  color: #d97706;
  border: 1px solid #fde68a;
}

.badge-skipped {
  background: #fee2e2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.badge-vacation {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.badge-paused {
  background: #fee2e2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.badge-pending {
  background: #fef3c7;
  color: #d97706;
  border: 1px solid #fde68a;
}

.badge-failed {
  background: #fee2e2;
  color: #ef4444;
  border: 1px solid #fecaca;
}
.badge-out-for-delivery {
  background: #fef08a;
  color: #854d0e;
  border: 1px solid #fde047;
}

.badge-packed {
  background: #ede9fe;
  color: #6d28d9;
  border: 1px solid #ddd6fe;
}

/* Admin V3 Delivery & Live Status Styles */
.sub-delivery-summary-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 16px;
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sub-delivery-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.sub-delivery-stat-box {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sub-delivery-stat-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sub-delivery-stat-val {
  font-size: 0.92rem;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sub-delivery-alert-failed {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cal-refresh-btn {
  transition: all 0.2s ease;
}

.cal-refresh-btn:hover {
  background: #e2e8f0 !important;
}

/* Phase 4: Order Refund Button & Line Item Checklist */
.btn-order-refund {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #ffffff;
  color: #b91c1c;
  border: 1px solid #fca5a5;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-order-refund:hover {
  background: #fef2f2;
  border-color: #ef4444;
}

.refund-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 0.82rem;
}

.refund-item-row.selected {
  background: #eff6ff;
  border-color: #bfdbfe;
}

/* Mobile Responsiveness for Calendar (down to 320px) */
@media (max-width: 480px) {
  .monthly-calendar-grid {
    grid-template-columns: repeat(7, minmax(36px, 1fr)) !important;
    gap: 4px !important;
  }
  .month-cal-weekday {
    font-size: 0.65rem !important;
    padding: 4px 0 !important;
    letter-spacing: 0 !important;
  }
  .month-cal-day-cell {
    min-height: 52px !important;
    padding: 4px 2px !important;
    border-radius: 6px !important;
  }
  .month-cal-day-num {
    font-size: 0.78rem !important;
  }
  .cal-icon-badge {
    width: 20px !important;
    height: 20px !important;
  }
  .cal-icon-badge svg {
    width: 11px !important;
    height: 11px !important;
  }
  .calendar-legend-bar {
    gap: 8px !important;
    font-size: 0.72rem !important;
  }
}
