:root {
  --bg-900: #080f1d;
  --bg-800: #0a172b;
  --bg-700: #102544;
  --bg-600: #18345c;

  --bordeaux-dark:  #76253f;
  --bordeaux:       #a43150;
  --bordeaux-grad:  #b33a59;
  --bordeaux-light: #c15b75;
  --bordeaux-error: #e05b78;

  --blue-border: #304463;
  --blue-btn:    #2e4664;
  --blue-video-1: #234a8a;
  --blue-video-2: #2d5fb5;

  --green-btn-1: #245e49;
  --green-btn-2: #307a5b;
  --green-status: #22c55e;

  --red-1: #591d35;
  --red-2: #76233f;
  --red-hangup: rgba(180, 30, 55, .92);

  --text-primary: #f4f6fa;
  --text-secondary: #a9b4c7;
  --text-muted: #71839d;
  --text-placeholder: #53647c;

  --status-online: #22c55e;
  --status-pending: #3b82f6;
  --status-approved: #22c55e;
  --status-rejected: #e05b78;

  --radius-sm: 6px;
  --radius-md: 14px;
  --radius-lg: 24px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0; min-height: 100%;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text-primary);
  background:
    radial-gradient(circle at 50% 0%, rgba(164, 49, 80, .18), transparent 60%),
    linear-gradient(180deg, var(--bg-600) 0%, var(--bg-700) 30%, var(--bg-800) 65%, var(--bg-900) 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--bordeaux-light); }
input, textarea, select, button { font-family: inherit; }

.container { max-width: 480px; margin: 0 auto; padding: 16px; }

.card {
  background: linear-gradient(180deg, rgba(16, 31, 55, .85), rgba(10, 24, 44, .95));
  border: 1px solid rgba(48, 68, 99, .6);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: 0 25px 80px rgba(0, 0, 0, .55);
}

.btn {
  display: block; width: 100%;
  padding: 14px 16px; border: none;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-weight: 700; letter-spacing: 2px;
  text-transform: uppercase; cursor: pointer;
  transition: transform .07s, opacity .15s, filter .15s;
}
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn--sos {
  background: linear-gradient(180deg, var(--bordeaux-grad), var(--bordeaux-dark));
  border: 1px solid var(--bordeaux);
  box-shadow: 0 0 35px rgba(124, 28, 55, .45);
  font-size: 20px; padding: 22px;
}
.btn--primary { background: linear-gradient(180deg, var(--bordeaux), var(--bordeaux-dark)); border: 1px solid var(--bordeaux-grad); }
.btn--blue    { background: linear-gradient(180deg, var(--blue-video-2), var(--blue-video-1)); border: 1px solid var(--blue-border); }
.btn--green   { background: linear-gradient(180deg, var(--green-btn-2), var(--green-btn-1)); border: 1px solid #3c8d69; }
.btn--red     { background: linear-gradient(180deg, var(--red-2), var(--red-1)); border: 1px solid #8f304b; }
.btn--ghost   { background: rgba(48, 68, 99, .25); border: 1px solid var(--blue-border); }

.row { display: flex; gap: 8px; }
.row > * { flex: 1; }

.field { margin: 12px 0; }
.field label {
  display: block; font-size: 11px; letter-spacing: 2px;
  text-transform: uppercase; color: var(--text-secondary); margin-bottom: 6px;
}
.field input, .field textarea, .field select {
  width: 100%; padding: 12px 14px;
  background: rgba(13, 31, 53, .8);
  border: 1px solid var(--blue-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary); font-size: 15px;
}
.field input::placeholder, .field textarea::placeholder { color: var(--text-placeholder); }
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--bordeaux);
  box-shadow: 0 0 0 3px rgba(164, 49, 80, .25);
}

.title { text-align: center; letter-spacing: 6px; font-weight: 900; font-size: 22px; margin: 8px 0 2px; text-transform: uppercase; }
.subtitle { text-align: center; color: var(--text-secondary); letter-spacing: 1.5px; font-size: 12px; margin-bottom: 16px; }

.error { color: var(--bordeaux-error); font-size: 13px; margin-top: 8px; }
.muted { color: var(--text-muted); font-size: 12px; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.status-online  { background: var(--status-online);  box-shadow: 0 0 8px var(--status-online); }
.status-offline { background: #ef4444; }
.status-pending { background: var(--status-pending); }

.media-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 8px; }
.media-grid .thumb { position: relative; padding-top: 100%; border-radius: var(--radius-sm); overflow: hidden; background: rgba(13, 31, 53, .8); border: 1px solid var(--blue-border); }
.media-grid .thumb img, .media-grid .thumb video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.media-grid .thumb .remove {
  position: absolute; top: 4px; right: 4px; width: 22px; height: 22px;
  border-radius: 50%; background: rgba(0,0,0,.7); color: #fff; border: none;
  cursor: pointer; font-size: 12px; line-height: 1;
}

.badge { display: inline-block; padding: 3px 8px; border-radius: 999px; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; }
.badge--pending  { background: rgba(59, 130, 246, .18);  color: #93c5fd; }
.badge--approved { background: rgba(34, 197, 94, .18);   color: #86efac; }
.badge--rejected { background: rgba(224, 91, 120, .18);  color: #fda4af; }
.badge--exported { background: rgba(196, 137, 39, .18);  color: #fcd34d; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(48, 68, 99, .5);
  background: rgba(8, 15, 29, .7);
  backdrop-filter: blur(6px);
  position: sticky; top: 0; z-index: 10;
}
.topbar .brand { font-weight: 900; letter-spacing: 3px; font-size: 14px; text-transform: uppercase; }
.topbar .user { font-size: 12px; color: var(--text-secondary); }

/* ==========================================
   НОВЫЕ СТИЛИ (СМП ЕНЦ ПК 112)
   ========================================== */

/* Имя пользователя в шапке */
.topbar .user-name {
  color: var(--bordeaux-light);
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-size: 13px;
  width: 100%;
  text-align: right;
}

/* Бордовые кнопки (Фото / Видео / Голос) */
.btn--media {
  background: linear-gradient(180deg, var(--bordeaux-grad), var(--bordeaux-dark));
  border: 1px solid var(--bordeaux);
  color: var(--text-primary);
  font-size: 13px;
}
.btn--media:active { transform: scale(.97); }

/* Голубая кнопка (История обращений) */
.btn--history {
  background: linear-gradient(180deg, var(--blue-video-2), var(--blue-video-1));
  border: 1px solid var(--blue-border);
  color: var(--text-primary);
  margin-top: 16px;
  box-shadow: 0 0 15px rgba(45, 95, 181, .3);
}

/* Блок с пульсирующей эмблемой и цифрой 112 */
.sos-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin: 10px 0 16px;
}

.emblem-pulse {
  position: relative;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(164, 49, 80, .2), transparent 70%);
  border: 2px solid var(--bordeaux);
  box-shadow: 0 0 25px rgba(164, 49, 80, .4);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Внутренняя картинка (логотип) */
.emblem-pulse img {
  width: 80%;
  height: 80%;
  object-fit: contain;
  border-radius: 50%;
}

/* Если логотипа нет — показываем заглушку (звезду) */
.emblem-pulse .emblem-placeholder {
  font-size: 40px;
  color: var(--bordeaux-light);
}

/* Волны пульсации */
.emblem-pulse::before,
.emblem-pulse::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid var(--pulse-ring);
  animation: emblemPulse 2s ease-out infinite;
}
.emblem-pulse::after {
  animation-delay: 1s;
}

@keyframes emblemPulse {
  0%   { transform: scale(1);   opacity: .8; }
  100% { transform: scale(1.4); opacity: 0; }
}

/* Пульсирующий текст 112 */
.text-112 {
  font-size: 64px;
  font-weight: 900;
  letter-spacing: 6px;
  color: var(--bordeaux-light);
  text-shadow:
    0 0 15px rgba(164, 49, 80, .8),
    0 0 30px rgba(164, 49, 80, .5),
    0 0 50px rgba(124, 28, 55, .3);
  animation: textPulse 2s ease-in-out infinite;
}

@keyframes textPulse {
  0%, 100% { opacity: 1;   text-shadow: 0 0 15px rgba(164,49,80,.8), 0 0 30px rgba(164,49,80,.5); }
  50%      { opacity: .8;  text-shadow: 0 0 25px rgba(164,49,80,1),  0 0 50px rgba(164,49,80,.7); }
}
