/* ============================================
   RAMAT VISA MANAGER - Design System
   Premium Dark Theme with Glassmorphism
   ============================================ */

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

/* ---- CSS Custom Properties ---- */
:root {
  /* Colors */
  --bg-primary: #0a0e27;
  --bg-secondary: #070b1e;
  --surface: #111638;
  --surface-hover: #1a2050;
  --surface-active: #222960;
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.15);
  --border-focus: rgba(59, 130, 246, 0.5);

  --text-primary: #f0f0f5;
  --text-secondary: #8b8fa3;
  --text-muted: #5a5e72;
  --text-inverse: #0a0e27;

  --accent-blue: #3b82f6;
  --accent-blue-light: #60a5fa;
  --accent-blue-bg: rgba(59, 130, 246, 0.12);
  --accent-emerald: #10b981;
  --accent-emerald-light: #34d399;
  --accent-emerald-bg: rgba(16, 185, 129, 0.12);
  --accent-amber: #f59e0b;
  --accent-amber-light: #fbbf24;
  --accent-amber-bg: rgba(245, 158, 11, 0.12);
  --accent-red: #ef4444;
  --accent-red-light: #f87171;
  --accent-red-bg: rgba(239, 68, 68, 0.12);
  --accent-purple: #8b5cf6;
  --accent-purple-light: #a78bfa;
  --accent-purple-bg: rgba(139, 92, 246, 0.12);
  --accent-gray: #6b7280;
  --accent-gray-bg: rgba(107, 114, 128, 0.12);

  /* Gradients */
  --gradient-blue: linear-gradient(135deg, #3b82f6, #2563eb);
  --gradient-emerald: linear-gradient(135deg, #10b981, #059669);
  --gradient-amber: linear-gradient(135deg, #f59e0b, #d97706);
  --gradient-red: linear-gradient(135deg, #ef4444, #dc2626);
  --gradient-purple: linear-gradient(135deg, #8b5cf6, #7c3aed);
  --gradient-mesh: linear-gradient(135deg, #0a0e27 0%, #111638 25%, #0f1235 50%, #0a0e27 75%, #111638 100%);
  --gradient-primary: linear-gradient(135deg, #3b82f6, #8b5cf6);
  --gradient-card: linear-gradient(135deg, rgba(17, 22, 56, 0.8), rgba(26, 32, 80, 0.4));

  /* Glass */
  --glass-bg: rgba(17, 22, 56, 0.6);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  --glass-blur: blur(20px);

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.5);
  --shadow-glow-blue: 0 0 20px rgba(59, 130, 246, 0.3);
  --shadow-glow-emerald: 0 0 20px rgba(16, 185, 129, 0.3);

  /* Sizing */
  --sidebar-width: 260px;
  --sidebar-collapsed: 0px;
  --topbar-height: 70px;
  --border-radius-sm: 8px;
  --border-radius-md: 12px;
  --border-radius-lg: 16px;
  --border-radius-xl: 20px;
  --border-radius-full: 9999px;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.2s ease;
  --transition-slow: 0.3s ease;
  --transition-spring: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Font */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

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

a:hover {
  color: var(--accent-blue-light);
}

img {
  max-width: 100%;
  height: auto;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--surface-hover);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--surface-hover) var(--bg-primary);
}

/* ============================================
   LOGIN PAGE
   ============================================ */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

/* Animated background */
.login-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: var(--bg-primary);
  overflow: hidden;
}

.login-bg::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.15), transparent 70%);
  top: -200px;
  right: -100px;
  animation: float-orb 15s ease-in-out infinite;
}

.login-bg::after {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.12), transparent 70%);
  bottom: -150px;
  left: -100px;
  animation: float-orb 18s ease-in-out infinite reverse;
}

.login-bg-orb {
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.1), transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: float-orb 12s ease-in-out infinite 3s;
}

@keyframes float-orb {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -40px) scale(1.05); }
  50% { transform: translate(-20px, 20px) scale(0.95); }
  75% { transform: translate(40px, 10px) scale(1.02); }
}

.login-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  padding: 48px 40px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-xl);
  box-shadow: var(--glass-shadow);
  animation: fadeInUp 0.6s ease-out;
}

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

.login-logo {
  text-align: center;
  margin-bottom: 36px;
}

.login-logo .logo-icon {
  font-size: 48px;
  display: block;
  margin-bottom: 12px;
}

.login-logo h1 {
  font-size: 24px;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-logo p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 4px;
}

.login-error {
  display: none;
  background: var(--accent-red-bg);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--accent-red-light);
  padding: 12px 16px;
  border-radius: var(--border-radius-sm);
  font-size: 14px;
  margin-bottom: 20px;
  animation: shake 0.4s ease;
}

.login-error.show {
  display: flex;
  align-items: center;
  gap: 8px;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* ============================================
   FORM ELEMENTS
   ============================================ */

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}

.form-label .required {
  color: var(--accent-red);
  margin-left: 2px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-sm);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 14px;
  transition: all var(--transition-base);
  outline: none;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-muted);
}

.form-input:hover,
.form-select:hover,
.form-textarea:hover {
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.06);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--accent-blue);
  background: rgba(59, 130, 246, 0.06);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-input.error,
.form-select.error {
  border-color: var(--accent-red);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238b8fa3' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
  cursor: pointer;
}

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

.form-input-icon {
  position: relative;
}

.form-input-icon .icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 16px;
  pointer-events: none;
}

.form-input-icon .form-input {
  padding-left: 44px;
}

.form-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}

.form-error-text {
  font-size: 12px;
  color: var(--accent-red);
  margin-top: 6px;
  display: none;
}

.form-error-text.show {
  display: block;
}

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

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

.form-section {
  margin-bottom: 32px;
}

.form-section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-section-title .icon {
  font-size: 20px;
}

.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  margin-top: 32px;
}

/* Checkbox */
.form-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
}

.form-checkbox input[type="checkbox"] {
  appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-hover);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
  flex-shrink: 0;
}

.form-checkbox input[type="checkbox"]:checked {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
}

.form-checkbox input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 12px;
  font-weight: 700;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--border-radius-sm);
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
  outline: none;
  white-space: nowrap;
  text-decoration: none;
  line-height: 1;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--gradient-blue);
  color: white;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
  transform: translateY(-1px);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.btn-gradient {
  background: var(--gradient-primary);
  color: white;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-gradient:hover:not(:disabled) {
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
  transform: translateY(-1px);
}

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

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

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 8px 12px;
}

.btn-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}

.btn-danger {
  background: var(--gradient-red);
  color: white;
}

.btn-danger:hover:not(:disabled) {
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
  transform: translateY(-1px);
}

.btn-emerald {
  background: var(--gradient-emerald);
  color: white;
}

.btn-emerald:hover:not(:disabled) {
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
  transform: translateY(-1px);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
}

.btn-lg {
  padding: 16px 32px;
  font-size: 16px;
}

.btn-block {
  width: 100%;
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--border-radius-sm);
}

.btn-icon.sm {
  width: 32px;
  height: 32px;
  font-size: 14px;
}

/* Login button */
.btn-login {
  width: 100%;
  padding: 14px;
  font-size: 15px;
  background: var(--gradient-primary);
  color: white;
  border: none;
  border-radius: var(--border-radius-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.btn-login:hover:not(:disabled) {
  box-shadow: var(--shadow-glow-blue);
  transform: translateY(-1px);
}

.btn-login:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.btn-login .spinner {
  display: none;
}

.btn-login.loading .spinner {
  display: inline-block;
}

.btn-login.loading .btn-text {
  visibility: hidden;
}

/* ============================================
   APP LAYOUT
   ============================================ */

.app-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform var(--transition-slow);
}

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.sidebar-logo .logo-icon {
  font-size: 28px;
}

.sidebar-logo .logo-text {
  font-size: 18px;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--border-radius-sm);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-base);
  margin-bottom: 4px;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.nav-item:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.nav-item.active {
  color: var(--accent-blue);
  background: var(--accent-blue-bg);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 3px;
  background: var(--accent-blue);
  border-radius: 0 3px 3px 0;
}

.nav-item .nav-icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.nav-item .nav-badge {
  margin-left: auto;
  background: var(--accent-red);
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--border-radius-full);
  min-width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-user .user-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--border-radius-full);
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  color: white;
  flex-shrink: 0;
}

.sidebar-user .user-info {
  flex: 1;
  min-width: 0;
}

.sidebar-user .user-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user .user-role {
  font-size: 12px;
  color: var(--text-muted);
}

.btn-logout {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 8px;
  border-radius: var(--border-radius-sm);
  transition: all var(--transition-base);
  font-size: 16px;
}

.btn-logout:hover {
  color: var(--accent-red);
  background: var(--accent-red-bg);
}

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

/* Top Bar */
.topbar {
  height: var(--topbar-height);
  padding: 0 32px;
  display: flex;
  align-items: center;
  gap: 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 14, 39, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 24px;
  cursor: pointer;
  padding: 4px;
}

.topbar-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.topbar-search {
  flex: 1;
  max-width: 400px;
  margin-left: auto;
}

.topbar-search .search-box {
  position: relative;
}

.topbar-search .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
  pointer-events: none;
}

.topbar-search input {
  width: 100%;
  padding: 10px 16px 10px 40px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-full);
  color: var(--text-primary);
  font-size: 13px;
  font-family: var(--font-family);
  outline: none;
  transition: all var(--transition-base);
}

.topbar-search input::placeholder {
  color: var(--text-muted);
}

.topbar-search input:focus {
  border-color: var(--accent-blue);
  background: rgba(59, 130, 246, 0.06);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.topbar-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--border-radius-full);
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 15px;
  color: white;
  cursor: pointer;
  transition: all var(--transition-base);
  flex-shrink: 0;
}

.topbar-avatar:hover {
  box-shadow: var(--shadow-glow-blue);
  transform: scale(1.05);
}

/* Page Content */
.page-content {
  padding: 32px;
  flex: 1;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 16px;
}

.page-header h1 {
  font-size: 24px;
  font-weight: 700;
}

.page-header-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* ============================================
   CARDS
   ============================================ */

.card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-md);
  padding: 24px;
  transition: all var(--transition-base);
}

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

.card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Stat Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-md);
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-base);
}

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

.stat-card .stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--border-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 16px;
}

.stat-card .stat-icon.blue {
  background: var(--accent-blue-bg);
}

.stat-card .stat-icon.emerald {
  background: var(--accent-emerald-bg);
}

.stat-card .stat-icon.amber {
  background: var(--accent-amber-bg);
}

.stat-card .stat-icon.red {
  background: var(--accent-red-bg);
}

.stat-card .stat-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 6px;
}

.stat-card .stat-label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.stat-card .stat-bg-icon {
  position: absolute;
  right: 16px;
  bottom: 12px;
  font-size: 64px;
  opacity: 0.05;
  line-height: 1;
}

/* ============================================
   TABLES
   ============================================ */

.table-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-md);
  overflow: hidden;
}

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

.table-header h3 {
  font-size: 16px;
  font-weight: 600;
}

.table-wrapper {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  padding: 14px 20px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  white-space: nowrap;
}

.data-table td {
  padding: 14px 20px;
  font-size: 14px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

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

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

.data-table .text-secondary {
  color: var(--text-secondary);
}

.data-table .embassy-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.data-table .embassy-flag {
  font-size: 20px;
}

/* ============================================
   BADGES & STATUS
   ============================================ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--border-radius-full);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.badge-draft {
  background: var(--accent-gray-bg);
  color: var(--accent-gray);
}

.badge-collecting {
  background: var(--accent-blue-bg);
  color: var(--accent-blue-light);
}

.badge-ready {
  background: var(--accent-emerald-bg);
  color: var(--accent-emerald-light);
}

.badge-booked {
  background: var(--accent-purple-bg);
  color: var(--accent-purple-light);
}

.badge-approved {
  background: rgba(34, 197, 94, 0.12);
  color: #4ade80;
}

.badge-rejected {
  background: var(--accent-red-bg);
  color: var(--accent-red-light);
}

.badge-submitted {
  background: var(--accent-amber-bg);
  color: var(--accent-amber-light);
}

.badge-sm {
  padding: 2px 8px;
  font-size: 11px;
}

/* Priority Dot */
.priority-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.priority-dot.normal {
  background: var(--accent-blue);
}

.priority-dot.high {
  background: var(--accent-amber);
}

.priority-dot.urgent {
  background: var(--accent-red);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; box-shadow: none; }
  50% { opacity: 0.7; box-shadow: 0 0 8px var(--accent-red); }
}

/* ============================================
   FILTER BAR
   ============================================ */

.filter-bar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-bar .search-box {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 350px;
}

.filter-bar .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.filter-bar .search-input {
  width: 100%;
  padding: 10px 16px 10px 40px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-sm);
  color: var(--text-primary);
  font-size: 13px;
  font-family: var(--font-family);
  outline: none;
  transition: all var(--transition-base);
}

.filter-bar .search-input:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.filter-bar .filter-select {
  padding: 10px 36px 10px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-sm);
  color: var(--text-primary);
  font-size: 13px;
  font-family: var(--font-family);
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238b8fa3' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
  transition: all var(--transition-base);
  min-width: 140px;
}

.filter-bar .filter-select:focus {
  border-color: var(--accent-blue);
}

/* ============================================
   MODALS
   ============================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}

.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px) scale(0.98);
  transition: all var(--transition-slow);
  box-shadow: var(--shadow-xl);
}

.modal-overlay.show .modal {
  transform: translateY(0) scale(1);
}

.modal-header {
  padding: 24px 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 8px;
  border-radius: var(--border-radius-sm);
  transition: all var(--transition-base);
  font-size: 18px;
}

.modal-close:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 0 24px 24px;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.modal-lg {
  max-width: 720px;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */

.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-sm);
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  color: var(--text-primary);
  pointer-events: auto;
  animation: slideInRight 0.3s ease-out;
  max-width: 400px;
}

.toast.toast-exit {
  animation: slideOutRight 0.2s ease-in forwards;
}

.toast .toast-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.toast.toast-success {
  border-left: 3px solid var(--accent-emerald);
}

.toast.toast-error {
  border-left: 3px solid var(--accent-red);
}

.toast.toast-warning {
  border-left: 3px solid var(--accent-amber);
}

.toast.toast-info {
  border-left: 3px solid var(--accent-blue);
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  margin-left: auto;
  font-size: 14px;
  flex-shrink: 0;
}

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

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

/* ============================================
   LOADING
   ============================================ */

.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.spinner.spinner-sm {
  width: 16px;
  height: 16px;
  border-width: 2px;
}

.spinner.spinner-lg {
  width: 32px;
  height: 32px;
  border-width: 3px;
}

.spinner.spinner-blue {
  border-color: rgba(59, 130, 246, 0.2);
  border-top-color: var(--accent-blue);
}

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

.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 14, 39, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  border-radius: inherit;
}

.loading-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  flex-direction: column;
  gap: 16px;
  color: var(--text-secondary);
}

/* Skeleton Loading */
.skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-hover) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--border-radius-sm);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-text {
  height: 14px;
  margin-bottom: 8px;
  width: 80%;
}

.skeleton-text.short {
  width: 40%;
}

.skeleton-stat {
  height: 40px;
  width: 60px;
  margin-bottom: 8px;
}

/* ============================================
   CLIENT CARDS
   ============================================ */

.clients-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.client-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-md);
  padding: 20px;
  transition: all var(--transition-base);
  cursor: pointer;
}

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

.client-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.client-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--border-radius-full);
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  color: white;
  flex-shrink: 0;
}

.client-avatar.emerald { background: var(--gradient-emerald); }
.client-avatar.amber { background: var(--gradient-amber); }
.client-avatar.purple { background: var(--gradient-purple); }

.client-card-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.client-card-passport {
  font-size: 13px;
  color: var(--text-secondary);
  font-family: monospace;
}

.client-card-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.client-card-info-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.client-card-info-item .icon {
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.client-card-actions {
  display: flex;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

/* ============================================
   EMBASSY CARDS
   ============================================ */

.embassies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.embassy-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-md);
  padding: 24px;
  transition: all var(--transition-base);
  text-align: center;
}

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

.embassy-flag {
  font-size: 56px;
  margin-bottom: 12px;
  line-height: 1;
}

.embassy-country {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.embassy-center {
  display: inline-flex;
  padding: 4px 12px;
  border-radius: var(--border-radius-full);
  background: var(--accent-blue-bg);
  color: var(--accent-blue-light);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 16px;
}

.embassy-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.embassy-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

.embassy-detail-label {
  color: var(--text-muted);
}

.embassy-detail-value {
  color: var(--text-primary);
  font-weight: 500;
}

.embassy-apps-count {
  padding: 10px;
  border-radius: var(--border-radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-secondary);
}

.embassy-apps-count strong {
  color: var(--text-primary);
}

/* ============================================
   CHECKLIST
   ============================================ */

.checklist {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  transition: all var(--transition-base);
}

.checklist-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.checklist-item.completed {
  border-color: rgba(16, 185, 129, 0.3);
  background: rgba(16, 185, 129, 0.04);
}

.checklist-item.required {
  border-color: rgba(239, 68, 68, 0.2);
}

.checklist-item .checklist-check {
  margin-top: 2px;
}

.checklist-item .checklist-content {
  flex: 1;
}

.checklist-item .checklist-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.checklist-item .checklist-name .required-badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: var(--border-radius-full);
  background: var(--accent-red-bg);
  color: var(--accent-red-light);
  font-weight: 600;
}

.checklist-item .checklist-name .optional-badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: var(--border-radius-full);
  background: var(--accent-gray-bg);
  color: var(--accent-gray);
  font-weight: 600;
}

.checklist-item.completed .checklist-name {
  text-decoration: line-through;
  color: var(--text-secondary);
}

.checklist-item .checklist-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.checklist-item .checklist-notes {
  margin-top: 8px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--border-radius-sm);
  font-size: 13px;
  color: var(--text-secondary);
}

/* Progress Bar */
.progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--border-radius-full);
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-bar-fill {
  height: 100%;
  border-radius: var(--border-radius-full);
  background: var(--gradient-emerald);
  transition: width var(--transition-slow);
}

.progress-label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 12px;
}

/* ============================================
   TABS
   ============================================ */

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
  overflow-x: auto;
}

.tab-btn {
  padding: 12px 20px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-base);
  white-space: nowrap;
  position: relative;
}

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

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

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

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.2s ease;
}

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

/* ============================================
   APPOINTMENTS LIST
   ============================================ */

.appointments-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.appointment-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-sm);
  transition: all var(--transition-base);
}

.appointment-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border-hover);
}

.appointment-date {
  text-align: center;
  padding: 8px 12px;
  background: var(--accent-blue-bg);
  border-radius: var(--border-radius-sm);
  min-width: 56px;
}

.appointment-date .day {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent-blue-light);
  line-height: 1;
}

.appointment-date .month {
  font-size: 11px;
  color: var(--accent-blue);
  text-transform: uppercase;
  font-weight: 600;
}

.appointment-info {
  flex: 1;
}

.appointment-client {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 3px;
}

.appointment-detail {
  font-size: 13px;
  color: var(--text-secondary);
}

.appointment-time {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-amber);
}

/* ============================================
   APPLICATION DETAIL SECTIONS
   ============================================ */

.detail-sections {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.detail-section {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-md);
  overflow: hidden;
}

.detail-section-header {
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition-base);
}

.detail-section-header:hover {
  background: rgba(255, 255, 255, 0.02);
}

.detail-section-title {
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.detail-section-toggle {
  color: var(--text-muted);
  transition: transform var(--transition-base);
  font-size: 14px;
}

.detail-section.collapsed .detail-section-toggle {
  transform: rotate(-90deg);
}

.detail-section-body {
  padding: 24px;
}

.detail-section.collapsed .detail-section-body {
  display: none;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

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

.detail-item-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.detail-item-value {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 500;
}

/* ============================================
   FILE UPLOAD
   ============================================ */

.file-upload {
  border: 2px dashed var(--border);
  border-radius: var(--border-radius-sm);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-base);
}

.file-upload:hover {
  border-color: var(--accent-blue);
  background: rgba(59, 130, 246, 0.04);
}

.file-upload .upload-icon {
  font-size: 32px;
  margin-bottom: 8px;
  display: block;
}

.file-upload .upload-text {
  font-size: 14px;
  color: var(--text-secondary);
}

.file-upload .upload-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.file-upload input[type="file"] {
  display: none;
}

.uploaded-files {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.uploaded-file {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-sm);
  font-size: 13px;
}

.uploaded-file .file-icon {
  font-size: 18px;
}

.uploaded-file .file-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.uploaded-file .file-size {
  color: var(--text-muted);
  font-size: 12px;
}

.uploaded-file .file-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
  transition: color var(--transition-base);
}

.uploaded-file .file-remove:hover {
  color: var(--accent-red);
}

/* ============================================
   APPLICATION TOP BAR
   ============================================ */

.app-detail-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.app-ref-number {
  font-size: 22px;
  font-weight: 700;
  font-family: monospace;
  color: var(--text-primary);
}

/* ============================================
   EMPTY STATE
   ============================================ */

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.empty-state .empty-icon {
  font-size: 56px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 360px;
  margin: 0 auto;
}

/* ============================================
   PAGINATION
   ============================================ */

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 20px;
}

.pagination-btn {
  padding: 8px 14px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--border-radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-family);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition-base);
}

.pagination-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
}

.pagination-btn.active {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: white;
}

.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ============================================
   CONFIRMATION DIALOG
   ============================================ */

.confirm-dialog {
  text-align: center;
  padding: 12px 0;
}

.confirm-dialog .confirm-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.confirm-dialog h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.confirm-dialog p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.confirm-dialog .confirm-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* ============================================
   VIEW TOGGLE
   ============================================ */

.view-toggle {
  display: flex;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-sm);
  overflow: hidden;
}

.view-toggle-btn {
  padding: 8px 14px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-base);
  font-size: 14px;
}

.view-toggle-btn.active {
  background: var(--accent-blue);
  color: white;
}

.view-toggle-btn:hover:not(.active) {
  color: var(--text-primary);
}

/* ============================================
   SIDEBAR OVERLAY (mobile)
   ============================================ */

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

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

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1200px) {
  .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.show {
    display: block;
  }

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

  .topbar {
    padding: 0 16px;
  }

  .topbar-hamburger {
    display: block;
  }

  .topbar-search {
    display: none;
  }

  .page-content {
    padding: 20px 16px;
  }

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

  .stat-card {
    padding: 16px;
  }

  .stat-card .stat-value {
    font-size: 24px;
  }

  .stat-card .stat-bg-icon {
    display: none;
  }

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

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

  .filter-bar {
    flex-direction: column;
  }

  .filter-bar .search-box {
    max-width: none;
    width: 100%;
  }

  .filter-bar .filter-select {
    width: 100%;
  }

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

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

  .login-card {
    margin: 16px;
    padding: 32px 24px;
  }

  .table-card {
    border-radius: var(--border-radius-sm);
  }

  .modal {
    margin: 16px;
    max-height: calc(100vh - 32px);
  }

  .data-table th,
  .data-table td {
    padding: 12px 14px;
  }

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

  .tabs {
    gap: 0;
  }

  .tab-btn {
    padding: 10px 14px;
    font-size: 13px;
  }
}

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

  .page-content {
    padding: 16px 12px;
  }

  .topbar-title {
    font-size: 16px;
  }

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

  .form-actions .btn {
    width: 100%;
  }

  .confirm-dialog .confirm-actions {
    flex-direction: column;
  }

  .confirm-dialog .confirm-actions .btn {
    width: 100%;
  }
}

/* ============================================
   RTL Support
   ============================================ */

[dir="rtl"] .sidebar {
  left: auto;
  right: 0;
  border-right: none;
  border-left: 1px solid var(--border);
}

[dir="rtl"] .main-content {
  margin-left: 0;
  margin-right: var(--sidebar-width);
}

[dir="rtl"] .nav-item.active::before {
  left: auto;
  right: 0;
  border-radius: 3px 0 0 3px;
}

[dir="rtl"] .data-table th,
[dir="rtl"] .data-table td {
  text-align: right;
}

[dir="rtl"] .form-select {
  background-position: left 16px center;
  padding-left: 40px;
  padding-right: 16px;
}

@media (max-width: 768px) {
  [dir="rtl"] .sidebar {
    transform: translateX(100%);
  }

  [dir="rtl"] .sidebar.open {
    transform: translateX(0);
  }

  [dir="rtl"] .main-content {
    margin-right: 0;
  }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.text-blue { color: var(--accent-blue); }
.text-emerald { color: var(--accent-emerald); }
.text-amber { color: var(--accent-amber); }
.text-red { color: var(--accent-red); }
.text-purple { color: var(--accent-purple); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }

.bg-blue { background: var(--accent-blue-bg); }
.bg-emerald { background: var(--accent-emerald-bg); }
.bg-amber { background: var(--accent-amber-bg); }
.bg-red { background: var(--accent-red-bg); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.gap-24 { gap: 24px; }

.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

.w-full { width: 100%; }
.hidden { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.relative { position: relative; }
.font-mono { font-family: 'JetBrains Mono', 'Fira Code', monospace; }
