* { box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f5f6f8;
    color: #1a1a1a;
    margin: 0;
}
.topbar {
    background: #1a1a2e;
    color: #fff;
    padding: 14px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}
.topbar h1 { font-size: 18px; margin: 0; }
.topbar nav a {
    color: #cbd5e1;
    text-decoration: none;
    margin-left: 18px;
    font-size: 14px;
}
.topbar nav a:hover { color: #fff; }

main {
    max-width: 1000px;
    margin: 24px auto;
    padding: 0 20px;
}

h2 { margin-top: 0; }

.hint { color: #64748b; font-size: 14px; }
.error { color: #dc2626; font-weight: 600; }
.success { color: #16a34a; font-weight: 600; }

.products-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.products-table th, .products-table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid #eef0f2;
    font-size: 14px;
}
.products-table th {
    background: #f8fafc;
    font-weight: 600;
    color: #475569;
}
.products-table a { color: #2563eb; text-decoration: none; }
.products-table a:hover { text-decoration: underline; }

.price-down { color: #16a34a; font-weight: 700; }
.price-up { color: #dc2626; font-weight: 700; }

.badge {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}
.badge-ok { background: #dcfce7; color: #16a34a; }
.badge-error { background: #fee2e2; color: #dc2626; }
.badge-off { background: #e5e7eb; color: #6b7280; }

.form {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    max-width: 520px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    margin-bottom: 20px;
}
.form label {
    display: block;
    margin-bottom: 14px;
    font-size: 14px;
    font-weight: 600;
    color: #334155;
}
.form label.checkbox { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.form input[type=text],
.form input[type=url],
.form input[type=password],
.form select {
    width: 100%;
    padding: 9px 10px;
    margin-top: 5px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
}
.form button, main > form button {
    background: #2563eb;
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
}
.form button:hover { background: #1d4ed8; }
.btn-danger { background: #dc2626 !important; }
.btn-danger:hover { background: #b91c1c !important; }

#test-result { margin-left: 10px; font-size: 13px; }

.stats {
    display: flex;
    gap: 16px;
    margin: 16px 0;
    flex-wrap: wrap;
}
.stat-box {
    background: #fff;
    padding: 14px 18px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    min-width: 160px;
}
.stat-label { display: block; font-size: 12px; color: #64748b; margin-bottom: 4px; }
.stat-value { display: block; font-size: 20px; font-weight: 700; }

canvas { background: #fff; padding: 16px; border-radius: 8px; margin: 16px 0; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }

.login-page { display: flex; align-items: center; justify-content: center; height: 100vh; }
.login-box {
    background: #fff;
    padding: 32px;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    text-align: center;
    width: 300px;
}
.login-box h1 { margin-top: 0; font-size: 20px; }
.login-box input {
    width: 100%;
    padding: 10px;
    margin: 12px 0;
    border: 1px solid #d1d5db;
    border-radius: 6px;
}
.login-box button {
    width: 100%;
    padding: 10px;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}
