/* 
   Winknzap - Gig Worker Portal
   Premium Dark Aesthetic CSS System
*/

/* --- Core Tokens & Variables --- */
:root {
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* Color Palette */
  --bg-main: #0a0f1d;
  --bg-card: rgba(18, 26, 47, 0.6);
  --bg-card-hover: rgba(26, 38, 68, 0.75);
  --border-glass: rgba(0, 180, 216, 0.15);
  --border-glass-hover: rgba(0, 245, 212, 0.35);

  --color-primary: #00b4d8;
  --color-primary-glow: rgba(0, 180, 216, 0.4);
  --color-accent: #00f5d4;
  --color-accent-glow: rgba(0, 245, 212, 0.4);

  --color-success: #10b981;
  --color-success-glow: rgba(16, 185, 129, 0.3);
  --color-warning: #f59e0b;
  --color-warning-glow: rgba(245, 158, 11, 0.3);
  --color-danger: #ef4444;
  --color-danger-glow: rgba(239, 68, 68, 0.3);
  --color-info: #3b82f6;

  --text-main: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --sidebar-width: 260px;
  --header-height: 80px;
}

/* --- Base Resets & Global Styles --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(0, 180, 216, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(0, 245, 212, 0.06) 0%, transparent 40%);
  background-attachment: fixed;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -0.02em;
}

h1 { font-size: 2.2rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.2rem; }

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: var(--transition-smooth);
}
a:hover {
  color: var(--color-accent);
}

/* --- Layout Architecture --- */
.app-header {
  height: var(--header-height);
  padding: 0 2rem;
  background: rgba(10, 15, 29, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
}

.app-container {
  display: flex;
  min-height: calc(100vh - var(--header-height));
  margin-top: var(--header-height);
}

.app-sidebar {
  width: var(--sidebar-width);
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border-right: 1px solid var(--border-glass);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: fixed;
  top: var(--header-height);
  bottom: 0;
  left: 0;
  z-index: 90;
}

.app-content {
  flex: 1;
  padding: 3rem 3.5rem;
  margin-left: var(--sidebar-width);
  overflow-y: auto;
  min-width: 0; /* Prevents flex items from overflowing */
}

/* --- Navigation Styles --- */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1rem 1.4rem;
  border-radius: 12px;
  color: var(--text-secondary);
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-smooth);
  background: transparent;
  border: none;
  text-align: left;
  font-size: 15px;
  width: 100%;
}

.nav-item i {
  width: 20px;
  height: 20px;
  transition: var(--transition-smooth);
}

.nav-item:hover, .nav-item.active {
  color: var(--text-main);
  background: rgba(0, 180, 216, 0.1);
  box-shadow: inset 0 0 10px rgba(0, 180, 216, 0.05);
}

.nav-item.active {
  color: var(--color-accent);
  border-left: 3px solid var(--color-accent);
  border-radius: 4px 12px 12px 4px;
}

.nav-item:hover i, .nav-item.active i {
  transform: translateX(2px);
  color: var(--color-accent);
}

/* --- Brand Aesthetics & Logo --- */
.logo-area {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  width: 42px;
  height: 42px;
  background: radial-gradient(circle, var(--color-primary-glow), transparent);
  border: 1px solid var(--border-glass-hover);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px var(--color-primary-glow);
}

.electric-glow-icon {
  color: var(--color-accent);
  filter: drop-shadow(0 0 4px var(--color-accent));
}

.logo-text {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-heading);
}

.brand-word {
  display: flex;
  align-items: center;
}

.brand-wink {
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--text-main);
}

.brand-zap {
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--color-primary);
  text-shadow: 0 0 12px var(--color-primary-glow);
}

.brand-sub {
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  color: var(--color-accent);
  background: rgba(0, 245, 212, 0.08);
  padding: 0.2rem 0.5rem;
  border-radius: 5px;
  border: 1px solid rgba(0, 245, 212, 0.18);
  font-weight: 700;
}

/* --- Glassmorphism UI Panels --- */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  padding: 2.2rem;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  transition: var(--transition-smooth);
}


.glass-panel:hover {
  border-color: var(--border-glass-hover);
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary), #0077b6);
  color: #fff;
  box-shadow: 0 4px 15px rgba(0, 180, 216, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 245, 212, 0.4);
  background: linear-gradient(135deg, var(--color-accent), var(--color-primary));
  color: #0a0f1d;
}

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

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

.btn-danger {
  background: linear-gradient(135deg, var(--color-danger), #b91c1c);
  color: white;
  box-shadow: 0 4px 15px var(--color-danger-glow);
}

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5);
  background: #dc2626;
}

.btn-outline {
  background: transparent !important;
}

.btn-danger.btn-outline {
  border: 1px solid var(--color-danger);
  color: var(--color-danger);
}

.btn-danger.btn-outline:hover {
  background: var(--color-danger) !important;
  color: white;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  border-radius: 8px;
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.1rem;
  border-radius: 12px;
}

.btn-full {
  width: 100%;
}

/* --- Stats Grid & Cards --- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.5rem;
}

.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.stat-icon.info {
  background: rgba(59, 130, 246, 0.15);
  color: var(--color-info);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.stat-icon.success {
  background: rgba(16, 185, 129, 0.15);
  color: var(--color-success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.stat-icon.warning {
  background: rgba(245, 158, 11, 0.15);
  color: var(--color-warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.stat-icon.danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--color-danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.stat-icon.primary {
  background: rgba(0, 180, 216, 0.15);
  color: var(--color-primary);
  border: 1px solid rgba(0, 180, 216, 0.3);
}

.stat-data {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 800;
  font-family: var(--font-heading);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* --- Common UI Components --- */
.view-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.view-header h1 {
  background: linear-gradient(120deg, #ffffff, var(--color-primary), var(--color-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.view-header p {
  color: var(--text-secondary);
  font-size: 1rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-info { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.badge-success { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.badge-danger { background: rgba(239, 68, 68, 0.15); color: #f87171; }

.mt-6 { margin-top: 1.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-1 { margin-top: 0.25rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 1rem; }
.justify-center { justify-content: center; }
.text-center { text-align: center; }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.85rem; }
.text-xs { font-size: 0.75rem; }

/* --- Forms & Input Styling --- */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  width: 100%;
}

.form-row {
  display: flex;
  gap: 2.2rem;
  width: 100%;
}

.form-row > .form-group {
  flex: 1;
  min-width: 0;
}

.form-group label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
select,
textarea {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  border-radius: 10px;
  padding: 0.85rem 1.1rem;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: var(--transition-smooth);
  outline: none;
  width: 100%;
}

select option {
  background-color: #0d1527;
  color: #f3f4f6;
  padding: 0.6rem;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 10px var(--color-primary-glow);
  background: rgba(255, 255, 255, 0.08);
}

.photo-dual-input {
  display: flex;
  gap: 0.85rem;
  width: 100%;
  align-items: center;
  min-width: 0;
}

.photo-dual-input button {
  flex-shrink: 0;
}

.photo-dual-input input[type="text"] {
  flex: 1;
  min-width: 0;
}


/* Custom Checkbox Grid & Buttons */
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.custom-checkbox {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  user-select: none;
}

.custom-checkbox input {
  display: none;
}

.custom-checkbox span {
  position: relative;
  padding-left: 28px;
  font-size: 0.95rem;
}

.custom-checkbox span::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  border-radius: 6px;
  transition: var(--transition-smooth);
}

.custom-checkbox input:checked + span::before {
  background: var(--color-primary);
  border-color: var(--color-accent);
  box-shadow: 0 0 8px var(--color-primary-glow);
}

.custom-checkbox input:checked + span::after {
  content: "✓";
  position: absolute;
  left: 5px;
  top: 50%;
  transform: translateY(-50%);
  color: #0a0f1d;
  font-size: 12px;
  font-weight: 900;
}

/* Custom Checkbox Buttons */
.languages-flex {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.custom-checkbox-btn {
  cursor: pointer;
}

.custom-checkbox-btn input {
  display: none;
}

.custom-checkbox-btn span {
  display: inline-block;
  padding: 0.5rem 1.2rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.9rem;
  transition: var(--transition-smooth);
}

.custom-checkbox-btn input:checked + span {
  background: rgba(0, 180, 216, 0.15);
  border-color: var(--color-accent);
  color: var(--color-accent);
  box-shadow: 0 0 10px rgba(0, 245, 212, 0.1);
}

/* Switch Toggle Component */
.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 24px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.1);
  transition: .4s;
  border-radius: 24px;
  border: 1px solid var(--border-glass);
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: var(--text-secondary);
  transition: .4s;
  border-radius: 50%;
}

.switch input:checked + .slider {
  background-color: rgba(0, 180, 216, 0.2);
  border-color: var(--color-primary);
}

.switch input:checked + .slider:before {
  transform: translateX(24px);
  background-color: var(--color-accent);
}

/* File Upload drag area */
.file-upload-drag-area {
  border: 2px dashed var(--border-glass);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.01);
  transition: var(--transition-smooth);
}

.file-upload-drag-area:hover, .file-upload-drag-area.dragover {
  border-color: var(--color-accent);
  background: rgba(0, 245, 212, 0.03);
}

.drag-icon {
  width: 40px;
  height: 40px;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.selected-file-name {
  display: block;
  margin-top: 0.5rem;
  font-weight: 600;
  color: var(--color-accent);
}

/* Validation styling */
.validation-error {
  color: var(--color-danger);
  font-size: 0.85rem;
  margin-top: 0.25rem;
  font-weight: 500;
}

/* --- Dashboard Section Layouts --- */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.list-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--text-secondary);
}

.empty-state .large-icon {
  width: 60px;
  height: 60px;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

/* Dashboard List Items */
.list-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: var(--transition-smooth);
}

.list-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-glass-hover);
}

.item-main {
  display: flex;
  align-items: center;
  gap: 1rem;
}

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

.item-details h4 {
  font-weight: 600;
  color: var(--text-main);
  font-size: 1rem;
}

.item-details p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* --- Profile Page Layout --- */
.profile-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.5rem;
}

.profile-photo-container {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  margin: 0 auto 1.5rem;
  border: 3px solid var(--color-primary);
  padding: 4px;
  box-shadow: 0 0 20px var(--color-primary-glow);
  overflow: hidden;
  position: relative;
}

.profile-photo-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.role-badge {
  display: inline-block;
  padding: 0.25rem 1rem;
  background: rgba(0, 180, 216, 0.15);
  color: var(--color-primary);
  border: 1px solid var(--border-glass);
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-top: 0.5rem;
}

.member-since {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.profile-about-box {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
  padding: 1rem;
  font-size: 0.9rem;
  text-align: left;
  margin-top: 1.5rem;
  border-left: 3px solid var(--color-accent);
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.detail-item {
  display: flex;
  flex-direction: column;
}

.detail-item.full-width {
  grid-column: 1 / -1;
}

.detail-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.detail-value {
  font-size: 1.05rem;
  color: var(--text-main);
  margin-top: 0.25rem;
}

.certificate-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.cert-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
}

.cert-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 500;
}

/* --- Tables & Lists Layout --- */
.table-container-card {
  padding: 0;
  overflow: hidden;
}

.table-header {
  padding: 1.5rem 1.8rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-glass);
  flex-wrap: wrap;
  gap: 1rem;
}

.table-filters {
  display: flex;
  gap: 1rem;
}

.table-filters input, .table-filters select {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  width: auto;
}

.responsive-table {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th, td {
  padding: 1rem 1.8rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

th {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.9rem;
  background: rgba(0, 0, 0, 0.1);
}

td {
  font-size: 0.95rem;
  vertical-align: middle;
}

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

tr:hover td {
  background: rgba(255, 255, 255, 0.015);
}

.applicant-badge-td {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.applicant-badge-td img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-glass);
}

.services-list-td {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.service-tag {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* --- Inline Form & Settings Manager --- */
.inline-form {
  display: flex;
  gap: 0.75rem;
}

.services-edit-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 300px;
  overflow-y: auto;
}

.service-edit-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.service-edit-item span {
  font-weight: 500;
}

.delete-service-btn {
  background: transparent;
  border: none;
  color: var(--color-danger);
  cursor: pointer;
  opacity: 0.7;
  transition: var(--transition-smooth);
}

.delete-service-btn:hover {
  opacity: 1;
  transform: scale(1.1);
}

/* Toggle Options List */
.toggle-options-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 1rem;
}

.toggle-option-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.toggle-title {
  font-weight: 600;
  font-size: 0.95rem;
}

/* --- Modals Systems --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(5, 7, 13, 0.85);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition-smooth);
  overflow-y: auto;
  padding: 1.5rem;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: 100%;
  max-width: 520px;
  border-radius: 20px;
  transform: scale(0.95);
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 4rem);
}

@media (min-width: 769px) {
  .modal-card {
    max-width: 680px;
    max-height: 92vh;
  }
}

.modal-large {
  max-width: 800px;
}

.modal-overlay.active .modal-card {
  transform: scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--border-glass);
  margin-bottom: 1.5rem;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.8rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.modal-close:hover {
  color: var(--color-danger);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.8rem;
  border-top: 1px solid var(--border-glass);
  padding-top: 1.2rem;
  flex-wrap: wrap;
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding-right: 0.5rem;
}

/* Warning alert */
.warning-icon-container {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid var(--color-danger);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  box-shadow: 0 0 15px var(--color-danger-glow);
}

.warning-glow-icon {
  color: var(--color-danger);
  width: 32px;
  height: 32px;
  filter: drop-shadow(0 0 4px var(--color-danger));
}

/* --- Tabbed Login Portal Aesthetics --- */
.auth-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-main);
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(0, 180, 216, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 90% 80%, rgba(0, 245, 212, 0.1) 0%, transparent 50%);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition-smooth);
}

.auth-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.login-card {
  width: 100%;
  max-width: 520px;
  background: rgba(12, 20, 39, 0.7);
  border: 1px solid var(--border-glass);
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.6);
  border-radius: 20px;
  padding: 2.5rem !important;
}

.logo-icon-large {
  width: 54px;
  height: 54px;
  margin: 0 auto 0.75rem;
}

.login-header h2 {
  font-size: 1.8rem;
  color: var(--text-main);
}

.login-header p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Authentication Tabs */
.auth-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  padding: 0.25rem;
  margin: 1.8rem 0;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.auth-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  padding: 0.65rem 0;
  border-radius: 10px;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: var(--transition-smooth);
  font-family: var(--font-heading);
}

.auth-tab-btn i {
  width: 16px;
  height: 16px;
}

.auth-tab-btn:hover {
  color: var(--text-main);
}

.auth-tab-btn.active {
  color: #0a0f1d;
  font-weight: 700;
}

.auth-tab-btn[data-tab="service_provider"].active {
  background: var(--color-primary);
  box-shadow: 0 0 15px var(--color-primary-glow);
}

.auth-tab-btn[data-tab="admin"].active {
  background: var(--color-accent);
  box-shadow: 0 0 15px var(--color-accent-glow);
}

.auth-tab-btn[data-tab="super_admin"].active {
  background: var(--color-success);
  color: white;
  box-shadow: 0 0 15px var(--color-success-glow);
}

.auth-tab-btn[data-tab="super_admin"].active i {
  color: white;
}

/* Tab Content Visibility */
.auth-tab-content {
  display: none;
  animation: fadeIn 0.4s ease;
}

.auth-tab-content.active {
  display: block;
}

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

.login-divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--text-muted);
  margin: 1.5rem 0;
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
}

.login-divider::before, .login-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.login-divider:not(:empty)::before { margin-right: .8em; }
.login-divider:not(:empty)::after { margin-left: .8em; }

.email-select-dropdown {
  background: rgba(255, 255, 255, 0.04);
  font-weight: 500;
}

.auth-subtext {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.link-btn {
  background: transparent;
  border: none;
  color: var(--color-primary);
  font-weight: 700;
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0 0.25rem;
  text-decoration: underline;
  transition: var(--transition-smooth);
}

.link-btn:hover {
  color: var(--color-accent);
}

/* User Profile Badge */
.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  padding: 0.35rem 0.75rem;
  border-radius: 12px;
  margin-left: 1rem;
}

.user-profile-badge img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-glass);
}

.badge-text {
  display: flex;
  flex-direction: column;
}

.badge-text span:first-child {
  font-weight: 600;
  font-size: 0.85rem;
}

.badge-role-tag {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--color-accent);
}

.logout-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-smooth);
  padding: 0.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logout-btn:hover {
  color: var(--color-danger);
  transform: scale(1.05);
}

.sidebar-footer-text {
  text-align: center;
  padding: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  width: 100%;
}


/* --- SVG Graphics/Charts Aesthetics --- */
.chart-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 200px;
  position: relative;
}

.chart-container-large {
  width: 100%;
  height: 220px;
}

.flex-col-center {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.donut-chart-legend {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1rem;
  width: 100%;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 500;
}

.legend-color {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.svg-chart-tooltip {
  fill: #0a0f1d;
  stroke: var(--border-glass);
  stroke-width: 1px;
  rx: 6;
  ry: 6;
}

/* SVG Chart Animations & Paths */
.svg-bar {
  transition: var(--transition-smooth);
  cursor: pointer;
}

.svg-bar:hover {
  fill-opacity: 0.8;
  filter: drop-shadow(0 0 4px var(--color-accent-glow));
}

.svg-donut-slice {
  transition: var(--transition-smooth);
  cursor: pointer;
}

.svg-donut-slice:hover {
  transform: scale(1.03);
  transform-origin: center;
  filter: drop-shadow(0 0 6px var(--color-primary-glow));
}

.svg-line-dot {
  cursor: pointer;
  transition: var(--transition-smooth);
}

.svg-line-dot:hover {
  r: 7;
  stroke-width: 3px;
  filter: drop-shadow(0 0 4px var(--color-accent));
}

/* --- Application Details Viewer Styles --- */
.app-detail-modal-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1.5rem;
}

.app-detail-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.app-detail-main {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 1.5rem;
}

.app-detail-group {
  margin-bottom: 1.5rem;
}

.app-detail-group:last-child {
  margin-bottom: 0;
}

.app-detail-group h4 {
  font-size: 0.95rem;
  font-weight: 700;
  border-left: 3px solid var(--color-primary);
  padding-left: 0.5rem;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.app-info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem 1.5rem;
}

.app-info-item {
  display: flex;
  flex-direction: column;
}

.app-info-item.full-width {
  grid-column: 1 / -1;
}

.app-info-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.app-info-value {
  font-size: 0.9rem;
  color: var(--text-main);
  margin-top: 0.15rem;
}

/* Toast System Styling */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 10000;
}

.toast {
  background: rgba(18, 26, 47, 0.95);
  border: 1px solid var(--border-glass);
  border-radius: 10px;
  padding: 1rem 1.5rem;
  color: var(--text-main);
  font-family: var(--font-body);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  animation: slideIn 0.3s forwards;
  min-width: 300px;
}

.toast.success {
  border-left: 4px solid var(--color-success);
}

.toast.error {
  border-left: 4px solid var(--color-danger);
}

.toast.info {
  border-left: 4px solid var(--color-primary);
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(100%); opacity: 0; }
}

/* Jobs board list grid */
.jobs-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.job-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.5rem;
  height: 100%;
}

.job-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.job-title {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.3;
}

.job-card-details {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.85rem;
}

.job-detail-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
}

.job-detail-row i {
  width: 16px;
  height: 16px;
  color: var(--color-primary);
}

.job-card-footer {
  margin-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 1rem;
}

.job-posted-date {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* --- Responsive Adaptations (Mobile, Tablet, Desktop) --- */
@media (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .profile-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  :root {
    --sidebar-width: 0px; /* Hide desktop sidebar */
  }

  body {
    padding-bottom: 70px; /* Leave space for bottom navigation bar */
  }

  .app-header {
    padding: 0 1rem;
  }

  .role-selector-container {
    padding: 0.2rem 0.4rem;
  }

  .role-btn span {
    display: none; /* Icon-only headers on mobile to save space */
  }

  .role-btn {
    padding: 0.4rem;
  }

  .user-profile-badge {
    margin-left: 0.5rem;
    padding: 0.25rem 0.5rem;
  }

  .badge-text {
    display: none;
  }

  .app-sidebar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    width: 100vw;
    height: 60px;
    border-right: none;
    border-top: 1px solid var(--border-glass);
    padding: 0;
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
    background: rgba(10, 15, 29, 0.95);
    z-index: 1000;
  }

  .sidebar-nav {
    flex-direction: row;
    width: 100%;
    justify-content: space-around;
    gap: 0;
  }

  .nav-item {
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    gap: 0.25rem;
    border-radius: 8px;
    background: transparent !important;
    border: none !important;
    text-align: center;
  }

  .nav-item i {
    width: 18px;
    height: 18px;
  }

  .nav-item:hover i, .nav-item.active i {
    transform: none;
  }

  .sidebar-footer {
    display: none; /* Hide delete account from footer, we put it in settings */
  }

  .app-content {
    margin-left: 0;
    padding: 1.5rem 1rem;
  }

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

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .stat-card {
    padding: 1rem;
    gap: 0.75rem;
  }

  .stat-value {
    font-size: 1.4rem;
  }

  .form-row {
    flex-direction: column;
    gap: 1rem;
  }

  .user-select-grid {
    grid-template-columns: 1fr;
  }

  .app-detail-modal-grid {
    grid-template-columns: 1fr;
  }

  .inline-form {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .view-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .view-header .btn {
    width: 100%;
  }

  .table-filters {
    flex-direction: column;
    width: 100%;
  }

  .table-filters input, .table-filters select {
    width: 100%;
  }

  .modal-card {
    border-radius: 12px;
    padding: 1.2rem;
  }
}

/* Clickable Logo and Document Indicator Enhancements */
.clickable-logo {
  cursor: pointer;
  transition: var(--transition-smooth);
  user-select: none;
}

.clickable-logo:hover {
  transform: scale(1.02);
  filter: brightness(1.1);
}

.clickable-logo:active {
  transform: scale(0.98);
}

.doc-present-indicator {
  color: var(--color-accent);
  font-weight: 600;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(0, 245, 212, 0.08);
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  border: 1px solid rgba(0, 245, 212, 0.15);
}

.doc-absent-indicator {
  color: var(--text-muted);
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

/* --- Form Wizard Spacious Styling --- */
.wizard-form {
  padding: 3rem !important;
}

.wizard-form .form-section {
  margin-bottom: 3.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid rgba(0, 180, 216, 0.15);
}

.wizard-form .form-section:last-of-type {
  border-bottom: none;
  margin-bottom: 1rem;
  padding-bottom: 0;
}

.wizard-form .form-section .section-title {
  font-size: 1.4rem;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--color-primary);
}

.wizard-form .form-section .section-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 2rem;
}

.wizard-form .form-group {
  margin-bottom: 2rem;
}

.wizard-form .form-row {
  margin-bottom: 1.5rem;
}

/* Comment Box review field */
.review-comment-box textarea {
  width: 100%;
  border-color: rgba(245, 158, 11, 0.2);
  background: rgba(0, 0, 0, 0.2);
}

.review-comment-box textarea:focus {
  border-color: var(--color-warning);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.25);
}

/* Document actions display */
.cert-actions a, .cert-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
/* Active Job Postings list max height adjustment */
#adminJobsList {
  max-height: 650px;
}
