:root {
  --bg: #0B2A4A;
  --bg-dark: #071b30;
  --card-bg: #13375c;
  --card-hover: #194570;
  --accent: #F5C518;
  --floor-bg: #F5C518;
  --floor-text: #0B2A4A;
  --text: #ffffff;
  --text-muted: #b0bcc8;
  --border: rgba(255, 255, 255, 0.12);
  --green: #3fb950;
  --red: #f85149;
  --blue: #58a6ff;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding: 24px;
  line-height: 1.45;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
}

.container-narrow {
  max-width: 1050px;
  margin: 0 auto;
}

header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

header h1 {
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.nav-link, button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 8px;
  border: none;
  padding: 10px 16px;
  cursor: pointer;
  transition: opacity 0.15s, background-color 0.15s;
}

.nav-link {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.nav-link:hover, .nav-link.active {
  background: var(--accent);
  color: var(--bg);
}

button, .btn {
  background: var(--accent);
  color: var(--bg);
}

button:hover:not(:disabled), .btn:hover:not(:disabled) {
  opacity: 0.9;
}

button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

button.secondary, .btn.secondary {
  background: #2a4d75;
  color: var(--text);
}

button.danger, .btn.danger {
  background: var(--red);
  color: #fff;
}

button.warning, .btn.warning {
  background: var(--blue);
  color: #fff;
}

button.small, .btn.small {
  padding: 6px 12px;
  font-size: 0.85rem;
}

.panel, .card {
  background: var(--card-bg);
  border-radius: 14px;
  padding: 22px;
  margin-bottom: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.22);
}

.panel h2, .card h2 {
  font-size: 1.15rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 14px;
}

label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

input, select, textarea {
  width: 100%;
  font-family: inherit;
  font-size: 0.98rem;
  color: var(--text);
  background: var(--bg-dark);
  border: 1px solid #2a4d75;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 14px;
}

textarea {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85rem;
  resize: vertical;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

@media (max-width: 820px) {
  .grid-2, .grid-3 {
    grid-template-columns: 1fr;
  }
}

.comp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

.comp-tile {
  display: block;
  text-decoration: none;
  color: var(--text);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  transition: transform 0.15s, border-color 0.15s, background-color 0.15s;
}

.comp-tile:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  background: var(--card-hover);
}

.comp-tile h3 {
  font-size: 1.3rem;
  color: var(--accent);
  margin-bottom: 8px;
}

.comp-meta {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.pool-card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 22px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}

.pool-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border-bottom: 2px solid rgba(245, 197, 24, 0.25);
  padding-bottom: 12px;
  margin-bottom: 20px;
}

.pool-header h2 {
  font-size: 1.55rem;
  color: var(--accent);
}

.section {
  margin-bottom: 20px;
}

.section h3 {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.section .team {
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.2;
}

.section .branch {
  font-size: 1.1rem;
  color: var(--accent);
  font-weight: 600;
  margin-top: 4px;
}

.floor {
  background: var(--floor-bg);
  color: var(--floor-text);
  padding: 20px;
  border-radius: 12px;
}

.floor h3 {
  color: rgba(11, 42, 74, 0.72);
}

.floor .team {
  font-size: 2.5rem;
}

.floor .branch {
  color: var(--floor-text);
}

.hall-container {
  display: flex;
  gap: 14px;
}

@media (max-width: 768px) {
  .hall-container {
    flex-direction: column;
  }
  .floor .team {
    font-size: 1.9rem;
  }
  .section .team {
    font-size: 1.45rem;
  }
}

.hall-item {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  padding: 14px;
  border-radius: 10px;
}

.hall-item .team {
  font-size: 1.5rem;
}

.hall-item .branch {
  font-size: 1rem;
}

.march-banner {
  background: rgba(88, 166, 255, 0.15);
  border: 1px solid var(--blue);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  text-align: center;
}

.march-banner .title {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--blue);
}

.queue-list {
  list-style: none;
}

.queue-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  margin-bottom: 6px;
}

.queue-list li.is-activity {
  background: rgba(88, 166, 255, 0.12);
  border-left: 4px solid var(--blue);
}

.queue-list li.is-current {
  border: 2px solid var(--accent);
  background: rgba(245, 197, 24, 0.12);
}

.queue-list li.is-done {
  opacity: 0.45;
}

.queue-list li.is-scratched .item-main {
  text-decoration: line-through;
  opacity: 0.55;
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
}

.badge.active {
  background: var(--green);
  color: #06210c;
}

.badge.finished {
  background: rgba(255, 255, 255, 0.14);
  color: var(--text-muted);
}

.badge.scratched {
  background: rgba(248, 81, 73, 0.25);
  color: #ff9c97;
}

.badge.activity {
  background: rgba(88, 166, 255, 0.25);
  color: #9ecbff;
}

.status-idle, .status-finished {
  opacity: 0.82;
}

.empty {
  color: var(--text-muted);
  font-style: italic;
}

.poll-indicator {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.ok { color: var(--green); }
.err { color: var(--red); }

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: 0.92rem;
}

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

th {
  color: var(--accent);
  font-size: 0.82rem;
  text-transform: uppercase;
}

.footer-logo {
  text-align: center;
  margin-top: 36px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.footer-logo img {
  max-height: 120px;
  max-width: 100%;
  opacity: 0.9;
}
