:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #07101c;
  color: #edf4f7;
  font-synthesis: none;
  --bg: #07101c;
  --panel: #0d1827;
  --line: #213248;
  --muted: #8fa2b8;
  --text: #edf4f7;
  --green: #31d790;
  --green-soft: rgba(49, 215, 144, 0.12);
  --red: #ff7a7a;
  --blue: #7eb6ff;
  --radius: 16px;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.24);
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: radial-gradient(circle at 80% -10%, #123329 0, transparent 32rem), var(--bg); }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
a { color: inherit; }
.hidden { display: none !important; }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(100%, 430px); padding: 34px; border: 1px solid var(--line); border-radius: 24px; background: rgba(13, 24, 39, 0.94); box-shadow: var(--shadow); }
.brand { display: flex; align-items: center; gap: 12px; }
.radar-mark { width: 40px; height: 40px; border: 1px solid rgba(49,215,144,.5); border-radius: 50%; position: relative; background: radial-gradient(circle, var(--green) 0 10%, transparent 11% 34%, rgba(49,215,144,.25) 35% 37%, transparent 38% 60%, rgba(49,215,144,.16) 61% 63%, transparent 64%); }
.radar-mark::after { content: ""; position: absolute; width: 46%; height: 1px; left: 50%; top: 50%; transform-origin: left; transform: rotate(-35deg); background: linear-gradient(90deg, var(--green), transparent); }
.brand-kicker, .eyebrow { color: var(--green); font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.brand-title { margin: 2px 0 0; font-size: 17px; letter-spacing: -.01em; }
.login-card h1 { margin: 34px 0 8px; font-size: clamp(28px, 6vw, 36px); line-height: 1.08; letter-spacing: -.04em; }
.login-copy { margin: 0 0 28px; color: var(--muted); line-height: 1.55; }
.form-field { display: grid; gap: 8px; margin-top: 16px; }
.form-field label { color: #c8d5df; font-size: 13px; font-weight: 700; }
.input, .select { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 11px; background: #091422; color: var(--text); padding: 0 13px; }
.input::placeholder { color: #63758b; }
.input:hover, .select:hover { border-color: #39506b; }
.primary-button, .secondary-button, .ghost-button { border-radius: 11px; border: 1px solid transparent; min-height: 42px; padding: 0 16px; font-weight: 800; transition: .18s ease; }
.primary-button { width: 100%; margin-top: 22px; background: var(--green); color: #04140d; }
.primary-button:hover { background: #58e3a6; transform: translateY(-1px); }
.primary-button:disabled { opacity: .55; cursor: wait; transform: none; }
.secondary-button { background: #142438; color: var(--text); border-color: var(--line); }
.secondary-button:hover, .ghost-button:hover { background: #1a2d45; }
.ghost-button { background: transparent; color: #b8c7d4; border-color: var(--line); }
.form-error { min-height: 20px; margin: 12px 0 0; color: var(--red); font-size: 13px; }
.app-shell { min-height: 100vh; }
.topbar { position: sticky; z-index: 10; top: 0; display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 76px; padding: 0 clamp(18px, 4vw, 48px); border-bottom: 1px solid rgba(33,50,72,.8); background: rgba(7,16,28,.88); backdrop-filter: blur(18px); }
.user-area { display: flex; align-items: center; gap: 12px; }
.user-email { color: var(--muted); font-size: 13px; max-width: 230px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.main { width: min(1500px, 100%); margin: 0 auto; padding: 38px clamp(18px, 4vw, 48px) 64px; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.page-heading h1 { margin: 7px 0 0; font-size: clamp(30px, 4vw, 46px); letter-spacing: -.045em; line-height: 1; }
.page-heading p { margin: 10px 0 0; color: var(--muted); }
.sync-label { color: var(--muted); font-size: 12px; text-align: right; white-space: nowrap; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 28px; }
.metric { min-height: 118px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, rgba(17,31,48,.96), rgba(11,22,36,.96)); }
.metric-label { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.metric-value { margin-top: 12px; font-size: 29px; font-weight: 850; letter-spacing: -.035em; }
.metric:first-child .metric-value { color: var(--green); }
.metric-note { margin-top: 5px; color: #71849a; font-size: 12px; }
.filter-panel { display: grid; grid-template-columns: minmax(230px, 2fr) repeat(4, minmax(135px, 1fr)) auto; gap: 10px; margin-top: 18px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(13,24,39,.86); }
.search-wrap { position: relative; }
.search-wrap .input { padding-left: 38px; }
.search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.filter-reset { min-width: 44px; padding: 0 12px; }
.results-bar { display: flex; justify-content: space-between; align-items: center; margin: 24px 2px 10px; color: var(--muted); font-size: 13px; }
.results-count strong { color: var(--text); }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(13,24,39,.9); box-shadow: var(--shadow); }
.opportunity-table { width: 100%; border-collapse: collapse; min-width: 1050px; }
.opportunity-table th { padding: 14px 16px; background: #101d2d; color: #8ea2b8; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; text-align: left; white-space: nowrap; }
.opportunity-table td { padding: 17px 16px; border-top: 1px solid rgba(33,50,72,.72); vertical-align: middle; }
.opportunity-table tbody tr:hover { background: rgba(126,182,255,.035); }
.product-name { max-width: 360px; font-weight: 750; line-height: 1.35; }
.product-meta { margin-top: 5px; color: var(--muted); font-size: 12px; }
.store-name { color: #c7d5e1; font-weight: 650; }
.old-price { color: #8194aa; text-decoration: line-through; white-space: nowrap; }
.current-price { color: var(--text); font-size: 16px; font-weight: 800; white-space: nowrap; }
.discount-pill { display: inline-flex; align-items: center; justify-content: center; min-width: 64px; padding: 7px 9px; border-radius: 999px; background: var(--green-soft); color: var(--green); font-weight: 850; }
.date-main { color: #cad5df; white-space: nowrap; }
.date-sub { margin-top: 4px; color: var(--muted); font-size: 12px; }
.status-select { min-width: 116px; min-height: 37px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; background: #0a1523; color: var(--text); font-size: 13px; }
.status-select.status-new { color: var(--green); border-color: rgba(49,215,144,.35); }
.status-select.status-reviewed { color: var(--blue); }
.status-select.status-ignored { color: #8393a5; }
.product-link { display: inline-flex; align-items: center; gap: 6px; color: #c8d7e3; font-size: 13px; font-weight: 750; text-decoration: none; white-space: nowrap; }
.product-link:hover { color: var(--green); }
.empty-state, .error-state, .loading-state { display: grid; place-items: center; min-height: 330px; padding: 42px 20px; text-align: center; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(13,24,39,.75); }
.empty-state h2, .error-state h2 { margin: 14px 0 8px; }
.empty-state p, .error-state p, .loading-state { color: var(--muted); }
.state-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--green-soft); color: var(--green); font-size: 22px; }
.spinner { width: 28px; height: 28px; margin-bottom: 14px; border: 3px solid #29405a; border-top-color: var(--green); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast-region { position: fixed; z-index: 100; right: 18px; bottom: 18px; display: grid; gap: 10px; }
.toast { max-width: 360px; padding: 13px 16px; border: 1px solid var(--line); border-radius: 11px; background: #15263a; box-shadow: var(--shadow); color: var(--text); font-size: 13px; animation: toast-in .2s ease-out; }
.toast.error { border-color: rgba(255,122,122,.45); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
@media (max-width: 1050px) {
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .filter-panel { grid-template-columns: repeat(3, 1fr); }
  .search-wrap { grid-column: span 2; }
}
@media (max-width: 680px) {
  .topbar { min-height: 68px; padding: 0 16px; }
  .brand-kicker, .user-email { display: none; }
  .brand-title { font-size: 15px; }
  .radar-mark { width: 34px; height: 34px; }
  .main { padding-top: 28px; }
  .page-heading { align-items: start; flex-direction: column; }
  .sync-label { text-align: left; }
  .metrics { grid-template-columns: 1fr 1fr; gap: 9px; }
  .metric { min-height: 103px; padding: 16px; }
  .metric-value { font-size: 24px; }
  .filter-panel { grid-template-columns: 1fr 1fr; }
  .search-wrap { grid-column: 1 / -1; }
  .filter-reset { grid-column: span 2; }
  .results-bar { align-items: start; flex-direction: column; gap: 5px; }
  .table-wrap { overflow: visible; border: 0; background: transparent; box-shadow: none; }
  .opportunity-table { min-width: 0; display: block; }
  .opportunity-table thead { display: none; }
  .opportunity-table tbody { display: grid; gap: 12px; }
  .opportunity-table tr { display: grid; grid-template-columns: 1fr 1fr; gap: 15px 12px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
  .opportunity-table td { display: block; padding: 0; border: 0; }
  .opportunity-table td:first-child { grid-column: 1 / -1; }
  .opportunity-table td::before { content: attr(data-label); display: block; margin-bottom: 6px; color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
  .product-name { max-width: none; }
}
