/* === Base === */
body {
  font-family: system-ui, -apple-system, sans-serif;
  margin: 0;
  padding: 24px;
  padding-top: 56px;
  background: #07182d;
  color: #eee;
}

h1 {
  margin: 0 0 24px;
  font-size: 20px;
}

a {
  color: #e94560;
  text-decoration: none;
}

/* === Top bar === */
.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  background: #0f3460;
  z-index: 10;
}

.top-bar a {
  color: white;
  text-decoration: none;
  font-size: 14px;
}

.top-bar a.active {
  font-weight: 700;
}

.top-bar .org-name {
  color: #eee;
  font-size: 14px;
  opacity: 0.7;
}

/* === Centered card (login, settings) === */
.container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  background: #07182d;
  padding: 28px 40px;
  border-radius: 16px;
}

/* === Inputs === */
input {
  padding: 8px 12px;
  font-size: 14px;
  border: none;
  border-radius: 8px;
  background: #0f3460;
  color: #eee;
  box-sizing: border-box;
}

input::placeholder {
  color: #888;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
}

select {
  padding: 6px 10px;
  border: none;
  border-radius: 6px;
  background: #0f3460;
  color: #eee;
  font-size: 13px;
}

/* === Buttons === */
button {
  padding: 10px 20px;
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  background: #e94560;
  color: white;
  cursor: pointer;
  transition: background 0.2s;
}

button:hover {
  background: #c73e54;
}

.btn {
  padding: 8px 16px;
  font-size: 14px;
  border-radius: 6px;
}

.btn-save {
  background: #2ecc71;
  color: white;
}

.btn-cancel {
  background: #555;
  color: white;
}

.btn-edit {
  background: #3498db;
  color: white;
  padding: 4px 10px;
  font-size: 12px;
}

/* === Tables === */
table {
  width: 100%;
  border-collapse: collapse;
  background: #07182d;
  border-radius: 8px;
  overflow: hidden;
}

th, td {
  padding: 8px 8px;
  text-align: center;
  border-bottom: 1px solid #0f3460;
}

th {
  font-size: 12px;
  text-transform: uppercase;
  background: #0f3460;
}

tr th:nth-child(2) {
  text-align: left;
}

tr td:nth-child(2) {
  text-align: left;
}

tr td:first-child {
  font-weight: 700;
}

tr:last-child td {
  border-bottom: none;
}

.empty {
  text-align: center;
  padding: 40px;
  opacity: 0.4;
}

.editing {
  background: #0f3460;
}

.editing input,
.editing select {
  background: #16213e;
  padding: 4px 6px;
  border: none;
  border-radius: 4px;
  color: #eee;
  font-size: 14px;
}

/* === Login page === */
.login-body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 0;
  padding-top: 0;
}

.login-body input {
  width: 100%;
}

.login-body button {
  width: 100%;
}

.btn-row {
  display: flex;
  gap: 12px;
  width: 100%;
}

.btn-row button {
  flex: 1;
}

.btn-secondary {
  background: #0f3460;
}

.btn-secondary:hover {
  background: #1a4a8a;
}

.error {
  color: #e94560;
  font-size: 14px;
  text-align: center;
  display: none;
  margin: 0;
}

/* === My Competitions page === */
.comp-create {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.comp-create input {
  flex: 1;
}

.comp-create button {
  padding: 12px 24px;
}

/* === Settings page === */
#settings-panel {
  flex-direction: row;
  align-items: flex-start;
  flex-wrap: wrap;
}

.settings-section {
  flex: 1;
  min-width: 200px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.settings-section input,
.settings-section select {
  width: 100%;
}

.weight-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.weight-col h3 {
  margin: 0;
  font-size: 14px;
  text-transform: uppercase;
  opacity: 0.6;
}

.settings-section h3 {
  margin: 0;
  font-size: 14px;
  text-transform: uppercase;
  opacity: 0.6;
}

.weight-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 32px;
}

.weight-tag {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: #0f3460;
  border-radius: 6px;
  font-size: 14px;
}

.weight-tag button {
  padding: 0;
  font-size: 14px;
  background: none;
  color: #e94560;
  cursor: pointer;
}

.weight-tag button:hover {
  background: none;
}

.add-weight {
  display: flex;
  gap: 6px;
}

.add-weight input {
  width: 80px;
}

.add-weight button {
  padding: 6px 12px;
  font-size: 14px;
}

/* === Athletes page === */
.form-row {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.form-row input {
  width: 120px;
}

.form-row select {
  width: 130px;
}

table input[type="number"].e-weight,
table input[type="number"].e-birthyear,
table input[type="text"].e-age,
table .e-lift {
  width: 75px;
}

table input[type="text"].e-wc,
table input[type="number"].e-group,
table input[type="number"].e-lot {
  width: 60px;
}


.btn-add {
  background: #e94560;
  color: white;
}

.btn-lifts {
  background: #9b59b6;
  color: white;
  padding: 4px 10px;
  font-size: 12px;
}

.lifts-row td {
  padding: 0 16px 16px;
}

.lifts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.lift-group {
  background: #0f3460;
  border-radius: 6px;
  padding: 10px;
}

.lift-group h4 {
  margin: 0 0 8px;
  font-size: 12px;
  text-transform: uppercase;
  opacity: 0.6;
}

.lift-item {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  font-size: 13px;
}

.lift-item label {
  min-width: 70px;
}

.lift-item input[type="number"] {
  width: 60px;
  padding: 4px 6px;
  border: none;
  border-radius: 4px;
  background: #16213e;
  color: #eee;
  font-size: 13px;
}

.light-btn {
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.light-btn:hover {
  background: inherit;
}

.light-0 {
  background: #666;
  color: white;
}

.light-1 {
  background: #2ecc71;
  color: white;
}

.light--1 {
  background: #e74c3c;
  color: white;
}

/* === Competition page === */
.control-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.clock-bar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.judge-bar {
  display: flex;
  gap: 8px;
}

.group-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.group-bar label {
  font-size: 14px;
  opacity: 0.7;
}

.group-section {
  margin-bottom: 24px;
}

.group-section h3 {
  margin: 0 0 8px;
  font-size: 14px;
  text-transform: uppercase;
  opacity: 0.6;
}

.group-inactive {
  opacity: 0.5;
}

.group-section th:nth-child(n+5):nth-child(-n+13),
.group-section td:nth-child(n+5):nth-child(-n+13) {
  padding: 6px 2px;
}

.lift-btns {
  display: flex;
  gap: 8px;
}

.total-cell {
  font-weight: 700;
  text-align: center;
}

/* === Clock === */
#clock-display {
  font-size: 24px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  min-width: 80px;
  text-align: center;
}

.btn-good {
  background: #2ecc71;
  color: white;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 700;
  border-radius: 8px;
}

.btn-nolift {
  background: #e74c3c;
  color: white;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 700;
  border-radius: 8px;
}

.btn-good:disabled,
.btn-nolift:disabled {
  opacity: 0.3;
  cursor: default;
}

.lift-good {
  background: #2ecc71;
  color: white;
  text-align: center;
}

.lift-fail {
  background: #e74c3c;
  color: white;
  text-align: center;
}

.lift-pending {
  /*background: #f39c12;*/
  color: white;
  text-align: center;
}

.lift-empty {
  text-align: center;
}

.lift-current {
  background: #5dade2;
  color: white;
  text-align: center;
}
.lift-cell {
}
.lift-weight {
  text-align: center;
  padding: 8px 12px;
  font-size: 14px;
  border: none;
  border-radius: 4px;
  background: #0f3460;
  color: #eee;
  box-sizing: border-box;
  width: 65px;
}

.lift-good .lift-weight {
  background:#2ecc71;
}

.lift-fail .lift-weight {
  background:#e74c3c;
}

.lift-status {
  display: block;
  margin: 4px auto 0;
  padding: 2px 2px;
  font-size: 11px;
  border: none;
  border-radius: 4px;
  background: #16213e;
  color: #eee;
  cursor: pointer;
}

.completed {
  opacity: 0.4;
}

.group-section td:nth-child(2) {
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
