:root {
    --bg: #f6f8fb;
    --card: #ffffff;
    --ink: #1f2933;
    --muted: #64748b;
    --accent: #2563eb;
    --accent-ink: #ffffff;
    --good: #16a34a;
    --border: #e2e8f0;
}

* {
    box-sizing: border-box;
}

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

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: var(--card);
    border-bottom: 1px solid var(--border);
}

.brand {
    font-weight: 700;
    font-size: 1.25rem;
    text-decoration: none;
    color: var(--ink);
}

.site-nav {
    display: flex;
    gap: 1.25rem;
}

.site-nav a {
    color: var(--muted);
    text-decoration: none;
}

.site-nav a:hover {
    color: var(--accent);
}

.site-main {
    max-width: 900px;
    margin: 0 auto;
    padding: 1.5rem;
}

.flash {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid transparent;
}

.flash-success {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #065f46;
}

.flash-error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.deal-list {
    list-style: none;
    padding: 0;
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.deal-card {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 1rem 1.25rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.deal-route {
    font-weight: 700;
    font-size: 1.1rem;
}

.deal-price {
    font-size: 1.4rem;
    color: var(--accent);
}

.deal-discount {
    color: var(--good);
    font-weight: 600;
}

.deal-date,
.empty {
    color: var(--muted);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 420px;
}

.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input[type="text"],
.auth-form input[type="number"] {
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
}

.auth-form label.checkbox,
.auth-form .form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

button[type="submit"] {
    align-self: flex-start;
    padding: 0.6rem 1.4rem;
    border: none;
    border-radius: 8px;
    background: var(--accent);
    color: var(--accent-ink);
    font-size: 1rem;
    cursor: pointer;
}

button[type="submit"]:hover {
    filter: brightness(1.05);
}

.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.button {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    background: var(--accent);
    color: var(--accent-ink);
    text-decoration: none;
}

.hint,
.page-head + .hint {
    color: var(--muted);
}

.sub-list {
    list-style: none;
    padding: 0;
    display: grid;
    gap: 1rem;
}

.sub-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1.5rem;
    padding: 1rem 1.25rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.sub-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.sub-filters span {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.1rem 0.6rem;
}

.inline-form {
    margin-left: auto;
}

.link-danger {
    background: none;
    border: none;
    color: #dc2626;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0;
}

.danger-zone {
    margin-top: 2.5rem;
    padding: 1.25rem;
    border: 1px solid #fecaca;
    border-radius: 12px;
    background: #fef2f2;
}

.danger-zone h2 {
    margin-top: 0;
    color: #991b1b;
}

.button-danger {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 8px;
    background: #dc2626;
    color: #fff;
    cursor: pointer;
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 1.5rem;
}

.filter-bar input,
.filter-bar select {
    padding: 0.5rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
}

.lead {
    color: var(--muted);
    margin-bottom: 1.25rem;
}

.deal-return {
    color: var(--muted);
    font-size: 0.9rem;
}

.reset-filters {
    color: var(--muted);
    font-size: 0.9rem;
}

.deal-link {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    text-decoration: none;
    color: inherit;
}

.deal-detail {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
}

.deal-price-lg {
    font-size: 2rem;
    color: var(--accent);
    margin: 0 0 0.25rem;
}

.history-chart {
    list-style: none;
    padding: 0;
    display: grid;
    gap: 0.35rem;
}

.history-chart li {
    display: grid;
    grid-template-columns: 3rem 1fr auto;
    align-items: center;
    gap: 0.75rem;
}

.history-date {
    color: var(--muted);
    font-size: 0.85rem;
}

.history-bar {
    height: 0.8rem;
    background: var(--accent);
    border-radius: 4px;
    min-width: 2px;
}

.history-price {
    font-variant-numeric: tabular-nums;
    font-size: 0.9rem;
}
