/* main.css — общие стили Banksters, подключается на всех страницах */

/* ── Reset & base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

:root {
    --bg: #f5f7fb;
    --surface: #fff;
    --accent: #0f3460;
    --blue: #3b82f6;
    --blue-hover: #2563eb;
    --text: #1a1a2e;
    --muted: #64748b;
    --light: #94a3b8;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --bg-soft: #f8fafc;

    --green: #16a34a;
    --green-bg: #dcfce7;
    --red: #dc2626;
    --red-bg: #fee2e2;
    --orange: #e65100;
    --amber-bg: #fef9c3;
    --amber-border: #fde047;
    --amber-text: #854d0e;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
}

/* ── Container ────────────────────────────────────────────────────────────── */
.bs-container { max-width: 1400px; margin: 0 auto; padding: 20px 16px 40px; }
.container     { max-width: 1200px; margin: 0 auto; padding: 20px 16px 40px; }

/* ── Generic card ─────────────────────────────────────────────────────────── */
.card {
    background: var(--surface);
    border-radius: 14px;
    box-shadow: 0 1px 4px rgba(0,0,0,.07);
    margin-bottom: 24px;
    overflow: hidden;
}
.card-header { padding: 18px 24px 14px; border-bottom: 1px solid var(--border); }
.card-header h2 { font-size: 15px; font-weight: 700; }
.card-header p  { font-size: 12px; color: var(--muted); margin-top: 2px; }
.card-body { padding: 24px; }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn-primary {
    padding: 9px 22px;
    background: var(--blue); color: #fff;
    border: none; border-radius: 8px;
    font-weight: 600; font-size: 13px;
    cursor: pointer; transition: background .15s;
}
.btn-primary:hover { background: var(--blue-hover); }

.btn-secondary {
    padding: 9px 16px;
    background: transparent; color: var(--muted);
    border: 1.5px solid var(--border); border-radius: 8px;
    font-size: 13px; cursor: pointer; transition: all .15s;
}
.btn-secondary:hover { border-color: var(--light); color: var(--text); }

/* ── Form inputs ──────────────────────────────────────────────────────────── */
input[type=number], input[type=text], input[type=date], select {
    width: 100%;
    padding: 7px 10px;
    border: 1.5px solid var(--border);
    border-radius: 7px;
    font-size: 12px; color: #475569;
    background: var(--bg-soft); outline: none;
    transition: border-color .15s;
}
input:focus, select:focus { border-color: var(--blue); background: var(--surface); }
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }

/* ── Badges ───────────────────────────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 2px 7px; border-radius: 5px;
    font-size: 11px; font-weight: 600;
    border: 1px solid rgba(0,0,0,.06);
}
.badge-ok   { background: #dcfce7; color: #16a34a; }
.badge-warn { background: #fef9c3; color: #854d0e; }
.badge-err  { background: #fee2e2; color: #dc2626; }
.badge-blue { background: #dbeafe; color: #1d4ed8; }

/* АСВ бейдж */
.badge-asv { background: #e7f5ea; color: #25613a; font-size: 11px; }
/* Валюта */
.badge-rub { background: #edf7ee; color: #2f6b3d; }
.badge-usd { background: #fef9c3; color: #854d0e; }
.badge-eur { background: #eef4fb; color: #355c8a; }

/* ── Metric card ──────────────────────────────────────────────────────────── */
.metric-card {
    background: var(--surface);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.metric-card-label {
    font-size: 12px; font-weight: 600; color: #64748b;
    margin-bottom: 14px; text-transform: uppercase; letter-spacing: .5px;
}
.metric-card-value {
    font-size: 34px; font-weight: 700; color: var(--accent);
    line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.metric-card-unit { font-size: 0.6em; font-weight: 600; color: #64748b; margin-left: 4px; }
.metric-card-sub  { font-size: 12px; color: var(--muted); margin-top: 6px; }
@media (max-width: 900px) { .metric-card-value { font-size: 28px; } }
@media (max-width: 700px) { .metric-card { padding: 14px; } .metric-card-value { font-size: 26px; } }

/* ── Grid ─────────────────────────────────────────────────────────────────── */
.grid   { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 900px) { .grid-3 { grid-template-columns: 1fr; } }

/* ── Admin panel cards (.p-card, .stat-row) ───────────────────────────────── */
.p-card {
    background: var(--surface);
    border-radius: 12px; padding: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.p-card h3 { font-size: 13px; font-weight: 700; color: var(--accent); margin-bottom: 14px; text-transform: uppercase; letter-spacing: .5px; }

.stat-row { display: flex; justify-content: space-between; align-items: center; padding: 5px 0; border-bottom: 1px solid var(--border-light); }
.stat-row:last-child { border-bottom: none; }
.stat-label { font-size: 13px; color: var(--muted); }
.stat-val   { font-size: 13px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }

/* ── Admin nav links ──────────────────────────────────────────────────────── */
.links { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.link-btn {
    padding: 7px 18px;
    border: 1.5px solid var(--border); border-radius: 8px;
    font-size: 13px; color: var(--muted); text-decoration: none;
    background: var(--surface); cursor: pointer; font-weight: 500;
    transition: all .15s;
}
.link-btn:hover { border-color: var(--blue); color: var(--blue); }
.link-btn-active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ── Loader ───────────────────────────────────────────────────────────────── */
.bs-loader { text-align: center; padding: 40px; color: var(--muted); font-size: 14px; }
.bs-loader::before {
    content: ''; display: block; width: 32px; height: 32px;
    border: 3px solid var(--border); border-top-color: var(--blue);
    border-radius: 50%; margin: 0 auto 12px;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Empty state ──────────────────────────────────────────────────────────── */
.bs-empty { text-align: center; padding: 40px; color: var(--light); }
