:root {
    --bg: #f3f1ec;
    --paper: #fffdf8;
    --ink: #1c1915;
    --muted: #6b645b;
    --line: #e4ddd3;
    --accent: #c45c26;
    --accent-dark: #9b4316;
    --ok: #2f6b4f;
    --danger: #b42318;
    --shadow: 0 18px 50px rgba(28, 25, 21, 0.08);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: "Segoe UI", system-ui, sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at top right, #f7e7d6 0, transparent 32%),
        var(--bg);
}

a {
    color: inherit;
}

.login-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.card {
    width: min(440px, 100%);
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: var(--shadow);
    padding: 32px;
}

.brand {
    font-size: 13px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent);
    margin: 0 0 8px;
}

h1 {
    margin: 0 0 8px;
    font-size: 28px;
    line-height: 1.2;
}

.lead {
    margin: 0 0 24px;
    color: var(--muted);
}

label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin: 0 0 6px;
}

input[type="text"],
input[type="password"],
input[type="number"] {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px 14px;
    font: inherit;
    background: #fff;
    margin-bottom: 16px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 12px;
    padding: 11px 16px;
    font: inherit;
    font-weight: 650;
    cursor: pointer;
    text-decoration: none;
}

.btn-primary {
    width: 100%;
    background: #ea207e;
    color: #fff;
}

.btn-primary:hover {
    background: #c81a6a;
}

.btn-ghost {
    background: #f6f1ea;
    color: var(--ink);
}

.btn-small {
    width: auto;
    padding: 8px 12px;
    font-size: 13px;
}

.alert {
    background: #fdecea;
    color: var(--danger);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 16px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 18px 24px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 253, 248, 0.9);
    position: sticky;
    top: 0;
}

.topbar h1 {
    font-size: 20px;
}

.topbar-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.page {
    padding: 24px;
    max-width: 1200px;
    margin: 0 auto;
}

.table-wrap {
    overflow: auto;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow);
}

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

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

th {
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
    background: #faf7f2;
}

.th-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    width: 16px;
    height: 16px;
    border: 0;
    border-radius: 50%;
    background: none;
    color: var(--muted);
    opacity: 0.65;
    cursor: help;
    flex: 0 0 16px;
}

.info-icon svg {
    width: 14px;
    height: 14px;
    display: block;
}

.info-icon:hover,
.info-icon:focus-visible {
    color: var(--accent);
    opacity: 1;
    outline: none;
}

.tooltip {
    position: fixed;
    z-index: 40;
    max-width: 260px;
    padding: 8px 10px;
    border-radius: 10px;
    background: var(--ink);
    color: var(--paper);
    font-size: 12px;
    line-height: 1.4;
    letter-spacing: 0;
    text-transform: none;
    font-weight: 400;
    box-shadow: 0 10px 24px rgba(28, 25, 21, 0.22);
    pointer-events: none;
}

.tooltip[hidden] {
    display: none;
}

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

.thumb {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    object-fit: cover;
    background: #efe8de;
    border: 1px solid var(--line);
    flex: 0 0 56px;
}

.name {
    font-weight: 650;
}

.product-link {
    color: inherit;
    text-decoration: none;
}

.product-link:hover,
.product-link:focus-visible {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.meta {
    color: var(--muted);
    font-size: 12px;
    margin-top: 2px;
}

.price-new {
    font-weight: 700;
    color: var(--ok);
}

.price-old {
    color: var(--muted);
    text-decoration: line-through;
}

.min-set {
    color: var(--accent-dark);
    font-weight: 650;
}

.btn-icon-remove {
    border: 0;
    background: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 0 0 0 8px;
}

.btn-icon-remove:hover {
    color: var(--danger);
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(28, 25, 21, 0.45);
    display: none;
    place-items: center;
    padding: 24px;
    z-index: 20;
}

.modal-backdrop.is-open,
.modal-backdrop.is-open[hidden] {
    display: grid;
}

.modal {
    width: min(460px, 100%);
    background: var(--paper);
    border-radius: 20px;
    padding: 24px;
    box-shadow: var(--shadow);
}

.modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.hint {
    color: var(--muted);
    font-size: 13px;
    margin: -8px 0 16px;
}

.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 16px;
}

.tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 9px 14px;
    background: var(--paper);
    color: var(--muted);
    font-weight: 650;
    font-size: 14px;
    text-decoration: none;
}

.tab:hover {
    color: var(--ink);
}

.tab.is-active {
    background: #ea207e;
    border-color: #ea207e;
    color: #fff;
}

.tab-count {
    border-radius: 999px;
    background: #f0eae1;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    padding: 2px 8px;
}

.tab.is-active .tab-count {
    background: rgba(255, 255, 255, 0.24);
    color: #fff;
}

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

.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: center;
    padding: 16px;
    border-top: 1px solid var(--line);
}

.btn.is-disabled {
    opacity: 0.45;
    pointer-events: none;
}
