:root {
  --bg: #e8e8e8;
  --bg-secondary: #d9d9d9;
  --bg-tertiary: #c9c9c9;
  --accent: #2c5282;
  --accent-light: #4a5f8a;
  --accent-soft: #e0e7f0;
  --accent-border: #2c5282;
  --border-subtle: #b3b3b3;
  --text-main: #1a1a1a;
  --text-muted: #555555;
  --danger: #c53030;
  --success: #2f855a;
  --surface-base: #d9d9d9;
  --surface-hover: #cfcfcf;
  --surface-active: #c7c7c7;
  --control-radius: 0.6rem;
  --control-pad-y: 0.5rem;
  --control-pad-x: 1rem;
  --header-height: 96px;
  --avatar-size: 2.5rem;
  --avatar-radius: 50%;
  --avatar-bg: #1f2937;
  --avatar-bg-alt: #334155;
  --avatar-bg-blue: #1a365d;
  --avatar-text: #f8fafc;
  --avatar-font: "Segoe UI", "Inter", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: #e8e8e8;
}

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(to bottom, #e8e8e8 0%, #d9d9d9 100%);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  width: 100%;
  will-change: auto;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  width: 100%;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.main-layout {
  display: flex;
  flex: 1;
  min-height: 0;
}

@media (max-width: 768px) {
  header {
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
  }

  header .nav-links {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 0.5rem;
  }

  .nav-link {
    flex: 1 1 140px;
    min-height: 44px;
    padding: 0.6rem 0.75rem;
  }

  .main-layout,
  .herd-layout {
    flex-direction: column;
    min-width: 0;
  }

  #sidebar.left-panel {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    border-right: none;
    border-bottom: 2px solid var(--accent);
  }

  .map-panel {
    position: relative;
    top: auto;
    height: auto;
  }

  .herd-map-row {
    flex-direction: column;
    height: auto;
    min-height: 280px;
    max-height: none;
  }

  #map {
    height: 320px;
    min-height: 320px;
  }

  .dashboard-column--secondary {
    min-width: 0;
  }

  .health-records-detail-controls {
    flex-direction: column;
    align-items: flex-start;
  }

  .health-records-detail-controls select {
    width: 100%;
    min-width: 0;
  }

  .health-records-detail-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .docs-modal-body {
    overflow-x: auto;
  }

  .health-secondary-filters {
    flex-direction: column;
    align-items: stretch;
  }

  .search-wrapper {
    width: 100%;
  }

  .health-records-filter-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .button-primary,
  .button-secondary,
  .report-btn,
  .quick-link-btn,
  .group-list-actions button,
  .health-records-filter-actions .small-button {
    width: 100%;
  }
}

header {
  padding: 1rem 1.5rem;
  border-bottom: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  background: #d9d9d9;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.brand:hover {
  opacity: 0.8;
}

.brand-logo {
  width: 64px;
  height: 64px;
  border-radius: 0;
  overflow: hidden;
  border: none;
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
}

.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  gap: 0.1rem;
}

.brand-title {
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 1.05rem;
  color: var(--accent);
  font-weight: 700;
}

.brand-subtitle {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: 0.02em;
}

header button {
  border: none;
  padding: 0.3rem 0.9rem;
  border-radius: 9999px;
  cursor: pointer;
  font-size: 0.8rem;
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
  transition: all 0.15s ease-out;
}

header button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.5);
}

header button:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

main {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

#auth-panel {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2.5rem 1rem 2.5rem;
  overflow-y: auto;
}

#app-panel {
  flex: 1;
  display: none;
  flex-direction: column;
  min-height: 0;
}

#auth-panel.visible,
#app-panel.visible {
  display: flex !important;
}

.auth-card {
  width: 100%;
  max-width: 480px;
  background: #f0f0f0;
  border-radius: 1rem;
  padding: 2.5rem 2.2rem 2rem;
  border: 1px solid #b3b3b3;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
  position: relative;
  overflow: hidden;
}

.auth-card::before {
  content: "";
  position: absolute;
  inset: -40%;
  background:
    radial-gradient(circle at 0% 0%, rgba(37, 99, 235, 0.05), transparent 55%),
    radial-gradient(circle at 110% 110%, rgba(59, 130, 246, 0.05), transparent 45%);
  opacity: 0.8;
  pointer-events: none;
}

.auth-inner {
  position: relative;
  z-index: 1;
}

.auth-card h2 {
  margin: 0;
  font-size: 1.6rem;
  letter-spacing: -0.3px;
  font-weight: 700;
  color: var(--text-main);
}

.auth-card p {
  margin: 0.5rem 0 1.3rem;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.field {
  margin-bottom: 1rem;
}

.field label {
  display: block;
  font-size: 0.8rem;
  margin-bottom: 0.4rem;
  color: var(--text-main);
  font-weight: 600;
}

.field input {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border-radius: 0.6rem;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: var(--text-main);
  font-size: 0.95rem;
  outline: none;
  transition: all 0.2s ease;
}

.field input:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.field input:focus {
  border-color: var(--accent);
  background: #f8fbff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* Select styling - match input appearance */
.field select {
  width: 100%;
  min-height: 44px;
  padding: 0.7rem 0.85rem;
  border-radius: 0.6rem;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: var(--text-main);
  font-size: 0.95rem;
  outline: none;
  transition: all 0.2s ease;
  cursor: pointer;
}

.field select:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.field select:focus {
  border-color: var(--accent);
  background: #f8fbff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* Checkbox agreement section */
.agreements {
  margin-top: 0.5rem;
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  justify-content: flex-start;
  text-align: left;
  cursor: pointer;
  font-size: 0.95rem;
  color: var(--text-main);
}

.checkbox-row input[type="checkbox"] {
  margin-top: 2px;
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  cursor: pointer;
  accent-color: var(--accent);
}

.checkbox-row span {
  line-height: 1.35;
}

.checkbox-row a {
  color: var(--accent-primary);
  text-decoration: underline;
}

.checkbox-row a:hover {
  text-decoration: none;
}

.button-primary {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 0.7rem;
  border: none;
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
  margin-top: 0.5rem;
  transition: all 0.2s ease;
  font-size: 0.95rem;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.button-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.5);
}

.button-primary:active {
  transform: translateY(0);
}

.button-secondary {
  width: 100%;
  padding: 0.7rem 1rem;
  border-radius: 0.7rem;
  border: 1.5px solid var(--accent);
  background: #e8e8e8;
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
  margin-top: 0.5rem;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.button-secondary:hover {
  background: #d9d9d9;
  border-color: var(--accent);
  color: #1e40af;
}

.auth-status {
  font-size: 0.85rem;
  margin-top: 0.75rem;
  min-height: 1.2em;
  color: var(--text-muted);
}

.auth-contact {
  margin-top: 1.5rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.auth-contact-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.6rem;
  color: var(--text-main);
  font-weight: 700;
}

.auth-contact-row {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.auth-contact-label {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.auth-contact a {
  color: #0284c7;
  text-decoration: none;
  font-weight: 600;
}

.auth-contact a:hover {
  text-decoration: underline;
  color: #1e40af;
}

/* Remember Me Checkbox Styling */
.auth-remember-me {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.auth-remember-me input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--accent);
  border: 1.5px solid #cbd5e1;
  border-radius: 0.35rem;
  transition: all 0.2s ease;
  background: #ffffff;
  flex-shrink: 0;
}

.auth-remember-me input[type="checkbox"]:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(44, 82, 130, 0.1);
}

.auth-remember-me input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.auth-remember-me label {
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-main);
  transition: color 0.2s ease;
  user-select: none;
  margin: 0;
  white-space: nowrap;
}

.auth-remember-me:hover label {
  color: var(--accent);
}

/* Add Animal Modal Styling */
#open-add-animal-modal-btn {
  background: linear-gradient(135deg, #f1f7ff 0%, #e6f0ff 100%);
  border: 1px solid rgba(148, 197, 255, 0.8);
  color: var(--text-main);
  font-weight: 600;
  padding: 0.35rem 0.7rem;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
}

#open-add-animal-modal-btn:hover {
  background: linear-gradient(135deg, #e9f2ff 0%, #d9eaff 100%);
  border-color: rgba(148, 197, 255, 1);
}

#add-animal-modal .docs-modal-card {
  background: #e8e8e8;
  border: 2px solid var(--accent);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(37, 99, 235, 0.1);
  width: auto;
  height: auto;
  padding: 1.2rem;
}

#add-animal-modal .docs-modal-header {
  margin-bottom: 0.5rem;
}

#add-animal-modal .docs-modal-title {
  color: var(--text-main);
}

#add-animal-modal .docs-modal-body {
  max-height: 85vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 0.5rem;
}

#add-animal-modal .docs-modal-body::-webkit-scrollbar {
  width: 6px;
}

#add-animal-modal .docs-modal-body::-webkit-scrollbar-track {
  background: transparent;
}

#add-animal-modal .docs-modal-body::-webkit-scrollbar-thumb {
  background: rgba(44, 82, 130, 0.3);
  border-radius: 3px;
}

#add-animal-modal .docs-modal-body::-webkit-scrollbar-thumb:hover {
  background: rgba(44, 82, 130, 0.5);
}

body.modal-open {
  overflow: hidden;
}

.add-animal-scan-btn {
  background: #fafaf9;
  border-radius: 0.5rem;
  border: 1.5px solid var(--border-subtle);
  color: var(--text-main);
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s ease;
  font-weight: 500;
}

.add-animal-scan-btn:hover {
  border-color: #0284c7;
  background: #f5f5f4;
}

#add-animal-modal .button-primary,
#add-animal-modal .button-secondary,
#add-animal-modal .btn-outline {
  width: 100%;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
  margin-top: 0 !important;
}

#add-animal-modal .btn-outline {
  background: #fafaf9;
  border-radius: 0.5rem;
  border: 1.5px solid var(--border-subtle);
  color: var(--text-main);
}

#add-animal-modal .btn-outline:hover {
  border-color: #0284c7;
  background: #f5f5f4;
}

.password-wrapper {
  position: relative;
}

.password-wrapper input {
  padding-right: 2.2rem;
}

.password-toggle {
  position: absolute;
  right: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  opacity: 0.9;
}

.password-toggle:hover {
  opacity: 1;
}

.password-toggle svg {
  width: 16px;
  height: 16px;
}

/* APP PANEL */

#app-panel .main-layout {
  display: flex;
  flex: 1;
  min-height: 0;
}

#app-panel .main-layout > section {
  display: none;
  min-height: 0;
}

#app-panel .main-layout > section.view--active {
  display: flex;
  flex-direction: column;
  flex: 1;
  width: 100%;
  min-height: 0;
}



.herd-layout {
  display: flex;
  width: 100%;
  flex: 1;
}

#sidebar.left-panel {
  width: 450px;
  max-width: 480px;
  min-width: 420px;
  border-right: 2px solid var(--accent);
  background: linear-gradient(to bottom, #e8e8e8 0%, #d9d9d9 100%);
  padding: 0.9rem 0.9rem 1rem;
  overflow-y: auto;
  flex-shrink: 0;
}

#map {
  flex: 1;
  min-height: 0;
  height: 100%;
  width: 100%;
  position: relative;
  z-index: 0;
}

.map-panel {
  flex: 1;
  height: calc(100vh - var(--header-height));
  position: sticky;
  top: 0;
  min-width: 0;
}

.herd-map-row {
  display: flex;
  height: 60vh;
  min-height: 420px;
  max-height: 70vh;
}

.herd-body-panel {
  padding: 1.5rem;
  overflow-y: auto;
  height: 100%;
}



.leaflet-pane,
.leaflet-control {
  z-index: 1;
}

.leaflet-popup-content-wrapper {
  background: #e8e8e8;
  color: var(--text-main);
  border: 1.5px solid var(--accent);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(37, 99, 235, 0.15);
  border-radius: 0.8rem;
}

.leaflet-popup-tip {
  background: #e8e8e8;
  border: 1.5px solid var(--accent);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.leaflet-popup-content {
  margin: 0.65rem 0.8rem;
  line-height: 1.3;
}

.leaflet-container a.leaflet-popup-close-button {
  color: var(--text-muted);
  opacity: 0.9;
}

.leaflet-container a.leaflet-popup-close-button:hover {
  color: var(--accent-soft);
  opacity: 1;
}

.section-block {
  margin-bottom: 1.15rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
}

.section-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  font-weight: 600;
}

.badge {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 9999px;
  border: 1px solid var(--accent);
  color: #ffffff;
  background: var(--accent);
  font-weight: 500;
}

.small-button {
  padding: 0.35rem 0.7rem;
  border-radius: 0.5rem;
  border: 1px solid var(--accent);
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
  color: #e2e8f0;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.small-button:hover {
  background: linear-gradient(135deg, var(--accent-light) 0%, #60a5fa 100%);
  border-color: var(--accent-light);
}

.docs-soft-button {
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.docs-soft-button:hover {
  background: #d6e0ee;
  border-color: var(--accent-light);
  color: var(--accent);
}

.health-records-detail-item {
  padding: 0.7rem 0.9rem;
  border-radius: 0.6rem;
  border: 1px solid var(--accent-border);
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  box-shadow: 0 2px 4px rgba(44, 82, 130, 0.1);
  transition: all 0.2s ease;
}

.health-records-detail-item:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 8px rgba(44, 82, 130, 0.15);
  transform: translateY(-1px);
}

.health-records-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.health-records-detail-category {
  font-weight: 600;
  color: var(--accent);
}

.health-records-detail-notes {
  font-size: 0.85rem;
  color: var(--text-main);
  line-height: 1.4;
}

.health-records-detail-controls {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.8rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.health-records-detail-controls select {
  padding: 0.4rem 0.6rem;
  border-radius: 0.5rem;
  border: 2px solid var(--accent-border);
  background: #ffffff;
  color: var(--text-main);
  min-width: 220px;
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
}

.health-records-detail-controls select:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.health-records-detail-controls select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(44, 82, 130, 0.1);
}

.health-records-detail-table-wrap {
  border: 1px solid #d0d0d0;
  border-radius: 0.3rem;
  background: #ffffff;
  overflow: hidden;
}

.health-records-detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
}

.health-records-detail-table thead th {
  text-align: left;
  padding: 0.5rem 0.6rem;
  background: #f8f9fa;
  border-bottom: 1px solid #d0d0d0;
  color: var(--text-main);
  font-weight: 600;
  font-size: 0.75rem;
}

.health-records-detail-table tbody td {
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid #e8e8e8;
  vertical-align: top;
  color: var(--text-main);
  line-height: 1.4;
}

.health-records-detail-table tbody tr {
  transition: background-color 0.1s ease;
}

.health-records-detail-table tbody tr:nth-child(even) {
  background: #fafafa;
}

.health-records-detail-table tbody tr:hover {
  background: #f0f4f8;
}

.health-records-detail-empty {
  padding: 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.health-records-filter-section {
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: #f5f5f5;
  border-radius: 0.4rem;
  border: 1px solid #d0d0d0;
}

.health-records-filter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid #d0d0d0;
}

.health-records-filter-title {
  font-weight: 600;
  color: var(--text-main);
  font-size: 0.8rem;
}

.health-records-filter-actions {
  display: flex;
  gap: 0.4rem;
}

.health-records-filter-actions .small-button {
  padding: 0.35rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 0.3rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.health-records-filter-actions .small-button:hover {
  background: #d6e0ee;
  border-color: var(--accent);
}

.health-records-filter-checkboxes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.5rem;
}

.health-records-filter-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.5rem;
  background: #ffffff;
  border: 1px solid #d0d0d0;
  border-radius: 0.3rem;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.15s ease;
}

.health-records-filter-label:hover {
  background: #f0f4f8;
}

.health-records-filter-label input[type="checkbox"] {
  cursor: pointer;
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
}

.health-records-filter-label span {
  font-size: 0.8rem;
  color: var(--text-main);
  font-weight: 400;
}

.health-records-category-section {
  background: #ffffff;
  border: 1px solid #d0d0d0;
  border-radius: 0.4rem;
  padding: 0.75rem;
}

.docs-primary-button {
  border: 1px solid var(--accent);
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
  color: #e2e8f0;
}

.docs-secondary-button {
  border: 1px solid var(--accent-light);
  background: var(--accent-soft);
  color: var(--accent);
}

.docs-secondary-button:hover {
  background: #d6e0ee;
  border-color: var(--accent-light);
  color: var(--accent);
}

.small-button-geo-details {
  padding: 0.35rem 0.85rem;
  font-size: 0.82rem;
  border: 1px solid #34d399;
  background: #f4fbf7;
  color: #166534;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(52, 211, 153, 0.16);
}

.small-button-geo-details:hover {
  background: #e8f6ef;
  border-color: #22c55e;
  color: #14532d;
}

#start-draw-geofence-btn {
  border: 1px solid #34d399;
  background: linear-gradient(90deg, #f4fbf7 0%, #e8f6ef 100%);
  color: #166534;
  font-weight: 700;
  box-shadow: 0 3px 10px rgba(52, 211, 153, 0.18);
}

#start-draw-geofence-btn:hover {
  background: linear-gradient(90deg, #e8f6ef 0%, #d7f1e3 100%);
  border-color: #22c55e;
  color: #14532d;
}

.report-button {
  width: 100%;
  margin-top: 0.2rem;
  padding: 0.4rem 0.6rem;
}

/* REPORTS PAGE - GLASSMORPHISM PREMIUM DESIGN */

.reports-page {
  width: 100%;
  background: linear-gradient(to bottom, #e8e8e8 0%, #d9d9d9 100%);
  padding: 40px 24px;
  display: flex;
  justify-content: center;
}

.reports-container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
}

.reports-heading {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 2rem;
  letter-spacing: 0.02em;
}

.report-card {
  margin-top: 24px;
  padding: 24px 28px;
  border-radius: 0.6rem;
  background: var(--bg-secondary);
  border: 2px solid var(--accent);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
}

.report-card:hover {
  background: var(--surface-hover);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.report-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.report-card-title {
  font-size: 0.95rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin: 0;
}

.report-card-tools {
  display: flex;
  gap: 8px;
}

.report-card-tools button {
  background: transparent;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 6px;
  padding: 4px 8px;
  color: #38bdf8;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.report-card-tools button:hover {
  border-color: rgba(148, 163, 184, 0.6);
  background: rgba(56, 189, 248, 0.08);
}

.report-card-body {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.report-btn {
  flex: 1;
  min-width: 260px;
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  padding: 0.5rem 1rem;
  border-radius: var(--control-radius);
  border: none;
  background: var(--accent);
  color: #ffffff;
  font-size: 0.95rem;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(44, 82, 130, 0.4);
}

.report-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(44, 82, 130, 0.5);
  background: var(--accent-light);
}

.report-btn:active {
  transform: translateY(0);
}

.report-btn-icon {
  font-size: 1.1rem;
  opacity: 0.8;
}

.report-icon {
  width: 20px;
  height: 20px;
  stroke: #ffffff;
  opacity: 0.9;
  transition: 0.2s ease;
  flex-shrink: 0;
}

.report-btn:hover .report-icon {
  stroke: #ffffff;
  opacity: 1;
}

.report-status-row {
  display: flex;
  gap: 24px;
  font-size: 0.8rem;
}

.report-status-row .auth-status {
  flex: 1;
  margin-top: 0;
}

@media (max-width: 768px) {
  .reports-page {
    padding: 24px 16px;
  }

  .reports-heading {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
  }

  .report-card {
    padding: 18px 20px;
    margin-top: 18px;
  }

  .report-card-body {
    flex-direction: column;
    gap: 16px;
  }

  .report-btn {
    min-width: unset;
    width: 100%;
  }

  .report-status-row {
    flex-direction: column;
    gap: 8px;
  }

  .report-status-row .auth-status {
    width: 100%;
  }
}

.pill-success {
  border-color: #a7f3d0;
  background: #ecfdf3;
  color: #065f46;
}

.pill-danger {
  border-color: #fecaca;
  background: #fef2f2;
  color: #7f1d1d;
}

.list {
  font-size: 0.8rem;
}

.cow-card {
  border-radius: 0.7rem;
  padding: 0.6rem 0.8rem;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #e0e0e0 0%, #d9d9d9 100%);
  border: 2px solid #999999;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.cow-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.2);
}

/* Selected cow (when clicked from map) */
.cow-card.selected {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.25);
}

.cow-card.cow-type-cow:hover,
.cow-card.cow-type-cow.selected {
  border-color: #3b82f6;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(59, 130, 246, 0.08) 100%);
}

.cow-card.cow-type-heifer:hover,
.cow-card.cow-type-heifer.selected {
  border-color: #f97316;
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.15) 0%, rgba(249, 115, 22, 0.08) 100%);
}

.cow-card.cow-type-steer:hover,
.cow-card.cow-type-steer.selected {
  border-color: #eab308;
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.15) 0%, rgba(234, 179, 8, 0.08) 100%);
}

.cow-card.cow-type-bull:hover,
.cow-card.cow-type-bull.selected {
  border-color: #ef4444;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(239, 68, 68, 0.08) 100%);
}

.cow-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
  gap: 0.4rem;
}

.cow-id {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-main);
}

.cow-tag {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.cow-actions {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.rename-btn {
  border: none;
  background: rgba(37, 99, 235, 0.1);
  color: var(--accent);
  border-radius: 0.4rem;
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s ease;
}

.rename-btn:hover {
  background: rgba(37, 99, 235, 0.2);
  border: 1px solid var(--accent);
}

.delete-btn {
  border: none;
  background: rgba(220, 38, 38, 0.1);
  color: #dc2626;
  border-radius: 0.4rem;
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s ease;
}

.delete-btn:hover {
  background: rgba(220, 38, 38, 0.2);
  color: #991b1b;
}

/* Herd Details button - matches geofence details button */
.details-btn {
  border: 1px solid var(--accent);
  background: rgba(37, 99, 235, 0.1);
  color: var(--accent);
  border-radius: 0.4rem;
  padding: 0.25rem 0.8rem;
  font-size: 0.82rem;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s ease;
}

.details-btn:hover {
  background: rgba(37, 99, 235, 0.2);
  border-color: var(--accent);
}

.cow-meta {
  font-size: 0.77rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.battery-ok {
  color: #16a34a;
}

.battery-low {
  color: #f97316;
}

.battery-critical {
  color: #dc2626;
}

.alerts-list {
  margin-top: 0.4rem;
  border-top: 1px dashed var(--border-subtle);
  padding-top: 0.4rem;
  font-size: 0.78rem;
}

.alert-item {
  font-size: 0.78rem;
  background: rgba(220, 38, 38, 0.1);
  border: 1px solid rgba(220, 38, 38, 0.3);
  border-radius: 0.55rem;
  padding: 0.4rem 0.6rem;
  margin-bottom: 0.3rem;
  color: #991b1b;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.1);
  transition: all 0.2s ease;
}

.alert-item:hover {
  background: rgba(220, 38, 38, 0.15);
  border-color: #dc2626;
}

.alert-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.4rem;
}

.alert-dismiss-btn {
  border: none;
  background: transparent;
  color: #991b1b;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0 0.2rem;
  line-height: 1;
  transition: color 0.2s ease;
  font-weight: bold;
}

.alert-dismiss-btn:hover {
  color: #7f1d1d;
}

.geofences-list {
  margin-top: 0.45rem;
  border-top: 1px dashed var(--border-subtle);
  padding-top: 0.4rem;
  font-size: 0.8rem;
}

.geofence-item {
  margin-bottom: 0.3rem;
  padding: 0.3rem 0.5rem;
  border-radius: 0.5rem;
  background: rgba(22, 163, 74, 0.1);
  border: 1px solid rgba(22, 163, 74, 0.3);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.1);
  transition: all 0.2s ease;
}

.geofence-item:hover {
  background: rgba(22, 163, 74, 0.15);
  border-color: #16a34a;
}

.geofence-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.4rem;
}

.geofence-item-name {
  font-weight: 600;
  font-size: 0.8rem;
}

.geofence-item-meta {
  font-size: 0.73rem;
  color: var(--text-muted);
}

.geofence-remove-btn {
  border: none;
  background: transparent;
  color: #ccfbf1;
  font-size: 1rem;
  cursor: pointer;
  padding: 0 0.2rem;
  line-height: 1;
}

.geofence-remove-btn:hover {
  color: #fecaca;
}

.geofence-details {
  margin-top: 0.3rem;
  padding-top: 0.25rem;
  border-top: 1px dashed rgba(45, 212, 191, 0.6);
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
  display: none;
}

.filters-row {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.3rem;
}

.filters-row input {
  flex: 1;
  padding: 0.4rem 0.6rem;
  border-radius: 0.5rem;
  border: 1.5px solid var(--accent);
  background: #ffffff;
  color: #1a1a1a;
  font-size: 0.78rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.filters-row input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 8px rgba(37, 99, 235, 0.2);
}

.filters-row select {
  padding: 0.5rem 2rem 0.5rem 0.6rem;
  border-radius: 0.5rem;
  border: 1.5px solid var(--border-subtle);
  background: #ffffff url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232563eb' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e") no-repeat right 0.5rem center;
  background-size: 1.2em 1.2em;
  color: #1a1a1a;
  font-size: 0.78rem;
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

.filters-row select:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.1);
}

.filters-row select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.support-contact {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.support-contact a {
  color: #0284c7;
  text-decoration: none;
  font-weight: 600;
}

.support-contact a:hover {
  text-decoration: underline;
  color: #1e40af;
}

@media (max-width: 900px) {
  #sidebar.left-panel {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: auto;
    position: relative;
  }
  .herd-layout {
    flex-direction: column;
    height: auto;
  }
  .map-panel {
    position: relative;
    height: 50vh;
  }
}

.radio-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.radio-row label {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
  margin-bottom: 0;
}

.radio-row input[type="radio"] {
  accent-color: #38bdf8;
}

.fading-status {
  transition: opacity 0.6s ease;
}

/* Documentation modal */

.docs-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.2s ease-out;
  opacity: 0;
  backdrop-filter: blur(2px);
}

.docs-modal.visible {
  display: flex;
  opacity: 1;
}

.docs-modal-card {
  width: min(1000px, 95vw);
  height: min(650px, 90vh);
  background: #e8e8e8;
  border-radius: 1rem;
  border: 2px solid var(--accent);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(37, 99, 235, 0.1);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.25s ease-out;
}

.docs-modal-card.confirm-modal {
  width: min(440px, 92vw);
  max-width: 440px;
  height: auto;
  min-height: auto;
  max-height: 70vh;
  padding: 1.2rem;
}

.docs-modal-card.confirm-modal .docs-modal-body {
  padding: 0.3rem 0;
  line-height: 1.5;
}

.docs-modal-card.confirm-modal .docs-modal-footer {
  padding-top: 0.8rem;
  margin-top: 0.5rem;
}

.docs-modal-card.confirm-modal .docs-modal-header {
  margin-bottom: 0.8rem;
  padding-bottom: 0.6rem;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.docs-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 0.5rem;
}

.docs-modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
}

.docs-modal-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

.docs-close-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.1rem 0.35rem;
  border-radius: 9999px;
  transition: all 0.2s ease;
}

.docs-close-btn:hover {
  background: var(--bg-secondary);
  color: var(--text-main);
}

.docs-modal-body {
  flex: 1;
  overflow: auto;
  padding-right: 0.2rem;
  color: var(--text-main);
}

.docs-status {
  font-size: 0.78rem;
  margin-bottom: 0.5rem;
  min-height: 1.1em;
  color: var(--text-muted);
}

.docs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  margin-bottom: 0.6rem;
  margin-top: 0.2rem;
}

.docs-table th,
.docs-table td {
  border-bottom: 1px solid rgba(30, 64, 175, 0.5);
  padding: 0.35rem 0.4rem;
  vertical-align: top;
}

.docs-table th {
  text-align: left;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

.docs-field-label-cell {
  width: 28%;
  white-space: nowrap;
}

.docs-textarea {
  width: 100%;
  min-height: 40px;
  resize: vertical;
  padding: 0.35rem 0.45rem;
  border-radius: 0.55rem;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: var(--text-main);
  font-size: 0.8rem;
  outline: none;
  box-shadow: 0 0 0 1px #e5e7eb;
}

.docs-textarea:focus {
  border-color: var(--accent-border);
  box-shadow:
    0 0 0 1px rgba(14, 165, 233, 0.9),
    0 0 0 4px rgba(56, 189, 248, 0.15);
}

/* Masked date input for birthday - MM/DD/YYYY format with auto-slash insertion */
.docs-masked-date-input {
  width: 100%;
  max-width: 150px;
  padding: 0.4rem 0.5rem;
  border-radius: 0.55rem;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: var(--text-main);
  font-size: 0.8rem;
  font-family: "Monaco", "Courier New", monospace;
  font-weight: 500;
  letter-spacing: 0.05em;
  outline: none;
  box-shadow: 0 0 0 1px #e5e7eb;
  cursor: text;
  transition: all 0.2s ease;
  text-align: center;
}

.docs-masked-date-input::placeholder {
  color: rgba(148, 163, 184, 0.6);
  font-weight: 400;
  letter-spacing: 0.02em;
}

.docs-masked-date-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* Category search input for filtering dropdown */
.docs-category-search-merged {
  flex: 1;
  padding: 0.4rem 0.5rem;
  border: none;
  background: #ffffff;
  color: var(--text-main);
  font-size: 0.8rem;
  font-family: inherit;
  outline: none;
  cursor: text;
  transition: all 0.2s ease;
}

.docs-category-search-merged::placeholder {
  color: rgba(148, 163, 184, 0.6);
}

.docs-category-search-merged:focus {
  background: rgba(37, 99, 235, 0.05);
}

.docs-category-select-merged {
  border: none;
  border-left: 1px solid rgba(148, 163, 184, 0.6);
  background: #ffffff;
  padding: 0.4rem 0.5rem;
  color: var(--text-main);
  font-size: 0.8rem;
  font-family: inherit;
  outline: none;
  cursor: pointer;
  min-width: 150px;
  transition: all 0.2s ease;
}

.docs-category-select-merged:focus {
  background: rgba(37, 99, 235, 0.05);
}

.docs-category-select-merged option {
  background: #ffffff;
  color: var(--text-main);
  padding: 0.4rem;
}

.docs-category-input-wrapper {
  display: flex;
  flex: 1;
  align-items: center;
  border: 1px solid #d1d5db;
  border-radius: 0.55rem;
  background: #ffffff;
  overflow: hidden;
  box-shadow: none;
  transition: all 0.2s ease;
}

.docs-category-input-wrapper:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.docs-category-unified-bar {
  display: flex;
  gap: 0.4rem;
  align-items: stretch;
  margin-bottom: 0.4rem;
}

/* Birthday Input Styling */
.docs-birthday-input-wrapper {
  display: inline-flex;
  align-items: center;
  border: 1px solid #d1d5db;
  border-radius: 0.55rem;
  background: #ffffff;
  padding: 0.4rem 0.5rem;
  gap: 0.6rem;
  box-shadow: none;
  transition: all 0.2s ease;
}

.docs-birthday-input-wrapper:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.docs-masked-date-input {
  flex: 1;
  border: none;
  background: #ffffff;
  color: var(--text-main);
  font-size: 0.8rem;
  font-family: inherit;
  outline: none;
  padding: 0;
  transition: all 0.2s ease;
}

.docs-masked-date-input::placeholder {
  color: rgba(148, 163, 184, 0.6);
}

.docs-birthday-calendar-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: rgba(37, 99, 235, 0.08);
  border-radius: 4px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.docs-birthday-calendar-icon:hover {
  background: rgba(37, 99, 235, 0.16);
}

.docs-category-search::placeholder {
  color: rgba(148, 163, 184, 0.6);
}

.docs-category-search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* Category dropdown select - standalone (legacy) */
.docs-category-select {
  width: 100%;
  padding: 0.4rem 1.8rem 0.4rem 0.5rem;
  border-radius: 0.55rem;
  border: 1px solid #d1d5db;
  background: #ffffff url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232563eb' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e") no-repeat right 0.4rem center;
  background-size: 1em 1em;
  color: var(--text-main);
  font-size: 0.8rem;
  font-family: inherit;
  outline: none;
  box-shadow: none;
  cursor: pointer;
  transition: all 0.2s ease;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

.docs-category-select:hover {
  border-color: #cbd5e1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.docs-category-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.docs-category-select option {
  background: #ffffff;
  color: var(--text-main);
  padding: 0.4rem;
}

.docs-remove-btn {
  border: none;
  background: rgba(248, 113, 113, 0.18);
  color: #fecaca;
  border-radius: 9999px;
  padding: 0.12rem 0.55rem;
  font-size: 0.7rem;
  cursor: pointer;
  white-space: nowrap;
}

.docs-remove-btn:hover {
  background: rgba(248, 113, 113, 0.28);
}

.docs-add-list {
  margin-bottom: 0;
}

.docs-add-list button {
  margin: 0.15rem 0.15rem 0 0;
}

.docs-add-list select {
  width: 100%;
  margin: 0;
}

.docs-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  padding-top: 1rem;
  border-top: 2px solid var(--border-subtle);
  margin-top: 0.8rem;
}

/* Left side of modal footer (Rename/Delete in details module) */
.docs-modal-footer-left {
  display: flex;
  gap: 0.6rem;
  margin-right: auto;
  align-items: center;
}

.small-button-danger {
  padding: 0.35rem 0.7rem;
  border-radius: 0.5rem;
  border: 1px solid #fecaca;
  background: #fee2e2;
  color: #dc2626;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.small-button-danger:hover {
  background: #fca5a5;
  border-color: #dc2626;
  color: #7f1d1d;
}

/* FIXED: Flattened .docs-family / notes styles */

.docs-family {
  margin-top: 0.8rem;
  padding-top: 0.8rem;
  border-top: 2px dashed var(--border-subtle);
  font-size: 0.8rem;
}

.docs-family-header {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.docs-family-list-item {
  padding: 0.3rem 0.4rem;
  border-radius: 0.5rem;
  border: 1px solid #dbeafe;
  background: #f0f9ff;
  margin-bottom: 0.3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.3rem;
  color: var(--text-main);
  transition: all 0.2s ease;
}

.docs-family-list-item:hover {
  background: #dbeafe;
  border-color: var(--accent);
}

.docs-family-text {
  font-size: 0.78rem;
}

.docs-family-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.docs-family-remove-btn {
  border: none;
  background: transparent;
  color: #ef4444;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  padding: 0 0.2rem;
  font-weight: bold;
}

.docs-family-remove-btn:hover {
  color: #dc2626;
}

.docs-family-add {
  margin-top: 0.35rem;
  display: flex;
  gap: 0.3rem;
  align-items: center;
  flex-wrap: wrap;
}

.docs-family-add select {
  padding: 0.28rem 0.45rem;
  border-radius: 9999px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: var(--text-main);
  font-size: 0.78rem;
}

.docs-family-note {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.docs-bday-select {
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: var(--text-main);
  font-size: 0.78rem;
}

.docs-notes-section {
  margin-top: 0.8rem;
  padding-top: 0.6rem;
  border-top: 1px dashed rgba(30, 64, 175, 0.6);
  font-size: 0.8rem;
  width: 100%;
}

.docs-notes-section .docs-textarea {
  width: 100%;
  min-height: 96px;
  resize: vertical;
}

/* ------------------------------------------------------------------
 * EXPORT MODAL CUSTOM STYLES
 * ------------------------------------------------------------------ */

.export-fields-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.4rem 0.7rem;
  font-size: 0.82rem;
  margin-top: 0.3rem;
}

/* ===== FOOTER ===== */
footer {
  background: linear-gradient(180deg, #0f172a 0%, #020617 100%);
  color: #d1d5db;
  margin-top: auto;
  padding: 4rem 0 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

footer .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.footer-content {
  display: grid;
  grid-template-columns: 1.75fr 1fr 1fr 1fr;
  gap: 4rem;
  margin-bottom: 3rem;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 1.5rem;
}

.footer-brand {
  max-width: 320px;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  margin-bottom: 1.25rem;
}

.footer-logo-img {
  height: 42px;
  width: auto;
  opacity: 0.95;
}

.footer-brand-name {
  font-size: 1.35rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.footer-tagline {
  font-size: 0.9rem;
  color: #94a3b8;
  line-height: 1.7;
  margin: 0;
  font-weight: 400;
}

.footer-section h4 {
  color: #f1f5f9;
  margin-bottom: 1.25rem;
  font-size: 0.8125rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.footer-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-section ul li {
  margin-bottom: 0.75rem;
}

.footer-section ul li:last-child {
  margin-bottom: 0;
}

.footer-section a {
  color: #94a3b8;
  transition: all 180ms ease-out;
  font-size: 0.9rem;
  line-height: 1.7;
  font-weight: 400;
  display: inline-block;
  text-decoration: none;
}

.footer-section a:hover {
  color: #f1f5f9;
  text-decoration: none;
  transform: translateX(2px);
}

.footer-bottom {
  border-top: 1px solid rgba(148, 163, 184, 0.1);
  padding-top: 2rem;
  margin-top: 0.5rem;
  text-align: center;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.footer-bottom p {
  font-size: 0.8125rem;
  color: #64748b;
  margin: 0;
  font-weight: 400;
  letter-spacing: 0.01em;
}

@media (max-width: 767px) {
  #auth-panel {
    overflow-y: visible;
  }

  footer {
    padding: 3rem 0 1.75rem;
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: 2.5rem;
    padding: 0 1.5rem;
  }
  
  .footer-brand {
    max-width: 100%;
  }
  
  .footer-section {
    text-align: left;
  }
}

.export-field-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.4rem;
  border-radius: 0.5rem;
  background: #fafaf9;
  border: 1px solid rgba(51, 65, 85, 0.9);
}

.export-field-item input[type="checkbox"] {
  accent-color: #38bdf8;
}

/* Recent Shots Export Modal - Higher z-index to appear above other modals */
#recent-shots-export-modal {
  z-index: 10000;
}

.export-field-item span {
  color: var(--text-main);
  font-size: 0.8rem;
}

/* Form Field Styles for Shot Records */
.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

.form-field input,
.form-field select,
.form-field textarea {
  padding: 0.6rem 0.7rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border-subtle);
  background: #ffffff;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-field select {
  cursor: pointer;
  padding-right: 2rem;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232563eb' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  background-size: 1.2em 1.2em;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

/* Date input calendar icon styling */
input[type="date"]::-webkit-calendar-picker-indicator {
  filter: brightness(0.8) sepia(1) hue-rotate(190deg) saturate(2);
  cursor: pointer;
  accent-color: var(--accent);
}

input[type="date"] {
  color-scheme: light;
  accent-color: var(--accent);
}

.shot-row-delete-btn {
  background: none;
  border: none;
  color: #dc2626;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, transform 0.15s;
  line-height: 1;
}

.shot-row-delete-btn:hover {
  color: #991b1b;
  transform: scale(1.15);
}

/* Give Shots Workflow Styling */

.give-shots-single-animal-item,
.give-shots-group-item,
.manage-group-item {
  transition: background-color 0.2s ease;
}

.give-shots-checkbox-item,
.manage-group-members-item {
  display: flex;
  align-items: center;
  padding: 0.6rem 0.7rem;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background-color 0.2s ease;
  background: #fafafa;
}

.give-shots-checkbox-item:hover,
.manage-group-members-item:hover {
  background-color: var(--accent-soft);
}

.give-shots-animal-checkbox,
.manage-group-members-checkbox {
  margin-right: 0.6rem;
  cursor: pointer;
  accent-color: var(--accent);
}

.give-shots-modal-btn {
  border: 1px solid var(--accent-soft);
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 0.5rem;
  padding: 0.3rem 0.8rem;
  font-size: 0.82rem;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s ease;
}

.give-shots-modal-btn:hover {
  background: rgba(37, 99, 235, 0.15);
  border-color: var(--accent);
  transition: all 0.15s ease;
}

.give-shots-modal-btn:hover {
  background-color: rgba(37, 99, 235, 0.2);
  border-color: var(--accent-border);
  box-shadow: 0 0 8px rgba(37, 99, 235, 0.3);
}

.give-shots-modal-btn:active {
  transform: scale(0.98);
}

/* Performance optimizations */
#map {
  will-change: transform;
}

.cow-card,
.report-item {
  will-change: auto;
}

.docs-modal-card {
  will-change: transform;
}

.give-shots-modal-btn.accent {
  background: var(--accent);
  color: #0b1120;
  border-color: var(--accent);
}

.give-shots-modal-btn.accent:hover {
  background-color: #22d3ee;
  border-color: #22d3ee;
}

.give-shots-danger-btn {
  background-color: rgba(249, 115, 115, 0.2);
  border: 1px solid rgba(249, 115, 115, 0.5);
  color: var(--danger);
}

.give-shots-danger-btn:hover {
  background-color: rgba(249, 115, 115, 0.3);
  border-color: var(--danger);
  box-shadow: 0 0 8px rgba(249, 115, 115, 0.3);
}

/* Group color select dropdown - professional styling */
.group-color-select {
  width: 100%;
  padding: 0.6rem 2rem 0.6rem 0.75rem;
  border-radius: 0.5rem;
  border: 1.5px solid #d1d5db;
  background: #ffffff url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232563eb' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e") no-repeat right 0.5rem center;
  background-size: 1.2em 1.2em;
  color: var(--text-main);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  cursor: pointer;
  box-shadow: 0 0 0 1px #e5e7eb;
  transition: all 0.2s ease;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

.group-color-select:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.1);
}

.group-color-select:focus {
  border-color: var(--accent-border);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.group-color-select option {
  background: #ffffff;
  color: var(--text-main);
  padding: 0.6rem 0.6rem 0.6rem 1.2rem;
  font-size: 0.9rem;
  border-left: 12px solid transparent;
}

/* Colored left borders for visual indication */
.group-color-select option[value="default"] {
  border-left-color: #3b82f6;
}

.group-color-select option[value="green"] {
  border-left-color: #22c55e;
}

.group-color-select option[value="purple"] {
  border-left-color: #a855f7;
}

.group-color-select option[value="orange"] {
  border-left-color: #f97316;
}

.group-color-select option[value="pink"] {
  border-left-color: #ec4899;
}

.group-color-select option[value="cyan"] {
  border-left-color: #06b6d4;
}

.group-color-select option[value="red"] {
  border-left-color: #ef4444;
}

.group-color-select option[value="yellow"] {
  border-left-color: #eab308;
}

/* Color option selection for group cards - legacy styles kept for compatibility */
.color-option {
  transition: all 0.2s ease;
}

.color-option:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* Modal styling consistency */
.docs-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  justify-content: center;
  align-items: center;
  z-index: 100;
  padding: 1rem;
  overflow-y: auto;
}

.docs-modal-card {
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 0.7rem;
  box-shadow:
    0 25px 50px rgba(0, 0, 0, 0.1),
    0 0 1px #e5e7eb inset;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}

.docs-modal-header {
  padding: 1rem;
  border-bottom: 1px solid rgba(51, 65, 85, 0.6);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.docs-modal-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

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

.docs-modal-body {
  padding: 0.4rem 1rem 1rem; /* smaller top padding */
  flex: 1;
  overflow-y: auto;
}

.docs-modal-footer {
  padding: 0.8rem 1rem;
  border-top: 1px solid rgba(51, 65, 85, 0.6);
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

#give-shots-multiple-modal .docs-modal-body {
  gap: 0.2rem;
  padding: 0.4rem;
}

#give-shots-individual-mode,
#give-shots-group-mode {
  gap: 0.2rem !important;
}

#give-shots-confirm-delete-all-modal .docs-modal-body {
  margin-bottom: 0 !important;
  padding-bottom: 0.3rem !important;
}

#give-shots-confirm-delete-all-modal .docs-modal-footer {
  padding-top: 0 !important;
  border-top: none !important;
  margin-top: 0 !important;
}
/* FIX: tighten space between title block and Attribute row */
.docs-header,
.docs-header * {
  margin-bottom: 0.25rem !important;
  padding-bottom: 0 !important;
}

.docs-divider,
.docs-header hr {
  margin: 0.25rem 0 !important;
  padding: 0 !important;
}

.docs-content .docs-row:first-child {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

header .nav-links {
  display: none;
  gap: 0.4rem;
  flex: 1;
  justify-content: flex-end;
}

.nav-link {
  border: 1px solid var(--border-subtle);
  padding: var(--control-pad-y) var(--control-pad-x);
  border-radius: var(--control-radius);
  font-size: 0.9rem;
  cursor: pointer;
  background: var(--surface-base);
  color: var(--text-main);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
  font-weight: 500;
  box-shadow: none;
}

.nav-link:hover:not(.nav-link--active) {
  background: var(--surface-hover);
  color: var(--text-main);
}

.nav-link--active {
  background: var(--surface-active);
  color: var(--accent);
  font-weight: 600;
  border: 1px solid var(--accent-border);
}

.nav-link--logout {
  margin-left: 0.5rem;
  border: 1.5px solid #dc2626;
  color: #dc2626;
  font-weight: 600;
  background: transparent;
}

.nav-link--logout:hover {
  background: rgba(220, 38, 38, 0.1);
  border-color: #991b1b;
  color: #991b1b;
}

.profile-dropdown {
  position: relative;
  margin-left: 0.5rem;
}

.profile-button {
  border: 1px solid var(--border-subtle);
  width: var(--avatar-size);
  height: var(--avatar-size);
  padding: 0;
  border-radius: var(--avatar-radius);
  background: var(--avatar-bg);
  color: var(--avatar-text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, border-color 0.15s ease;
  overflow: hidden;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: none;
}

.profile-button span {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  line-height: 1.1;
}

.profile-button:hover {
  background: var(--avatar-bg-alt);
}

.profile-button:focus-visible,
.nav-link:focus-visible,
.profile-menu-item:focus-visible {
  outline: 2px solid var(--accent-border);
  outline-offset: 2px;
}

.profile-menu {
  position: absolute;
  top: calc(100% + 0.2rem);
  right: 0;
  background: var(--surface-base);
  border: 1px solid var(--border-subtle);
  min-width: 140px;
  box-shadow: none;
  display: none;
  z-index: 1000;
  border-radius: var(--control-radius);
  overflow: hidden;
}

.profile-menu--open {
  display: block;
}

.profile-menu-item {
  display: block;
  width: 100%;
  padding: 0.5rem 1rem;
  border: none;
  background: transparent;
  color: var(--text-main);
  text-align: left;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 0;
  border-bottom: 1px solid #cfcfcf;
}

.profile-menu-item:hover {
  background: var(--surface-hover);
}

.profile-menu-item:not(:last-child) {
  border-bottom: 1px solid #cfcfcf;
}

.profile-menu hr {
  border: 0;
  border-top: 1px solid #cfcfcf;
  margin: 0;
}

.view {
  display: none;
  width: 100%;
  min-height: 0;
}
.view--active {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 0;
}

/* =====================================================
   HEALTH RECORDS PAGE STYLING
   ===================================================== */

.health-records-page {
  padding: 24px 32px;
  width: 100%;
  max-width: none;
}

/* Add a bit of breathing room before the footer on Health Records */
.health-records-page {
  padding-bottom: 3rem;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.page-title {
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--text-main);
}

.page-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.page-header-actions {
  display: flex;
  gap: 12px;
}

.btn-primary {
  background: linear-gradient(135deg, #0284c7 0%, #0ea5e9 100%);
  border-radius: 0.5rem;
  border: none;
  color: #ffffff;
  font-weight: 600;
  padding: 0.65rem 1.2rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.9rem;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
}

.btn-outline {
  background: #fafaf9;
  border-radius: 0.5rem;
  border: 1.5px solid var(--border-subtle);
  color: var(--text-main);
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s ease;
  font-weight: 500;
}

.btn-outline:hover {
  border-color: #0284c7;
  background: #f5f5f4;
}

.health-filters {
  margin-bottom: 16px;
}

.filter-chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 1rem;
  padding: 1rem 1.25rem;
  background: var(--bg-secondary);
  border-radius: 0.6rem;
  border: 1px solid var(--border-subtle);
  align-items: flex-start;
}

.filter-chip-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: fit-content;
}

.filter-group-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
  padding-left: 0.5rem;
}

.filter-group-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-chip {
  border-radius: 0.4rem;
  border: 1px solid var(--border-subtle);
  padding: 0.45rem 0.9rem;
  font-size: 0.8rem;
  cursor: pointer;
  background: #ffffff;
  color: var(--text-main);
  transition: all 0.15s ease;
  font-weight: 500;
  white-space: nowrap;
}

.filter-chip-all {
  align-self: flex-end;
  margin-bottom: 0;
}

.filter-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.filter-chip:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.filter-chip.active {
  border-color: var(--accent);
  color: #ffffff;
  background: var(--accent);
  box-shadow: 0 1px 3px rgba(44, 82, 130, 0.25);
}

@media (max-width: 768px) {
  .filter-chips-container {
    gap: 1rem;
  }
  
  .filter-chip-group {
    width: 100%;
  }
}

.health-secondary-filters {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.search-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  border: 1.5px solid #dbeafe;
  padding: 0.5rem 0.9rem;
  background: #fafaf9;
  transition: all 0.15s ease;
}

.search-wrapper:focus-within {
  border-color: #0284c7;
  box-shadow: 0 0 12px rgba(2, 132, 199, 0.2);
  background: #f5f5f4;
}

.search-wrapper input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-size: 0.9rem;
}

.search-wrapper input::placeholder {
  color: var(--text-muted);
}

.search-icon {
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
  color: #0284c7;
  flex-shrink: 0;
  transition: color 0.15s ease;
}

.search-wrapper:focus-within .search-icon {
  color: #0284c7;
}

.animal-select-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.animal-select-wrapper select {
  background: #ffffff url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232c5282' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e") no-repeat right 0.5rem center;
  background-size: 1.2em 1.2em;
  border-radius: 0.5rem;
  border: 1px solid #d1d5db;
  color: var(--text-main);
  padding: 0.5rem 2rem 0.5rem 0.6rem;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s ease;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

.animal-select-wrapper select:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.1);
}

.animal-select-wrapper select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.animal-select-wrapper select:focus {
  border-color: #0284c7;
  outline: none;
}

.health-records-card {
  margin-top: 16px;
  border-radius: 0.8rem;
  background: #fafaf9;
  border: 1.5px solid var(--border-subtle);
  padding: 12px 16px;
  overflow-x: auto;
}

.health-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.health-table th,
.health-table td {
  padding: 10px 8px;
  text-align: left;
  white-space: nowrap;
}

.health-table thead th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
  font-weight: 600;
}

.health-table tbody tr {
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  transition: background-color 0.15s ease;
}

.health-table tbody tr:nth-child(even) {
  background: #f5f5f4;
}

.health-table tbody tr:hover {
  background: #ebe9e8;
}

/* Editable cells in health records table */
.health-table .editable-cell {
  background: transparent;
  border: 1px solid transparent;
  padding: 0.35rem 0.5rem;
  font-size: 0.85rem;
  font-family: inherit;
  color: var(--text-main);
  width: 100%;
  transition: all 0.2s ease;
  border-radius: 0.25rem;
}

.health-table .editable-cell:hover {
  border-color: rgba(148, 163, 184, 0.3);
  background: #fff;
}

.health-table .editable-cell:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 2px rgba(44, 82, 130, 0.1);
}

/* Health Record Delete Button */
.health-record-delete-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  color: #dc2626;
  font-size: 1.4rem;
  font-weight: bold;
  line-height: 1;
  transition: all 0.2s ease;
  border-radius: 0.25rem;
}

.health-record-delete-btn:hover {
  color: #991b1b;
  background: rgba(220, 38, 38, 0.1);
  transform: scale(1.15);
}

.health-record-delete-btn:active {
  transform: scale(1.05);
}

.empty-state {
  text-align: center;
  padding: 32px 12px;
  color: var(--text-muted);
}

.empty-state p {
  margin-bottom: 1rem;
  font-size: 1rem;
}

@media (max-width: 900px) {
  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .health-secondary-filters {
    flex-direction: column;
    align-items: stretch;
  }
  
  .animal-select-wrapper {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .health-records-page {
    padding: 16px 20px;
  }
}

/* ------------------------------------------------------------------
 * GROUPS PAGE STYLES - List Layout
 * ------------------------------------------------------------------ */

/* Add breathable space below the Groups content before the footer */
#view-groups {
  margin-bottom: 12rem;
}

/* Prefer spacing on the list wrapper, not individual cards */
#groups-list-container {
  padding-bottom: 12rem;
}

.group-list-item {
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 0.6rem;
  padding: 0.9rem 1.1rem;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Add subtle space below the last group item to feel natural before footer */

.group-list-item:hover {
  border-color: var(--accent-border);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.group-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.group-list-info {
  flex: 1;
  min-width: 0;
}

.group-list-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
  margin: 0 0 0.3rem 0;
  word-break: break-word;
}

.group-list-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.15rem;
}

.group-list-meta:last-child {
  margin-bottom: 0;
}

.group-list-actions {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
}

.group-list-actions button {
  padding: 0.4rem 0.8rem;
  font-size: 0.75rem;
  border-radius: 0.4rem;
  border: 1px solid #dbeafe;
  background: #f0f9ff;
  color: #0284c7;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  font-weight: 500;
}

.group-list-actions button:hover {
  background: #dbeafe;
  border-color: #0284c7;
}

.group-list-actions button.danger {
  border-color: var(--danger);
  background: rgba(248, 113, 113, 0.2);
  color: var(--danger);
  font-weight: 600;
}

.group-list-actions button.danger:hover {
  background: rgba(248, 113, 113, 0.3);
  border-color: var(--danger);
  box-shadow: 0 0 8px rgba(248, 113, 113, 0.4);
}

@media (max-width: 768px) {
  .group-list-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .group-list-actions {
    width: 100%;
  }
  
  .group-list-actions button {
    flex: 1;
  }
}

/* Health Records Modal - Recipient Mode Tabs */
.recipient-mode-tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid rgba(51, 65, 85, 0.5);
  padding-bottom: 0.5rem;
}

.recipient-mode-tab {
  flex: 1;
  padding: 0.6rem 1rem;
  background: #f0f0f0;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.recipient-mode-tab:hover {
  background: #e5e7eb;
  border-color: #b3b3b3;
}

.recipient-mode-tab.active {
  background: linear-gradient(to right, #dbeafe 0%, #e0f2fe 100%);
  border-color: var(--accent-border);
  color: #0284c7;
  box-shadow: 0 0 10px rgba(2, 132, 199, 0.15);
  font-weight: 600;
}

/* Multi-select animal search */
.search-results-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 200px;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  margin-top: 4px;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.search-result-item {
  padding: 0.6rem 0.8rem;
  cursor: pointer;
  border-bottom: 1px solid rgba(51, 65, 85, 0.3);
  transition: background 0.15s ease;
}

.search-result-item:hover {
  background: rgba(56, 189, 248, 0.1);
}

.search-result-item:last-child {
  border-bottom: none;
}

/* Selected animals chips */
.selected-animals-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
  min-height: 40px;
}

.animal-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.7rem;
  background: #f0f9ff;
  border: 1.5px solid #dbeafe;
  border-radius: 6px;
  font-size: 0.85rem;
  color: #0284c7;
  font-weight: 500;
}

.animal-chip-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  margin: 0;
  font-size: 1.2rem;
  line-height: 1;
  transition: color 0.15s ease;
}

.animal-chip-remove:hover {
  color: var(--danger);
}

.selected-count {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.selected-count span {
  font-weight: 600;
  color: var(--accent);
}

/* Form sections */
.form-section {
  padding: 1rem;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.form-section h3 {
  margin: 0 0 0.75rem 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
}

.form-field {
  margin-bottom: 0.8rem;
}

.form-field:last-child {
  margin-bottom: 0;
}

.form-field label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.form-field input[type="text"],
.form-field input[type="date"],
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 0.6rem 0.8rem;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  color: var(--text-main);
  font-size: 0.875rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--accent-border);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.15);
}

.recipient-mode-content {
  position: relative;
}

/* ========================================
   ASK ANI WIDGET
   ======================================== */

.ask-ani-widget {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 2px solid #dbeafe;
  border-radius: 12px;
  padding: 1.2rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 100%;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.1);
}

.ask-ani-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.ask-ani-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.5px;
}

.ask-ani-action-btn {
  background: #f0f9ff;
  border: 1px solid #dbeafe;
  color: var(--accent);
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.ask-ani-action-btn:hover {
  background: #dbeafe;
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.15);
}

.ask-ani-action-btn svg {
  width: 18px;
  height: 18px;
}

.ani-chat-messages {
  background: #f9fafb;
  border-radius: 8px;
  padding: 0.75rem;
  max-height: 300px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 120px;
  border: 1px solid var(--border-subtle);
}

.ani-message {
  display: flex;
  gap: 0.5rem;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ani-message--user {
  justify-content: flex-end;
}

.ani-message--bot {
  justify-content: flex-start;
}

.ani-message-bubble {
  background: #f0f9ff;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  max-width: 85%;
  word-wrap: break-word;
  font-size: 0.875rem;
  line-height: 1.4;
  color: var(--text-main);
}

.ani-message--user .ani-message-bubble {
  background: linear-gradient(135deg, var(--accent) 0%, #0ea5e9 100%);
  border-color: var(--accent);
  color: #ffffff;
}

.ani-status {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.ani-typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: typing 1.4s infinite;
}

.ani-typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.ani-typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {
  0%, 60%, 100% {
    opacity: 0.4;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-8px);
  }
}

.ani-input-area {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.ani-mic-btn {
  background: #f0f9ff;
  border: 1px solid #dbeafe;
  color: var(--accent);
  width: 40px;
  height: 40px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.ani-mic-btn:hover {
  background: #dbeafe;
  border-color: var(--accent);
}

.ani-mic-btn:active {
  transform: scale(0.95);
}

.ani-mic-btn.recording {
  background: #fee2e2;
  border-color: #fecaca;
  color: #dc2626;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
  }
}

.ani-mic-btn svg {
  width: 20px;
  height: 20px;
}

.ani-text-input {
  flex: 1;
  background: #ffffff;
  border: 1px solid #dbeafe;
  border-radius: 6px;
  padding: 0.6rem 0.8rem;
  color: var(--text-main);
  font-size: 0.875rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ani-text-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.1);
}

.ani-text-input::placeholder {
  color: var(--text-muted);
}

.ani-send-btn {
  background: linear-gradient(135deg, var(--accent) 0%, #0ea5e9 100%);
  border: 1px solid var(--accent);
  color: #ffffff;
  width: 40px;
  height: 40px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.ani-send-btn:hover {
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
  transform: translateY(-1px);
}

.ani-send-btn:active {
  transform: scale(0.95);
}

.ani-send-btn svg {
  width: 20px;
  height: 20px;
}

.ani-transcript {
  background: #dbeafe;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  padding: 0.7rem;
  font-size: 0.8rem;
  color: var(--accent);
  text-align: center;
  font-weight: 500;
}

/* ============================================================================
 * PROFESSIONAL DASHBOARD STYLES
 * ============================================================================ */

.dashboard-container {
  flex: 1;
  padding: 2rem;
  width: 100%;
}

.dashboard-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--border-subtle);
}

.dashboard-header-content h1 {
  margin: 0;
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.dashboard-subtitle {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 2rem;
}

.dashboard-column {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.dashboard-column--secondary {
  min-width: 300px;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.stat-card {
  background: linear-gradient(135deg, #d9d9d9 0%, #c9c9c9 100%);
  border: 2px solid var(--accent);
  border-radius: 0.8rem;
  padding: 1.25rem;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
}

.stat-card:hover {
  border-color: var(--accent);
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.2);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
}

.stat-value.stat-alert {
  color: #dc2626;
}

/* Alerts List Compact */
.alerts-compact {
  max-height: 200px;
  overflow-y: auto;
}

.alerts-compact .alert-item {
  padding: 0.75rem;
  font-size: 0.9rem;
}

/* Quick Links */
.quick-links {
  background: #d9d9d9;
  border: 2px solid var(--accent);
  border-radius: 0.8rem;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.quick-links-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: 0.5px;
}

.quick-link-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.85rem 1rem;
  margin-bottom: 0.5rem;
  background: rgba(37, 99, 235, 0.1);
  border: 1.5px solid var(--accent);
  border-radius: 0.6rem;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: left;
}

.quick-link-btn:hover {
  background: rgba(37, 99, 235, 0.2);
  border-color: var(--accent);
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.quick-link-btn svg {
  width: 24px;
  height: 24px;
  color: var(--accent);
  flex-shrink: 0;
}

.quick-link-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: #1e293b;
  margin: 0;
}

.quick-link-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0.15rem 0 0;
}

/* Quick Actions Edit Button */
.quick-actions-edit-btn {
  background: rgba(37, 99, 235, 0.1);
  border: 1.5px solid var(--accent);
  color: var(--accent);
  cursor: pointer;
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  border-radius: 0.4rem;
  transition: all 0.2s ease;
  text-transform: uppercase;
}

.quick-actions-edit-btn:hover {
  background: rgba(37, 99, 235, 0.2);
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.quick-actions-edit-btn:active {
  transform: scale(0.96);
}

/* Quick Links Container */
.quick-links-items {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Quick Action Item with Delete Button */
.quick-action-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border: 1.5px solid #dbeafe;
  border-radius: 0.6rem;
  transition: all 0.3s ease;
  position: relative;
}

.quick-action-item:hover {
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.15);
}

.quick-action-item.edit-mode {
  padding-right: 2.5rem;
}

.quick-action-item-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  cursor: pointer;
  color: var(--text-main);
}

.quick-action-item-content:hover {
  opacity: 0.8;
}

.quick-action-item-content svg {
  width: 24px;
  height: 24px;
  color: var(--accent);
  flex-shrink: 0;
}

.quick-action-item-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.quick-action-item-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-main);
  margin: 0;
}

.quick-action-item-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0;
}

/* Delete Button in Edit Mode */
.quick-action-delete-btn {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: #fee2e2;
  border: 1px solid #fecaca;
  color: #dc2626;
  border-radius: 0.4rem;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: bold;
  opacity: 0;
}

.quick-action-item.edit-mode .quick-action-delete-btn {
  opacity: 1;
}

.quick-action-delete-btn:hover {
  background: #fca5a5;
  border-color: #dc2626;
  color: #991b1b;
}

.quick-action-delete-btn:active {
  transform: translateY(-50%) scale(0.95);
}

/* Status List */
.status-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.status-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: var(--text-main);
  padding: 0.5rem;
  border-radius: 0.4rem;
  background: rgba(56, 189, 248, 0.05);
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-ok {
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.4);
}

.status-text {
  flex: 1;
}

/* Responsive Dashboard */
@media (max-width: 1200px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .dashboard-container {
    padding: 1.5rem;
  }

  .dashboard-header-content h1 {
    font-size: 1.5rem;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }
}

/* Quick Actions Add Select Dropdown */
.quick-actions-add-select {
  width: 100%;
  padding: 0.65rem 0.75rem;
  background: linear-gradient(to bottom, var(--bg) 0%, var(--bg-secondary) 100%);
  border: 1px solid var(--border-subtle);
  border-radius: 0.5rem;
  color: var(--text-main);
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%232c5282' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.quick-actions-add-select:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

.quick-actions-add-select:focus {
  outline: none;
  background: var(--bg);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(44, 82, 130, 0.15), 0 2px 5px rgba(0, 0, 0, 0.15);
}

.quick-actions-add-select option {
  background: var(--bg-secondary);
  color: var(--text-main);
  padding: 0.5rem;
}

.quick-actions-add-select option:checked {
  background: var(--accent);
  color: #ffffff;
}

/* =====================================================
   SETTINGS PAGE STYLING
   ===================================================== */

.settings-container {
  display: flex;
  flex-direction: column;
}

.settings-header {
  padding: 3rem 2.5rem 2rem;
  border-bottom: 2px solid var(--accent);
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.settings-header h1 {
  margin: 0 0 0.75rem;
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.5px;
}

.settings-header p {
  margin: 0;
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

/* Settings Tabs Navigation */
.settings-tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 2px solid #e5e7eb;
  background: #ffffff;
  overflow-x: auto;
  padding: 0 2.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.settings-tab-btn {
  padding: 1.25rem 2rem;
  border: none;
  background: transparent;
  color: #6b7280;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 3px solid transparent;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  position: relative;
}

.settings-tab-btn:hover {
  color: var(--accent);
  background: linear-gradient(to bottom, rgba(44, 82, 130, 0.03), rgba(44, 82, 130, 0.08));
  transform: translateY(-1px);
}

.settings-tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: linear-gradient(to bottom, rgba(44, 82, 130, 0.05), rgba(44, 82, 130, 0.1));
  font-weight: 700;
}

.settings-tab-icon {
  width: 20px;
  height: 20px;
  transition: transform 0.25s ease;
}

.settings-tab-btn:hover .settings-tab-icon {
  transform: scale(1.1);
}

.settings-tab-btn.active .settings-tab-icon {
  transform: scale(1.15);
}

/* Settings Content */
.settings-content {
  flex: 1;
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  background: linear-gradient(to bottom, #f9fafb 0%, #f3f4f6 100%);
}

.settings-tab-content {
  display: none;
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.settings-tab-content.active {
  display: block;
}

.settings-section {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  padding: 2.25rem;
  margin-bottom: 2rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
}

.settings-section:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12), 0 2px 4px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
  border-color: var(--accent);
}

.profile-photo-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.profile-photo-preview {
  width: 96px;
  height: 96px;
  border-radius: var(--avatar-radius);
  border: 1px solid var(--border-subtle);
  background: var(--avatar-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.profile-photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.profile-photo-initials {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--avatar-text);
  font-size: 1.4rem;
  background: transparent;
  font-family: var(--avatar-font);
}

.profile-photo-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.avatar-settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  align-items: start;
}

.avatar-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--control-radius);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.avatar-card h3 {
  margin: 0;
  font-size: 1rem;
}

.avatar-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.avatar-preview-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

#profile-initials {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--avatar-size);
  height: var(--avatar-size);
  border-radius: var(--avatar-radius);
  font-family: var(--avatar-font);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--avatar-text);
  background: var(--avatar-bg);
}

/* Avatar Choice Panel */
.avatar-choice-panel {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  align-items: center;
  padding: 2.5rem 2rem;
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg) 100%);
  border: 1px solid var(--border-subtle);
  border-radius: 1rem;
  text-align: center;
}

.avatar-choice-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.3px;
}

.avatar-choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.5rem;
  width: 100%;
  max-width: 420px;
}

.avatar-choice-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 2rem 1.5rem;
  background: #ffffff;
  border: 2px solid #e5e5e5;
  border-radius: 0.8rem;
  cursor: pointer;
  transition: all 0.25s ease;
  font-family: inherit;
}

.avatar-choice-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.12);
  transform: translateY(-2px);
}

.avatar-choice-card.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

.avatar-choice-icon {
  font-size: 3rem;
  line-height: 1;
}

.avatar-choice-label {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-main);
  letter-spacing: -0.2px;
}

.avatar-choice-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Avatar Edit Panel */
.avatar-edit-panel {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.avatar-edit-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--border-subtle);
}

.avatar-edit-back-btn {
  width: 2.2rem;
  height: 2.2rem;
  padding: 0;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--control-radius);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-main);
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.avatar-edit-back-btn:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
  color: var(--accent);
}

.avatar-edit-back-btn svg {
  width: 1.1rem;
  height: 1.1rem;
}

.avatar-edit-header h3 {
  margin: 0;
  font-size: 1.2rem;
  color: var(--text-main);
  letter-spacing: -0.2px;
}

.avatar-edit-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

@media (max-width: 768px) {
  .avatar-edit-content {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

.avatar-edit-preview-section,
.avatar-edit-controls-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.section-label {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.8;
}

.avatar-edit-preview {
  width: 180px;
  height: 180px;
  border: 2px solid var(--border-subtle);
  border-radius: var(--avatar-radius);
  background: var(--avatar-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  margin: 0;
  touch-action: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.avatar-photo-drag-hint {
  position: absolute;
  bottom: 0.75rem;
  right: 0.75rem;
  font-size: 0.75rem;
  color: var(--avatar-text);
  opacity: 0.75;
  background: rgba(0, 0, 0, 0.4);
  padding: 0.4rem 0.7rem;
  border-radius: 0.3rem;
  font-weight: 500;
}

#avatar-photo-edit-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: grab;
  user-select: none;
}

#avatar-photo-edit-img:active {
  cursor: grabbing;
}

#avatar-initials-edit-text {
  font-size: 2rem !important;
  position: absolute;
}

.slider-group {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0.5rem 0;
}

.slider-group input[type="range"] {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: #d0d0d0;
  outline: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.slider-group input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
  border: 2px solid #ffffff;
}

.slider-group input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

#avatar-initials-size-value {
  display: inline-block;
  min-width: 3.5rem;
  text-align: right;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
}

.profile-photo-hint {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.profile-photo-buttons {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.25rem;
}

.profile-photo-hint {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.profile-photo-buttons .btn-outline.danger {
  border-color: #fecdd3;
  color: #b91c1c;
  background: #fff7f7;
}

.profile-photo-buttons .btn-outline.danger:hover {
  background: #fee2e2;
}

.profile-customization {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.form-group.compact {
  margin-bottom: 0;
}

.form-group.compact input,
.form-group.compact select {
  height: 40px;
  padding: 0.5rem 0.65rem;
}

.settings-section:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.settings-section-header {
  margin-bottom: 2rem;
  padding-bottom: 1.75rem;
  border-bottom: 2px solid #e5e7eb;
  position: relative;
}

.settings-section-header::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 60px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

.settings-section-header h2 {
  margin: 0 0 0.75rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.3px;
}

.settings-section-header p {
  margin: 0;
  color: #6b7280;
  font-size: 1rem;
  line-height: 1.6;
}

/* Forms */
.settings-form {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.form-group label {
  font-weight: 600;
  color: var(--text-main);
  font-size: 0.975rem;
  letter-spacing: -0.1px;
}

.form-group input,
.form-group select {
  padding: 0.85rem 1rem;
  border: 2px solid #e5e7eb;
  border-radius: 0.6rem;
  font-size: 0.975rem;
  color: var(--text-main);
  background: #ffffff;
  font-family: inherit;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(44, 82, 130, 0.1), 0 1px 3px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

.form-group input:read-only {
  background: #f9fafb;
  color: #9ca3af;
  cursor: not-allowed;
  border-color: #e5e7eb;
}

.form-group small {
  color: #6b7280;
  font-size: 0.875rem;
  line-height: 1.5;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

/* Checkbox Group */
.checkbox-group {
  gap: 0.75rem;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  cursor: pointer;
  padding: 1rem 1.25rem;
  border-radius: 0.6rem;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border: 2px solid transparent;
  background: #f9fafb;
}

.checkbox-label:hover {
  background: linear-gradient(to right, rgba(44, 82, 130, 0.05), rgba(44, 82, 130, 0.08));
  border-color: var(--accent);
  transform: translateX(4px);
}

.checkbox-label input[type="checkbox"] {
  margin-top: 0.25rem;
  cursor: pointer;
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.checkbox-label span {
  flex: 1;
  font-weight: 600;
  color: var(--text-main);
  font-size: 0.975rem;
}

.checkbox-label small {
  display: block;
  margin-top: 0.35rem;
  color: #6b7280;
  font-weight: 400;
  line-height: 1.5;
}

/* Buttons */
.btn-primary {
  padding: 0.85rem 2rem;
  background: linear-gradient(135deg, var(--accent) 0%, #1e3a8a 100%);
  color: #ffffff;
  border: none;
  border-radius: 0.6rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  align-self: flex-start;
  box-shadow: 0 2px 8px rgba(44, 82, 130, 0.25);
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #1e3a8a 0%, var(--accent) 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(44, 82, 130, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(44, 82, 130, 0.25);
}

.btn-outline {
  padding: 0.85rem 2rem;
  background: #ffffff;
  color: var(--accent);
  border: 2px solid var(--accent);
  border-radius: 0.6rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.btn-outline:hover {
  background: var(--accent);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(44, 82, 130, 0.3);
}

.btn-outline:active {
  transform: translateY(0);
}

.btn-danger {
  padding: 0.85rem 2rem;
  background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
  color: #ffffff;
  border: none;
  border-radius: 0.6rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.25);
}

.btn-danger:hover {
  background: linear-gradient(135deg, #991b1b 0%, #7f1d1d 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(220, 38, 38, 0.4);
}

/* Settings Buttons */
.settings-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.settings-buttons .btn-outline {
  flex: 1;
  justify-content: center;
  min-width: 150px;
}

/* Form Status */
.form-status {
  padding: 1rem;
  border-radius: 0.5rem;
  font-size: 0.9rem;
  display: none;
  animation: slideIn 0.3s ease;
}

.form-status.show {
  display: block;
}

.form-status.success {
  background: rgba(22, 163, 74, 0.1);
  color: #166534;
  border-left: 4px solid var(--success);
}

.form-status.error {
  background: rgba(220, 38, 38, 0.1);
  color: #991b1b;
  border-left: 4px solid var(--danger);
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Security Status */
.security-status {
  padding: 2rem;
  background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
  border-radius: 0.75rem;
  margin-bottom: 1.5rem;
  border: 2px solid #e5e7eb;
}

.status-badge {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 0.4rem;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.status-badge.inactive {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  color: #991b1b;
  border: 1px solid #fca5a5;
}

.status-badge.active {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  color: #166534;
  border: 1px solid #86efac;
}

.security-status p {
  margin: 0 0 1.25rem;
  color: #6b7280;
  line-height: 1.6;
}

/* Session Item */
.session-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
  border-radius: 0.75rem;
  margin-bottom: 1rem;
  border: 2px solid #e5e7eb;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.session-item:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.session-info {
  flex: 1;
}

.session-device {
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.35rem;
  font-size: 1rem;
}

.session-time {
  color: #6b7280;
  font-size: 0.875rem;
}

.session-badge-current {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  color: #166534;
  border-radius: 0.4rem;
  font-size: 0.8rem;
  font-weight: 700;
  border: 1px solid #86efac;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Danger Zone */
.danger-zone {
  border: 2px solid #fca5a5;
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.15);
}

.danger-zone .settings-section-header {
  border-bottom-color: #fca5a5;
}

.danger-zone .settings-section-header h2 {
  color: #dc2626;
}

.danger-zone .settings-section-header::after {
  background: #dc2626;
}

/* Responsive Design */
@media (max-width: 768px) {
  .settings-container {
    flex-direction: column;
  }

  .settings-header {
    padding: 1.5rem 1rem;
  }

  .settings-header h1 {
    font-size: 1.5rem;
  }

  .settings-tabs {
    padding: 0 1rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .settings-tab-btn {
    padding: 1rem;
    font-size: 0.85rem;
  }

  .settings-content {
    padding: 1rem;
  }

  .settings-section {
    padding: 1.25rem;
    margin-bottom: 1.25rem;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .settings-buttons {
    flex-direction: column;
  }

  .settings-buttons .btn-outline {
    width: 100%;
  }

  .btn-primary,
  .btn-outline,
  .btn-danger {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .settings-header h1 {
    font-size: 1.3rem;
  }

  .settings-section-header h2 {
    font-size: 1.1rem;
  }

  .settings-tabs {
    padding: 0 0.5rem;
  }

  .settings-tab-btn {
    padding: 0.8rem 0.75rem;
    font-size: 0.75rem;
    gap: 0.5rem;
  }

  .settings-tab-icon {
    width: 16px;
    height: 16px;
  }
}

