*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #0f1117;
  color: #e2e8f0;
  min-height: 100vh;
}

/* LOGIN PAGE */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #0f1117 0%, #1a1f2e 100%);
}

.login-card {
  background: #1e2433;
  border: 1px solid #2d3548;
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.wide-card { max-width: 640px; }

.logo-area { text-align: center; margin-bottom: 32px; }
.logo-area h1 { font-size: 2rem; font-weight: 800; color: #fff; letter-spacing: -1px; }
.dot { color: #4f9cf9; }
.tagline { color: #8892a4; font-size: 0.9rem; margin-top: 4px; }

form { display: flex; flex-direction: column; gap: 16px; }

label { font-size: 0.8rem; font-weight: 600; color: #8892a4; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: -8px; }

select, input[type="password"], input[type="text"], input[type="file"] {
  background: #0f1117; border: 1px solid #2d3548; border-radius: 8px;
  padding: 12px 16px; color: #e2e8f0; font-size: 0.95rem; width: 100%; transition: border-color 0.2s;
}
select:focus, input:focus { outline: none; border-color: #4f9cf9; }
select option { background: #1e2433; }

.btn-primary {
  background: #4f9cf9; color: #fff; border: none; border-radius: 8px;
  padding: 13px; font-size: 0.95rem; font-weight: 600; cursor: pointer; transition: background 0.2s; margin-top: 4px;
}
.btn-primary:hover { background: #3b82f6; }

.btn-secondary {
  background: #2d3548; color: #e2e8f0; border: none; border-radius: 8px;
  padding: 11px 20px; font-size: 0.9rem; font-weight: 600; cursor: pointer;
}
.btn-secondary:hover { background: #374060; }

.error-msg { color: #f87171; font-size: 0.85rem; text-align: center; min-height: 20px; }
.admin-link { text-align: center; margin-top: 24px; }
.admin-link a { color: #4f9cf9; font-size: 0.82rem; text-decoration: none; opacity: 0.7; }
.admin-link a:hover { opacity: 1; }

/* TOPBAR */
.topbar {
  background: #1e2433; border-bottom: 1px solid #2d3548;
  padding: 0 32px; height: 60px; display: flex; align-items: center;
  justify-content: space-between; position: sticky; top: 0; z-index: 100;
}
.topbar h1 { font-size: 1.3rem; font-weight: 800; color: #fff; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.rep-badge { background: #4f9cf9; color: #fff; padding: 5px 14px; border-radius: 20px; font-size: 0.85rem; font-weight: 600; }
.btn-logout { background: transparent; color: #8892a4; border: 1px solid #2d3548; border-radius: 7px; padding: 6px 14px; font-size: 0.82rem; cursor: pointer; transition: all 0.2s; }
.btn-logout:hover { color: #e2e8f0; border-color: #4f9cf9; }

/* DASHBOARD */
.dashboard-container {
  padding: 32px; max-width: 1400px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr 1fr; gap: 32px;
}
@media (max-width: 900px) { .dashboard-container { grid-template-columns: 1fr; } }

.panel { background: #1e2433; border: 1px solid #2d3548; border-radius: 16px; padding: 24px; }
.competitors-panel { border-color: #3d2d4a; }
.panel-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.panel-header h2 { font-size: 1.1rem; font-weight: 700; color: #e2e8f0; }
.count-badge { background: #4f9cf9; color: #fff; border-radius: 20px; padding: 3px 12px; font-size: 0.78rem; font-weight: 700; }
.competitor-badge { background: #a855f7; }

.search-bar { margin-bottom: 16px; }
.search-bar input { background: #0f1117; border: 1px solid #2d3548; border-radius: 8px; padding: 10px 14px; color: #e2e8f0; font-size: 0.88rem; width: 100%; }
.search-bar input:focus { outline: none; border-color: #4f9cf9; }

.account-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; max-height: 500px; overflow-y: auto; padding-right: 4px; }
.account-card { background: #0f1117; border: 1px solid #2d3548; border-radius: 10px; padding: 14px 12px; font-size: 0.85rem; font-weight: 500; color: #e2e8f0; transition: border-color 0.2s, transform 0.15s; }
.account-card:hover { border-color: #4f9cf9; transform: translateY(-1px); }
.competitor-card { border-color: #3d2d4a; }
.competitor-card:hover { border-color: #a855f7; }
.solution-tag { display: inline-block; margin-top: 6px; border-radius: 4px; padding: 2px 7px; font-size: 0.72rem; font-weight: 600; }

.comp-legend { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.legend-pill { padding: 3px 10px; border-radius: 12px; font-size: 0.75rem; font-weight: 600; cursor: pointer; transition: opacity 0.2s; }
.legend-pill.inactive { opacity: 0.35; }

.empty-state { grid-column: 1 / -1; text-align: center; color: #4a5568; padding: 32px; font-size: 0.9rem; }

/* ADMIN */
.upload-section { margin-bottom: 28px; padding-bottom: 28px; border-bottom: 1px solid #2d3548; }
.upload-section:last-child { border-bottom: none; }
.upload-section h3 { margin-bottom: 10px; font-size: 1rem; color: #e2e8f0; }
.upload-hint { color: #8892a4; font-size: 0.82rem; margin-bottom: 12px; line-height: 1.6; }
.upload-hint code { background: #0f1117; border: 1px solid #2d3548; border-radius: 4px; padding: 1px 6px; color: #4f9cf9; font-size: 0.8rem; }
.upload-status { margin-top: 12px; font-size: 0.85rem; color: #34d399; min-height: 20px; }
.data-preview { background: #0f1117; border: 1px solid #2d3548; border-radius: 8px; padding: 14px; font-size: 0.78rem; color: #8892a4; max-height: 200px; overflow-y: auto; font-family: monospace; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #0f1117; }
::-webkit-scrollbar-thumb { background: #2d3548; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #4f9cf9; }