/* ============================================
   AZ Khonnect Client Portal - style.css
   ============================================ */

/* --- Custom Properties --- */
:root {
  --color-primary: #1a2744;
  --color-primary-light: #263759;
  --color-blue: #3da5d9;
  --color-blue-hover: #2e8fbf;
  --color-bg: #f5f7fa;
  --color-bg-card: #ffffff;
  --color-text: #1a2744;
  --color-text-secondary: #64748b;
  --color-border: #e2e8f0;
  --color-success: #22c55e;
  --color-warning: #f59e0b;
  --color-error: #ef4444;
  --color-info: #3da5d9;
  --sidebar-width: 240px;
  --topbar-height: 64px;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
  --transition: 0.2s ease;
}

/* --- Dark Mode --- */
[data-theme="dark"] {
  --color-primary: #0f1a2e;
  --color-primary-light: #1a2744;
  --color-bg: #0f172a;
  --color-bg-card: #1e293b;
  --color-text: #e2e8f0;
  --color-text-secondary: #94a3b8;
  --color-border: #334155;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.2);
  --shadow: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.3);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.4);
}


/* --- Portal logo on dark sidebar - always needs light treatment --- */
.sidebar-header .portal-logo,
.auth-logo .portal-logo {
  filter: invert(1) hue-rotate(180deg) brightness(1.2);
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--color-blue); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--color-blue-hover); }

img { max-width: 100%; display: block; }

/* --- Typography --- */
h1 { font-size: 1.75rem; font-weight: 700; }
h2 { font-size: 1.375rem; font-weight: 600; }
h3 { font-size: 1.125rem; font-weight: 600; }
h4 { font-size: 1rem; font-weight: 600; }

/* ============================================
   LOGIN / REGISTER PAGE
   ============================================ */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem 1rem;
  background: linear-gradient(135deg, var(--color-primary) 0%, #263759 50%, var(--color-blue) 100%);
}

.auth-container {
  width: 100%;
  max-width: 440px;
}

.auth-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-logo img {
  height: 48px;
  margin: 0 auto 1rem;
}

.auth-logo h1 {
  color: #fff;
  font-size: 1.5rem;
  font-weight: 700;
}

.auth-logo p {
  color: rgba(255,255,255,0.7);
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.auth-card {
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.auth-tabs {
  display: flex;
  border-bottom: 2px solid var(--color-border);
}

.auth-tab {
  flex: 1;
  padding: 1rem;
  text-align: center;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--color-text-secondary);
  cursor: pointer;
  border: none;
  background: none;
  transition: all var(--transition);
  position: relative;
}

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

.auth-tab.active {
  color: var(--color-blue);
}

.auth-tab.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--color-blue);
}

.auth-form {
  display: none;
  padding: 2rem;
}

.auth-form.active { display: block; }

.auth-footer {
  text-align: center;
  margin-top: 1.5rem;
}

.auth-footer a {
  color: rgba(255,255,255,0.7);
  font-size: 0.875rem;
}

.auth-footer a:hover { color: #fff; }

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

.form-group label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  margin-bottom: 0.375rem;
}

.form-control {
  width: 100%;
  padding: 0.6875rem 0.875rem;
  font-family: inherit;
  font-size: 0.9375rem;
  color: var(--color-text);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--color-blue);
  box-shadow: 0 0 0 3px rgba(61,165,217,0.15);
}

.form-control::placeholder { color: var(--color-text-secondary); opacity: 0.6; }

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

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.875rem center;
  padding-right: 2.5rem;
}

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

.form-hint {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  margin-top: 0.25rem;
}

.forgot-link {
  display: block;
  text-align: right;
  font-size: 0.8125rem;
  margin-top: -0.5rem;
  margin-bottom: 1.25rem;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6875rem 1.5rem;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  line-height: 1.4;
}

.btn-primary {
  background: var(--color-blue);
  color: #fff;
}

.btn-primary:hover { background: var(--color-blue-hover); color: #fff; transform: translateY(-1px); box-shadow: var(--shadow-md); }

.btn-secondary {
  background: var(--color-bg);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.btn-secondary:hover { background: var(--color-border); }

.btn-danger {
  background: var(--color-error);
  color: #fff;
}

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

.btn-sm { padding: 0.4375rem 1rem; font-size: 0.8125rem; }

.btn-block { width: 100%; }

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ============================================
   LAYOUT - SIDEBAR + MAIN
   ============================================ */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
  width: var(--sidebar-width);
  background: var(--color-primary);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar-header img { height: 32px; }

.sidebar-header h2 {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
}

.sidebar-header span {
  font-size: 0.6875rem;
  color: rgba(255,255,255,0.5);
  display: block;
  margin-top: 0.125rem;
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0;
  overflow-y: auto;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6875rem 1.5rem;
  color: rgba(255,255,255,0.65);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition);
  border-left: 3px solid transparent;
}

.sidebar-nav a:hover {
  color: #fff;
  background: rgba(255,255,255,0.05);
}

.sidebar-nav a.active {
  color: #fff;
  background: rgba(61,165,217,0.12);
  border-left-color: var(--color-blue);
}

.sidebar-nav .nav-icon {
  font-size: 1.125rem;
  width: 1.5rem;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-nav .nav-label { white-space: nowrap; }

.sidebar-nav .nav-divider {
  height: 1px;
  background: rgba(255,255,255,0.08);
  margin: 0.75rem 1.5rem;
}

.sidebar-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.sidebar-footer a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: rgba(255,255,255,0.5);
  font-size: 0.8125rem;
  font-weight: 500;
  transition: color var(--transition);
}

.sidebar-footer a:hover { color: #fff; }

/* --- Main Content --- */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --- Topbar --- */
.topbar {
  height: var(--topbar-height);
  background: var(--color-bg-card);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.topbar-left h1 { font-size: 1.25rem; }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--color-text);
  cursor: pointer;
  padding: 0.25rem;
}

.notification-btn {
  position: relative;
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--color-text-secondary);
  cursor: pointer;
  padding: 0.375rem;
  border-radius: var(--radius);
  transition: all var(--transition);
}

.notification-btn:hover { background: var(--color-bg); color: var(--color-text); }

.dark-mode-toggle {
  background: none;
  border: 1px solid var(--color-border);
  font-size: 1.1rem;
  color: var(--color-text-secondary);
  cursor: pointer;
  padding: 0.375rem 0.5rem;
  border-radius: var(--radius);
  transition: all var(--transition);
}

.dark-mode-toggle:hover { background: var(--color-bg); color: var(--color-text); }

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 600;
}

/* --- Page Content --- */
.page-content {
  flex: 1;
  padding: 2rem;
}

.page-header {
  margin-bottom: 1.5rem;
}

.page-header h1 { margin-bottom: 0.25rem; }

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

/* ============================================
   STATS CARDS
   ============================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  transition: transform var(--transition), box-shadow var(--transition);
}

.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.stat-card .stat-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  margin-bottom: 0.5rem;
}

.stat-card .stat-value {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
}

.stat-card .stat-icon {
  font-size: 1.5rem;
  float: right;
  opacity: 0.5;
}

/* ============================================
   REQUEST CARDS
   ============================================ */
.section-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.requests-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.25rem;
}

.request-card {
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  cursor: pointer;
  transition: all var(--transition);
}

.request-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--color-blue); }

.request-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.service-type {
  font-weight: 600;
  font-size: 0.9375rem;
}

.request-desc {
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  margin-bottom: 1rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.request-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.75rem;
  font-size: 0.75rem;
  color: var(--color-text-secondary);
}

.request-id { font-family: 'SF Mono', 'Fira Code', monospace; }

/* --- Status Badge --- */
.status-badge {
  display: inline-block;
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* --- Progress Bar --- */
.progress-bar-container {
  height: 6px;
  background: var(--color-border);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: 999px;
  transition: width 0.5s ease;
}

/* ============================================
   PROGRESS STEPS (Detail Page)
   ============================================ */
.progress-steps {
  display: flex;
  justify-content: space-between;
  margin: 1.5rem 0 2rem;
  position: relative;
}

.progress-steps::before {
  content: '';
  position: absolute;
  top: 12px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--color-border);
  z-index: 0;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 1;
  flex: 1;
}

.step-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-bg-card);
  border: 2px solid var(--color-border);
  margin-bottom: 0.5rem;
  transition: all var(--transition);
}

.step.active .step-dot {
  background: var(--color-blue);
  border-color: var(--color-blue);
}

.step.current .step-dot {
  background: var(--color-blue);
  border-color: var(--color-blue);
  box-shadow: 0 0 0 4px rgba(61,165,217,0.2);
}

.step-label {
  font-size: 0.625rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  text-align: center;
  max-width: 80px;
}

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

/* ============================================
   TIMELINE (Vertical)
   ============================================ */
.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  left: 8px;
  bottom: 0;
  width: 2px;
  background: var(--color-border);
}

.timeline-item {
  position: relative;
  padding-bottom: 1.5rem;
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-dot {
  position: absolute;
  left: -2rem;
  top: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-blue);
  border: 3px solid var(--color-bg);
  z-index: 1;
  box-shadow: var(--shadow-sm);
}

.timeline-content {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}

.timeline-content h4 {
  font-size: 0.875rem;
  margin-bottom: 0.375rem;
}

.timeline-content p {
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  margin-bottom: 0.375rem;
}

.timeline-date {
  font-size: 0.6875rem;
  color: var(--color-text-secondary);
  opacity: 0.7;
}

/* ============================================
   MESSAGES / CHAT
   ============================================ */
.messages-section {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.messages-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  font-weight: 600;
  font-size: 0.9375rem;
}

.messages-body {
  padding: 1.25rem;
  max-height: 400px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.message {
  max-width: 80%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-lg);
  font-size: 0.875rem;
  line-height: 1.5;
}

.message-client {
  background: var(--color-bg);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.message-admin {
  background: rgba(61,165,217,0.08);
  border: 1px solid rgba(61,165,217,0.15);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.message-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.25rem;
  font-size: 0.75rem;
}

.message-header strong { font-size: 0.8125rem; }
.message-header span { color: var(--color-text-secondary); }

.messages-input {
  display: flex;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--color-border);
  gap: 0.75rem;
}

.messages-input input {
  flex: 1;
}

/* ============================================
   DETAIL PAGE LAYOUT
   ============================================ */
.detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.detail-header h1 { font-size: 1.375rem; }

.detail-meta {
  display: flex;
  gap: 1.5rem;
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  margin-bottom: 1.5rem;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.detail-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.detail-card h3 {
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--color-border);
}

.detail-field {
  margin-bottom: 1rem;
}

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

.detail-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.detail-value {
  font-size: 0.9375rem;
}

/* --- Admin Controls --- */
.admin-controls {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.admin-controls label {
  font-size: 0.8125rem;
  font-weight: 600;
}

.admin-badge {
  background: var(--color-primary);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ============================================
   ADMIN TABLE
   ============================================ */
.filters-bar {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.filters-bar select {
  min-width: 180px;
}

.table-container {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.data-table th {
  background: var(--color-bg);
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-secondary);
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

.data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}

.data-table tbody tr {
  cursor: pointer;
  transition: background var(--transition);
}

.data-table tbody tr:hover { background: rgba(61,165,217,0.04); }

.data-table tbody tr:nth-child(even) { background: var(--color-bg); }
.data-table tbody tr:nth-child(even):hover { background: rgba(61,165,217,0.06); }

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--color-text-secondary);
}

.empty-state p { margin-bottom: 1.25rem; font-size: 1rem; }

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  padding: 0.875rem 1.5rem;
  border-radius: var(--radius);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 500;
  z-index: 10000;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-lg);
  max-width: 400px;
}

.toast.show { transform: translateY(0); opacity: 1; }

.toast-success { background: var(--color-success); }
.toast-error { background: var(--color-error); }
.toast-info { background: var(--color-info); }
.toast-warning { background: var(--color-warning); }

/* ============================================
   LOADING OVERLAY
   ============================================ */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ============================================
   MODAL
   ============================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 5000;
}

.modal-backdrop.show { display: flex; }

.modal {
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
}

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

.modal-header h3 { margin: 0; }

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--color-text-secondary);
  cursor: pointer;
  line-height: 1;
}

.modal-body { padding: 1.5rem; }

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99;
    display: none;
  }

  .sidebar-overlay.show { display: block; }

  .main-content {
    margin-left: 0;
  }

  .mobile-toggle { display: block; }

  .topbar { padding: 0 1rem; }

  .page-content { padding: 1.25rem; }

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

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

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

  .progress-steps { overflow-x: auto; gap: 0; }

  .step-label { font-size: 0.5rem; }

  .filters-bar { flex-direction: column; align-items: stretch; }

  .data-table { font-size: 0.8125rem; }

  .detail-header { flex-direction: column; align-items: flex-start; }
}

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

/* --- Language Switcher --- */
.auth-lang {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
}

.lang-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.3);
  color: rgba(255,255,255,0.7);
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  transition: all 0.2s ease;
}

.lang-btn:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

.lang-btn.active {
  background: var(--color-blue);
  border-color: var(--color-blue);
  color: #fff;
}

/* --- Password Requirements --- */
.password-requirements {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 0.85rem;
}

.password-requirements ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.password-requirements li {
  padding: 3px 0 3px 22px;
  position: relative;
  color: var(--color-text-secondary);
}

.password-requirements li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid currentColor;
}

.password-requirements li.req-pass {
  color: var(--color-success);
}

.password-requirements li.req-pass::before {
  background: var(--color-success);
  border-color: var(--color-success);
}

.password-requirements li.req-fail {
  color: var(--color-text-secondary);
}

/* --- GDPR & Terms Checkboxes --- */
.form-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}

.form-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 3px;
  flex-shrink: 0;
  accent-color: var(--color-blue);
  cursor: pointer;
}

.form-checkbox label {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  line-height: 1.5;
  cursor: pointer;
}

.form-checkbox label a {
  color: var(--color-blue);
  text-decoration: underline;
}

.form-checkbox label a:hover {
  color: var(--color-blue-hover);
}

/* --- Modal --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-content {
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  max-width: 640px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  padding: 32px;
  position: relative;
  box-shadow: var(--shadow-lg);
}

.modal-content h2 {
  color: var(--color-text);
  font-size: 1.4rem;
  margin-bottom: 20px;
  padding-right: 40px;
}

.modal-content h3 {
  color: var(--color-text);
  font-size: 1.05rem;
  margin-top: 20px;
  margin-bottom: 8px;
}

.modal-content p {
  color: var(--color-text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 12px;
}

.modal-content ul {
  list-style: disc;
  padding-left: 20px;
  margin-bottom: 12px;
}

.modal-content ul li {
  color: var(--color-text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 4px;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border: none;
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 1.4rem;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

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

/* --- Form Error/Success --- */
.form-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  margin-top: 12px;
}

.form-success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #16a34a;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  margin-top: 12px;
}

[data-theme="dark"] .form-error {
  background: #451a1a;
  border-color: #7f1d1d;
}

[data-theme="dark"] .form-success {
  background: #14532d;
  border-color: #166534;
}

[data-theme="dark"] .password-requirements {
  background: #1e293b;
}

[data-theme="dark"] .modal-content {
  background: #1e293b;
}

/* --- Notification Dropdown --- */
.notification-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  width: 280px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  margin-top: 8px;
}

.notif-header {
  padding: 12px 16px;
  font-weight: 600;
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border);
  font-size: 0.9rem;
}

.notif-empty {
  padding: 24px 16px;
  text-align: center;
  color: var(--color-text-secondary);
  font-size: 0.875rem;
}
