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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #f0f4f8;
  color: #1a2a3a;
  line-height: 1.5;
  min-height: 100vh;
}

/* ─── Layout ─────────────────────────────────────────── */

.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 16px;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid #d0dbe6;
}

header h1 {
  font-size: 1.25rem;
  color: #0b5394;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.875rem;
  color: #4a6a8a;
  position: relative;
}

/* ─── Hamburger Menu ────────────────────────────────── */

.menu-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #0b5394;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}

.menu-btn:hover {
  color: #094075;
}

.nav-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  min-width: 180px;
  z-index: 1050;
  overflow: hidden;
}

.nav-menu-item {
  display: block;
  width: 100%;
  padding: 12px 16px;
  border: none;
  background: none;
  text-align: left;
  font-size: 0.9rem;
  font-family: inherit;
  color: #1a2a3a;
  cursor: pointer;
  transition: background 0.1s;
}

.nav-menu-item:hover {
  background: #e8f0f8;
}

.nav-menu-item.signout-item {
  color: #d32f2f;
}

.nav-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1040;
}

/* ─── Buttons ────────────────────────────────────────── */

.btn {
  display: inline-block;
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-primary {
  background: #0b5394;
  color: #fff;
}

.btn-primary:hover {
  background: #094075;
}

.btn-secondary {
  background: #d0dbe6;
  color: #1a2a3a;
}

.btn-secondary:hover {
  background: #b8c8d8;
}

.btn-danger {
  background: #c0392b;
  color: #fff;
}

.btn-danger:hover {
  background: #a93226;
}

.btn-sm {
  padding: 4px 10px;
  font-size: 0.8rem;
}

.btn-link {
  background: none;
  border: none;
  color: #0b5394;
  cursor: pointer;
  font-size: 0.875rem;
  text-decoration: underline;
  padding: 0;
}

/* ─── Auth Section ───────────────────────────────────── */

#auth-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
}

#auth-section h2 {
  font-size: 1.5rem;
  color: #0b5394;
  margin-bottom: 24px;
}

.auth-form {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-form input {
  padding: 10px 12px;
  border: 1px solid #b8c8d8;
  border-radius: 6px;
  font-size: 0.95rem;
}

.auth-form input:focus {
  outline: none;
  border-color: #0b5394;
  box-shadow: 0 0 0 2px rgba(11, 83, 148, 0.15);
}

.auth-toggle {
  text-align: center;
  margin-top: 8px;
  font-size: 0.875rem;
  color: #4a6a8a;
}

.auth-links {
  text-align: center;
  font-size: 0.825rem;
}

.auth-error {
  color: #c0392b;
  font-size: 0.85rem;
  text-align: center;
}

/* ─── Totals Bar ─────────────────────────────────────── */

.totals-bar {
  background: #fff;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.totals-season-label {
  text-align: center;
  font-size: 0.75rem;
  color: #5a7a9a;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.totals-metrics {
  display: flex;
  justify-content: space-around;
}

.totals-empty {
  text-align: center;
  font-size: 0.875rem;
  color: #7a9aba;
  padding: 4px 0;
}

.total-item {
  text-align: center;
}

.total-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: #0b5394;
}

.total-label {
  font-size: 0.75rem;
  color: #5a7a9a;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ─── List Controls ─────────────────────────────────── */

.list-controls {
  background: #fff;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.controls-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.controls-search {
  flex: 1;
}

.controls-input {
  padding: 6px 8px;
  border: 1px solid #b8c8d8;
  border-radius: 6px;
  font-size: 0.85rem;
  font-family: inherit;
  background: #fff;
}

.controls-input:focus {
  outline: none;
  border-color: #0b5394;
  box-shadow: 0 0 0 2px rgba(11, 83, 148, 0.15);
}

.controls-row input[type="date"] {
  flex: 1;
  min-width: 0;
}

.controls-row select {
  flex: 1;
  min-width: 0;
}

#clear-filters-btn {
  white-space: nowrap;
  font-size: 0.8rem;
}

/* ─── Entry List ─────────────────────────────────────── */

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.toolbar h2 {
  font-size: 1.1rem;
}

.entry-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.entry-card {
  background: #fff;
  border-radius: 8px;
  padding: 14px 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition: box-shadow 0.15s;
}

.entry-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.entry-card-date {
  font-weight: 600;
  color: #0b5394;
  margin-bottom: 2px;
}

.entry-card-boat {
  font-size: 1rem;
}

.entry-card-details {
  font-size: 0.825rem;
  color: #5a7a9a;
  margin-top: 4px;
}

.empty-state {
  text-align: center;
  padding: 48px 16px;
  color: #7a9aba;
  font-size: 0.95rem;
}

/* ─── Entry Form ─────────────────────────────────────── */

.entry-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-group label {
  font-size: 0.825rem;
  font-weight: 600;
  color: #3a5a7a;
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 8px 10px;
  border: 1px solid #b8c8d8;
  border-radius: 6px;
  font-size: 0.95rem;
  font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #0b5394;
  box-shadow: 0 0 0 2px rgba(11, 83, 148, 0.15);
}

.form-group textarea {
  resize: vertical;
  min-height: 60px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

#form-delete-btn {
  margin-left: auto;
}

.form-error {
  color: #c0392b;
  font-size: 0.85rem;
}

/* ─── Loading ────────────────────────────────────────── */

.loading {
  text-align: center;
  padding: 32px;
  color: #7a9aba;
}

/* ─── Hidden ─────────────────────────────────────────── */

/* ─── Settings ───────────────────────────────────────── */

.settings-section {
  background: #fff;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.settings-section-title {
  font-size: 0.95rem;
  color: #0b5394;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #d0dbe6;
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.825rem;
  font-weight: 600;
  color: #3a5a7a;
}

.toggle-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #0b5394;
  cursor: pointer;
}

.settings-hint {
  font-size: 0.8rem;
  color: #5a7a9a;
  margin-top: 4px;
  line-height: 1.4;
}

.password-field {
  display: flex;
  gap: 8px;
  align-items: center;
}

.password-field input {
  flex: 1;
}

.btn-toggle-pw {
  background: none;
  border: none;
  color: #0b5394;
  cursor: pointer;
  font-size: 0.8rem;
  padding: 4px 8px;
  white-space: nowrap;
}

.btn-toggle-pw:hover {
  text-decoration: underline;
}

.pw-requirements {
  list-style: none;
  font-size: 0.8rem;
  color: #7a9aba;
  margin-top: 4px;
}

.pw-requirements li {
  padding: 2px 0;
}

.pw-requirements li::before {
  content: "\2022 ";
}

.pw-requirements li.met {
  color: #27ae60;
}

.pw-requirements li.met::before {
  content: "\2713 ";
}

.field-error {
  color: #c0392b;
  font-size: 0.8rem;
  margin-top: 2px;
}

.settings-saved-msg {
  color: #27ae60;
  font-size: 0.875rem;
  font-weight: 500;
  text-align: center;
  padding: 8px;
  background: #eafaf1;
  border-radius: 6px;
}

/* ─── Hidden ─────────────────────────────────────────── */

.hidden {
  display: none !important;
}

/* ─── Floating Action Button ────────────────────────── */

.fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: #0b5394;
  color: #fff;
  font-size: 1.5rem;
  line-height: 56px;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  z-index: 1000;
  transition: background 0.15s, box-shadow 0.15s;
}

.fab:hover {
  background: #094075;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.entry-list {
  padding-bottom: 80px;
}

/* ─── Dashboard ─────────────────────────────────────── */

.dashboard-stats-row {
  display: flex;
  justify-content: space-around;
  padding: 8px 0;
}

.dashboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.dashboard-table th {
  text-align: left;
  font-weight: 600;
  color: #3a5a7a;
  padding: 6px 8px;
  border-bottom: 2px solid #d0dbe6;
}

.dashboard-table td {
  padding: 6px 8px;
  border-bottom: 1px solid #eef2f6;
}

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

.dashboard-record {
  padding: 8px 0;
  border-bottom: 1px solid #eef2f6;
}

.dashboard-record:last-child {
  border-bottom: none;
}

.dashboard-record-label {
  font-size: 0.8rem;
  color: #5a7a9a;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.dashboard-record-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: #0b5394;
}

.dashboard-record-detail {
  font-size: 0.825rem;
  color: #4a6a8a;
}

.monthly-chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 140px;
  padding-top: 8px;
}

.chart-bar-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
}

.chart-bar-track {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
}

.chart-bar {
  width: 70%;
  background: #0b5394;
  border-radius: 3px 3px 0 0;
  min-height: 0;
  transition: height 0.3s;
}

.chart-bar-value {
  font-size: 0.65rem;
  color: #0b5394;
  font-weight: 600;
  margin-bottom: 2px;
}

.chart-bar-label {
  font-size: 0.65rem;
  color: #5a7a9a;
  margin-top: 4px;
}

.dashboard-muted {
  text-align: center;
  color: #7a9aba;
  font-size: 0.875rem;
  padding: 12px 0;
}

/* ─── Boat Dropdown ─────────────────────────────────── */

.boat-dropdown-wrap {
  position: relative;
}

.boat-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #b8c8d8;
  border-radius: 0 0 6px 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  z-index: 100;
  max-height: 220px;
  overflow-y: auto;
}

.boat-dropdown-item {
  padding: 8px 10px;
  cursor: pointer;
  transition: background 0.1s;
}

.boat-dropdown-item:hover {
  background: #e8f0f8;
}

.boat-dropdown-name {
  font-weight: 600;
}

.boat-dropdown-meta {
  font-size: 0.8rem;
  color: #5a7a9a;
}

/* ─── Import Modal ──────────────────────────────────── */

.import-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.import-dialog {
  background: #fff;
  border-radius: 10px;
  padding: 24px;
  max-width: 420px;
  width: 90%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.import-dialog h3 {
  font-size: 1.1rem;
  color: #0b5394;
  margin: 0;
}

.import-radio-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.import-radio-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  cursor: pointer;
}

.import-radio-group input[type="radio"] {
  accent-color: #0b5394;
}

.import-warning {
  background: #fdf2e9;
  border: 1px solid #e67e22;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 0.85rem;
  color: #a04000;
}

.import-progress {
  font-size: 0.85rem;
  color: #4a6a8a;
  text-align: center;
}

/* ─── Help Page ──────────────────────────────────────── */

.help-content p {
  font-size: 0.9rem;
  color: #2a3a4a;
  line-height: 1.6;
  margin-bottom: 8px;
}

.help-content p:last-child {
  margin-bottom: 0;
}

.help-content ul {
  font-size: 0.9rem;
  color: #2a3a4a;
  line-height: 1.6;
  padding-left: 20px;
  margin-bottom: 8px;
}

.help-content ul:last-child {
  margin-bottom: 0;
}

.help-content code {
  background: #e8f0f8;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.85rem;
}
