:root {
  --bg: #08090c;
  --panel: #11141a;
  --panel-2: #171b23;
  --border: rgba(202, 168, 93, 0.22);
  --text: #f2efe8;
  --muted: #9b9ea7;
  --gold: #caa85d;
  --gold-2: #e4cc88;
  --danger: #ef6461;
  --ok: #58c27d;
  --warning: #d69b35;
  --radius: 18px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: radial-gradient(circle at top, #151515 0, var(--bg) 48%, #050506 100%);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, Segoe UI, Arial, sans-serif;
}
button, input, textarea, select { font: inherit; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 300px 1fr; }
.sidebar { padding: 24px; border-right: 1px solid var(--border); background: rgba(10, 11, 15, 0.84); }
.brand { display: flex; align-items: center; gap: 14px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.brand__logo { width: 58px; height: 58px; border-radius: 50%; object-fit: cover; border: 1px solid var(--gold); }
.brand__title { font-size: 22px; font-weight: 800; letter-spacing: .06em; color: var(--gold-2); }
.brand__subtitle { color: var(--muted); font-size: 13px; }
.nav { display: grid; gap: 10px; margin-top: 24px; }
.nav__item { text-align: left; background: transparent; color: var(--muted); border: 1px solid transparent; padding: 13px 14px; border-radius: 14px; cursor: pointer; }
.nav__item:hover, .nav__item.active { color: var(--text); background: var(--panel-2); border-color: var(--border); }
.sidebar__footer { position: fixed; bottom: 20px; left: 24px; color: var(--muted); font-size: 13px; }
.status-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--warning); margin-right: 6px; }
.main { padding: 30px; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
h1 { margin: 0; font-size: 30px; }
p { color: var(--muted); }
.user-panel { display: flex; align-items: center; gap: 12px; color: var(--muted); }
.login-card { max-width: 420px; padding: 28px; border-radius: var(--radius); border: 1px solid var(--border); background: linear-gradient(180deg, rgba(23,27,35,.95), rgba(12,13,18,.95)); box-shadow: 0 24px 90px rgba(0,0,0,.36); }

/* Auth-only screen: center the login card on a solid dark background. */
.app-shell--auth {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
}
.app-shell--auth .login-card {
  margin: 0;
}
.login-card__logo { width: 86px; height: 86px; border-radius: 50%; display: block; margin: 0 auto 18px; border: 1px solid var(--gold); }
label { display: block; color: var(--gold-2); margin: 14px 0 6px; font-size: 13px; }
input, textarea, select { width: 100%; background: #090b0f; color: var(--text); border: 1px solid var(--border); border-radius: 12px; padding: 12px; outline: none; }
input:focus, textarea:focus, select:focus { border-color: var(--gold); }
.btn { border: 0; border-radius: 12px; padding: 11px 16px; cursor: pointer; }
.btn--primary { width: 100%; margin-top: 18px; color: #0b0b0e; background: linear-gradient(135deg, var(--gold), var(--gold-2)); font-weight: 800; }
.btn--danger { background: rgba(232, 85, 85, 0.15); color: #ff8c8c; border: 1px solid rgba(232, 85, 85, 0.35); }
.btn--ghost { background: transparent; color: var(--gold-2); border: 1px solid var(--border); }
.hidden { display: none !important; }
.form-error { color: var(--danger); margin-top: 12px; }
.muted { color: var(--muted); font-size: 13px; }
.content { display: grid; gap: 18px; }
.grid { display: grid; gap: 16px; }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card { background: rgba(20,23,30,.92); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.quick-card { display: flex; align-items: center; gap: 14px; cursor: pointer; text-decoration: none; color: inherit; transition: border-color .15s, background .15s; }
.quick-card:hover { border-color: var(--gold); background: rgba(202,168,93,.06); }
.quick-card__icon { width: 44px; height: 44px; border-radius: 12px; background: rgba(202,168,93,.12); display: grid; place-items: center; color: var(--gold-2); flex-shrink: 0; }
.quick-card__icon svg { width: 22px; height: 22px; }
.quick-card__title { font-weight: 700; color: var(--text); }
.quick-card__desc { font-size: 13px; color: var(--muted); }
.card__value { font-size: 30px; color: var(--gold-2); font-weight: 800; }
.table { width: 100%; border-collapse: collapse; overflow: hidden; border-radius: 16px; }
.table th, .table td { padding: 13px 12px; border-bottom: 1px solid rgba(255,255,255,.06); text-align: left; }
.table th { color: var(--gold-2); font-weight: 700; background: rgba(202,168,93,.08); }
.badge { padding: 4px 9px; border-radius: 999px; font-size: 12px; }
.badge--ok { background: rgba(88,194,125,.13); color: var(--ok); }
.badge--new { background: rgba(111,121,255,.13); color: #9da5ff; }
.badge--work { background: rgba(214,155,53,.14); color: var(--warning); }
.badge--closed { background: rgba(88,194,125,.13); color: var(--ok); }
.toolbar { display: flex; justify-content: space-between; gap: 14px; align-items: center; margin-bottom: 14px; }
.toolbar input { max-width: 380px; }
.toolbar .btn { width: auto; margin-top: 0; }
.filters-row { display: flex; gap: 18px; align-items: flex-end; flex-wrap: wrap; }
.filters-row label { display: flex; flex-direction: column; gap: 6px; min-width: 200px; }
.filters-row .btn { width: auto; margin-top: 0; margin-bottom: 6px; }
.filters-row--audit label { min-width: 160px; }
.filters-row--audit label:has(input[type="date"]) { min-width: 140px; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 20px; flex-wrap: wrap; }
.pagination__pages { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.btn--pagination { padding: 6px 12px; min-width: 34px; }
.btn--pagination.active { background: var(--gold); color: #0b0b0e; border-color: var(--gold); }
.reference-category { position: relative; margin-bottom: 12px; border: 1px solid var(--border); border-radius: var(--radius); }
.reference-category__summary { display: flex; align-items: flex-start; padding: 14px 18px; padding-right: 110px; cursor: pointer; font-weight: 600; list-style: none; }
.reference-category__summary::-webkit-details-marker { display: none; }
.reference-category__summary::before { content: '▶'; margin-right: 10px; margin-top: 4px; color: var(--gold); font-size: 12px; display: inline-block; transition: transform .2s; flex-shrink: 0; }
.reference-category__summary .reference-category__title { flex: 1; min-width: 0; }
.reference-category[open] > .reference-category__summary::before { transform: rotate(90deg); }
.reference-category__actions { position: absolute; top: 8px; right: 12px; display: flex; gap: 6px; z-index: 2; }
.reference-category__body { padding: 16px; border-top: 1px solid var(--border); }
.reference-upload { margin-bottom: 16px; }
.reference-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.reference-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.reference-card__thumb { aspect-ratio: 4 / 3; background: var(--panel-2); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.reference-card__thumb img { width: 100%; height: 100%; object-fit: cover; }
.reference-card__empty { color: var(--muted); font-size: 13px; }
.reference-card__footer { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--border); }
.reference-card__title { font-size: 13px; color: var(--text); }
.reference-card__actions { display: flex; gap: 4px; }
.btn--icon { padding: 4px 8px; font-size: 14px; }
.image-preview-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.92); display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 1000; padding: 24px; }
.image-preview-overlay img { max-width: 100%; max-height: 85vh; object-fit: contain; }
.image-preview__close { margin-top: 16px; }
.dialog { background: rgba(20,23,30,.98); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; color: var(--text); max-width: 720px; width: 90vw; }
.dialog::backdrop { background: rgba(0,0,0,.72); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 16px; }
.form-grid label { margin: 0; }
.form-grid--full { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 20px; }
.form-actions .btn--primary { width: auto; margin: 0; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0 12px; border-bottom: 1px solid var(--border); padding-bottom: 10px; }
.tab-btn { background: transparent; border: 1px solid var(--border); color: var(--muted); border-radius: 10px; padding: 8px 14px; cursor: pointer; font-size: 13px; }
.tab-btn:hover, .tab-btn.active { color: var(--text); background: var(--panel-2); border-color: var(--gold); }
.tab-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.tab-pane { display: none; }
.tab-pane.active { display: block; }
.subsection-title { color: var(--gold-2); font-size: 15px; margin: 14px 0 8px; }
.list-item { display: flex; justify-content: space-between; align-items: center; padding: 10px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; }
.list-item__meta { color: var(--muted); font-size: 12px; }
@media (max-width: 960px) { .app-shell { grid-template-columns: 1fr; } .sidebar { position: static; } .sidebar__footer { position: static; margin-top: 24px; } .grid--4 { grid-template-columns: 1fr 1fr; } .grid--3 { grid-template-columns: 1fr; } .form-grid { grid-template-columns: 1fr; } }

.avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--panel-2), var(--panel));
  border: 1px solid var(--border);
  color: var(--gold-2);
  font-weight: 700;
  font-size: 20px;
  flex-shrink: 0;
}

.avatar--sm {
  width: 40px;
  height: 40px;
  font-size: 14px;
}

.avatar--md {
  width: 96px;
  height: 96px;
  font-size: 32px;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.avatar--placeholder {
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  color: #0b0b0e;
}

.table-avatar {
  width: 56px;
  padding: 8px 12px !important;
  text-align: center;
}

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

.avatar-upload input[type="file"] {
  padding: 8px 0;
}

.avatar-preview {
  margin-top: 6px;
}

.avatar-preview .avatar {
  border: 2px solid var(--gold);
}

.dialog-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.soldier-row:hover {
  background: rgba(255, 255, 255, 0.05);
}

.soldier-row button {
  cursor: default;
}

.soldier-name {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.soldier-name strong {
  font-weight: 700;
  color: var(--text);
}

.soldier-name span {
  color: var(--muted);
  font-size: 13px;
}

.soldier-user-link {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.soldier-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  white-space: nowrap;
}

.btn--icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 10px;
}

.interview-item {
  cursor: pointer;
}

.interview-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.interview-view {
  padding: 8px 0;
}

.interview-view__section {
  margin-bottom: 16px;
}

.interview-view__label {
  color: var(--gold-2);
  font-size: 13px;
  margin-bottom: 6px;
}

.interview-view__text {
  white-space: pre-wrap;
  line-height: 1.5;
}

.interview-view__meta {
  color: var(--muted);
  font-size: 12px;
  margin-top: 12px;
}

.relative-item {
  cursor: pointer;
}

.relative-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.relative-view {
  padding: 8px 0;
}

.relative-view__section {
  margin-bottom: 16px;
}

.relative-view__label {
  color: var(--gold-2);
  font-size: 13px;
  margin-bottom: 6px;
}

.relative-view__text {
  white-space: pre-wrap;
  line-height: 1.5;
}

select:disabled {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  padding-right: 8px;
  color: var(--text);
  opacity: 1;
}

.file-upload {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.file-upload__label {
  color: var(--gold-2);
  font-size: 13px;
}

.file-upload__control {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.file-upload__control input {
  display: none;
}

.file-upload__name {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
}

.soldier-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

.soldier-card-header h3 {
  margin: 0;
  flex: 1;
}

@media (max-width: 960px) {
  .soldier-card-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .soldier-card-header .avatar--md {
    width: 72px;
    height: 72px;
    font-size: 24px;
  }
}

/* Колокольчик */
.notif-bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--gold-2);
  cursor: pointer;
  font-size: 18px;
  flex-shrink: 0;
}
.notif-bell:hover { background: var(--panel-2); }
.notif-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  pointer-events: none;
}
.notif-badge--hidden { display: none; }

/* Дропдаун */
.notif-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 360px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(0,0,0,.5);
  z-index: 999;
  overflow: hidden;
  display: none;
}
.notif-dropdown.open { display: block; }
.notif-dropdown__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--gold-2);
  font-weight: 700;
  font-size: 14px;
}
.notif-dropdown__header button {
  background: transparent;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
}
.notif-dropdown__header button:hover { color: var(--text); }
.notif-dropdown__list { max-height: 340px; overflow-y: auto; }
.notif-dropdown__empty { padding: 20px 16px; color: var(--muted); font-size: 13px; text-align: center; }
.notif-dropdown__item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 11px 16px;
  border-bottom: 1px solid rgba(255,255,255,.04);
  cursor: pointer;
}
.notif-dropdown__item:hover { background: var(--panel-2); }
.notif-dropdown__item--read { opacity: 0.55; }
.notif-dropdown__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  flex-shrink: 0;
  margin-top: 5px;
}
.notif-dropdown__item--read .notif-dropdown__dot { background: transparent; }
.notif-dropdown__title { font-size: 13px; font-weight: 600; color: var(--text); }
.notif-dropdown__body { font-size: 12px; color: var(--muted); margin-top: 2px; }
.notif-dropdown__time { font-size: 11px; color: var(--muted); margin-top: 3px; }
.notif-dropdown__footer {
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  text-align: center;
}
.notif-dropdown__footer button {
  background: transparent;
  border: 0;
  color: var(--gold-2);
  cursor: pointer;
  font-size: 13px;
}
.notif-dropdown__footer button:hover { color: var(--text); }

/* Страница уведомлений */
.notif-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
  cursor: pointer;
}
.notif-item:hover { background: rgba(255,255,255,.03); }
.notif-item__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold);
  flex-shrink: 0;
  margin-top: 5px;
}
.notif-item--read .notif-item__dot { background: transparent; border: 1px solid var(--border); }
.notif-item--read { opacity: 0.6; }
.notif-item__title { font-weight: 700; font-size: 14px; }
.notif-item__body { color: var(--muted); font-size: 13px; margin-top: 3px; }
.notif-item__time { color: var(--muted); font-size: 12px; margin-top: 4px; }
