:root {
  --bg-primary: #1E2328;
  --bg-secondary: #181B1F;
  --bg-card: #31333E;
  --bg-card-hover: #3A3C48;
  --accent: #EBD323;
  --accent-light: #F0DE4A;
  --accent-glow: rgba(235, 211, 35, 0.25);
  --text-primary: #FFFFFF;
  --text-secondary: #9DA0A4;
  --text-muted: #7A7D80;
  --border: rgba(255, 255, 255, 0.08);
  --gradient: linear-gradient(135deg, #EBD323 0%, #F0DE4A 100%);
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

html { scroll-behavior: smooth; }

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

a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-light); }

/* ── Header ── */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(20px);
  background: rgba(30, 35, 40, 0.9);
  border-bottom: 1px solid var(--border);
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text-primary);
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: var(--accent);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.nav { display: flex; align-items: center; gap: 8px; }

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

.nav a:hover, .nav a.active {
  color: var(--text-primary);
  background: rgba(235, 211, 35, 0.12);
}

.search-box {
  position: relative;
  flex: 1;
  max-width: 360px;
}

.search-box input {
  width: 100%;
  padding: 10px 16px 10px 40px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

.search-box input:focus { border-color: var(--accent); }
.search-box input::placeholder { color: var(--text-muted); }

.search-box svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font);
}

.btn-primary {
  background: var(--accent);
  color: var(--bg-primary);
  box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-primary:hover {
  background: var(--accent-light);
  transform: translateY(-1px);
  box-shadow: 0 6px 24px var(--accent-glow);
}

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

.btn-ghost:hover {
  color: var(--text-primary);
  border-color: var(--accent);
  background: rgba(235, 211, 35, 0.08);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #F87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-sm { padding: 6px 14px; font-size: 0.82rem; }

/* ── Hero ── */
.hero {
  position: relative;
  padding: 80px 24px 60px;
  text-align: center;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 600px;
  background: radial-gradient(ellipse, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 16px;
  position: relative;
}

.hero h1 span {
  color: var(--accent);
}

.hero p {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto 32px;
  position: relative;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Categories ── */
.section { padding: 48px 0; }

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.section-subtitle {
  color: var(--text-secondary);
  margin-bottom: 32px;
}

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

.category-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  cursor: pointer;
  transition: all 0.25s;
  text-decoration: none;
  color: inherit;
  display: block;
}

.category-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(235, 211, 35, 0.3);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.category-icon {
  font-size: 2rem;
  margin-bottom: 12px;
  display: block;
}

.category-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.category-card p {
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.5;
}

.category-count {
  display: inline-block;
  margin-top: 12px;
  font-size: 0.78rem;
  color: var(--accent);
  font-weight: 600;
}

/* ── Articles ── */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

.article-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: all 0.25s;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}

.article-card:hover {
  border-color: rgba(235, 211, 35, 0.3);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.article-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 10px;
}

.article-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 8px;
  line-height: 1.4;
}

.article-card p {
  color: var(--text-secondary);
  font-size: 0.88rem;
  flex: 1;
}

.article-meta {
  margin-top: 16px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ── Article page ── */
.article-page { padding: 48px 0 80px; }

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 32px;
}

.breadcrumb a { color: var(--text-secondary); }

.article-header { margin-bottom: 40px; }

.article-header h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 12px;
}

.article-header .excerpt {
  font-size: 1.1rem;
  color: var(--text-secondary);
}

.article-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  max-width: 800px;
}

.article-content h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 32px 0 12px;
  color: var(--text-primary);
}

.article-content h2:first-child { margin-top: 0; }

.article-content h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 24px 0 8px;
}

.article-content p {
  margin-bottom: 12px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.article-content ul, .article-content ol {
  margin: 12px 0 12px 24px;
  color: var(--text-secondary);
}

.article-content li { margin-bottom: 6px; }

.article-content blockquote {
  border-left: 3px solid var(--accent);
  padding: 12px 20px;
  margin: 20px 0;
  background: rgba(235, 211, 35, 0.08);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-secondary);
}

.article-content code {
  background: var(--bg-secondary);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.88em;
}

.article-content img,
.article-content .md-image {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  margin: 20px 0;
  display: block;
  border: 1px solid var(--border);
}

.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
}

.article-content th, .article-content td {
  padding: 10px 14px;
  border: 1px solid var(--border);
  text-align: left;
  font-size: 0.9rem;
}

.article-content th {
  background: var(--bg-secondary);
  font-weight: 600;
}

.article-content a { color: var(--accent); }

/* ── Admin ── */
.admin-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: calc(100vh - 65px);
}

.admin-sidebar {
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  padding: 24px 16px;
}

.admin-sidebar h3 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 12px;
  padding: 0 12px;
}

.admin-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 2px;
  transition: all 0.2s;
}

.admin-nav a:hover, .admin-nav a.active {
  background: rgba(235, 211, 35, 0.12);
  color: var(--text-primary);
}

.admin-main { padding: 32px; }

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}

.admin-header h1 { font-size: 1.6rem; font-weight: 700; }

/* ── Forms ── */
.form-group { margin-bottom: 20px; }

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

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--accent); }

.form-group textarea { min-height: 200px; resize: vertical; line-height: 1.6; }

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

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.checkbox-label input { width: auto; }

.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.editor-toolbar .btn { font-size: 0.82rem; }

.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  margin-bottom: 8px;
}

.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--accent);
  background: rgba(235, 211, 35, 0.05);
}

.upload-zone input { display: none; }

/* ── Table ── */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.data-table tr:hover td { background: rgba(235, 211, 35, 0.04); }

.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-published {
  background: rgba(34, 197, 94, 0.15);
  color: #4ADE80;
}

.status-draft {
  background: rgba(235, 211, 35, 0.15);
  color: var(--accent);
}

/* ── Auth pages ── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: var(--shadow);
}

.auth-card h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 8px;
  text-align: center;
}

.auth-card .subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 32px;
}

.auth-card .btn-primary { width: 100%; justify-content: center; padding: 14px; }

.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  margin-bottom: 16px;
}

.alert-error {
  background: rgba(239, 68, 68, 0.12);
  color: #F87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.alert-success {
  background: rgba(34, 197, 94, 0.12);
  color: #4ADE80;
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.alert-info {
  background: rgba(235, 211, 35, 0.12);
  color: var(--accent);
  border: 1px solid rgba(235, 211, 35, 0.25);
}

/* ── Footer ── */
.footer {
  border-top: 1px solid var(--border);
  padding: 32px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer a { color: var(--text-secondary); }

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-muted);
}

.empty-state .icon { font-size: 3rem; margin-bottom: 16px; }

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 14px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  font-size: 0.9rem;
  z-index: 1000;
  animation: slideUp 0.3s ease;
}

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

/* ── Responsive ── */
@media (max-width: 768px) {
  .header-inner { flex-wrap: wrap; }
  .search-box { order: 3; max-width: 100%; flex-basis: 100%; }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { display: none; }
  .form-row { grid-template-columns: 1fr; }
  .articles-grid { grid-template-columns: 1fr; }
  .article-content { padding: 24px; }
}

.hidden { display: none !important; }

/* ── Employee forms (compensation, vacation) ── */
.form-page { max-width: 640px; margin: 0 auto; padding: 48px 24px 80px; }

.form-page .page-header {
  background: var(--bg-card);
  border-top: 6px solid var(--accent);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
}

.form-page .page-header h1 { font-size: 1.5rem; margin-bottom: 6px; }
.form-page .page-header p { color: var(--text-secondary); font-size: 0.92rem; }

.field-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 12px;
}

.field-card > label.field-label,
.field-card > .field-label {
  display: block;
  font-weight: 600;
  margin-bottom: 12px;
  font-size: 0.95rem;
}

.field-hint { display: block; font-weight: 400; font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }

.radio-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  font-size: 0.88rem;
  color: var(--text-secondary);
  cursor: pointer;
  line-height: 1.5;
}

.radio-option input { margin-top: 3px; width: auto; accent-color: var(--accent); }

.file-drop {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 18px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.file-drop:hover, .file-drop.dragover { border-color: var(--accent); background: rgba(235, 211, 35, 0.05); }
.file-drop input { display: none; }
.file-drop .file-list { margin-top: 8px; color: var(--text-primary); font-size: 0.82rem; }

.status-pending { background: rgba(235, 211, 35, 0.15); color: var(--accent); }
.status-approved { background: rgba(34, 197, 94, 0.15); color: #4ADE80; }
.status-rejected { background: rgba(239, 68, 68, 0.15); color: #F87171; }

.balance-box {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 16px;
}

.balance-stat { text-align: left; }
.balance-stat .value { font-size: 1.8rem; font-weight: 800; color: var(--accent); }
.balance-stat .label { font-size: 0.8rem; color: var(--text-muted); }

.away-list { display: flex; flex-direction: column; gap: 10px; }

.away-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 0.9rem;
}

.away-row .dates { color: var(--text-secondary); font-size: 0.85rem; }

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

.tabs button {
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: 10px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  font-family: var(--font);
}

.tabs button.active { color: var(--text-primary); border-bottom-color: var(--accent); }

/* ── Личный кабинет ── */
.lk-page { max-width: 760px; margin: 0 auto; padding: 48px 24px 80px; }

.lk-login-card {
  max-width: 440px;
  margin: 80px auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: var(--shadow);
  text-align: center;
}

.lk-login-card h1 { font-size: 1.4rem; margin-bottom: 8px; }
.lk-login-card p { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 24px; }
.lk-login-card .form-group { text-align: left; }

.lk-hero {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--bg-card);
  border-top: 6px solid var(--accent);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 20px;
}

.lk-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--gradient);
  color: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 800;
  flex-shrink: 0;
}

.lk-hero h1 { font-size: 1.35rem; margin-bottom: 4px; }
.lk-hero p { color: var(--text-secondary); font-size: 0.85rem; }
.lk-hero .lk-actions { margin-left: auto; display: flex; gap: 10px; flex-shrink: 0; }

.lk-balance-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}

.lk-balance-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
}

.lk-balance-top .big { font-size: 2.2rem; font-weight: 800; color: var(--accent); }
.lk-balance-top .big span { font-size: 1rem; font-weight: 600; color: var(--text-muted); }

.progress-track {
  width: 100%;
  height: 10px;
  background: var(--bg-secondary);
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-fill {
  height: 100%;
  background: var(--gradient);
  border-radius: 20px;
  transition: width 0.4s ease;
}

.lk-section { margin-bottom: 28px; }

.lk-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.lk-section-header h2 { font-size: 1.1rem; font-weight: 700; }

.lk-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-bottom: 10px;
}

.lk-item .main { font-size: 0.9rem; }
.lk-item .sub { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }
.lk-item .right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
