:root {
    --bg: #f4f6f8;
    --surface: #ffffff;
    --surface-soft: #eef3f7;
    --line: #d9e1e8;
    --text: #14202b;
    --muted: #647282;
    --primary: #17466f;
    --primary-strong: #0d2e4d;
    --accent: #c9972f;
    --green: #188462;
    --danger: #b63737;
    --shadow: 0 18px 45px rgba(18, 32, 43, .11);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
}

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

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 68px;
    padding: 0 28px;
    background: rgba(255, 255, 255, .94);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(12px);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    color: #fff;
    background: var(--primary);
    border-radius: 8px;
    font-weight: 800;
}

.brand strong,
.brand small {
    display: block;
}

.brand small,
.toolbar p,
.panel-head p,
td small {
    color: var(--muted);
}

.nav {
    display: flex;
    gap: 8px;
}

.nav a,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #fff;
    color: var(--text);
    font-weight: 700;
}

.button.primary {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

.page {
    width: min(1480px, calc(100vw - 32px));
    margin: 0 auto;
    padding: 28px 0 44px;
}

.toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 8px;
    font-size: 32px;
}

h2 {
    margin-bottom: 4px;
    font-size: 18px;
}

.filters {
    display: grid;
    grid-template-columns: minmax(220px, 1.4fr) repeat(4, minmax(150px, 1fr)) auto auto;
    gap: 12px;
    align-items: end;
    margin-bottom: 18px;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

label span {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

input,
select {
    width: 100%;
    min-height: 40px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #fff;
    color: var(--text);
    font: inherit;
}

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

.kpis article,
.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.kpis article {
    padding: 18px;
}

.kpis span {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.kpis strong {
    font-size: 28px;
}

.grid.two {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 18px;
}

.stack {
    display: grid;
    gap: 18px;
    align-content: start;
}

.panel {
    overflow: hidden;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 18px 12px;
    border-bottom: 1px solid var(--line);
}

.table-wrap {
    overflow: auto;
}

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

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

th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

td strong,
td small {
    display: block;
}

.price {
    display: inline-block;
    color: var(--green);
    font-weight: 900;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    margin-left: 8px;
    padding: 0 8px;
    border-radius: 999px;
    background: #eaf7f1;
    color: var(--green);
    font-size: 12px;
    font-weight: 900;
}

.empty {
    padding: 34px;
    color: var(--muted);
    text-align: center;
}

.basket-list,
.monitor-list {
    display: grid;
}

.basket-list a,
.monitor-list a {
    display: grid;
    gap: 4px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
}

.basket-list a:hover,
.monitor-list a:hover {
    background: var(--surface-soft);
}

.basket-list strong,
.monitor-list span,
.monitor-list small {
    color: var(--muted);
}

.tv-body {
    overflow: hidden;
    background: var(--tv-primary);
    color: var(--tv-font);
}

.tv-screen {
    min-height: 100vh;
    padding: 3.4vw;
    background:
        linear-gradient(135deg, rgba(255,255,255,.08), transparent 42%),
        var(--tv-primary);
}

.tv-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 3vw;
}

.tv-header span,
.tv-header time {
    color: rgba(255,255,255,.72);
    font-size: clamp(18px, 1.6vw, 30px);
    font-weight: 800;
}

.tv-header h1 {
    margin: 6px 0 0;
    color: #fff;
    font-size: clamp(40px, 5.8vw, 108px);
    line-height: .98;
}

.offer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.6vw;
}

.offer-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 29vh;
    padding: clamp(20px, 2.4vw, 42px);
    overflow: hidden;
    background: #fff;
    color: var(--text);
    border: .45vw solid rgba(255,255,255,.2);
    border-radius: 8px;
    box-shadow: 0 26px 70px rgba(0,0,0,.22);
}

.offer-card.is-hidden {
    display: none;
}

.offer-discount {
    position: absolute;
    top: 18px;
    right: 18px;
    padding: 8px 12px;
    background: var(--danger);
    color: #fff;
    border-radius: 7px;
    font-size: clamp(18px, 2vw, 36px);
    font-weight: 900;
}

.offer-dept {
    max-width: 70%;
    color: var(--primary);
    font-size: clamp(16px, 1.4vw, 24px);
    font-weight: 900;
    text-transform: uppercase;
}

.offer-card h2 {
    margin: 20px 0 auto;
    font-size: clamp(28px, 3.4vw, 62px);
    line-height: 1.03;
}

.offer-price {
    margin-top: 24px;
}

.offer-price small {
    display: block;
    color: var(--muted);
    font-size: clamp(18px, 1.7vw, 30px);
    font-weight: 900;
    text-decoration: line-through;
}

.offer-price strong {
    display: block;
    color: var(--tv-accent);
    font-size: clamp(48px, 5.5vw, 112px);
    line-height: .92;
}

.offer-card footer {
    margin-top: 18px;
    color: var(--muted);
    font-size: clamp(14px, 1.2vw, 22px);
    font-weight: 800;
}

@media (max-width: 1100px) {
    .filters,
    .grid.two,
    .kpis {
        grid-template-columns: 1fr 1fr;
    }

    .filters .button {
        min-width: 100%;
    }

    .offer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 720px) {
    .topbar,
    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .filters,
    .grid.two,
    .kpis,
    .offer-grid {
        grid-template-columns: 1fr;
    }

    .tv-body {
        overflow: auto;
    }
}
