@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700;900&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --navy: #0A1628;
  --blue: #1E3A5F;
  --blue-light: #2A5298;
  --gold: #C9A84C;
  --gold-light: #E8C97A;
  --white-cold: #F0F4FF;
  --white: #FFFFFF;
  --red: #E63946;
  --green: #2A9D5C;
  --gray: #8899AA;
  --gray-light: #D8E2EF;
  --text: #1A2A3A;
  --shadow: 0 4px 24px rgba(10,22,40,0.13);
  --shadow-lg: 0 8px 48px rgba(10,22,40,0.22);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--navy);
  color: var(--text);
  min-height: 100vh;
}

/* ─── HEADER ─── */
.site-header {
  background: linear-gradient(135deg, var(--navy) 0%, var(--blue) 100%);
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 20px rgba(0,0,0,0.4);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

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

.logo-seal {
  width: 48px;
  height: 48px;
  animation: sealAppear 1.2s cubic-bezier(0.34,1.56,0.64,1) forwards;
}

@keyframes sealAppear {
  from { transform: scale(0) rotate(-30deg); opacity: 0; }
  to   { transform: scale(1) rotate(0deg);  opacity: 1; }
}

.logo-text { color: var(--white); }
.logo-text .name {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: 0.04em;
  line-height: 1;
}
.logo-text .sub {
  font-size: 0.68rem;
  color: var(--gold-light);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 2px;
}

.header-nav { display: flex; gap: 6px; align-items: center; }
.nav-link {
  color: var(--white-cold);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 6px;
  transition: background 0.2s, color 0.2s;
  letter-spacing: 0.03em;
}
.nav-link:hover { background: rgba(201,168,76,0.18); color: var(--gold-light); }
.nav-link.active { background: var(--gold); color: var(--navy); font-weight: 600; }

/* ─── HERO ─── */
.hero {
  background: linear-gradient(160deg, var(--navy) 0%, var(--blue) 60%, #0D2040 100%);
  padding: 80px 2rem 90px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 110%, rgba(201,168,76,0.12) 0%, transparent 70%);
}

.hero-seal {
  width: 110px;
  height: 110px;
  margin: 0 auto 28px;
  animation: sealAppear 1.4s cubic-bezier(0.34,1.56,0.64,1) 0.2s both;
  filter: drop-shadow(0 4px 24px rgba(201,168,76,0.35));
}

.hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 900;
  color: var(--white);
  line-height: 1.15;
  margin-bottom: 14px;
  position: relative;
}
.hero h1 span { color: var(--gold); }

.hero-sub {
  font-size: 1.05rem;
  color: var(--gray-light);
  max-width: 560px;
  margin: 0 auto 36px;
  line-height: 1.7;
  position: relative;
}

.hero-badges {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  position: relative;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(201,168,76,0.3);
  border-radius: 999px;
  padding: 7px 18px;
  font-size: 0.8rem;
  color: var(--gold-light);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ─── MAIN CONTENT ─── */
.main-wrap {
  background: var(--white-cold);
  min-height: 100vh;
  padding: 0;
}

.section {
  padding: 60px 2rem;
  max-width: 900px;
  margin: 0 auto;
}
.section-lg { max-width: 1200px; }

.section-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 8px;
}
.section-title span { color: var(--gold); }
.section-sub {
  color: var(--gray);
  font-size: 0.95rem;
  margin-bottom: 36px;
  max-width: 560px;
}

.divider {
  width: 48px;
  height: 3px;
  background: var(--gold);
  border-radius: 2px;
  margin-bottom: 36px;
}

/* ─── CARDS TYPE CHOOSER ─── */
.type-chooser {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 40px;
}

.type-card {
  cursor: pointer;
  border: 2px solid var(--gray-light);
  border-radius: 16px;
  padding: 28px 24px;
  background: var(--white);
  transition: all 0.25s;
  position: relative;
  overflow: hidden;
}
.type-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--gold);
  transform: scaleX(0);
  transition: transform 0.25s;
}
.type-card:hover { border-color: var(--gold); box-shadow: var(--shadow); transform: translateY(-2px); }
.type-card:hover::before { transform: scaleX(1); }
.type-card.selected { border-color: var(--gold); background: #FFFBF0; box-shadow: var(--shadow); }
.type-card.selected::before { transform: scaleX(1); }

.type-card .icon {
  font-size: 2.2rem;
  margin-bottom: 14px;
  display: block;
}
.type-card h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  color: var(--navy);
  margin-bottom: 8px;
}
.type-card p { font-size: 0.85rem; color: var(--gray); line-height: 1.6; }

/* ─── FORM ─── */
.form-card {
  background: var(--white);
  border-radius: 20px;
  padding: 40px;
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-light);
  animation: fadeUp 0.4s ease both;
}

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

.form-section-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  color: var(--blue);
  font-weight: 600;
  margin: 28px 0 18px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--gray-light);
  display: flex;
  align-items: center;
  gap: 10px;
}
.form-section-title:first-child { margin-top: 0; }

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

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field.span-2 { grid-column: span 2; }

label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--blue);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
label .req { color: var(--red); margin-left: 3px; }

input[type=text], input[type=email], input[type=number], input[type=password], textarea, select {
  border: 1.5px solid var(--gray-light);
  border-radius: 10px;
  padding: 11px 14px;
  font-family: 'Inter', sans-serif;
  font-size: 0.92rem;
  color: var(--text);
  background: var(--white-cold);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  width: 100%;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--blue-light);
  box-shadow: 0 0 0 3px rgba(42,82,152,0.1);
  background: var(--white);
}
textarea { resize: vertical; min-height: 110px; }

.conditions-block {
  background: #F8F6EE;
  border: 1px solid #E8C97A;
  border-radius: 14px;
  padding: 22px 24px;
  margin: 24px 0;
}
.conditions-block h4 {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  color: var(--navy);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.condition-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
  cursor: pointer;
}
.condition-item:last-child { margin-bottom: 0; }
.condition-item input[type=checkbox] {
  width: 18px;
  height: 18px;
  min-width: 18px;
  accent-color: var(--gold);
  margin-top: 2px;
}
.condition-item span {
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.55;
}
.condition-item span strong { color: var(--navy); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 28px;
  border-radius: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all 0.2s;
  letter-spacing: 0.02em;
}
.btn-primary {
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-light) 100%);
  color: var(--white);
  box-shadow: 0 4px 14px rgba(30,58,95,0.35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(30,58,95,0.45); }
.btn-gold {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
  color: var(--navy);
  box-shadow: 0 4px 14px rgba(201,168,76,0.35);
}
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(201,168,76,0.45); }
.btn-danger { background: var(--red); color: var(--white); }
.btn-danger:hover { background: #c0303c; }
.btn-ghost { background: transparent; border: 1.5px solid var(--gray-light); color: var(--text); }
.btn-ghost:hover { border-color: var(--blue); color: var(--blue); }
.btn-sm { padding: 7px 16px; font-size: 0.8rem; border-radius: 7px; }

.btn-full { width: 100%; justify-content: center; margin-top: 10px; }

/* ─── ALERTS ─── */
.alert {
  border-radius: 12px;
  padding: 16px 20px;
  font-size: 0.88rem;
  margin-bottom: 24px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  animation: fadeUp 0.35s ease both;
}
.alert-success { background: #EAF7EF; border: 1px solid #2A9D5C; color: #1E6B3E; }
.alert-error { background: #FEF0F0; border: 1px solid var(--red); color: #9B1A22; }
.alert-info { background: #EEF4FF; border: 1px solid var(--blue-light); color: var(--blue); }
.alert-warning { background: #FFF9EC; border: 1px solid var(--gold); color: #7A5A0A; }

/* ─── STATUS BADGES ─── */
.status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.status-pending { background: #FFF3E0; color: #E65100; }
.status-approved { background: #E8F5E9; color: #1B5E20; }
.status-rejected { background: #FFEBEE; color: #B71C1C; }
.status-review { background: #E3F2FD; color: #0D47A1; }

/* ─── ADMIN LAYOUT ─── */
.admin-layout {
  display: flex;
  min-height: 100vh;
  background: #F0F4FF;
}

.sidebar {
  width: 260px;
  min-width: 260px;
  background: linear-gradient(180deg, var(--navy) 0%, var(--blue) 100%);
  padding: 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-header {
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.sidebar-header .name {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  color: var(--white);
  font-weight: 700;
}
.sidebar-header .role {
  font-size: 0.72rem;
  color: var(--gold-light);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 3px;
}

.sidebar-nav { flex: 1; padding: 16px 12px; }
.nav-group-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  padding: 8px 10px 6px;
  margin-top: 8px;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 11px;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 9px;
  font-size: 0.88rem;
  font-weight: 500;
  transition: all 0.18s;
  margin-bottom: 2px;
}
.sidebar-link .icon { font-size: 1rem; width: 20px; text-align: center; }
.sidebar-link:hover { background: rgba(255,255,255,0.1); color: var(--white); }
.sidebar-link.active { background: var(--gold); color: var(--navy); font-weight: 600; }
.sidebar-link .count {
  margin-left: auto;
  background: var(--red);
  color: var(--white);
  border-radius: 999px;
  font-size: 0.68rem;
  padding: 1px 7px;
  font-weight: 700;
}

.admin-main {
  flex: 1;
  padding: 32px 36px;
  overflow-x: hidden;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 30px;
}
.page-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.7rem;
  color: var(--navy);
}
.page-header p { color: var(--gray); font-size: 0.88rem; margin-top: 3px; }

/* ─── STATS GRID ─── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 30px;
}
.stat-card {
  background: var(--white);
  border-radius: 16px;
  padding: 22px 20px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--gold);
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: attr(data-icon);
  position: absolute;
  right: 16px; top: 16px;
  font-size: 2rem;
  opacity: 0.12;
}
.stat-card .label { font-size: 0.75rem; color: var(--gray); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.stat-card .value { font-family: 'Playfair Display', serif; font-size: 2.2rem; font-weight: 700; color: var(--navy); line-height: 1; margin: 6px 0 2px; }
.stat-card .delta { font-size: 0.78rem; color: var(--green); }
.stat-card.red { border-left-color: var(--red); }
.stat-card.green { border-left-color: var(--green); }
.stat-card.blue { border-left-color: var(--blue-light); }

/* ─── TABLE ─── */
.table-wrap {
  background: var(--white);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 24px;
}
.table-head {
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--gray-light);
  background: var(--white);
}
.table-head h3 { font-family: 'Playfair Display', serif; font-size: 1.05rem; color: var(--navy); }

.table-filters {
  display: flex;
  gap: 10px;
  align-items: center;
}
.table-filters input, .table-filters select {
  padding: 8px 13px;
  border: 1.5px solid var(--gray-light);
  border-radius: 8px;
  font-size: 0.82rem;
  color: var(--text);
  background: var(--white-cold);
  outline: none;
}
.table-filters input:focus, .table-filters select:focus { border-color: var(--blue-light); }

table { width: 100%; border-collapse: collapse; }
thead tr { background: var(--white-cold); }
th {
  text-align: left;
  padding: 12px 16px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--blue);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--gray-light);
}
td {
  padding: 13px 16px;
  font-size: 0.87rem;
  color: var(--text);
  border-bottom: 1px solid var(--gray-light);
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: #F8FAFE; }

.td-bold { font-weight: 600; color: var(--navy); }
.td-id { font-size: 0.75rem; color: var(--gray); font-family: monospace; }

/* ─── MODAL ─── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10,22,40,0.65);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(3px);
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--white);
  border-radius: 20px;
  max-width: 700px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: fadeUp 0.3s ease both;
}
.modal-header {
  padding: 24px 28px 18px;
  border-bottom: 1px solid var(--gray-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h3 { font-family: 'Playfair Display', serif; font-size: 1.2rem; color: var(--navy); }
.modal-close {
  background: var(--white-cold);
  border: none;
  border-radius: 8px;
  width: 32px; height: 32px;
  cursor: pointer;
  font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.modal-close:hover { background: var(--gray-light); }
.modal-body { padding: 24px 28px; }
.modal-footer {
  padding: 16px 28px 24px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  border-top: 1px solid var(--gray-light);
}

/* ─── DETAIL ROWS ─── */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
.detail-item label { font-size: 0.72rem; font-weight: 700; color: var(--gray); letter-spacing: 0.08em; text-transform: uppercase; display: block; margin-bottom: 4px; }
.detail-item p { font-size: 0.9rem; color: var(--text); font-weight: 500; }
.detail-item.full { grid-column: span 2; }

.doc-field {
  background: var(--white-cold);
  border: 1.5px solid var(--gray-light);
  border-radius: 10px;
  padding: 13px 16px;
  font-size: 0.88rem;
  margin-bottom: 10px;
}
.doc-field label { display: block; font-size: 0.72rem; font-weight: 700; color: var(--blue); letter-spacing: 0.07em; text-transform: uppercase; margin-bottom: 5px; }
.doc-field input { background: var(--white); }

/* ─── CANDIDAT ─── */
.candidat-card {
  background: var(--white);
  border-radius: 20px;
  padding: 36px;
  box-shadow: var(--shadow);
  max-width: 680px;
  margin: 0 auto;
}
.candidat-status-block {
  text-align: center;
  padding: 36px 24px;
  background: var(--white-cold);
  border-radius: 16px;
  margin: 24px 0;
}
.candidat-status-block .big-icon { font-size: 3.5rem; margin-bottom: 16px; display: block; }
.candidat-status-block h3 { font-family: 'Playfair Display', serif; font-size: 1.4rem; color: var(--navy); margin-bottom: 8px; }
.candidat-status-block p { color: var(--gray); font-size: 0.9rem; max-width: 380px; margin: 0 auto; }

.docs-list { margin-top: 24px; }
.doc-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: var(--white-cold);
  border: 1px solid var(--gray-light);
  border-radius: 12px;
  margin-bottom: 10px;
}
.doc-item .doc-icon { font-size: 1.6rem; }
.doc-item .doc-info { flex: 1; }
.doc-item .doc-name { font-weight: 600; color: var(--navy); font-size: 0.9rem; }
.doc-item .doc-val { font-size: 0.88rem; color: var(--blue-light); font-family: monospace; font-weight: 600; margin-top: 2px; }

/* ─── LOGIN ─── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--navy) 0%, var(--blue) 100%);
  padding: 20px;
}
.login-card {
  background: var(--white);
  border-radius: 20px;
  padding: 44px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
}
.login-card .login-seal { display: block; width: 64px; margin: 0 auto 20px; }
.login-card h2 { font-family: 'Playfair Display', serif; font-size: 1.6rem; color: var(--navy); text-align: center; margin-bottom: 6px; }
.login-card p { text-align: center; color: var(--gray); font-size: 0.88rem; margin-bottom: 28px; }

/* ─── NOTES TEXTAREA ─── */
.note-field textarea { min-height: 80px; font-size: 0.85rem; }

/* ─── TABS ─── */
.tabs { display: flex; gap: 4px; margin-bottom: 24px; background: var(--white-cold); padding: 4px; border-radius: 12px; width: fit-content; }
.tab-btn {
  padding: 8px 20px;
  border-radius: 9px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--gray);
  transition: all 0.2s;
}
.tab-btn.active { background: var(--white); color: var(--navy); box-shadow: var(--shadow); }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeUp 0.3s ease both; }

/* ─── FOOTER ─── */
.site-footer {
  background: var(--navy);
  padding: 28px 2rem;
  text-align: center;
  border-top: 1px solid rgba(201,168,76,0.2);
}
.site-footer p { color: rgba(255,255,255,0.35); font-size: 0.78rem; letter-spacing: 0.05em; }
.site-footer span { color: var(--gold); }

/* ─── INFO BOX ─── */
.info-box {
  background: #EEF4FF;
  border-left: 4px solid var(--blue-light);
  border-radius: 0 10px 10px 0;
  padding: 14px 18px;
  font-size: 0.85rem;
  color: var(--blue);
  margin-bottom: 20px;
  line-height: 1.6;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
  .type-chooser { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .field.span-2 { grid-column: span 1; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .admin-layout { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: relative; }
  .admin-main { padding: 20px 16px; }
  .header-nav .nav-link { display: none; }
  .header-nav .nav-link.active { display: inline-flex; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-item.full { grid-column: span 1; }
}
