/* ==========================================================================
   PayEcho Dashboard & Management Styles
   Shared by /manage-subscription and /orders-support
   Matches PayEcho Brand System (Outfit, Brand Blue #054fcc, Amber #ffd400)
   ========================================================================== */

/* Layout & Containers */
.dash-container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 32px 22px 72px;
}

.dash-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 992px) {
  .dash-grid-split {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 28px;
    align-items: start;
  }
}

/* User Account Bar */
.user-bar {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  box-shadow: 0 4px 16px rgba(5, 79, 204, 0.04);
  margin-bottom: 28px;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 14px;
}

.user-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 12px rgba(5, 79, 204, 0.2);
}

.user-meta h3 {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
}

.user-meta p {
  font-size: 0.82rem;
  color: var(--muted);
}

.user-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Dashboard Cards */
.dash-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 24px;
  box-shadow: var(--shadow);
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  margin-bottom: 24px;
}

.dash-card:hover {
  border-color: #a8c8f0;
}

.dash-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.dash-card-title {
  font-size: 1.25rem;
  font-weight: 750;
  color: var(--ink);
  letter-spacing: -0.015em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.dash-card-title svg {
  width: 22px;
  height: 22px;
  fill: var(--brand);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.badge-active {
  background: #e4f7e8;
  color: #057018;
  border: 1px solid #b8e6c1;
}

.badge-active::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #068e1f;
}

.badge-cancelled {
  background: #fff3d6;
  color: #9c6500;
  border: 1px solid #ffe199;
}

.badge-cancelled::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #e9a820;
}

.badge-expired {
  background: #f1f3f5;
  color: #606f7b;
  border: 1px solid #dee2e6;
}

.badge-failed, .badge-hold {
  background: #fde8e8;
  color: #c81e1e;
  border: 1px solid #f8b4b4;
}

.badge-failed::before, .badge-hold::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #e02424;
}

.badge-provider-play {
  background: #e8f0fe;
  color: #1967d2;
  border: 1px solid #aecbfa;
}

.badge-provider-razorpay {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.badge-lifetime {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #92400e;
  border: 1px solid #fcd34d;
}

/* Big Plan Display Hero */
.plan-hero-box {
  background: linear-gradient(135deg, #f0f6ff 0%, #ffffff 100%);
  border: 2px solid rgba(5, 79, 204, 0.2);
  border-radius: 16px;
  padding: 28px;
  margin-bottom: 24px;
}

.plan-hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 16px;
}

.plan-name-big {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin-bottom: 6px;
}

.plan-price-big {
  font-size: 2.2rem;
  font-weight: 850;
  color: var(--brand);
  letter-spacing: -0.03em;
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.plan-price-big small {
  font-size: 0.95rem;
  font-weight: 550;
  color: var(--muted);
}

.plan-dates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 20px;
  margin-top: 18px;
}

.date-item small {
  display: block;
  font-size: 0.74rem;
  font-weight: 650;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.05em;
  margin-bottom: 3px;
}

.date-item strong {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
}

/* Alert Banners */
.alert-banner {
  padding: 16px 20px;
  border-radius: 12px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 24px;
  font-size: 0.92rem;
  line-height: 1.55;
}

.alert-banner-warning {
  background: #fff8e6;
  border: 1px solid #ffd580;
  color: #8a5700;
}

.alert-banner-danger {
  background: #fde8e8;
  border: 1px solid #f8b4b4;
  color: #9b1c1c;
}

.alert-banner-info {
  background: var(--sky);
  border: 1px solid #b8dcfa;
  color: var(--brand-deep);
}

.alert-banner-success {
  background: #e4f7e8;
  border: 1px solid #b8e6c1;
  color: #057018;
}

.alert-icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  margin-top: 1px;
}

.alert-icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

/* Notice Box (Alternative Billing & Google Play) */
.notice-box {
  background: var(--mist);
  border: 1px solid #bedbf7;
  border-radius: 12px;
  padding: 18px 20px;
  margin-top: 24px;
  font-size: 0.88rem;
  color: var(--ink-soft);
}

.notice-box strong {
  color: var(--brand-deep);
  display: block;
  margin-bottom: 6px;
  font-size: 0.94rem;
}

/* Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 10px;
  border: 1px solid var(--line);
}

.dash-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
  min-width: 680px;
}

.dash-table th {
  background: #f0f6ff;
  color: var(--ink-soft);
  font-weight: 700;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dash-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  vertical-align: middle;
}

.dash-table tr:last-child td {
  border-bottom: none;
}

.dash-table tr:hover td {
  background: rgba(240, 246, 255, 0.4);
}

/* Action Buttons */
.btn-sm {
  padding: 7px 14px;
  font-size: 0.8rem;
  border-radius: 8px;
  font-weight: 600;
}

.btn-outline-danger {
  background: #fff;
  color: #c81e1e;
  border: 1px solid #f8b4b4;
}

.btn-outline-danger:hover {
  background: #fde8e8;
  border-color: #e02424;
}

.btn-outline-brand {
  background: #fff;
  color: var(--brand);
  border: 1px solid var(--brand);
}

.btn-outline-brand:hover {
  background: var(--sky);
}

.btn-danger {
  background: #e02424;
  color: #fff;
  border: 1px solid #c81e1e;
}

.btn-danger:hover {
  background: #c81e1e;
}

/* Forms */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 0.86rem;
  font-weight: 650;
  color: var(--ink);
  margin-bottom: 6px;
}

.form-label .req {
  color: #e02424;
  margin-left: 2px;
}

.form-control {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.92rem;
  color: var(--ink);
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(5, 79, 204, 0.15);
}

.form-control.is-invalid {
  border-color: #e02424;
  background-color: #fff8f8;
}

.form-feedback {
  font-size: 0.78rem;
  color: #e02424;
  margin-top: 4px;
}

.form-hint {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 4px;
}

textarea.form-control {
  resize: vertical;
  min-height: 90px;
}

/* Modal Dialog */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 31, 61, 0.65);
  backdrop-filter: blur(4px);
  z-index: 1050;
  display: none;
  place-items: center;
  padding: 20px;
  overflow-y: auto;
}

.modal-backdrop.is-open {
  display: grid;
}

.modal-dialog {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 540px;
  box-shadow: 0 20px 48px rgba(3, 58, 154, 0.2);
  border: 1px solid var(--line);
  overflow: hidden;
  animation: modalPop 0.2s ease-out;
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.96) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 750;
  color: var(--ink);
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}

.modal-close:hover {
  color: var(--ink);
  background: var(--paper);
}

.modal-body {
  padding: 24px;
  font-size: 0.92rem;
  color: var(--ink-soft);
  max-height: 70vh;
  overflow-y: auto;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  background: var(--paper);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* State Screens: Loading, Empty, Auth Gate */
.state-box {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 56px 24px;
  text-align: center;
  box-shadow: var(--shadow);
  max-width: 520px;
  margin: 40px auto;
}

.state-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--sky);
  color: var(--brand);
  display: grid;
  place-items: center;
  margin: 0 auto 20px;
}

.state-icon svg {
  width: 32px;
  height: 32px;
  fill: currentColor;
}

.state-title {
  font-size: 1.35rem;
  font-weight: 750;
  color: var(--ink);
  margin-bottom: 8px;
}

.state-desc {
  font-size: 0.94rem;
  color: var(--muted);
  max-width: 380px;
  margin: 0 auto 24px;
  line-height: 1.6;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3.5px solid var(--sky);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Auth Modal Tabs */
.auth-tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
}

.auth-tab-btn {
  flex: 1;
  padding: 12px;
  text-align: center;
  background: none;
  border: none;
  font-weight: 650;
  font-size: 0.92rem;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  cursor: pointer;
}

.auth-tab-btn.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
}

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 18px 0;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.auth-divider::before, .auth-divider::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid var(--line);
}

.auth-divider span {
  padding: 0 10px;
}

.btn-google {
  width: 100%;
  background: #fff;
  color: #3c4043;
  border: 1px solid #dadce0;
  border-radius: 8px;
  padding: 11px 16px;
  font-weight: 600;
  font-size: 0.92rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: background-color 0.2s, box-shadow 0.2s;
}

.btn-google:hover {
  background-color: #f8fafd;
  box-shadow: 0 1px 3px rgba(60, 64, 67, 0.15);
}

.btn-google svg {
  width: 20px;
  height: 20px;
}

/* Printable Receipt Styles */
.receipt-paper {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 32px;
  margin-top: 16px;
  font-family: var(--font);
}

.receipt-head {
  display: flex;
  justify-content: space-between;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 16px;
  margin-bottom: 20px;
}

.receipt-brand strong {
  font-size: 1.4rem;
  color: var(--ink);
}

.receipt-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 0.9rem;
}

.receipt-total {
  display: flex;
  justify-content: space-between;
  padding: 14px 0 0;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--brand);
}

@media print {
  body * {
    visibility: hidden;
  }
  #printableReceipt, #printableReceipt * {
    visibility: visible;
  }
  #printableReceipt {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    padding: 20px;
    border: none;
  }
  .no-print {
    display: none !important;
  }
}

/* Support Status Grid */
.support-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.support-status-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
}

.support-status-card h4 {
  font-size: 0.92rem;
  color: var(--ink);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.support-status-card p {
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.5;
}
