﻿:root {
    --bg: #f8f8f8;
    --bg-panel: rgba(255, 255, 255, 0.96);
    --ink: #000000;
    --muted: #5a5a5a;
    --line: rgba(90, 90, 90, 0.18);
    --brand: #e40000;
    --brand-dark: #b40000;
    --accent: #5a5a5a;
    --danger: #b42318;
    --success: #18794e;
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.08);
    --radius-lg: 28px;
    --radius-md: 18px;
    --radius-sm: 12px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background:
        radial-gradient(circle at top left, rgba(228, 0, 0, 0.08), transparent 28%),
        radial-gradient(circle at top right, rgba(90, 90, 90, 0.08), transparent 24%),
        linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
    color: var(--ink);
    font: 16px/1.5 "Segoe UI", "Trebuchet MS", sans-serif;
}

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

.shell {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
}

.sidebar {
    padding: 28px 22px;
    border-right: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(14px);
}

.brand {
    padding: 18px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #e40000, #b40000);
    color: #ffffff;
    box-shadow: var(--shadow);
}

.brand-kicker,
.eyebrow {
    display: inline-block;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-size: 11px;
    font-weight: 700;
}

.sidebar strong {
    display: block;
    margin-top: 10px;
    font-size: 28px;
    line-height: 1.1;
}

.sidebar-nav {
    margin-top: 28px;
    display: grid;
    gap: 10px;
}

.sidebar-link,
.sidebar-note {
    padding: 12px 14px;
    border-radius: 14px;
}

.sidebar-link {
    color: var(--muted);
    transition: 180ms ease;
}

.sidebar-link:hover,
.sidebar-link.active {
    color: #ffffff;
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    box-shadow: 0 14px 30px rgba(228, 0, 0, 0.18);
}

.sidebar-note {
    color: #5a5a5a;
    background: rgba(90, 90, 90, 0.08);
    font-size: 14px;
}

.content {
    padding: 34px;
}

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

.topbar-user {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.topbar-user span {
    color: var(--muted);
    font-size: 14px;
}

.hero,
.panel,
.form-panel,
.install-card {
    background: var(--bg-panel);
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.hero {
    padding: 34px;
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.hero h1,
.page-head h1 {
    margin: 10px 0 12px;
    font-size: clamp(34px, 5vw, 54px);
    line-height: 1;
}

.hero p,
.page-head p,
.hero-card p,
.feature-item p,
.empty-state {
    color: var(--muted);
}

.hero-card {
    padding: 22px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(228, 0, 0, 0.08), rgba(90, 90, 90, 0.08));
}

.kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.kpi-card {
    padding: 22px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(90, 90, 90, 0.12);
    box-shadow: var(--shadow);
}

.kpi-card span {
    color: var(--muted);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.kpi-card strong {
    display: block;
    margin: 10px 0 6px;
    font-size: 42px;
    line-height: 1;
}

.kpi-card small {
    color: var(--muted);
}

.kpi-card.accent {
    background: linear-gradient(135deg, #e40000, #d9252f);
    color: #ffffff;
}

.kpi-card.accent span,
.kpi-card.accent small {
    color: rgba(255, 255, 255, 0.84);
}

.panel-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 22px;
    margin-bottom: 24px;
}

.panel,
.form-panel {
    padding: 26px;
    margin-bottom: 24px;
}

.panel-head,
.page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.panel h2 {
    margin: 6px 0 0;
    font-size: 28px;
}

.bars {
    display: grid;
    gap: 14px;
}

.bar-row {
    display: grid;
    grid-template-columns: 72px 1fr 40px;
    align-items: center;
    gap: 12px;
}

.bar-track {
    height: 12px;
    border-radius: 999px;
    background: rgba(90, 90, 90, 0.12);
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--brand), #5a5a5a);
}

.feature-list {
    display: grid;
    gap: 14px;
}

.feature-item,
.info-box {
    padding: 18px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(90, 90, 90, 0.1);
}

.feature-item strong,
.info-box strong {
    display: block;
    margin-bottom: 6px;
}

.feature-item p,
.info-box p {
    margin: 0;
    color: var(--muted);
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 14px 12px;
    text-align: left;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

th {
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #ffffff;
    background: #1d7c38;
}

.actions {
    white-space: nowrap;
}

.actions a {
    margin-right: 12px;
    color: var(--brand-dark);
    font-weight: 700;
}

.actions-vertical {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    white-space: normal;
}

.actions-vertical a {
    margin-right: 0;
}

.cell-wide {
    min-width: 180px;
}

.cell-wider {
    min-width: 260px;
}

.code-stack {
    min-width: 170px;
}

.code-stack span {
    display: block;
    line-height: 1.35;
}

.code-stack strong {
    display: inline-block;
    min-width: 42px;
    color: var(--muted);
    font-size: 12px;
    letter-spacing: 0.08em;
}

.icon-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: rgba(90, 90, 90, 0.08);
    margin-right: 8px;
}

.icon-action.danger {
    background: rgba(180, 35, 24, 0.1);
}

.icon-pencil,
.icon-trash {
    position: relative;
    display: inline-block;
    width: 14px;
    height: 14px;
}

.icon-pencil::before {
    content: '';
    position: absolute;
    width: 11px;
    height: 3px;
    background: var(--brand-dark);
    transform: rotate(-35deg);
    top: 5px;
    left: 1px;
    border-radius: 2px;
}

.icon-pencil::after {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-left: 4px solid var(--brand-dark);
    border-top: 3px solid transparent;
    border-bottom: 3px solid transparent;
    transform: rotate(-35deg);
    top: 3px;
    right: -1px;
}

.icon-trash::before {
    content: '';
    position: absolute;
    left: 3px;
    top: 4px;
    width: 8px;
    height: 8px;
    border: 2px solid var(--danger);
    border-top: 0;
    border-radius: 0 0 2px 2px;
}

.icon-trash::after {
    content: '';
    position: absolute;
    left: 2px;
    top: 1px;
    width: 10px;
    height: 2px;
    background: var(--danger);
    box-shadow: 2px -2px 0 -1px var(--danger);
}

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

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.form-grid label,
.checks,
.form-actions {
    display: block;
}

.form-grid label span {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.hint {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    font-size: 13px;
}

input,
select,
textarea {
    width: 100%;
    padding: 14px 15px;
    border: 1px solid rgba(90, 90, 90, 0.14);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.96);
    color: var(--ink);
    font: inherit;
}

textarea {
    resize: vertical;
}

.full {
    grid-column: 1 / -1;
}

.checks {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
}

.checkbox {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    cursor: pointer;
}

.checkbox input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 48px;
    height: 28px;
    border-radius: 999px;
    background: #d9d9d9;
    border: 1px solid rgba(90, 90, 90, 0.18);
    position: relative;
    transition: background 180ms ease, border-color 180ms ease;
    cursor: pointer;
    flex: 0 0 auto;
}

.checkbox input[type="checkbox"]::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
    transition: transform 180ms ease;
}

.checkbox input[type="checkbox"]:checked {
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    border-color: transparent;
}

.checkbox input[type="checkbox"]:checked::after {
    transform: translateX(20px);
}

.checkbox input[type="checkbox"]:focus-visible {
    outline: 2px solid rgba(228, 0, 0, 0.25);
    outline-offset: 2px;
}

.inline-field {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: center;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 0 18px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    color: #ffffff;
    font-weight: 700;
    cursor: pointer;
}

.button.ghost {
    background: rgba(90, 90, 90, 0.09);
    color: var(--ink);
}

.button.slim {
    min-height: 46px;
    padding: 0 14px;
}

.alert {
    margin-bottom: 18px;
    padding: 14px 16px;
    border-radius: 14px;
}

.alert.success {
    background: rgba(24, 121, 78, 0.12);
    color: var(--success);
}

.alert.error {
    background: rgba(180, 35, 24, 0.1);
    color: var(--danger);
}

.install-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px;
}

.install-card {
    width: min(920px, 100%);
    padding: 32px;
}

.install-links,
.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
    align-items: center;
}

.toolbar input[type="text"] {
    width: min(320px, 100%);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

@media (max-width: 1120px) {
    .shell,
    .hero,
    .panel-grid,
    .kpis {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .content,
    .sidebar,
    .panel,
    .form-panel,
    .hero,
    .install-card {
        padding: 20px;
    }

    .form-grid,
    .info-grid,
    .inline-field {
        grid-template-columns: 1fr;
    }

    .bar-row {
        grid-template-columns: 56px 1fr 30px;
    }
}
