* {
  box-sizing: border-box;
}

:root {
  --background: #0f172a;
  --surface: #111827;
  --surface-light: #1f2937;
  --card: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --accent: #22c55e;
  --warning: #f59e0b;
  --danger: #dc2626;
  --border: #e5e7eb;
  --shadow: 0 20px 40px rgba(15, 23, 42, 0.18);
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
  color: var(--text);
  min-height: 100vh;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 24px;
  color: white;
}

.topbar h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3rem);
}

.eyebrow {
  margin: 0 0 4px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  font-size: 0.75rem;
  color: #93c5fd;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.nav-link,
.primary-btn,
.secondary-btn,
.danger-btn {
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 700;
}

.nav-link {
  background: rgba(255, 255, 255, 0.14);
  color: white;
}

.nav-link.active,
.primary-btn {
  background: var(--primary);
  color: white;
}

.primary-btn:hover {
  background: var(--primary-dark);
}

.secondary-btn {
  background: #e5e7eb;
  color: #111827;
}

.danger-btn {
  background: #fee2e2;
  color: var(--danger);
}

.full-width {
  width: 100%;
}

.hidden {
  display: none !important;
}

.auth-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 24px;
}

.hero-card,
.auth-card,
.app-panel,
.panel-card {
  background: var(--card);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.hero-card {
  padding: 40px;
}

.hero-card h2 {
  margin: 0 0 16px;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1;
}

.hero-card p {
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.6;
}

.feature-list,
.status-list {
  list-style: none;
  padding: 0;
  margin: 24px 0 0;
}

.feature-list li,
.status-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.auth-card {
  padding: 24px;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #f3f4f6;
  border-radius: 14px;
  padding: 6px;
  margin-bottom: 20px;
}

.tab {
  border: 0;
  background: transparent;
  border-radius: 10px;
  padding: 10px;
  font-weight: 700;
  color: var(--muted);
}

.tab.active {
  background: white;
  color: var(--primary);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.auth-form,
.recommendation-form,
.filters {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: #374151;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 11px 12px;
  background: white;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

.message {
  min-height: 20px;
  margin: 0;
  font-weight: 700;
}

.message.success {
  color: #15803d;
}

.message.error {
  color: var(--danger);
}

.hint {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0;
}

.app-panel {
  padding: 28px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 22px;
}

.section-header h2 {
  margin: 0;
  font-size: 2rem;
}

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

.stat-card {
  border-radius: 18px;
  background: #f8fafc;
  border: 1px solid var(--border);
  padding: 18px;
}

.stat-card span {
  display: block;
  color: var(--primary);
  font-size: 2.3rem;
  font-weight: 800;
}

.stat-card p {
  margin: 6px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.two-column {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 18px;
}

.panel-card {
  padding: 20px;
  box-shadow: none;
  border: 1px solid var(--border);
}

.panel-card h3 {
  margin-top: 0;
}

.dot {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 999px;
  margin-right: 8px;
}

.dot.done {
  background: var(--accent);
}

.dot.progress {
  background: var(--warning);
}

.recent-list {
  display: grid;
  gap: 10px;
}

.recent-item {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
}

.recent-item strong {
  display: block;
}

.recommendation-form {
  grid-template-columns: repeat(2, 1fr);
}

.full-span {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.filters {
  grid-template-columns: 1.2fr 1fr 1fr 1fr 160px auto;
  align-items: end;
  margin-bottom: 18px;
}

#clear-filters-btn {
  width: auto;
  min-width: 140px;
  justify-self: start;
  white-space: nowrap;
}

.result-count {
  font-weight: 700;
  color: var(--muted);
}

.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 16px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  min-width: 900px;
}

th,
td {
  text-align: left;
  border-bottom: 1px solid var(--border);
  padding: 12px;
  vertical-align: top;
}

th {
  background: #f9fafb;
  color: #374151;
  font-size: 0.9rem;
}

td.actions {
  white-space: nowrap;
}

.status-select {
  min-width: 140px;
}

.empty-state {
  text-align: center;
  border: 2px dashed #cbd5e1;
  border-radius: 18px;
  padding: 32px;
  color: var(--muted);
}

.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 4px 8px;
  background: #dbeafe;
  color: #1e40af;
  font-size: 0.8rem;
  font-weight: 700;
}

/* WatchTrack branding */
.watchtrack-logo-container {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: auto;
  margin: 0;
}

.watchtrack-logo {
  display: block;
  width: 85px;
  max-width: 85px;
  height: auto;
}

@media (max-width: 900px) {

  .auth-layout,
  .two-column,
  .recommendation-form,
  .filters,
  .stat-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .section-header {
    flex-direction: column;
  }

}