/* ==========================================================
   NOVOWEB Client Portal — минималистичная дизайн-система
   Чёрно-белая база + один акцентный цвет.
   Поменяйте переменные ниже, чтобы точно попасть в брендбук
   novoweb.eu, если понадобятся другие оттенки.
   ========================================================== */

/* Bootstrap Icons: единый отступ иконки от текста в лейблах/кнопках/навигации/ссылках */
label > i.bi, .btn i.bi, .sidebar a i.bi, .auth-links a i.bi,
.stat-card .label i.bi, table a i.bi, h2 i.bi, .field-icon i.bi {
    margin-right: 6px;
    vertical-align: -1px;
}

:root {
    --color-bg: #ffffff;
    --color-bg-soft: #fafafa;
    --color-surface: #ffffff;
    --color-border: #e5e5e5;
    --color-text: #111111;
    --color-text-soft: #6b6b6b;
    --color-text-faint: #9a9a9a;

    --color-accent: #3eaf7c;
    --color-accent-dark: #328f65;
    --color-accent-soft: #e7f5ef;

    --color-success: #16a34a;
    --color-success-soft: #ecfdf3;
    --color-warning: #d97706;
    --color-warning-soft: #fff7ed;
    --color-danger: #dc2626;
    --color-danger-soft: #fef2f2;
    --color-neutral-soft: #f2f2f2;

    --radius: 10px;
    --radius-sm: 6px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.06);

    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--color-bg-soft);
    color: var(--color-text);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--color-accent); text-decoration: none; transition: color .15s ease, opacity .15s ease; }
a:hover { text-decoration: underline; }

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: no-preference) {
    .main > * { animation: fadeInUp .35s ease both; }
    .main > *:nth-child(2) { animation-delay: .03s; }
    .main > *:nth-child(3) { animation-delay: .06s; }
    .main > *:nth-child(4) { animation-delay: .09s; }
    .auth-box { animation: fadeInUp .4s ease both; }
}

h1, h2, h3, h4 { font-weight: 600; letter-spacing: -0.01em; margin: 0 0 .5em; }
h1 { font-size: 26px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
p { margin: 0 0 1em; }

.muted { color: var(--color-text-soft); }
.faint { color: var(--color-text-faint); }

/* ---------- Layout shell ---------- */

.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: 230px;
    flex-shrink: 0;
    background: #0d0d0f;
    color: #f5f5f5;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar .brand {
    font-weight: 700;
    font-size: 18px;
    letter-spacing: .02em;
    color: #fff;
    margin-bottom: 24px;
    padding: 0 8px;
}
.sidebar .brand span { color: var(--color-accent); }

.sidebar a {
    color: #cfcfcf;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background-color .15s ease, color .15s ease, transform .15s ease;
}
.sidebar a:hover { background: rgba(255,255,255,.08); text-decoration: none; color: #fff; transform: translateX(2px); }
.sidebar a.active { background: var(--color-accent); color: #fff; }
.sidebar a.active:hover { transform: none; }

.sidebar .sidebar-footer {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,.1);
    font-size: 13px;
    color: #9a9a9a;
}

.main {
    flex: 1;
    min-width: 0;
    padding: 28px 36px 60px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.topbar h1 { margin: 0; }

/* ---------- Cards / stats ---------- */

.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}

.card + .card { margin-top: 16px; }

.stat-card { transition: box-shadow .2s ease, transform .2s ease; }
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: #d8d8d8; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.stat-card { padding: 18px 20px; }
.stat-card .label { font-size: 13px; color: var(--color-text-soft); margin-bottom: 6px; }
.stat-card .value { font-size: 24px; font-weight: 700; }
.stat-card .sub { font-size: 12px; color: var(--color-text-faint); margin-top: 4px; }

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    background: #fff;
    color: var(--color-text);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    line-height: 1.2;
    transition: background-color .15s ease, border-color .15s ease, transform .1s ease, box-shadow .15s ease;
}
.btn:hover { background: var(--color-neutral-soft); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--color-accent); border-color: var(--color-accent); color: #fff; box-shadow: 0 1px 2px rgba(62,175,124,.25); }
.btn-primary:hover { background: var(--color-accent-dark); border-color: var(--color-accent-dark); box-shadow: 0 2px 8px rgba(62,175,124,.35); }
.btn-danger { background: var(--color-danger); border-color: var(--color-danger); color: #fff; }
.btn-danger:hover { opacity: .88; }
.btn-sm { padding: 6px 10px; font-size: 13px; }
.btn-block { width: 100%; justify-content: center; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- Forms ---------- */

label { display: block; font-size: 13px; font-weight: 500; margin: 0 0 6px; }
.field { margin-bottom: 16px; }
.field-hint { font-size: 12px; color: var(--color-text-faint); margin-top: 4px; }
.field-error { font-size: 12px; color: var(--color-danger); margin-top: 4px; }

input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=tel], textarea, select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    color: var(--color-text);
    transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px var(--color-accent-soft);
}
input:hover, textarea:hover, select:hover { border-color: #c9c9c9; }
textarea { resize: vertical; min-height: 90px; }

.form-row { display: flex; gap: 16px; }
.form-row > .field { flex: 1; }

.phone-field { display: flex; gap: 8px; }
.phone-field select { flex: 0 0 190px; }
.phone-field input { flex: 1; }
@media (max-width: 480px) { .phone-field { flex-direction: column; } .phone-field select { flex: 1; } }

/* ---------- Tables ---------- */

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--color-border); }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--color-text-soft); font-weight: 600; }
tbody tr { transition: background-color .12s ease; }
tbody tr:hover { background: var(--color-bg-soft); }
.table-wrap { overflow-x: auto; }

/* ---------- Badges ---------- */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    background: var(--color-neutral-soft);
    color: var(--color-text-soft);
    white-space: nowrap;
    transition: transform .15s ease;
}
.badge-success { background: var(--color-success-soft); color: var(--color-success); }
.badge-warning { background: var(--color-warning-soft); color: var(--color-warning); }
.badge-danger  { background: var(--color-danger-soft); color: var(--color-danger); }
.badge-accent  { background: var(--color-accent-soft); color: var(--color-accent); }

/* ---------- Progress ---------- */

.progress-track { background: var(--color-neutral-soft); border-radius: 999px; height: 8px; overflow: hidden; }
.progress-fill {
    background: linear-gradient(90deg, var(--color-accent), var(--color-accent-dark));
    height: 100%;
    border-radius: 999px;
    transition: width .5s ease;
}

/* ---------- Timeline ---------- */

.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 4px; bottom: 4px; width: 2px; background: var(--color-border); }
.timeline-item { position: relative; padding-bottom: 22px; }
.timeline-item::before {
    content: ""; position: absolute; left: -22px; top: 4px;
    width: 10px; height: 10px; border-radius: 50%;
    background: var(--color-accent); border: 2px solid #fff; box-shadow: 0 0 0 2px var(--color-accent);
}
.timeline-item .ts { font-size: 12px; color: var(--color-text-faint); margin-bottom: 2px; }

/* ---------- Flash messages ---------- */

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.flash { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 14px; animation: slideDown .25s ease both; }
.flash-success { background: var(--color-success-soft); color: var(--color-success); }
.flash-error   { background: var(--color-danger-soft); color: var(--color-danger); }
.flash-info    { background: var(--color-accent-soft); color: var(--color-accent); }

/* ---------- Auth pages (login/register) ---------- */

.auth-screen {
    min-height: 100vh;
    display: flex;
    background: var(--color-bg-soft);
}

/* Левая декоративная панель с градиентом в акцентном цвете студии */
.auth-visual {
    flex: 1 1 46%;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 48px;
    color: #fff;
    overflow: hidden;
    background:
        radial-gradient(circle at 15% 20%, rgba(255,255,255,.14), transparent 40%),
        radial-gradient(circle at 85% 80%, rgba(255,255,255,.10), transparent 45%),
        linear-gradient(150deg, var(--color-accent-dark) 0%, var(--color-accent) 55%, #1f2937 130%);
}
.auth-visual::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: radial-gradient(circle at 30% 30%, #000 0%, transparent 75%);
    pointer-events: none;
}
.auth-visual .brand { font-weight: 700; font-size: 22px; position: relative; z-index: 1; }
.auth-visual .brand span { color: rgba(255,255,255,.75); font-weight: 400; }
.auth-visual .pitch { position: relative; z-index: 1; max-width: 380px; }
.auth-visual .pitch h2 { color: #fff; font-size: 26px; line-height: 1.3; margin-bottom: 14px; }
.auth-visual .pitch p { color: rgba(255,255,255,.85); font-size: 14px; }
.auth-visual .pitch-features { list-style: none; margin-top: 22px; display: flex; flex-direction: column; gap: 12px; }
.auth-visual .pitch-features li { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: rgba(255,255,255,.92); }
.auth-visual .pitch-features i { font-size: 16px; }
.auth-visual .foot { position: relative; z-index: 1; font-size: 12px; color: rgba(255,255,255,.65); }
@media (max-width: 860px) {
    .auth-visual { display: none; }
}

.auth-form-side {
    flex: 1 1 54%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.auth-box {
    width: 100%;
    max-width: 400px;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--shadow-md);
}
.auth-box .brand {
    font-weight: 700; font-size: 20px; text-align: center; margin-bottom: 6px;
}
.auth-box .brand span { color: var(--color-accent); }
.auth-box .brand i { color: var(--color-accent); margin-right: 6px; }
.auth-subtitle { text-align: center; color: var(--color-text-soft); font-size: 13px; margin-bottom: 24px; }
.auth-links { text-align: center; margin-top: 16px; font-size: 13px; }
.auth-links i { margin-right: 3px; }

/* ---------- Misc ---------- */

.empty-state { text-align: center; padding: 48px 20px; color: var(--color-text-soft); }
.divider { border: none; border-top: 1px solid var(--color-border); margin: 20px 0; }
.pagination { display: flex; gap: 6px; margin-top: 16px; }
.pagination a, .pagination span { padding: 6px 11px; border: 1px solid var(--color-border); border-radius: var(--radius-sm); font-size: 13px; }
.pagination .current { background: var(--color-accent); color: #fff; border-color: var(--color-accent); }

.print-only { display: none; }
@media print {
    .sidebar, .topbar .actions, .no-print { display: none !important; }
    .main { padding: 0; }
    .app-shell { display: block; }
    body { background: #fff; }
    .print-only { display: block; }
}
