/* ═══════════════════════════════════════════════════
   MODERN LUXURY DESIGN SYSTEM
   Healthcare MOJ — Premium Arabic Medical Directory
   ═══════════════════════════════════════════════════ */

/* ─── Variables ─── */
:root {
  /* Primary Palette — Deep Ocean */
  --primary-900: #061e2a;
  --primary-800: #0a2e3d;
  --primary-700: #0d3e52;
  --primary-600: #0f4f66;
  --primary: #126280;
  --primary-400: #1a7fa3;
  --primary-300: #2da0c7;
  --primary-200: #6dc0de;
  --primary-100: #b0dff0;
  --primary-50: #e6f4f9;

  /* Gold Accent */
  --gold-900: #5c3d0a;
  --gold-800: #8a5c10;
  --gold-700: #b37a18;
  --gold: #c9922a;
  --gold-500: #d4a43e;
  --gold-400: #e0b85a;
  --gold-300: #ebcc7e;
  --gold-200: #f3dea8;
  --gold-100: #f9efd5;
  --gold-50: #fdf8ec;

  /* Semantic */
  --success: #16a34a;
  --success-bg: #dcfce7;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --warning: #d97706;
  --warning-bg: #fffbeb;
  --info: #2563eb;
  --info-bg: #eff6ff;

  /* Neutrals */
  --gray-950: #0a0a0b;
  --gray-900: #18181b;
  --gray-800: #27272a;
  --gray-700: #3f3f46;
  --gray-600: #52525b;
  --gray-500: #71717a;
  --gray-400: #a1a1aa;
  --gray-300: #d4d4d8;
  --gray-200: #e4e4e7;
  --gray-100: #f4f4f5;
  --gray-50: #fafafa;

  /* Surfaces */
  --bg: #f8f9fc;
  --bg-elevated: #ffffff;
  --bg-sunken: #f1f3f8;
  --bg-glass: rgba(255, 255, 255, 0.72);
  --bg-glass-heavy: rgba(255, 255, 255, 0.88);

  /* Typography */
  --text-primary: #18181b;
  --text-secondary: #52525b;
  --text-tertiary: #a1a1aa;
  --text-inverse: #ffffff;
  --text-gold: var(--gold);

  /* Borders */
  --border: #e4e4e7;
  --border-light: #f4f4f5;
  --border-focus: var(--primary-400);

  /* Shadows — Layered for depth */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.04);
  --shadow-2xl: 0 25px 50px -12px rgba(0,0,0,0.16);
  --shadow-glow: 0 0 40px rgba(18, 98, 128, 0.12);
  --shadow-gold: 0 0 30px rgba(201, 146, 42, 0.15);

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 28px;
  --radius-full: 9999px;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --transition-fast: 150ms var(--ease-out);
  --transition: 250ms var(--ease-out);
  --transition-slow: 400ms var(--ease-out);

  /* Container */
  --container: 1120px;
}

/* ─── Reset ─── */
*, *::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: 'Tajawal', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.65;
  direction: rtl;
  text-align: right;
  min-height: 100vh;
  overflow-x: hidden;
}

::selection {
  background: var(--primary-200);
  color: var(--primary-900);
}

/* ─── Animated Background Shapes ─── */
.bg-shapes {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
}

.shape-1 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--primary-100), transparent 70%);
  top: -200px;
  right: -150px;
  animation: floatShape 20s ease-in-out infinite;
}

.shape-2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--gold-100), transparent 70%);
  bottom: -150px;
  left: -100px;
  animation: floatShape 25s ease-in-out infinite reverse;
}

.shape-3 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, var(--primary-50), transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: floatShape 30s ease-in-out infinite;
}

@keyframes floatShape {
  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(15px, 30px) scale(1.02); }
}

/* ─── Container ─── */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
}

/* ─── Header ─── */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-glass-heavy);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-light);
  padding: 0;
}

header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
}

.logo-icon {
  font-size: 1.6rem;
}

.logo-text {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

header nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--gray-100);
}

.nav-link.active {
  color: var(--primary);
  background: var(--primary-50);
}

.logout-link:hover {
  color: var(--danger);
  background: var(--danger-bg);
}

/* ─── Hero ─── */
.hero {
  padding: 80px 0 72px;
  text-align: center;
  position: relative;
}

.hero-content {
  margin-bottom: 48px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 24px;
  backdrop-filter: blur(10px);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

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

.hero h1 {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.03em;
  color: var(--gray-900);
  margin-bottom: 16px;
}

.gradient-text {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-400) 50%, var(--gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-desc {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ─── Search Box ─── */
.search-box {
  max-width: 680px;
  margin: 0 auto;
  position: relative;
}

.search-input-wrap {
  display: flex;
  align-items: center;
  background: var(--bg-elevated);
  border-radius: var(--radius-xl);
  border: 2px solid var(--border);
  overflow: hidden;
  transition: all var(--transition);
  box-shadow: var(--shadow-md);
}

.search-input-wrap:hover {
  border-color: var(--gray-300);
  box-shadow: var(--shadow-lg);
}

.search-input-wrap:focus-within {
  border-color: var(--primary-400);
  box-shadow: var(--shadow-lg), 0 0 0 4px rgba(26, 127, 163, 0.1);
  transform: translateY(-2px);
}

.search-icon {
  padding: 0 4px 0 16px;
  color: var(--gray-400);
  display: flex;
  align-items: center;
}

.search-input-wrap input {
  flex: 1;
  border: none;
  padding: 18px 16px;
  font-size: 1rem;
  font-family: inherit;
  background: transparent;
  color: var(--text-primary);
  outline: none;
  min-width: 0;
}

.search-input-wrap input::placeholder {
  color: var(--gray-400);
}

.search-input-wrap button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  margin: 6px;
  border: none;
  border-radius: calc(var(--radius-xl) - 4px);
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-600) 100%);
  color: var(--text-inverse);
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.search-input-wrap button:hover {
  background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary) 100%);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.search-input-wrap button:active {
  transform: translateY(0);
}

/* ─── Autocomplete ─── */
.autocomplete {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: 0;
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border);
  z-index: 50;
  max-height: 360px;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all var(--transition);
}

.autocomplete.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.autocomplete-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  cursor: pointer;
  transition: background var(--transition-fast);
  border-bottom: 1px solid var(--border-light);
}

.autocomplete-item:last-child { border-bottom: none; }

.autocomplete-item:hover {
  background: var(--gray-50);
}

.autocomplete-item .icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  flex-shrink: 0;
}

.autocomplete-item .icon.entity { background: var(--primary-50); }
.autocomplete-item .icon.specialty { background: var(--gold-50); }
.autocomplete-item .icon.governorate { background: var(--success-bg); }
.autocomplete-item .icon.branch { background: var(--info-bg); }

.autocomplete-item div { flex: 1; min-width: 0; }
.autocomplete-item div > div:first-child { font-weight: 500; color: var(--text-primary); }
.autocomplete-item .label { font-size: 0.8rem; color: var(--text-tertiary); margin-top: 2px; }

/* ─── Filters ─── */
.filters {
  position: sticky;
  top: 68px;
  z-index: 90;
  background: var(--bg-glass-heavy);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-light);
  padding: 16px 0;
}

.filters .container {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

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

.filter-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.filters select {
  padding: 10px 36px 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: inherit;
  background: var(--bg-elevated);
  color: var(--text-primary);
  cursor: pointer;
  min-width: 160px;
  transition: all var(--transition-fast);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 12px center;
}

.filters select:focus {
  outline: none;
  border-color: var(--primary-400);
  box-shadow: 0 0 0 3px rgba(26, 127, 163, 0.1);
}

.active-filters {
  margin-right: auto;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: var(--primary-50);
  color: var(--primary-700);
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 500;
}

/* ─── Results ─── */
.results-area {
  padding: 48px 0 100px;
  min-height: 400px;
}

.results-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  margin-bottom: 24px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.results-count {
  font-weight: 700;
  color: var(--primary);
  font-size: 1rem;
}

/* ─── Result Card ─── */
.result-card {
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: 20px;
  transition: all var(--transition);
  animation: cardIn 0.5s var(--ease-out) both;
}

.result-card:hover {
  border-color: var(--primary-200);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  transform: translateY(-4px);
}

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

.card-header {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border-light);
  background: linear-gradient(180deg, var(--gray-50) 0%, var(--bg-elevated) 100%);
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--gray-900);
}

.card-specialty {
  font-size: 0.8rem;
  padding: 5px 14px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--gold-100) 0%, var(--gold-50) 100%);
  color: var(--gold-800);
  font-weight: 600;
  border: 1px solid var(--gold-200);
  white-space: nowrap;
}

.card-body {
  padding: 8px 24px 24px;
}

/* ─── Branch ─── */
.branch-item {
  padding: 18px 0;
  border-bottom: 1px solid var(--border-light);
  transition: all var(--transition-fast);
}

.branch-item:last-child { border-bottom: none; }

.branch-item:hover {
  padding-right: 8px;
}

.branch-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.branch-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--gray-800);
  display: flex;
  align-items: center;
  gap: 6px;
}

.branch-gov {
  font-size: 0.78rem;
  color: var(--text-tertiary);
  background: var(--gray-100);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-weight: 500;
}

.branch-address {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
  line-height: 1.6;
}

.branch-phone {
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.branch-phone a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  background: var(--primary-50);
  color: var(--primary-700);
  font-weight: 600;
  font-size: 0.9rem;
  direction: ltr;
  text-decoration: none;
  transition: all var(--transition-fast);
  border: 1px solid var(--primary-100);
}

.branch-phone a:hover {
  background: var(--primary-100);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

/* ─── Empty State ─── */
.empty-state {
  text-align: center;
  padding: 80px 24px;
  background: var(--bg-elevated);
  border-radius: var(--radius-xl);
  border: 2px dashed var(--border);
}

.empty-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-100);
  border-radius: var(--radius-xl);
  color: var(--gray-400);
}

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

.empty-state p {
  color: var(--text-tertiary);
  font-size: 0.95rem;
}

/* ─── Loading ─── */
.loading {
  text-align: center;
  padding: 64px;
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto 16px;
}

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

.loading p {
  color: var(--text-tertiary);
  font-size: 0.9rem;
}

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-600) 100%);
  color: var(--text-inverse);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn-secondary {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-700) 100%);
  color: var(--text-inverse);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn-danger {
  background: var(--danger);
  color: var(--text-inverse);
}

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

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

.btn-outline:hover {
  border-color: var(--primary-300);
  color: var(--primary);
  background: var(--primary-50);
}

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

.btn-ghost:hover {
  background: var(--gray-100);
  color: var(--text-primary);
}

.btn-block { width: 100%; }

.btn-sm {
  padding: 6px 12px;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
}

/* ─── Admin Page ─── */
.admin-page {
  padding: 40px 0;
}

/* Login Card */
.login-card {
  max-width: 420px;
  margin: 60px auto;
  background: var(--bg-elevated);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  padding: 48px 40px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.login-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-50);
  border-radius: var(--radius-xl);
  color: var(--primary);
}

.login-card h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--gray-900);
}

.login-desc {
  color: var(--text-tertiary);
  font-size: 0.9rem;
  margin-bottom: 28px;
}

.error-msg {
  color: var(--danger);
  font-size: 0.85rem;
  margin-top: 12px;
  min-height: 20px;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 24px;
}

.tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  border: none;
  background: transparent;
  font-family: inherit;
}

.tab:hover {
  color: var(--text-primary);
  background: var(--gray-50);
}

.tab.active {
  background: var(--primary);
  color: var(--text-inverse);
  box-shadow: var(--shadow-sm);
}

.tab svg { opacity: 0.7; }
.tab.active svg { opacity: 1; }

.tab-content {
  animation: fadeIn 0.3s var(--ease-out);
}

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

/* Admin Header */
.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.admin-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-900);
}

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

.search-input-mini {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.search-input-mini:focus-within {
  border-color: var(--primary-400);
  box-shadow: 0 0 0 3px rgba(26, 127, 163, 0.1);
}

.search-input-mini svg { color: var(--gray-400); flex-shrink: 0; }

.search-input-mini input {
  border: none;
  background: transparent;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--text-primary);
  outline: none;
  width: 180px;
}

/* Form Card */
.form-card {
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
}

.form-card-header {
  padding: 24px 28px;
  border-bottom: 1px solid var(--border-light);
  background: linear-gradient(180deg, var(--gray-50) 0%, var(--bg-elevated) 100%);
}

.form-card-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--gray-900);
}

.form-card form {
  padding: 28px;
}

.form-hint {
  padding: 0 28px;
  margin-bottom: 8px;
  color: var(--text-tertiary);
  font-size: 0.82rem;
  line-height: 1.6;
}

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

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

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-elevated);
  transition: all var(--transition-fast);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-400);
  box-shadow: 0 0 0 3px rgba(26, 127, 163, 0.1);
}

.form-group input::placeholder {
  color: var(--gray-400);
}

.form-divider {
  height: 1px;
  background: var(--border);
  margin: 24px 0;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 16px;
}

.section-title svg { color: var(--primary); }

/* Checkbox */
.checkbox-label {
  display: flex !important;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  font-size: 0.9rem !important;
  color: var(--text-primary) !important;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* Branch Form */
.branch-form {
  background: var(--gray-50);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 12px;
  transition: all var(--transition-fast);
}

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

.branch-form hr {
  border: none;
  border-top: 1px dashed var(--border);
  margin: 0 0 16px;
}

.form-actions {
  display: flex;
  gap: 12px;
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
  margin-top: 8px;
}

/* Upload Zone */
.upload-zone {
  margin: 0 28px 28px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--primary-400);
  background: var(--primary-50);
}

.upload-icon {
  color: var(--gray-400);
  margin-bottom: 16px;
}

.upload-text {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.upload-hint {
  font-size: 0.85rem;
  color: var(--text-tertiary);
}

/* Table */
.table-container {
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
}

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

th, td {
  padding: 14px 20px;
  text-align: right;
  font-size: 0.88rem;
}

th {
  background: var(--gray-50);
  font-weight: 600;
  color: var(--gray-600);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 1px solid var(--border);
}

td {
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
}

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

tr:hover td {
  background: var(--gray-50);
}

/* ─── Toast ─── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--gray-900);
  color: var(--text-inverse);
  padding: 14px 28px;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 500;
  z-index: 1000;
  opacity: 0;
  transition: all 0.4s var(--ease-spring);
  box-shadow: var(--shadow-2xl);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }

/* ─── Footer ─── */
footer {
  border-top: 1px solid var(--border-light);
  padding: 24px 0;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 0.85rem;
  background: var(--bg-elevated);
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .hero h1 { font-size: 2rem; }
  .hero-desc { font-size: 1rem; }
  .hero { padding: 48px 0 40px; }
  .hero-content { margin-bottom: 32px; }

  .search-input-wrap button { padding: 12px 20px; font-size: 0.88rem; }

  .filter-group { width: 100%; }
  .filter-item { width: 100%; }
  .filters select { width: 100%; }

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

  .admin-header { flex-direction: column; align-items: stretch; }
  .admin-header-actions { flex-direction: column; }
  .search-input-mini { width: 100%; }
  .search-input-mini input { width: 100%; }

  .tabs { overflow-x: auto; }
  .tab { flex: none; padding: 10px 16px; font-size: 0.82rem; }

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

  header .container { height: 56px; }
  .logo-text { font-size: 1rem; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 1.6rem; }
  .hero-badge { font-size: 0.75rem; padding: 4px 12px; }
  .search-input-wrap input { padding: 14px 12px; }
  .search-input-wrap button { padding: 10px 16px; }
  .search-icon { display: none; }
}
