/* ===== Client Receipt Management - Pak Seo Tools ===== */
/* Multi-theme: slate (default), red, green, purple, amber, light */

:root,
[data-theme="slate"] {
  --bg: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --border: #475569;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --success: #10b981;
  --danger: #f43f5e;
  --warning: #f59e0b;
  --vip-bg: rgba(59, 130, 246, 0.2);
  --premium-bg: rgba(245, 158, 11, 0.2);
  --regular-bg: rgba(148, 163, 184, 0.15);
}

[data-theme="red"] {
  --bg: #0f0f0f;
  --bg-secondary: #1a1a1a;
  --bg-tertiary: #252525;
  --text: #e5e5e5;
  --text-muted: #a3a3a3;
  --border: #333;
  --primary: #dc2626;
  --primary-hover: #b91c1c;
  --success: #22c55e;
  --danger: #ef4444;
  --warning: #eab308;
  --vip-bg: rgba(220, 38, 38, 0.2);
  --premium-bg: rgba(234, 179, 8, 0.2);
  --regular-bg: rgba(163, 163, 163, 0.2);
}

[data-theme="green"] {
  --bg: #0a1410;
  --bg-secondary: #13201a;
  --bg-tertiary: #1e3329;
  --text: #ecfdf5;
  --text-muted: #9ca3af;
  --border: #2d4a3e;
  --primary: #059669;
  --primary-hover: #047857;
  --success: #34d399;
  --danger: #f87171;
  --warning: #fbbf24;
  --vip-bg: rgba(5, 150, 105, 0.25);
  --premium-bg: rgba(251, 191, 36, 0.2);
  --regular-bg: rgba(156, 163, 175, 0.15);
}

[data-theme="purple"] {
  --bg: #1e1b2e;
  --bg-secondary: #2d2a3e;
  --bg-tertiary: #3d3a52;
  --text: #f3e8ff;
  --text-muted: #a78bfa;
  --border: #4c4866;
  --primary: #7c3aed;
  --primary-hover: #6d28d9;
  --success: #34d399;
  --danger: #fb7185;
  --warning: #fbbf24;
  --vip-bg: rgba(124, 58, 237, 0.25);
  --premium-bg: rgba(251, 191, 36, 0.2);
  --regular-bg: rgba(167, 139, 250, 0.15);
}

[data-theme="amber"] {
  --bg: #1c1917;
  --bg-secondary: #292524;
  --bg-tertiary: #44403c;
  --text: #fef3c7;
  --text-muted: #d6d3d1;
  --border: #57534e;
  --primary: #f59e0b;
  --primary-hover: #d97706;
  --success: #22c55e;
  --danger: #f87171;
  --warning: #fbbf24;
  --vip-bg: rgba(245, 158, 11, 0.25);
  --premium-bg: rgba(251, 191, 36, 0.2);
  --regular-bg: rgba(214, 211, 209, 0.15);
}

[data-theme="light"] {
  --bg: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #e2e8f0;
  --text: #0f172a;
  --text-muted: #64748b;
  --border: #cbd5e1;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --success: #059669;
  --danger: #dc2626;
  --warning: #d97706;
  --vip-bg: rgba(37, 99, 235, 0.12);
  --premium-bg: rgba(217, 119, 6, 0.12);
  --regular-bg: rgba(100, 116, 139, 0.12);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
  transition: background 0.25s ease, color 0.2s ease;
}

.hidden { display: none !important; }

/* ----- Auth ----- */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.auth-box {
  width: 100%;
  max-width: 380px;
  padding: 2rem;
  background: var(--bg-secondary);
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.auth-logo {
  text-align: center;
  margin-bottom: 1.5rem;
}

.auth-logo .logo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: var(--primary);
  color: white;
  font-weight: 800;
  font-size: 1.5rem;
  border-radius: 50%;
  margin-bottom: 0.5rem;
}

.auth-logo h1 { font-size: 1.35rem; margin-bottom: 0.25rem; }
.auth-logo p { color: var(--text-muted); font-size: 0.9rem; }
.auth-form input { width: 100%; padding: 0.75rem 1rem; margin-bottom: 1rem; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text); }
.auth-form button { width: 100%; }
.auth-hint { font-size: 0.8rem; color: var(--text-muted); text-align: center; margin-top: 1rem; }
.auth-hint code { background: var(--bg-tertiary); padding: 0.2rem 0.4rem; border-radius: 4px; }

/* ----- Buttons ----- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #e11d48; }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg-tertiary); }
.btn-block { width: 100%; }
.icon-btn {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 8px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.icon-btn:hover { background: var(--bg-tertiary); }
.action-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, background 0.2s;
}
.action-btn:hover { color: var(--text); background: var(--bg-tertiary); }
.action-btn.danger:hover { color: var(--danger); background: rgba(239, 68, 68, 0.15); }

/* ----- App container (desktop: centered, max-width, zyada padding) ----- */
.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0 1rem;
}
@media (min-width: 1024px) {
  .app {
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    padding-left: 2rem;
    padding-right: 2rem;
    box-shadow: 0 0 0 1px var(--border);
  }
}
@media (min-width: 1280px) {
  .app { padding-left: 2.5rem; padding-right: 2.5rem; }
}

/* ----- Header ----- */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  transition: background 0.25s ease;
}
@media (min-width: 1024px) {
  .header { padding: 1.5rem 2rem; gap: 1.25rem; }
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.header-left .logo-icon {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  background: var(--primary);
  color: white;
  font-weight: 800;
  font-size: 1.25rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.header-left h1 { font-size: 1.15rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
@media (min-width: 640px) {
  .header-left h1 { max-width: none; }
}
.subtitle { font-size: 0.8rem; color: var(--text-muted); display: block; margin-top: 0.15rem; }
.header-right { display: flex; align-items: center; gap: 0.6rem; flex-shrink: 0; }
@media (min-width: 1024px) {
  .header-right { gap: 0.85rem; }
}

/* ----- Actions Bar ----- */
.actions-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 1rem 1.5rem;
  background: var(--primary);
  color: white;
  transition: background 0.25s ease;
}
@media (min-width: 1024px) {
  .actions-bar { padding: 1rem 2rem; }
}
.actions-buttons { display: flex; gap: 0.75rem; }

.actions-bar .btn-ghost { color: white; border-color: rgba(255,255,255,0.5); }
.actions-bar .btn-ghost:hover { background: rgba(255,255,255,0.15); }
.actions-bar .btn-primary { background: white; color: var(--primary); }
.actions-bar .btn-primary:hover { background: #f0f0f0; }

/* ----- Filter Bar ----- */
.filter-bar {
  padding: 1rem 1.5rem;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
@media (min-width: 1024px) {
  .filter-bar { padding: 1.25rem 2rem; gap: 1rem; }
}

.filter-label { font-size: 0.85rem; color: var(--text-muted); margin-right: 0.5rem; }
.filter-btn {
  padding: 0.5rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}
.filter-btn:hover { background: var(--bg-tertiary); }
.filter-btn.active { background: var(--primary); color: white; border-color: var(--primary); }

/* ----- Expiring Soon Alert ----- */
.expiring-alert {
  margin: 0 1rem 1.25rem;
  padding: 1.25rem 1.5rem;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12) 0%, rgba(244, 63, 94, 0.08) 100%);
  border: 1px solid var(--warning);
  border-radius: 14px;
  transition: box-shadow 0.2s ease;
}
@media (min-width: 1024px) {
  .expiring-alert { margin: 0 0 1.5rem; padding: 1.5rem 1.75rem; }
}
.expiring-alert:not(.hidden) { box-shadow: 0 2px 10px rgba(245, 158, 11, 0.15); }
.expiring-alert.hidden { display: none !important; }
.expiring-alert-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1rem;
  font-size: 0.95rem;
}
.expiring-alert-header i { color: var(--warning); }
.expiring-alert-header .btn-remind-all { margin-left: auto; padding: 0.5rem 1rem; font-size: 0.85rem; }
.btn-remind-all-bar { padding: 0.45rem 0.9rem; font-size: 0.85rem; margin-left: 0.5rem; }
.remind-all-modal { max-width: 420px; }
.remind-all-hint { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1rem; line-height: 1.45; }
.remind-all-progress { margin-bottom: 0.75rem; font-size: 0.9rem; font-weight: 500; color: var(--text); }
.remind-all-list {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-secondary);
}
.remind-all-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border);
}
.remind-all-item:last-child { border-bottom: none; }
.remind-all-item.done { color: var(--text-muted); }
.remind-all-item.done .remind-all-icon { color: var(--success); }
.remind-all-item.next { background: var(--bg-tertiary); font-weight: 500; border-left: 3px solid var(--primary); }
.remind-all-item.next .remind-all-icon { color: var(--primary); }
.remind-all-icon { flex-shrink: 0; width: 1.25rem; text-align: center; }
.remind-all-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--text-muted); }
.remind-all-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.remind-all-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.expiring-list {
  margin-bottom: 0.6rem;
  font-size: 0.85rem;
}
.expiring-list:last-child { margin-bottom: 0; }
.expiring-list-title {
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  font-size: 0.8rem;
}
.expiring-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  border-radius: 10px;
  margin-bottom: 0.5rem;
  border: 1px solid var(--border);
}
.expiring-item span:first-child { font-weight: 500; color: var(--text); }
.expiring-item .expiring-meta { color: var(--text-muted); font-size: 0.8rem; }
.expiring-item .btn { padding: 0.5rem 0.85rem; font-size: 0.85rem; }

/* ----- Main content ----- */
.main {
  padding: 1.25rem 1rem 2rem;
  overflow-y: auto;
  flex: 1;
}
@media (min-width: 1024px) {
  .main { padding: 2rem 0 3rem; }
}

.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--bg-secondary);
  border-radius: 14px;
  border: 1px solid var(--border);
  margin-bottom: 2rem;
  padding: 0.25rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: box-shadow 0.2s ease;
}
@media (min-width: 1024px) {
  .table-wrapper { margin-bottom: 2.5rem; padding: 0.5rem; }
}
.table-wrapper:hover { box-shadow: 0 4px 14px rgba(0,0,0,0.12); }

.client-table {
  width: 100%;
  min-width: 1000px;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.client-table th,
.client-table td {
  padding: 0.85rem 1.1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
@media (min-width: 1024px) {
  .client-table th,
  .client-table td {
    padding: 1rem 1.35rem;
  }
}

.client-table th {
  background: var(--bg-tertiary);
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.client-table td:nth-child(1) { min-width: 2.5rem; }
.client-table td:nth-child(2) { min-width: 7rem; }
.client-table td:nth-child(3) { min-width: 12rem; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.client-table td:nth-child(4) { min-width: 6rem; }
.client-table td:nth-child(5), .client-table td:nth-child(6) { min-width: 5.5rem; }
.client-table td:nth-child(7) { min-width: 4.5rem; }
.client-table td:nth-child(8) { min-width: 6rem; }
.client-table td:nth-child(9) { min-width: 5rem; }
.client-table td:nth-child(10) { min-width: 4.5rem; }
.client-table td:nth-child(11) { min-width: 5.5rem; }
.client-table td:nth-child(12) { min-width: 8rem; }
@media (min-width: 1024px) {
  .client-table td:nth-child(3) { max-width: 280px; min-width: 14rem; }
}

.client-table th i { margin-right: 0.5rem; opacity: 0.8; }
.client-table tbody tr { transition: background 0.15s ease; }
.client-table tbody tr:hover { background: var(--bg-tertiary); }
.client-table tbody tr:last-child td { border-bottom: none; }

.phone-masked { font-family: monospace; letter-spacing: 0.05em; }
.phone-reveal { cursor: pointer; color: var(--primary); margin-left: 0.25rem; }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-active { background: rgba(34, 197, 94, 0.2); color: var(--success); }
.badge-expired { background: rgba(239, 68, 68, 0.2); color: var(--danger); }
.badge-paid { background: rgba(34, 197, 94, 0.2); color: var(--success); }
.badge-unpaid { background: rgba(239, 68, 68, 0.2); color: var(--danger); }
.badge-vip { background: var(--vip-bg); color: var(--primary); }
.badge-premium { background: var(--premium-bg); color: var(--warning); }
.badge-regular { background: var(--regular-bg); color: var(--text-muted); }
.status-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; margin-right: 0.35rem; }
.status-dot.active { background: var(--success); }
.status-dot.expired { background: var(--danger); }

.actions-cell { display: flex; gap: 0.4rem; flex-wrap: wrap; }

/* ----- Revenue ----- */
.revenue-section {
  background: var(--bg-secondary);
  border-radius: 14px;
  border: 1px solid var(--border);
  padding: 1.75rem;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  transition: box-shadow 0.2s ease;
}
@media (min-width: 1024px) {
  .revenue-section { padding: 2rem 2.25rem; }
}
.revenue-section:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.1); }

.revenue-section h2 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
}

.revenue-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}
@media (min-width: 1024px) {
  .revenue-metrics { gap: 1.5rem; }
}

@media (max-width: 900px) {
  .revenue-metrics { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 500px) {
  .revenue-metrics { grid-template-columns: 1fr; }
}

.revenue-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  min-height: 64px;
  transition: transform 0.15s, box-shadow 0.15s;
}
@media (min-width: 1024px) {
  .revenue-card { padding: 1.35rem 1.6rem; min-height: 68px; }
}
.revenue-card:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }

.revenue-card i {
  font-size: 1.5rem;
  flex-shrink: 0;
  width: 32px;
  text-align: center;
}
.revenue-card-inner { min-width: 0; }
.revenue-card .label {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 0.25rem;
}
.revenue-card .value {
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.2;
}

.revenue-card.total-sales i { color: var(--primary); }
.revenue-card.total-sales .value { color: var(--primary); }
.revenue-card.total-customers i { color: var(--text); }
.revenue-card.total-customers .value { color: var(--text); }
.revenue-card.active-customers i { color: var(--success); }
.revenue-card.active-customers .value { color: var(--success); }
.revenue-card.expired-customers i { color: var(--danger); }
.revenue-card.expired-customers .value { color: var(--danger); }
.revenue-card.expiring-soon-customers i { color: var(--warning, #f59e0b); }
.revenue-card.expiring-soon-customers .value { color: var(--warning, #f59e0b); }
.revenue-card.collected i { color: var(--success); }
.revenue-card.collected .value { color: var(--success); }
.revenue-card.pending i { color: var(--danger); }
.revenue-card.pending .value { color: var(--danger); }

/* ----- Modals ----- */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
  overflow-y: auto;
}

.modal-content {
  background: var(--bg-secondary);
  border-radius: 12px;
  border: 1px solid var(--border);
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.5rem;
}

.modal-content h2 { margin-bottom: 1rem; font-size: 1.2rem; display: flex; align-items: center; gap: 0.5rem; }
.settings-modal-content { max-width: 420px; }
.settings-section { margin-bottom: 1.75rem; padding-bottom: 1.75rem; border-bottom: 1px solid var(--border); }
.settings-section:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
.settings-section h3 { font-size: 0.95rem; margin-bottom: 0.35rem; display: flex; align-items: center; gap: 0.5rem; color: var(--text); }
.settings-hint { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.75rem; line-height: 1.4; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 0.85rem; margin-bottom: 0.35rem; color: var(--text-muted); }
.form-group input,
.form-group select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.9rem;
}
.form-actions { display: flex; gap: 0.5rem; justify-content: flex-end; margin-top: 1.25rem; }

/* ----- Theme Picker ----- */
.theme-picker-content { max-width: 420px; }
.theme-picker-hint { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 1rem; }
.theme-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.theme-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s;
}
.theme-option:hover { border-color: var(--primary); transform: translateY(-2px); }
.theme-option.active { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary); }
.theme-preview {
  width: 100%;
  height: 48px;
  border-radius: 8px;
}
.theme-name { font-size: 0.85rem; font-weight: 600; color: var(--text); }

/* Receipt */
.receipt-content { max-width: 400px; }
.receipt-paper {
  background: white;
  color: #111;
  padding: 1.5rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.receipt-header { text-align: center; border-bottom: 2px solid #111; padding-bottom: 0.75rem; margin-bottom: 1rem; }
.receipt-header .receipt-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--primary);
  color: white;
  font-weight: 800;
  border-radius: 50%;
  margin-bottom: 0.5rem;
}
.receipt-header h2 { font-size: 1.25rem; margin-bottom: 0.25rem; }
.receipt-header p { font-size: 0.8rem; color: #555; }
#receiptBody p { margin-bottom: 0.5rem; display: flex; justify-content: space-between; gap: 1rem; }
#receiptBody .receipt-title { font-weight: 700; margin-top: 0.5rem; }
.receipt-footer { text-align: center; margin-top: 1rem; padding-top: 0.75rem; border-top: 1px dashed #999; font-size: 0.8rem; color: #666; }
.receipt-validity { margin-top: 0.5rem; }
.receipt-validity a { color: var(--primary); }
.receipt-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; }

/* Card (verification) */
.card { border: 1px solid var(--border); border-radius: 12px; background: var(--bg-secondary); }
.text-muted { color: var(--text-muted); font-size: 0.9rem; }
.text-center { text-align: center; }

/* ----- Tablet ----- */
@media (max-width: 900px) {
  .client-table { min-width: 800px; }
}

/* ----- Mobile ----- */
@media (max-width: 768px) {
  .form-row { grid-template-columns: 1fr; }
  .header {
    flex-direction: row;
    align-items: center;
    padding: 0.75rem 1rem;
    gap: 0.5rem;
  }
  .header-right {
    margin-left: auto;
    justify-content: flex-end;
  }
  .actions-bar {
    padding: 0.6rem 1rem;
  }
  .actions-bar .btn { padding: 0.6rem 1rem; min-height: 44px; }
  .filter-bar {
    padding: 0.6rem 1rem;
    gap: 0.4rem;
  }
  .filter-btn {
    padding: 0.5rem 0.75rem;
    min-height: 44px;
  }
  .main { padding: 0.75rem 1rem 1.5rem; }
  .table-wrapper {
    margin-left: 0;
    margin-right: 0;
    border-radius: 12px;
    border: 1px solid var(--border);
    /* Scroll hint on small screens */
    box-shadow: inset -8px 0 12px -8px rgba(0,0,0,0.2);
  }
  .client-table { font-size: 0.8rem; min-width: 780px; }
  .client-table th, .client-table td { padding: 0.65rem 0.75rem; }
  .action-btn {
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
  }
  .revenue-section { padding: 1.25rem; }
  .revenue-metrics { gap: 0.75rem; }
  .revenue-card {
    padding: 0.875rem 1rem;
    min-height: 54px;
  }
  .modal { padding: 0.5rem; align-items: flex-start; padding-top: 1rem; }
  .modal-content { max-height: 85vh; padding: 1.25rem; }
  .btn { min-height: 44px; }
  .icon-btn { width: 44px; height: 44px; }
}

@media (max-width: 480px) {
  .header-left h1 { font-size: 1rem; max-width: 140px; }
  .subtitle { font-size: 0.75rem; }
  .revenue-card .value { font-size: 0.95rem; }
  .expiring-alert { margin-left: 1rem; margin-right: 1rem; }
}

/* ----- Desktop: comfortable width ----- */
@media (min-width: 1200px) {
  .client-table td:nth-child(3) { max-width: 280px; }
}
