/*
 * Swimming Pool Management System
 * Premium Custom Stylesheet
 */

/* Import Outfit Font */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

/* Color Variables */
:root {
  --bg-primary: #0b0f19;
  --bg-secondary: #111827;
  --bg-card: rgba(31, 41, 55, 0.45);
  --bg-card-hover: rgba(31, 41, 55, 0.7);
  --border-color: rgba(75, 85, 99, 0.2);
  --border-color-active: rgba(6, 182, 212, 0.5);
  
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  
  --accent-cyan: #06b6d4;
  --accent-teal: #14b8a6;
  --accent-indigo: #6366f1;
  
  --status-success: #10b981;
  --status-success-bg: rgba(16, 185, 129, 0.15);
  --status-pending: #f59e0b;
  --status-pending-bg: rgba(245, 158, 11, 0.15);
  --status-danger: #ef4444;
  --status-danger-bg: rgba(239, 68, 68, 0.15);
  
  --font-family: 'Outfit', sans-serif;
  --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --glass-blur: blur(12px);
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset and Globals */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  background-image: linear-gradient(rgba(11, 15, 25, 0.88), rgba(11, 15, 25, 0.94)), url('https://images.unsplash.com/photo-1576013551627-0cc20b96c2a7?q=80&w=2070&auto=format&fit=crop');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: var(--text-primary);
  overflow-x: hidden;
  min-height: 100vh;
  line-height: 1.5;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-cyan);
}

/* Base Layout Structure */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Top Header Bar */
.app-header {
  background: rgba(17, 24, 39, 0.8);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-teal));
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.5rem;
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.4);
}

.logo-text h1 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: linear-gradient(to right, #fff, #9ca3af);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-text p {
  font-size: 0.75rem;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Role Selector Tabs */
.role-tabs {
  display: flex;
  gap: 0.5rem;
  background: rgba(31, 41, 55, 0.5);
  padding: 0.35rem;
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.role-btn {
  font-family: var(--font-family);
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 0.6rem 1.2rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition-smooth);
}

.role-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.role-btn.active {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-teal));
  color: #fff;
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.25);
}

/* Main Workspace */
.main-content {
  flex: 1;
  padding: 2rem;
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
}

.dashboard-panel {
  display: none;
  animation: fadeIn 0.4s ease-out forwards;
}

.dashboard-panel.active {
  display: block;
}

/* Glassmorphic Cards */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: var(--card-shadow);
  transition: var(--transition-smooth);
}

.glass-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-color-active);
  box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.45);
}

/* Section Titles */
.section-header {
  margin-bottom: 2rem;
}

.section-header h2 {
  font-size: 1.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-header p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-top: 0.25rem;
}

/* Layout Grids */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

.grid-3-col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.grid-1-3 {
  display: grid;
  grid-template-columns: 1fr 3fr;
  gap: 1.5rem;
}

.grid-3-1 {
  display: grid;
  grid-template-columns: 3fr 1fr;
  gap: 1.5rem;
}

/* Stats Cards */
.stat-card {
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--accent-cyan);
}

.stat-card.cyan::before { background: var(--accent-cyan); }
.stat-card.teal::before { background: var(--accent-teal); }
.stat-card.indigo::before { background: var(--accent-indigo); }
.stat-card.orange::before { background: var(--status-pending); }

.stat-flex {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.stat-info h3 {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
}

.stat-info .stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
}

.stat-info .stat-trend {
  font-size: 0.8rem;
  margin-top: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.stat-trend.up { color: var(--status-success); }
.stat-trend.down { color: var(--status-danger); }

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-cyan);
}

.stat-card.cyan .stat-icon { color: var(--accent-cyan); background: rgba(6, 182, 212, 0.1); }
.stat-card.teal .stat-icon { color: var(--accent-teal); background: rgba(20, 184, 166, 0.1); }
.stat-card.indigo .stat-icon { color: var(--accent-indigo); background: rgba(99, 102, 241, 0.1); }
.stat-card.orange .stat-icon { color: var(--status-pending); background: rgba(245, 158, 11, 0.1); }

/* Buttons & Controls */
.btn {
  font-family: var(--font-family);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  transition: var(--transition-smooth);
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-teal));
  color: #fff;
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.2);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(6, 182, 212, 0.35);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--text-secondary);
}

.btn-danger {
  background: var(--status-danger-bg);
  color: var(--status-danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: var(--status-danger);
  color: #fff;
  transform: translateY(-2px);
}

.btn-success {
  background: var(--status-success-bg);
  color: var(--status-success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
  background: var(--status-success);
  color: #fff;
  transform: translateY(-2px);
}

.btn-icon-only {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 8px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* User Onboarding Portal CSS */
.onboard-container {
  max-width: 800px;
  margin: 0 auto;
}

.stepper {
  display: flex;
  justify-content: space-between;
  margin-bottom: 2.5rem;
  position: relative;
}

.stepper::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--border-color);
  z-index: 1;
  transform: translateY(-50%);
}

.stepper-progress {
  position: absolute;
  top: 50%;
  left: 0;
  width: 0%;
  height: 2px;
  background: linear-gradient(to right, var(--accent-cyan), var(--accent-teal));
  z-index: 1;
  transform: translateY(-50%);
  transition: width 0.4s ease;
}

.step-node {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--text-secondary);
  position: relative;
  z-index: 2;
  transition: var(--transition-smooth);
}

.step-node.active {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.3);
}

.step-node.completed {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-teal));
  border-color: transparent;
  color: #fff;
}

.step-node .step-label {
  position: absolute;
  top: 42px;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  color: var(--text-secondary);
}

.step-node.active .step-label {
  color: var(--accent-cyan);
  font-weight: 600;
}

.step-node.completed .step-label {
  color: var(--text-primary);
}

/* Wizard Steps Panel */
.wizard-step {
  display: none;
}

.wizard-step.active {
  display: block;
  animation: slideUp 0.3s ease-out forwards;
}

/* Form Styles */
.form-group {
  margin-bottom: 1.25rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  letter-spacing: 0.3px;
}

.input-field {
  width: 100%;
  background: rgba(17, 24, 39, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  color: #fff;
  font-family: var(--font-family);
  font-size: 0.95rem;
  transition: var(--transition-smooth);
}

.input-field:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 8px rgba(6, 182, 212, 0.2);
  background: rgba(17, 24, 39, 0.8);
}

.select-field {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239ca3af'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1.25rem;
  padding-right: 2.5rem;
}

/* Custom Checkbox/Radio Grid */
.pool-cards-grid, .plan-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.selectable-card {
  position: relative;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  padding: 1.25rem;
  cursor: pointer;
  transition: var(--transition-smooth);
  background: rgba(31, 41, 55, 0.2);
}

.selectable-card:hover {
  border-color: rgba(6, 182, 212, 0.3);
  background: rgba(31, 41, 55, 0.35);
}

.selectable-card input[type="radio"] {
  position: absolute;
  top: 1rem;
  right: 1rem;
  accent-color: var(--accent-cyan);
  transform: scale(1.1);
}

.selectable-card.selected {
  border-color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.05);
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.1);
}

.card-title {
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 0.25rem;
}

.card-subtitle {
  font-size: 0.8rem;
  color: var(--accent-cyan);
  margin-bottom: 0.5rem;
}

.card-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.card-price {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  margin-top: 0.5rem;
}

/* Upload Area UI */
.upload-zone {
  border: 2px dashed var(--border-color);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition-smooth);
  background: rgba(17, 24, 39, 0.4);
  position: relative;
  margin-bottom: 1.5rem;
}

.upload-zone:hover {
  border-color: var(--accent-cyan);
  background: rgba(17, 24, 39, 0.6);
}

.upload-zone.dragover {
  border-color: var(--accent-teal);
  background: rgba(20, 184, 166, 0.1);
}

.upload-icon {
  font-size: 2rem;
  color: var(--accent-cyan);
  margin-bottom: 0.75rem;
  display: block;
}

.upload-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.upload-text strong {
  color: var(--accent-cyan);
}

.upload-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.file-preview-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.6rem 1rem;
  margin-top: 0.5rem;
}

.file-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.file-info i {
  color: var(--accent-teal);
}

.file-remove {
  color: var(--status-danger);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 2px;
}

/* Checkout Simulator */
.checkout-details {
  background: rgba(17, 24, 39, 0.6);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.checkout-row {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  font-size: 0.9rem;
}

.checkout-row.total {
  border-top: 1px solid var(--border-color);
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  font-weight: 700;
  font-size: 1.1rem;
  color: #fff;
}

.payment-method-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.payment-badge {
  background: rgba(31, 41, 55, 0.4);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition-smooth);
}

.payment-badge.selected {
  border-color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.1);
  color: var(--accent-cyan);
}

/* Success Receipt Modal/View */
.receipt-wrapper {
  text-align: center;
  padding: 1rem 0;
}

.checkmark-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--status-success-bg);
  border: 2px solid var(--status-success);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  color: var(--status-success);
  font-size: 2.25rem;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.2);
  animation: scaleIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* User Profile & Ticket Pass CSS */
.pass-ticket-grid {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 2rem;
}

.user-profile-header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
}

.user-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent-cyan);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.3);
}

.user-name-id h3 {
  font-size: 1.35rem;
  font-weight: 700;
}

.user-name-id p {
  color: var(--accent-cyan);
  font-family: monospace;
  font-size: 0.9rem;
}

.profile-details-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.detail-item h4 {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.detail-item p {
  font-weight: 500;
  color: #fff;
}

/* Ticket Design */
.ticket-wrapper {
  background: linear-gradient(145deg, #111827, #1f2937);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  box-shadow: var(--card-shadow);
}

.ticket-header {
  padding: 1.25rem;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px dashed var(--border-color);
  text-align: center;
}

.ticket-header h4 {
  font-size: 1rem;
  letter-spacing: 0.5px;
}

.ticket-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.qr-code-box {
  background: #fff;
  padding: 12px;
  border-radius: 12px;
  display: inline-block;
  box-shadow: 0 4px 15px rgba(0,0,0,0.25);
  margin-bottom: 1.25rem;
  position: relative;
}

/* Mask overlay when scan is expired or disabled */
.qr-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(17, 24, 39, 0.9);
  backdrop-filter: blur(2px);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  padding: 1rem;
  text-align: center;
}

.qr-overlay i {
  font-size: 1.75rem;
  color: var(--status-danger);
  margin-bottom: 0.5rem;
}

.qr-overlay.pending i {
  color: var(--status-pending);
}

.qr-overlay span {
  font-size: 0.8rem;
  font-weight: 600;
}

.ticket-status-badge {
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.ticket-status-badge.approved {
  background: var(--status-success-bg);
  color: var(--status-success);
}

.ticket-status-badge.pending {
  background: var(--status-pending-bg);
  color: var(--status-pending);
}

.ticket-status-badge.rejected {
  background: var(--status-danger-bg);
  color: var(--status-danger);
}

.ticket-status-badge.expired {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
}

.ticket-info {
  width: 100%;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
  padding: 0.75rem;
  font-size: 0.8rem;
  text-align: center;
  border: 1px solid var(--border-color);
}

.ticket-cutouts {
  position: absolute;
  width: 20px;
  height: 20px;
  background: var(--bg-primary);
  border-radius: 50%;
  top: 52px;
  z-index: 10;
  border: 1px solid var(--border-color);
}

.ticket-cutout-left {
  left: -11px;
}

.ticket-cutout-right {
  right: -11px;
}

/* Admin & Member Tab Navigation Bar */
.admin-tab-nav {
  display: flex;
  gap: 1rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 0.25rem;
}

.admin-tab-nav::-webkit-scrollbar {
  display: none;
}

.admin-tab-btn {
  flex-shrink: 0;
  white-space: nowrap;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-family);
  font-size: 0.95rem;
  font-weight: 600;
  padding-bottom: 0.75rem;
  cursor: pointer;
  position: relative;
  transition: var(--transition-smooth);
}

.admin-tab-btn:hover {
  color: var(--text-primary);
}

.admin-tab-btn.active {
  color: var(--accent-cyan);
}

.admin-tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent-cyan);
}

.admin-subpanel {
  display: none;
}

.admin-subpanel.active {
  display: block;
}

/* Responsive Table */
.table-container {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.admin-table th {
  background: rgba(31, 41, 55, 0.7);
  padding: 0.9rem 1.25rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
}

.admin-table td {
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
}

.admin-table tbody tr {
  transition: var(--transition-smooth);
}

.admin-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

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

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-approved { background: var(--status-success-bg); color: var(--status-success); }
.badge-pending { background: var(--status-pending-bg); color: var(--status-pending); }
.badge-rejected { background: var(--status-danger-bg); color: var(--status-danger); }

/* Document Verification Split View */
.document-split-viewer {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
}

.viewer-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.doc-card-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.document-image-holder {
  height: 240px;
  background: var(--bg-secondary);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.document-image-holder img,
.document-image-holder iframe {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Simulated Document SVG inside placeholder */
.doc-mock-svg {
  width: 80%;
  height: 80%;
}

.doc-name-banner {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(17, 24, 39, 0.85);
  padding: 0.5rem;
  font-size: 0.75rem;
  text-align: center;
  backdrop-filter: blur(4px);
}

.profile-card-side {
  padding: 1.5rem;
}

.profile-card-side .user-avatar-lg {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent-cyan);
  margin: 0 auto 1rem;
  display: block;
}

.decision-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* SVG Chart Styles */
.chart-container {
  height: 220px;
  position: relative;
  margin-top: 1rem;
}

.chart-svg {
  width: 100%;
  height: 100%;
}

.chart-axis-line {
  stroke: var(--border-color);
  stroke-width: 1px;
}

.chart-grid-line {
  stroke: rgba(255, 255, 255, 0.03);
  stroke-width: 1;
}

.chart-line {
  fill: none;
  stroke: url(#chart-gradient);
  stroke-width: 3;
  stroke-linecap: round;
  animation: drawLine 1.5s ease-out forwards;
}

.chart-area {
  fill: url(#area-gradient);
  opacity: 0.15;
}

.chart-bar {
  fill: url(#bar-gradient);
  rx: 4px;
  transition: height 0.5s ease, y 0.5s ease;
}

.chart-dot {
  fill: var(--accent-cyan);
  stroke: var(--bg-secondary);
  stroke-width: 2;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.chart-dot:hover {
  transform: scale(1.4);
}

/* Security Terminal UI */
.security-dashboard {
  max-width: 1200px;
  margin: 0 auto;
}

.scanner-box {
  width: 100%;
  aspect-ratio: 4 / 3;
  max-width: 440px;
  background: #000;
  border: 2px solid var(--border-color);
  border-radius: 20px;
  position: relative;
  overflow: hidden;
  margin: 0 auto 1.5rem;
  box-shadow: 0 0 25px rgba(0,0,0,0.5);
}

.scanner-box.scanning {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 30px rgba(6, 182, 212, 0.25);
}

.scanner-video-mock {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.65;
  filter: grayscale(40%) contrast(120%);
}

.scanner-grid {
  position: absolute;
  top: 15%;
  left: 15%;
  right: 15%;
  bottom: 15%;
  border: 2px dashed rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.scanner-corner {
  position: absolute;
  width: 20px;
  height: 20px;
  border-color: var(--accent-cyan);
  border-style: solid;
  border-width: 0;
}

.corner-tl { top: -2px; left: -2px; border-top-width: 4px; border-left-width: 4px; border-top-left-radius: 8px; }
.corner-tr { top: -2px; right: -2px; border-top-width: 4px; border-right-width: 4px; border-top-right-radius: 8px; }
.corner-bl { bottom: -2px; left: -2px; border-bottom-width: 4px; border-left-width: 4px; border-bottom-left-radius: 8px; }
.corner-br { bottom: -2px; right: -2px; border-bottom-width: 4px; border-right-width: 4px; border-bottom-right-radius: 8px; }

.scan-laser {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(to right, transparent, var(--accent-cyan), transparent);
  box-shadow: 0 0 12px var(--accent-cyan);
  animation: laserScan 2s infinite ease-in-out;
  pointer-events: none;
}

.scanning-pulse {
  position: absolute;
  font-size: 0.85rem;
  color: var(--accent-cyan);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  top: 1.25rem;
  left: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.scanning-pulse::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--accent-cyan);
  border-radius: 50%;
  animation: pulse 1.2s infinite ease-in-out;
}

/* Fullscreen Flash Overlays */
.flash-feedback {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  animation: fadeOutFeedback 2s ease-out forwards;
  pointer-events: none;
}

.flash-feedback.access-granted {
  background: rgba(16, 185, 129, 0.95);
}

.flash-feedback.access-denied {
  background: rgba(239, 68, 68, 0.95);
}

.flash-title {
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
}

.flash-message {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.9);
}

.flash-avatar {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 4px solid #fff;
  object-fit: cover;
  margin-top: 1rem;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* Security Logs */
.security-logs-card {
  max-height: 480px;
  display: flex;
  flex-direction: column;
}

.logs-list-wrapper {
  overflow-y: auto;
  flex: 1;
}

.log-entry-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.85rem;
}

.log-entry-row:last-child {
  border-bottom: none;
}

.log-time {
  color: var(--text-muted);
  font-family: monospace;
}

.log-name {
  font-weight: 600;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes laserScan {
  0% { top: 15%; }
  50% { top: 85%; }
  100% { top: 15%; }
}

@keyframes pulse {
  0% { transform: scale(0.9); opacity: 0.5; }
  50% { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.5; }
}

@keyframes drawLine {
  to { stroke-dashoffset: 0; }
}

@keyframes fadeOutFeedback {
  0% { opacity: 1; }
  70% { opacity: 1; }
  100% { opacity: 0; }
}

/* ==========================================================================
   Comprehensive Device Responsiveness System (Desktop, Laptop, Tablet, Mobile)
   ========================================================================== */

/* Universal Responsive Base Rules */
img, video, iframe, svg, canvas {
  max-width: 100%;
  height: auto;
}

.portal-hero-title {
  font-size: clamp(1.35rem, 4vw, 2.25rem);
  font-weight: 800;
  background: linear-gradient(to right, #fff, var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  text-align: center;
}

.grievance-grid {
  display: grid;
  grid-template-columns: 2fr 3fr;
  gap: 1.5rem;
}

/* Modals Fluid Sizing */
#login-modal-overlay > div,
#dmc-modal-overlay > div,
#report-export-modal-overlay > div {
  max-height: 92vh;
  overflow-y: auto;
}

/* Large Screens & Desktops (> 1200px) */
@media (min-width: 1201px) {
  .main-content {
    padding: 2rem;
  }
}

/* Laptops & Tablets Landscape (1025px - 1200px) */
@media (max-width: 1200px) {
  .main-content {
    padding: 1.5rem;
  }

  .dashboard-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }

  .grievance-grid {
    grid-template-columns: 1fr;
  }
}

/* Tablets Portrait (769px - 1024px) */
@media (max-width: 1024px) {
  .grid-1-3, .grid-3-1, .grid-3-col, .grievance-grid {
    grid-template-columns: 1fr;
  }

  .pass-ticket-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .document-split-viewer {
    grid-template-columns: 1fr;
  }

  .chart-container {
    height: 200px;
  }
}

/* Tablets & Mobile Landscape (481px - 768px) */
@media (max-width: 768px) {
  .app-header {
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    text-align: center;
  }

  .logo-section {
    justify-content: center;
  }

  .logo-text h1 {
    font-size: 1.1rem;
  }

  .logo-text p {
    font-size: 0.7rem;
  }

  .main-content {
    padding: 1rem 0.75rem;
  }

  .glass-card {
    padding: 1.15rem;
    border-radius: 14px;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .doc-card-container {
    grid-template-columns: 1fr;
  }

  .role-tabs {
    width: 100%;
    justify-content: center;
    overflow-x: auto;
    white-space: nowrap;
    padding: 0.25rem;
  }

  .role-btn {
    flex: 1;
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    justify-content: center;
  }

  .btn {
    min-height: 42px;
  }

  #session-info-panel {
    width: 100%;
    justify-content: center;
    border-top: 1px solid var(--border-color);
    padding-top: 0.5rem;
    margin-top: 0.25rem;
  }
}

/* Mobile Phones (Up to 480px) */
@media (max-width: 480px) {
  .stepper {
    margin-bottom: 1.75rem;
  }

  .step-node {
    width: 32px;
    height: 32px;
    font-size: 0.85rem;
  }

  .step-node .step-label {
    display: none;
  }

  .section-header {
    margin-bottom: 1.25rem;
  }

  .section-header h2 {
    font-size: 1.25rem;
    flex-wrap: wrap;
    justify-content: center;
  }

  .section-header p {
    font-size: 0.85rem;
  }

  .stat-info .stat-value {
    font-size: 1.5rem;
  }

  .stat-info h3 {
    font-size: 0.75rem;
  }

  .payment-method-selector {
    grid-template-columns: 1fr;
  }

  .payment-badge {
    padding: 0.6rem;
    font-size: 0.85rem;
  }

  .pool-cards-grid, .plan-cards-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .selectable-card {
    padding: 0.85rem;
  }

  .profile-details-list {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  #visit-calendar-grid {
    gap: 0.3rem;
    font-size: 0.75rem;
  }

  .calendar-day-cell {
    padding: 0.3rem 0.1rem;
    min-height: 38px;
    font-size: 0.75rem;
  }

  #wizard-buttons {
    gap: 0.5rem;
  }

  #wizard-buttons .btn {
    flex: 1;
    padding: 0.6rem 0.5rem;
    font-size: 0.85rem;
  }

  .scanner-box {
    aspect-ratio: 4 / 3;
    width: 100%;
    margin-bottom: 1rem;
  }

  #login-modal-overlay > div,
  #dmc-modal-overlay > div,
  #report-export-modal-overlay > div {
    padding: 1.25rem !important;
    width: 95% !important;
  }

  .checkout-row {
    font-size: 0.82rem;
  }
}

/* Extra Small Phones (320px - 360px) */
@media (max-width: 360px) {
  .app-header {
    padding: 0.6rem;
  }

  .logo-icon {
    width: 34px;
    height: 34px;
    font-size: 1.2rem;
  }

  .role-btn {
    padding: 0.4rem 0.5rem;
    font-size: 0.75rem;
  }

  .glass-card {
    padding: 0.85rem;
  }

  .portal-hero-title {
    font-size: 1.2rem;
  }

  .user-profile-header {
    flex-direction: column;
    text-align: center;
  }

  .user-avatar {
    margin: 0 auto;
  }
}

