:root {
    --red: #a4161a;
    --red-dark: #7a1013;
    --ink: #1f2328;
    --muted: #5b6470;
    --border: #e2e5e9;
    --bg: #f6f7f9;
    --card: #ffffff;
    --green-bg: #eaf7ee;
    --green-ink: #1e7a3c;
    --yellow-bg: #fff8db;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--ink);
}

.topbar {
    background: var(--red);
    color: #fff;
}

.topbar-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
    text-decoration: none;
}

.topbar nav a {
    color: #fff;
    text-decoration: none;
    margin-left: 18px;
    font-size: 0.95rem;
}

.btn-nav {
    background: rgba(255,255,255,0.15);
    padding: 6px 12px;
    border-radius: 6px;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 20px 60px;
}

h1 { font-size: 1.5rem; margin-bottom: 4px; }
h2 { font-size: 1.15rem; margin: 28px 0 12px; }
.subtitle { color: var(--muted); margin-top: 0; margin-bottom: 20px; }

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 0.92rem; }
th { color: var(--muted); font-weight: 600; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.03em; }
tr:last-child td { border-bottom: none; }

.actions a { margin-right: 10px; font-size: 0.88rem; }
.actions form { display: inline; }
.link-danger { color: var(--red); background: none; border: none; padding: 0; font-size: 0.88rem; cursor: pointer; text-decoration: underline; }

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

.btn {
    display: inline-block;
    background: var(--red);
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 7px;
    font-size: 0.95rem;
    cursor: pointer;
    text-decoration: none;
}
.btn:hover { background: var(--red-dark); }
.btn-secondary {
    background: #fff;
    color: var(--ink);
    border: 1px solid var(--border);
}
.btn-secondary:hover { background: #f0f1f3; }

form .field { margin-bottom: 16px; }
label { display: block; font-size: 0.88rem; font-weight: 600; margin-bottom: 5px; }
input[type=text], input[type=number] {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.95rem;
    background: var(--yellow-bg);
}
input:focus { outline: 2px solid var(--red); outline-offset: 1px; }

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

@media (max-width: 700px) {
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

.platform-block {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}
.platform-block h3 {
    margin: 0 0 12px;
    font-size: 1rem;
    color: var(--red);
}

.alert {
    padding: 12px 16px;
    border-radius: 7px;
    margin-bottom: 18px;
    font-size: 0.92rem;
}
.alert-success { background: var(--green-bg); color: var(--green-ink); }
.alert-error { background: #fdecea; color: #b3261e; }

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 16px;
}

.result-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 18px;
}
.result-card h3 {
    margin: 0 0 10px;
    font-size: 0.95rem;
    color: var(--red);
}
.result-price {
    font-size: 1.6rem;
    font-weight: 700;
    margin: 4px 0 10px;
}
.result-card .row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--muted);
    padding: 3px 0;
}
.result-card .row.total {
    color: var(--ink);
    font-weight: 600;
    border-top: 1px solid var(--border);
    margin-top: 8px;
    padding-top: 8px;
}
.result-card details { margin-top: 10px; }
.result-card summary { cursor: pointer; font-size: 0.85rem; color: var(--red); }

.badge-warning {
    background: #fdecea;
    color: #b3261e;
    padding: 10px 12px;
    border-radius: 7px;
    font-size: 0.85rem;
}

.top-actions { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
