/* ============================================================
   FunTime KillDB — бело-голубая минималистичная тема
   Чистый CSS, без внешних зависимостей.
   ============================================================ */

:root {
    --brand-50:  #eff8ff;
    --brand-100: #dbeefe;
    --brand-200: #bfe1fe;
    --brand-300: #93cefd;
    --brand-400: #60b2fa;
    --brand-500: #3b93f6;
    --brand-600: #2575eb;
    --brand-700: #1d5ed8;
    --brand-900: #1e438a;

    --slate-50:  #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-900: #0f172a;

    --bg: #f7f9fc;
    --radius: 16px;
    --shadow-soft: 0 1px 2px rgba(16,24,40,.04), 0 4px 24px rgba(37,117,235,.06);
    --shadow-glow: 0 8px 30px rgba(37,117,235,.18);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--slate-900);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
}

a { color: inherit; text-decoration: none; }

.icon { display: inline-block; vertical-align: -0.15em; flex-shrink: 0; }

/* ---------- Кастомный скроллбар ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--brand-200);
    border-radius: 9999px;
    border: 2px solid transparent;
    background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--brand-300); background-clip: content-box; }

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(255,255,255,.82);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(226,232,240,.7);
}
.navbar-inner {
    max-width: 1120px;
    margin: 0 auto;
    height: 64px;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: 12px;
    background: var(--brand-600); color: #fff; box-shadow: var(--shadow-glow);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-title { font-size: 15px; font-weight: 600; letter-spacing: -.01em; color: var(--slate-900); }
.brand-sub { font-size: 11px; color: var(--slate-400); }
.accent { color: var(--brand-600); }

.nav-links { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.nav-link {
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: var(--slate-600);
    transition: .15s;
}
.nav-link:hover { color: var(--slate-900); background: var(--slate-100); }
.nav-link.active { color: var(--brand-700); background: var(--brand-50); }
.nav-divider { width: 1px; height: 24px; background: var(--slate-200); margin: 0 6px; }
.nav-user { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--slate-600); font-weight: 500; }

/* ============================================================
   LAYOUT
   ============================================================ */
.container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 32px 24px;
}
.site-footer {
    max-width: 1120px;
    margin: 0 auto;
    padding: 40px 24px;
    text-align: center;
    font-size: 12px;
    color: var(--slate-400);
}

.stack { display: flex; flex-direction: column; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; } .gap-6 { gap: 24px; } .gap-8 { gap: 32px; }

/* ============================================================
   КНОПКИ
   ============================================================ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 14px; font-weight: 500;
    border: 1px solid transparent;
    cursor: pointer;
    transition: .15s;
    text-align: center;
    white-space: nowrap;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-sm { padding: 8px 12px; }
.btn-block { width: 100%; }

.btn-primary { background: var(--brand-600); color: #fff; box-shadow: var(--shadow-soft); }
.btn-primary:hover { background: var(--brand-700); }

.btn-ghost { background: #fff; color: var(--slate-700); border-color: var(--slate-200); }
.btn-ghost:hover { border-color: var(--brand-300); color: var(--brand-700); }

.btn-danger { background: #fff; color: #dc2626; border-color: #fecaca; padding: 8px 10px; }
.btn-danger:hover { background: #fef2f2; }

.btn-icon { padding: 8px; border-radius: 10px; background: transparent; border: none; color: var(--slate-400); cursor: pointer; transition: .15s; }
.btn-icon:hover { background: var(--brand-50); color: var(--brand-600); }
.btn-icon.danger:hover { background: #fef2f2; color: #dc2626; }

/* ============================================================
   ФОРМЫ
   ============================================================ */
.label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 500; color: var(--slate-700); }
.input, textarea.input, select.input {
    width: 100%;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid var(--slate-200);
    background: #fff;
    font-size: 14px;
    color: var(--slate-900);
    font-family: inherit;
    box-shadow: 0 1px 2px rgba(16,24,40,.04);
    transition: .15s;
}
.input::placeholder { color: var(--slate-400); }
.input:focus, textarea.input:focus, select.input:focus {
    outline: none;
    border-color: var(--brand-400);
    box-shadow: 0 0 0 3px var(--brand-100);
}
textarea.input { resize: vertical; }
.input-icon { position: relative; }
.input-icon .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--slate-400); pointer-events: none; }
.input-icon .input { padding-left: 40px; }
.field-hint { margin-top: 6px; font-size: 12px; color: var(--slate-400); }

/* ============================================================
   КАРТОЧКИ
   ============================================================ */
.card {
    background: #fff;
    border: 1px solid rgba(226,232,240,.7);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}
.card-pad { padding: 20px; }

/* ============================================================
   HERO / ЗАГОЛОВКИ
   ============================================================ */
.badge-pill {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 4px 12px;
    border-radius: 9999px;
    border: 1px solid var(--brand-100);
    background: var(--brand-50);
    color: var(--brand-700);
    font-size: 12px; font-weight: 500;
}
.badge-pill .dot { width: 6px; height: 6px; border-radius: 9999px; background: var(--brand-500); }
.page-title { margin: 16px 0 8px; font-size: 32px; font-weight: 700; letter-spacing: -.02em; color: var(--slate-900); }
.page-sub { margin: 0; color: var(--slate-500); max-width: 640px; }

.section-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.section-badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 24px; height: 24px; padding: 0 6px;
    border-radius: 8px; background: var(--brand-100); color: var(--brand-700);
    font-size: 12px; font-weight: 700;
}
.section-title { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -.01em; }

/* ============================================================
   СТАТИСТИКА
   ============================================================ */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.stat { display: flex; align-items: center; gap: 16px; padding: 20px; }
.stat-ico { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 12px; background: var(--brand-50); color: var(--brand-600); }
.stat-val { font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.stat-lbl { font-size: 14px; color: var(--slate-500); }

/* ============================================================
   ТАБЛИЦА
   ============================================================ */
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.toolbar .input-icon { flex: 1; min-width: 220px; }
.toolbar select.input { max-width: 260px; }

.result-count { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--slate-500); margin: 16px 0; }
.result-count b { color: var(--slate-900); }
.result-count .accent-ico { color: var(--brand-500); }

.table-wrap { overflow-x: auto; }
table.kills { width: 100%; border-collapse: collapse; font-size: 14px; text-align: left; }
table.kills thead tr { background: rgba(248,250,252,.6); border-bottom: 1px solid var(--slate-100); }
table.kills th {
    padding: 14px 20px;
    font-size: 12px; text-transform: uppercase; letter-spacing: .03em;
    color: var(--slate-500); font-weight: 500;
}
table.kills th a { display: inline-flex; align-items: center; gap: 6px; color: inherit; }
table.kills th a:hover { color: var(--brand-600); }
table.kills td { padding: 14px 20px; border-bottom: 1px solid var(--slate-50); }
table.kills tbody tr:last-child td { border-bottom: none; }
table.kills tbody tr:hover { background: rgba(239,248,255,.4); }
.target { font-weight: 500; color: var(--slate-900); }
.muted { color: var(--slate-600); }
.empty-dash { color: var(--slate-300); }

.chip {
    display: inline-flex; align-items: center;
    padding: 4px 10px;
    border-radius: 9999px;
    background: var(--brand-50);
    color: var(--brand-700);
    font-size: 12px; font-weight: 500;
    box-shadow: inset 0 0 0 1px var(--brand-100);
    white-space: nowrap;
}

.empty-state { padding: 56px 20px; text-align: center; color: var(--slate-400); }

/* ============================================================
   АВТОРИЗАЦИЯ
   ============================================================ */
.auth-wrap { max-width: 420px; margin: 32px auto; }
.auth-head { text-align: center; margin-bottom: 24px; }
.auth-ico {
    display: inline-flex; align-items: center; justify-content: center;
    width: 48px; height: 48px; margin-bottom: 16px;
    border-radius: 14px; background: var(--brand-600); color: #fff; box-shadow: var(--shadow-glow);
}
.auth-title { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.auth-sub { margin: 4px 0 0; font-size: 14px; color: var(--slate-500); }
.auth-switch { margin-top: 24px; text-align: center; font-size: 14px; color: var(--slate-500); }
.auth-switch a { color: var(--brand-600); font-weight: 500; }
.auth-switch a:hover { text-decoration: underline; }

/* ============================================================
   СООБЩЕНИЯ (alerts)
   ============================================================ */
.alert { display: flex; align-items: flex-start; gap: 8px; padding: 10px 14px; border-radius: 12px; font-size: 14px; margin-bottom: 16px; }
.alert-error { border: 1px solid #fecaca; background: #fef2f2; color: #b91c1c; }
.alert-success { border: 1px solid #bbf7d0; background: #f0fdf4; color: #15803d; }
.alert-info { border: 1px solid var(--brand-200); background: var(--brand-50); color: var(--brand-700); }

/* ============================================================
   DASHBOARD
   ============================================================ */
.dash-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.dash-ico { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px; background: var(--brand-600); color: #fff; box-shadow: var(--shadow-glow); }
.dash-title { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.dash-sub { margin: 2px 0 0; font-size: 14px; color: var(--slate-500); }

.dash-grid { display: grid; grid-template-columns: 2fr 3fr; gap: 24px; align-items: start; }

.list-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-bottom: 1px solid var(--slate-100); }
.list-head .title { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; color: var(--slate-700); }
.list-head .accent-ico { color: var(--brand-500); }

.kill-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--slate-50); }
.kill-row:last-child { border-bottom: none; }
.kill-row:hover { background: rgba(248,250,252,.6); }
.kill-row.editing { background: rgba(239,248,255,.6); }
.kill-row .row-main { min-width: 0; }
.kill-row .row-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.kill-row .row-meta { margin-top: 4px; font-size: 12px; color: var(--slate-400); }
.kill-row .row-note { margin-top: 4px; font-size: 14px; color: var(--slate-500); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 380px; }
.kill-row .row-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

.scroll-list { max-height: 640px; overflow-y: auto; }

/* Инвайты */
.invite-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--slate-50); }
.invite-row:last-child { border-bottom: none; }
.invite-left { display: flex; align-items: center; gap: 12px; }
.invite-status { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 10px; }
.invite-status.active { background: var(--brand-50); color: var(--brand-600); }
.invite-status.used { background: var(--slate-100); color: var(--slate-400); }
.invite-code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 14px; font-weight: 600; letter-spacing: .08em; color: var(--slate-900); }
.invite-code.used { color: var(--slate-400); text-decoration: line-through; }
.invite-meta { font-size: 12px; color: var(--slate-400); }

.sticky { position: sticky; top: 84px; }

/* ============================================================
   АДАПТИВ
   ============================================================ */
@media (max-width: 860px) {
    .dash-grid { grid-template-columns: 1fr; }
    .stats { grid-template-columns: 1fr; }
    .sticky { position: static; }
    .brand-sub { display: none; }
    .nav-user { display: none; }
    .page-title { font-size: 26px; }
}
