/* assets/css/style.css */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f4f6f4;
  padding: 30px;
  margin: 0;
  color: #333;
}

.container {
  max-width: 900px;
  margin: 0 auto;
}

/* --- THE NAVBAR --- */
.navbar {
  background: #1e5631; /* Kuner Green Main */
  color: white;
  padding: 15px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.navbar h2 {
  margin: 0;
  font-size: 1.4em;
}
.navbar a {
  color: #fff;
  text-decoration: none;
  margin-left: 15px;
  font-weight: 500;
}
.navbar a:hover {
  text-decoration: underline;
}

/* --- BANNERS & CARDS --- */
.welcome-banner {
  background: #fff;
  padding: 24px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
  margin-bottom: 25px;
  border-left: 4px solid #1e5631; /* Kuner Accent */
}

.card {
  background: #fff;
  padding: 25px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
  margin-bottom: 25px;
  border-left: 4px solid #1e5631; /* Adds the Kuner green accent to the left of all cards */
}

.item-row {
  background: #fff;
  padding: 24px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.02);
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap; /* Allows sections to wrap if they run out of room */
}

.item-details {
  flex: 1;
  min-width: 280px; /* Gives the text room to breathe */
}

.vote-actions {
  flex: 1;
  min-width: 320px; /* Ensures the form has an independent width layer */
}

/* Force the select box inside to stretch perfectly within its half */
.vote-actions select {
  padding: 10px 14px;
  border: 1px solid #ccd0d5;
  border-radius: 6px;
  background-color: #fff;
  font-size: 0.95em;
  width: 100%; /* Spans the form container cleanly */
  box-sizing: border-box;
}

.badge {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.88em;
  background: #e8f5e9;
  color: #2e7d32;
  padding: 6px 12px;
  border-radius: 20px;
  font-weight: 500;
  /* Remove white-space: nowrap if it was here, allowing natural, neat wrapping if required */
}

/* --- INTERACTIVE BUTTONS --- */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 6px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95em;
  background: #2d7a47; /* Kuner Mid-Green */
  color: white;
  transition: background 0.2s, transform 0.1s;
}
.btn:hover {
  background: #1e5631; /* Darker green on hover */
}
.btn:active {
  transform: scale(0.98);
}

/* --- FILTER BAR & LABELS --- */
.filter-bar {
  background: #fff;
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.03);
  margin-bottom: 30px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.filter-label {
  font-weight: bold;
  color: #555;
  margin-right: 5px;
}
.filter-btn {
  background: #eef2ef;
  color: #3b5243;
  padding: 6px 14px;
  border-radius: 20px;
  text-decoration: none;
  font-size: 0.9em;
  font-weight: 500;
  transition: all 0.2s;
}
.filter-btn:hover {
  background: #dbe4dd;
}
.filter-btn.active {
  background: #1e5631;
  color: #fff;
}

select {
  padding: 10px 14px;
  border: 1px solid #ccd0d5;
  border-radius: 6px;
  background-color: #fff;
  font-size: 0.95em;
  width: 100%;
  max-width: 420px; /* Limits width so it doesn't push off-card */
}

.badge-empty {
  background: #f5f5f5;
  color: #757575;
}
.scale-tag {
  font-size: 0.85em;
  color: #666;
  background: #f0f0f0;
  padding: 4px 8px;
  border-radius: 4px;
}
.cat-tag {
  font-size: 0.85em;
  background: #e8f5e9;
  color: #1e5631;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: 600;
  margin-right: 5px;
}

/* --- LIST STRUCTURES --- */
.meter-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.meter-item {
  padding: 16px;
  border-bottom: 1px solid #eef2ef;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.meter-item:last-child {
  border-bottom: none;
}
.meter-item a {
  font-weight: bold;
  font-size: 1.1em;
  text-decoration: none;
  color: #2d7a47;
}
.meter-item a:hover {
  color: #1e5631;
}

/* --- NEW METRIC FORM LAYOUT UPDATES --- */

/* Give every group row structural vertical breathing room */
.form-group {
  margin-bottom: 22px;
}

/* Force text labels to sit clearly ABOVE the inputs on their own line */
.form-group label {
  display: block;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 8px;
  font-size: 0.95em;
}

/* Make all core form inputs wide, padded, and modern */
/* --- UPDATED INPUT SELECTORS IN css/style.css --- */

/* Added input[type="password"] to the group below */
.form-card input[type="text"],
.form-card input[type="number"],
.form-card input[type="password"],
.form-card select,
.form-card textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #ccd0d5;
  border-radius: 6px;
  background-color: #fff;
  font-size: 1em;
  box-sizing: border-box;
  transition: border-color 0.2s;
}

/* Ensure password fields get the clean green border glow on focus too */
.form-card input:focus,
.form-card select:focus,
.form-card textarea:focus {
  border-color: #2d7a47;
  outline: none;
}

/* Polish the custom text options row pairing layout */
.option-row {
  display: flex;
  gap: 15px;
  margin-bottom: 12px;
}
.option-row input {
  flex: 1;
}

/* Make the textarea layout deep enough for descriptions */
.form-card textarea {
  height: 100px;
  resize: vertical;
}

/* --- SUB-GRID ROW WRAPPER --- */
.scale-row {
  display: flex;
  gap: 20px;       /* Puts a clean visual channel between the two columns */
  margin-bottom: 22px;
}

.scale-row .form-group {
  flex: 1;         /* Forces both columns to stay perfectly equal in width */
  margin-bottom: 0;/* Drops individual group padding since the parent row handles it */
}

/* Rankings History Table Layouts */
.rankings-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  font-family: sans-serif;
}

.rankings-page h2 {
  margin-bottom: 25px;
}

.table-responsive {
  overflow-x: auto;
  background: #ffffff;
  padding: 15px;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.rankings-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.rankings-table th {
  padding: 12px 15px;
  font-weight: bold;
  background-color: #f9f9f9;
  border-bottom: 2px solid #dddddd;
}

.rankings-table td {
  padding: 12px 15px;
  border-bottom: 1px solid #eeeeee;
}

.rankings-table .text-center {
  text-align: center;
}

.rankings-table .system-title {
  color: #444444;
}

.rankings-table .user-score {
  font-weight: bold;
  color: #2e7d32;
}

.rankings-table .norm-score {
  color: #666666;
}

.rankings-table .date-col {
  color: #777777;
  font-size: 0.9em;
}

/* Pagination UI controls */
.pagination-controls {
  margin-top: 30px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.btn-page {
  display: inline-block;
  padding: 8px 16px;
  border: 1px solid #cccccc;
  text-decoration: none;
  color: #333333;
  background: #ffffff;
  border-radius: 4px;
  margin: 0 8px;
  font-size: 0.9em;
}

.btn-page:hover:not(.disabled) {
  background-color: #f0f0f0;
}

.btn-page.disabled {
  border: 1px solid #e0e0e0;
  color: #bbbbbb;
  background: #fafafa;
  cursor: not-allowed;
}

.page-indicator {
  font-weight: 600;
  color: #333333;
  margin: 0 10px;
}

.empty-state {
  color: #666666;
  font-style: italic;
  margin-top: 25px;
  text-align: center;
  background: #ffffff;
  padding: 20px;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
