/* ============================================
   СТУДИЯ ЗАПИСИ — общий стиль
   Тёмная «аппаратная»: почти чёрный фон, красная лампа REC, моноширинные таймкоды.
   ============================================ */
:root {
    --bg: #0b0507;
    --panel: #140a0d;
    --panel-2: #1b0e12;
    --line: #2c161b;
    --line-2: #3d1f26;
    --text: #f3e9e4;
    --muted: #a8928c;
    --dim: #6f5a55;
    --rec: #ff2d55;
    --pink: #ff8fb1;
    --accent: #c41e3a;
    --ok: #46d17a;
    --warn: #ffb02e;
    --info: #5ab0ff;
    --radius: 14px;
    --mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
    --ui: 'Rubik', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { color-scheme: dark; }
body {
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.5 var(--ui);
    -webkit-font-smoothing: antialiased;
}
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(1200px 500px at 10% -10%, rgba(196, 30, 58, .16), transparent 60%),
        radial-gradient(900px 400px at 110% 0%, rgba(255, 143, 177, .07), transparent 60%);
    z-index: -1;
}
a { color: var(--pink); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--rec); color: #fff; }
:focus-visible { outline: 2px solid var(--pink); outline-offset: 2px; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.hidden { display: none !important; }

/* ---------- Шапка ---------- */
.st-top {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 20px;
    background: rgba(11, 5, 7, .86);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}
.st-brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; letter-spacing: .02em; }
.st-brand:hover { text-decoration: none; }
.st-brand img { width: 32px; height: 32px; }
.st-lamp {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 3px 10px 3px 8px; border-radius: 999px;
    border: 1px solid var(--line-2); color: var(--muted);
    font: 700 11px/1.6 var(--mono); letter-spacing: .14em;
}
.st-lamp::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #4a2028; }
.st-lamp.on { color: #fff; border-color: var(--rec); background: rgba(255, 45, 85, .12); }
.st-lamp.on::before { background: var(--rec); box-shadow: 0 0 10px var(--rec); animation: st-blink 1s steps(2) infinite; }
@keyframes st-blink { 50% { opacity: .35; } }
.st-top .grow { flex: 1; }
.st-user { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.st-user img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line-2); }

.st-wrap { max-width: 1240px; margin: 0 auto; padding: 24px 20px 80px; }
.st-h1 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 800; letter-spacing: -.01em; }
.st-sub { color: var(--muted); margin-top: 4px; }
.st-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }

/* ---------- Кнопки ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 16px; border-radius: 10px; border: 1px solid var(--line-2);
    background: var(--panel-2); color: var(--text); cursor: pointer;
    font-weight: 600; font-size: 14px; white-space: nowrap;
    transition: background .15s, border-color .15s, transform .1s;
}
.btn:hover { background: #26131a; border-color: #55303a; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--rec)); border-color: transparent; color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.danger { color: #ff8a9e; }
.btn.danger:hover { background: rgba(255, 45, 85, .12); border-color: var(--rec); }
.btn.ok { color: #9af0b8; }
.btn.ok:hover { background: rgba(70, 209, 122, .12); border-color: var(--ok); }
.btn.sm { padding: 6px 10px; font-size: 13px; border-radius: 8px; }
.btn.icon { padding: 7px; width: 34px; height: 34px; }
.btn.rec {
    width: 72px; height: 72px; border-radius: 50%; padding: 0;
    background: radial-gradient(circle at 35% 30%, #ff6b85, var(--rec) 60%, #a3102c);
    border: 3px solid #3a1118; box-shadow: 0 0 0 4px rgba(255, 45, 85, .15), 0 10px 30px rgba(255, 45, 85, .25);
    color: #fff; font-size: 13px; font-weight: 800; letter-spacing: .08em;
}
.btn.rec.recording { border-radius: 18px; animation: st-pulse 1.2s ease-in-out infinite; }
@keyframes st-pulse { 50% { box-shadow: 0 0 0 10px rgba(255, 45, 85, .08), 0 10px 30px rgba(255, 45, 85, .4); } }

/* ---------- Поля ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > span { font-size: 13px; color: var(--muted); font-weight: 600; }
.input, .select, .textarea {
    width: 100%; padding: 10px 12px; border-radius: 10px;
    border: 1px solid var(--line-2); background: #0e0709; color: var(--text);
}
.textarea { resize: vertical; min-height: 64px; line-height: 1.45; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--pink); box-shadow: 0 0 0 3px rgba(255, 143, 177, .14); }
.input.sm, .select.sm { padding: 6px 8px; font-size: 13px; border-radius: 8px; }
input[type=range] { accent-color: var(--rec); width: 100%; }
input[type=color] { width: 34px; height: 34px; border: 1px solid var(--line-2); border-radius: 8px; background: none; padding: 2px; cursor: pointer; }

/* ---------- Панели ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.panel.pad { padding: 18px; }
.panel h3 { font-size: 15px; font-weight: 700; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }

/* ---------- Список проектов ---------- */
.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.proj {
    position: relative; padding: 18px; border-radius: var(--radius);
    background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--line);
    display: flex; flex-direction: column; gap: 12px; overflow: hidden;
}
.proj::after {
    content: ''; position: absolute; inset: 0 0 auto auto; width: 140px; height: 140px;
    background: radial-gradient(circle, rgba(255, 45, 85, .14), transparent 70%); pointer-events: none;
}
.proj-title { font-size: 18px; font-weight: 800; }
.proj-meta { color: var(--muted); font-size: 13px; }
.proj-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
    display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
    background: #1f1015; border: 1px solid var(--line-2); font-size: 13px; font-weight: 600;
}
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--dim); }

/* Прогресс */
.bar { height: 8px; border-radius: 99px; background: #241217; overflow: hidden; display: flex; }
.bar i { display: block; height: 100%; }
.bar .b-ok { background: var(--ok); }
.bar .b-rec { background: var(--info); }
.bar .b-retake { background: var(--warn); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend b { color: var(--text); font-weight: 700; }

/* Статусы */
.st { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 6px; white-space: nowrap; }
.st-todo { background: #20121a; color: var(--muted); }
.st-recorded { background: rgba(90, 176, 255, .12); color: #9ccfff; }
.st-approved { background: rgba(70, 209, 122, .12); color: #9af0b8; }
.st-retake { background: rgba(255, 176, 46, .13); color: #ffcf7a; }

/* ---------- Вкладки ---------- */
.tabs { display: flex; gap: 4px; padding: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { padding: 9px 16px; border-radius: 9px; border: 0; background: none; color: var(--muted); font-weight: 700; cursor: pointer; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.active { background: #2a1219; color: #fff; box-shadow: inset 0 0 0 1px var(--line-2); }
.tab .count { font: 600 11px var(--mono); margin-left: 6px; padding: 1px 6px; border-radius: 6px; background: #3a1820; color: var(--pink); }

/* ---------- Модалки и уведомления ---------- */
.modal-bg { position: fixed; inset: 0; z-index: 200; background: rgba(0, 0, 0, .66); display: flex; align-items: center; justify-content: center; padding: 16px; animation: st-fade .15s; }
.modal { width: 100%; max-width: 520px; max-height: calc(100vh - 32px); overflow: auto; background: var(--panel); border: 1px solid var(--line-2); border-radius: 18px; padding: 22px; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); }
.modal h2 { font-size: 20px; margin-bottom: 14px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
@keyframes st-fade { from { opacity: 0; } }
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 300; display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 32px)); }
.toast { padding: 12px 14px; border-radius: 12px; background: #1c0e12; border: 1px solid var(--line-2); box-shadow: 0 10px 30px rgba(0, 0, 0, .5); font-size: 14px; animation: st-up .2s; }
.toast.ok { border-color: rgba(70, 209, 122, .5); }
.toast.err { border-color: rgba(255, 45, 85, .6); }
@keyframes st-up { from { transform: translateY(8px); opacity: 0; } }

.empty { text-align: center; color: var(--muted); padding: 50px 20px; }
.empty .big { font-size: 42px; margin-bottom: 8px; }
.notice { padding: 12px 14px; border-radius: 12px; background: rgba(255, 176, 46, .08); border: 1px solid rgba(255, 176, 46, .35); color: #ffd9a0; font-size: 14px; }
.notice.info { background: rgba(90, 176, 255, .07); border-color: rgba(90, 176, 255, .3); color: #cfe6ff; }

.upload-progress { margin-top: 8px; }
.kbd { font: 600 11px var(--mono); padding: 1px 6px; border-radius: 5px; border: 1px solid var(--line-2); border-bottom-width: 2px; color: var(--muted); background: #120a0c; }

@media (max-width: 640px) {
    .hide-sm { display: none; }
    .st-top { padding: 10px 14px; gap: 10px; }
    .st-wrap { padding: 18px 14px 80px; }
    .st-user span { display: none; }
    .proj-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before { animation: none !important; transition: none !important; }
}
