:root {
  --navy: #2A3A5A;
  --lime: #B8D935;
  --bg: #F2F4F7;
  --card: #FFFFFF;
  --text: #1E2430;
  --muted: #6B7280;
  --danger: #D9432B;
}

* { box-sizing: border-box; }

/* The panel toggles views via the hidden attribute; without this rule the
   display:flex below overrides it and both views render at once. */
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: 'Montserrat', sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* ---- login ---- */
.login-view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card {
  background: var(--card);
  padding: 32px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 280px;
}
.login-card h1 { font-size: 18px; margin: 0 0 8px; color: var(--navy); }
.login-card input {
  padding: 10px 12px;
  border: 1px solid #D9DEE6;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
}
.login-card button {
  padding: 10px;
  border: none;
  border-radius: 8px;
  background: var(--lime);
  color: var(--navy);
  font-weight: 700;
  cursor: pointer;
}
.error-text { color: var(--danger); font-size: 13px; min-height: 16px; margin: 0; }

/* ---- app shell ---- */
.topbar {
  background: var(--navy);
  color: white;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 20px;
  height: 56px;
}
.brand { font-weight: 700; }
.tabs { display: flex; gap: 8px; flex: 1; flex-wrap: wrap; }
.tab-btn {
  background: none;
  border: none;
  color: #C7CEDB;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
}
.tab-btn.active { background: rgba(255,255,255,0.12); color: white; }
.logout-btn {
  background: none;
  border: 1px solid rgba(255,255,255,0.3);
  color: white;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
}

.content { padding: 24px; max-width: 1100px; margin: 0 auto; }
h2 { color: var(--navy); }
.hint { color: var(--muted); font-size: 13px; max-width: 700px; }

.tab-pane { display: none; }
.tab-pane.active { display: block; }

.row { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; flex-wrap: wrap; }
select, .schedule-list input {
  padding: 8px 10px;
  border: 1px solid #D9DEE6;
  border-radius: 6px;
  font-family: inherit;
}

button {
  font-family: inherit;
}
#queue-upload-btn, #schedule-add-btn, #schedule-save-btn {
  padding: 8px 14px;
  border: none;
  border-radius: 6px;
  background: var(--navy);
  color: white;
  cursor: pointer;
  margin-right: 8px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border-radius: 8px;
  overflow: hidden;
}
.data-table th, .data-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid #EEF1F5;
  font-size: 14px;
}
.data-table th { background: #F7F8FA; color: var(--muted); font-weight: 600; }
.ok-badge { color: #1E8E3E; font-weight: 700; }
.err-badge { color: var(--danger); font-weight: 700; }

.queue-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.queue-item {
  background: var(--card);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.queue-item img { width: 100%; height: 160px; object-fit: cover; display: block; }
.queue-item .meta { padding: 8px; font-size: 12px; color: var(--muted); }
.queue-item .actions { display: flex; gap: 6px; padding: 0 8px 8px; }
.queue-item button {
  flex: 1;
  border: none;
  background: #EEF1F5;
  border-radius: 4px;
  padding: 4px;
  cursor: pointer;
  font-size: 11px;
}

.schedule-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.schedule-row { display: flex; align-items: center; gap: 6px; background: var(--card); padding: 6px 8px; border-radius: 6px; }
.schedule-row button { border: none; background: none; color: var(--danger); cursor: pointer; font-size: 16px; }

@media (max-width: 600px) {
  .topbar { flex-wrap: wrap; height: auto; padding: 10px; }
  .content { padding: 12px; }
}
