:root { 
  --orange: #f97316; 
  --error: #ef4444;
  --success: #10b981;
  --warning: #f59e0b;
  --info: #3b82f6;
}

body { 
  font-family: 'Prompt', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; 
  margin: 0; 
  background: #fafafa; 
  color: #222; 
  position: relative;
}

header { 
  display:flex; 
  gap:12px; 
  align-items:center; 
  justify-content:space-between; 
  padding:16px 20px; 
  background:#fff; 
  border-bottom:1px solid #eee; 
  flex-wrap: wrap;
}

.logo-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-img {
  width: 64px;
  height: 64px;
}

h1 { 
  margin:0; 
  font-size:20px; 
  color: var(--orange); 
  font-weight: 600;
}

main { 
  padding:16px; 
  max-width: 1400px;
  margin: 0 auto;
}

#loginGate {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px 16px;
}

body:not(.is-authenticated) main,
body:not(.is-authenticated) footer {
  display: none;
}

body.is-pending main,
body.is-pending footer,
body.is-pending .tabs {
  display: none;
}

body.is-authenticated #loginGate {
  display: none;
}

body:not(.is-authenticated) #loginGate {
  display: flex;
}

.hidden {
  display: none !important;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: #4b5563;
}

.user-info img.profile-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(249, 115, 22, 0.2);
  box-shadow: 0 4px 8px rgba(249, 115, 22, 0.2);
}

.user-info span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.login-card {
  background: #fff;
  border-radius: 20px;
  padding: 32px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: 0 24px 48px rgba(0,0,0,0.12);
}

.login-logo {
  width: 120px;
  margin-bottom: 16px;
}

.login-card h2 {
  margin: 0 0 12px 0;
  color: #1f2933;
}

.login-subtitle {
  margin: 0 0 16px 0;
  color: #4b5563;
  line-height: 1.5;
  text-align: center;
}

.login-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
  background: #f9fafb;
  border-radius: 12px;
  padding: 16px;
  text-align: left;
  color: #374151;
  font-size: 14px;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.05);
}

.login-step::before {
  content: "•";
  margin-right: 6px;
  color: #f97316;
}

.login-card input[type="text"],
.login-card input[type="number"],
.login-card input[type="datetime-local"] {
  width: 100%;
  padding: 12px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 14px;
}

.btn-line-login {
  width: 100%;
  background: #06c755;
  color: #fff;
  border: none;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-line-login:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(6, 199, 85, 0.25);
}

.login-hint {
  font-size: 12px;
  color: #6b7280;
  margin: 12px 0 0 0;
}

.dev-login {
  text-align: left;
  margin-top: 20px;
}

.dev-login summary {
  cursor: pointer;
  color: var(--orange);
  font-weight: 600;
}

.dev-login-form {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.dev-login-form input {
  flex: 1;
  min-width: 160px;
}

.dev-login-form button {
  background: #475569;
  color: #fff;
  border: none;
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
}

.tabs { 
  display:flex; 
  gap:10px; 
  margin-bottom:20px; 
  flex-wrap: wrap;
  overflow-x: auto;
  padding-bottom: 6px;
  -webkit-overflow-scrolling: touch;
}

.tabs button { 
  padding:10px 18px; 
  border:2px solid #e5e7eb; 
  background:#f9fafb; 
  border-radius:999px; 
  cursor:pointer; 
  font-size: 15px;
  font-weight: 600;
  color: #374151;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s, color 0.2s;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  white-space: nowrap;
}

.tabs button:hover {
  background: #fef3e7;
  border-color: var(--orange);
  color: var(--orange);
  transform: translateY(-1px);
}

.tabs button.active {
  background: var(--orange);
  color: #fff;
  border-color: var(--orange);
  box-shadow: 0 12px 24px rgba(249, 115, 22, 0.25);
}

.tab { 
  display:none; 
}

.tab.active { 
  display:block; 
}

.row { 
  display:grid; 
  gap:8px; 
  grid-template-columns: repeat(6, minmax(0, 1fr)); 
  margin-bottom:12px; 
  align-items:center; 
}

.row > label { 
  grid-column: span 1; 
  font-weight: 500;
  color: #555;
}

.row > input, 
.row > select, 
.row > textarea { 
  grid-column: span 2; 
  padding:10px; 
  border:1px solid #ddd; 
  border-radius:8px; 
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s;
}

.row > input:focus,
.row > select:focus,
.row > textarea:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

.row > input.error,
.row > select.error,
.row > textarea.error {
  border-color: var(--error);
  background: #fef2f2;
}

.row > textarea {
  resize: vertical;
  min-height: 60px;
}

.row.full-width {
  grid-template-columns: 1fr;
}

.row.full-width > label {
  grid-column: span 1;
}

.row.full-width .multi-options {
  grid-column: span 1;
}

.multi-options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
}

.multi-options label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
}

.multi-options input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

#mapLinkInput {
  background: #f3f4f6;
  cursor: not-allowed;
}

#map { 
  width: 100%; 
  height: 480px; 
  background:#eee; 
  border-radius:12px; 
  margin-bottom:12px; 
  border: 1px solid #ddd;
}

footer { 
  padding:12px 16px; 
  color:#666; 
  text-align: center;
  margin-top: 40px;
  font-size: 12px;
}

.app-version {
  font-weight: 600;
  color: var(--orange);
}

button { 
  background: var(--orange); 
  color:#fff; 
  border:none; 
  padding:10px 16px; 
  border-radius:8px; 
  cursor:pointer; 
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  font-family: inherit;
}

button:hover:not(:disabled) { 
  opacity: .9; 
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

input, select, textarea { 
  background:#fff; 
}

/* Notifications */
.toast-container {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 10000;
  pointer-events: none;
}

.toast {
  min-width: 200px;
  max-width: 90vw;
  padding: 10px 16px;
  border-radius: 999px;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  background: #4b5563;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast-success {
  background: var(--success);
}

.toast-error {
  background: var(--error);
}

.toast-info {
  background: var(--info);
}

/* Onboarding Tips */
#onboarding-tips {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 1;
  transition: opacity 0.3s;
}

#onboarding-tips.hide {
  opacity: 0;
  pointer-events: none;
}

.onboarding-content {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  max-width: 500px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  animation: slideUp 0.3s ease;
}

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

.onboarding-content h3 {
  margin: 0 0 16px 0;
  color: var(--orange);
  font-size: 20px;
}

.onboarding-content p {
  margin: 8px 0;
  color: #555;
  line-height: 1.6;
}

.pending-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 11000;
  padding: 20px;
  backdrop-filter: blur(6px);
}

.pending-card {
  background: #fff;
  border-radius: 20px;
  padding: 32px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.2);
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: slideUp 0.3s ease;
}

.pending-avatar-wrapper {
  display: flex;
  justify-content: center;
  margin-bottom: 8px;
}

.pending-avatar-wrapper.hidden {
  display: none;
}

.pending-avatar-wrapper img {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid rgba(249, 115, 22, 0.4);
  box-shadow: 0 18px 36px rgba(249, 115, 22, 0.35);
}

.pending-card h2 {
  margin: 0;
  font-size: 22px;
  color: var(--orange);
}

.pending-name {
  margin: 0;
  font-weight: 600;
  color: #1f2937;
}

.pending-note {
  font-size: 13px;
  color: #6b7280;
}

.btn-close-tips {
  margin-top: 16px;
  width: 100%;
}

/* Map Controls */
#tab-map .row {
  background: #fff;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 12px;
  border: 1px solid #eee;
}

#tab-map label {
  display: flex;
  align-items: center;
  gap: 6px;
}

#tab-map input[type="checkbox"] {
  width: auto;
  margin: 0;
}

/* Form sections */
section.tab {
  background: #fff;
  padding: 20px;
  border-radius: 12px;
  border: 1px solid #eee;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Mobile-first responsive design */
@media (max-width: 900px) {
  body {
    font-size: 16px; /* Prevent zoom on iOS */
  }
  
  header {
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 16px;
    gap: 8px;
  }
  
  .logo-img {
    width: 48px;
    height: 48px;
  }
  
  h1 {
    font-size: 18px;
  }
  
  .user-info {
    font-size: 11px;
    flex-wrap: wrap;
  }
  
  .user-info img.profile-avatar {
    width: 28px;
    height: 28px;
  }
  
  main {
    padding: 12px;
  }
  
  .tabs {
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 8px;
  }
  
  .tabs button {
    padding: 10px 14px;
    font-size: 14px;
    white-space: nowrap;
  }
  
  .row { 
    grid-template-columns: 1fr; 
    gap: 12px;
  }
  
  .row > label { 
    display: block; 
    margin-bottom: 6px;
    font-size: 14px;
  }
  
  .row > input, 
  .row > select, 
  .row > textarea { 
    grid-column: 1 / -1;
    padding: 12px;
    font-size: 16px; /* Prevent zoom on iOS */
  }
  
  .toast {
    width: calc(100% - 32px);
    max-width: none;
    margin: 0 auto;
  }
  
  #map {
    height: 400px;
  }
  
  button {
    padding: 12px 18px;
    font-size: 16px;
    min-height: 44px; /* iOS touch target */
  }
  
  .btn-line-login {
    min-height: 48px;
    font-size: 16px;
  }
  
  .login-card {
    padding: 24px 20px;
    margin: 16px;
  }
  
  .login-logo {
    width: 100px;
  }
  
  .login-card h2 {
    font-size: 20px;
  }
  
  .login-subtitle {
    font-size: 14px;
  }
  
  .dev-login summary {
    font-size: 15px;
    padding: 10px;
  }
  
  .dev-login-form {
    flex-direction: column;
  }
  
  .dev-login-form input {
    width: 100%;
    min-width: auto;
    padding: 12px;
    font-size: 16px;
  }
  
  .dev-login-form button {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    min-height: 44px;
  }
  
  section.tab {
    padding: 16px;
  }
  
  .visit-form {
    padding: 16px;
    gap: 16px;
  }
  
  .form-field input,
  .form-field select,
  .form-field textarea {
    padding: 12px;
    font-size: 16px; /* Prevent zoom on iOS */
  }
  
  .form-field label {
    font-size: 14px;
  }
  
  .btn-primary {
    width: 100%;
    padding: 14px 20px;
    font-size: 16px;
    min-height: 48px;
  }
  
  .btn-secondary {
    padding: 12px 16px;
    font-size: 15px;
    min-height: 44px;
  }
  
  .modal-content {
    margin: 10px;
    max-width: calc(100% - 20px);
    max-height: 90vh;
  }
  
  .modal-header,
  .modal-body,
  .modal-footer {
    padding: 16px;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .stat-card {
    padding: 16px;
  }
  
  .stat-icon {
    font-size: 28px;
  }
  
  .stat-value {
    font-size: 20px;
  }
  
  .visits-table {
    font-size: 12px;
  }
  
  .visits-table th,
  .visits-table td {
    padding: 8px 6px;
  }
  
  .admin-table {
    font-size: 12px;
  }
  
  .admin-table th,
  .admin-table td {
    padding: 8px 6px;
  }
  
  .admin-tabs {
    flex-wrap: wrap;
    gap: 6px;
  }
  
  .admin-tab-btn {
    padding: 10px 14px;
    font-size: 13px;
  }
  
  .overview-filters {
    grid-template-columns: 1fr;
  }
  
  .overview-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .overview-header-actions {
    width: 100%;
    flex-direction: column;
  }
  
  .overview-header-actions button {
    width: 100%;
  }
}

/* Loading states */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Dashboard */
.dashboard {
  padding: 20px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.stat-icon {
  font-size: 32px;
}

.stat-content {
  flex: 1;
}

.stat-label {
  font-size: 14px;
  color: #666;
  margin-bottom: 4px;
}

.stat-value {
  font-size: 24px;
  font-weight: bold;
  color: var(--orange);
}

.dashboard-charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.chart-card {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.chart-card h3 {
  margin: 0 0 16px 0;
  font-size: 16px;
  color: #333;
}

.chart-container {
  min-height: 200px;
}

.dashboard-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.btn-secondary {
  background: #6b7280;
  color: #fff;
}

.btn-secondary:hover {
  background: #4b5563;
}

.btn-danger {
  padding: 12px 16px;
  font-size: 15px;
  background: #dc2626;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

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

/* Visits List */
.visits-list {
  padding: 20px;
}

.list-filters {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.list-filters button {
  min-height: 44px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
}

.list-results {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  overflow-x: auto;
}

.loading-state,
.empty-state {
  text-align: center;
  padding: 40px;
  color: #666;
}

.visits-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.visits-table th {
  background: #f5f5f5;
  padding: 12px;
  text-align: left;
  font-weight: 600;
  color: #333;
  border-bottom: 2px solid #eee;
}

.visits-table td {
  padding: 12px;
  border-bottom: 1px solid #eee;
}

.visits-table tr:hover {
  background: #f9f9f9;
}

.team-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
}

.team-badge.team-A {
  background: #ef4444;
}

.team-badge.team-B {
  background: #3b82f6;
}

.team-badge.team-C {
  background: #10b981;
}

.team-badge.team-D {
  background: #f59e0b;
}

.btn-detail {
  background: var(--orange);
  color: #fff;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  transition: opacity 0.2s;
}

.btn-detail:hover {
  opacity: 0.9;
}

.btn-edit {
  background: #3b82f6;
  color: #fff;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  transition: opacity 0.2s;
}

.btn-edit:hover {
  opacity: 0.9;
}

.btn-delete {
  background: #ef4444;
  color: #fff;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  transition: opacity 0.2s;
}

.btn-delete:hover {
  opacity: 0.9;
}

.btn-approve {
  background: #0ea5e9;
  color: #fff;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  min-height: 32px;
  min-width: 80px;
  transition: opacity 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-approve:hover {
  opacity: 0.9;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.status-badge.pending {
  background: #fef3c7;
  color: #92400e;
}

.status-badge.active {
  background: #dcfce7;
  color: #065f46;
}

.status-badge.blocked {
  background: #fee2e2;
  color: #991b1b;
}

.btn-save {
  background: var(--orange);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: opacity 0.2s;
}

.btn-save:hover:not(:disabled) {
  opacity: 0.9;
}

.btn-save:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-geoloc-edit {
  background: #10b981;
  color: #fff;
  border: none;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  transition: opacity 0.2s;
}

.btn-geoloc-edit:hover {
  opacity: 0.9;
}

.list-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 20px;
  padding: 16px;
}

.btn-pagination {
  background: #f9fafb;
  border: 2px solid #d1d5db;
  color: #374151;
  padding: 10px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  min-height: 44px;
  transition: all 0.2s;
}

.btn-pagination:hover:not(:disabled) {
  background: var(--orange);
  color: #fff;
  border-color: var(--orange);
}

.btn-pagination:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#pageInfo {
  font-size: 14px;
  color: #666;
}

@media (max-width: 900px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-charts {
    grid-template-columns: 1fr;
  }

  .visits-table {
    font-size: 12px;
  }

  .visits-table th,
  .visits-table td {
    padding: 8px;
  }
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
  animation: fadeIn 0.2s;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-content {
  background: #fff;
  border-radius: 12px;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  animation: slideUp 0.3s;
}

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

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #eee;
}

.modal-header h3 {
  margin: 0;
  color: var(--orange);
  font-size: 20px;
}

.modal-close {
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: #666;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 0.2s;
}

.modal-close:hover {
  background: #f0f0f0;
}

.modal-body {
  padding: 20px;
}

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

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-item.full-width {
  grid-column: 1 / -1;
}

.detail-item strong {
  color: #666;
  font-size: 14px;
}

.detail-item span,
.detail-item div {
  color: #333;
  font-size: 16px;
}

.modal-footer {
  padding: 20px;
  border-top: 1px solid #eee;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

@media (max-width: 600px) {
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .modal-content {
    margin: 10px;
    max-width: calc(100% - 20px);
  }
}

/* Admin Panel */
.admin-panel {
  padding: 20px;
}

.admin-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 2px solid #eee;
}

.admin-tab-btn {
  padding: 12px 20px;
  border: none;
  background: transparent;
  color: #666;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
}

.admin-tab-btn:hover {
  color: var(--orange);
}

.admin-tab-btn.active {
  color: var(--orange);
  border-bottom-color: var(--orange);
}

.admin-content {
  display: none;
}

.admin-content.active {
  display: block;
}

.admin-content h3 {
  margin: 0 0 16px 0;
  color: #333;
  font-size: 20px;
}

.admin-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  align-items: center;
}

.admin-actions button {
  min-height: 32px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.admin-table td:last-child {
  white-space: nowrap;
}

.admin-table td:last-child button {
  margin: 0 2px;
}

.admin-card {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.05);
}

#inviteTools {
  display: none;
}

.admin-card h4 {
  margin: 0 0 12px 0;
  color: #1f2933;
  font-size: 16px;
}

.system-retention-form {
  display: grid;
  gap: 12px;
  max-width: 420px;
  margin-bottom: 12px;
}

.system-retention-input {
  display: flex;
  gap: 8px;
  align-items: center;
}

.system-retention-input input {
  width: 120px;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-family: inherit;
}

.system-retention-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.status-text {
  font-size: 14px;
  margin-top: 8px;
  color: #374151;
}

.status-text.success {
  color: #15803d;
}

.status-text.info {
  color: #374151;
}

.status-text.error {
  color: #b91c1c;
}

.invite-form {
  display: grid;
  gap: 12px;
}

.invite-row {
  display: grid;
  gap: 6px;
}

.invite-row input {
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-family: inherit;
}

.invite-result {
  margin-top: 16px;
  display: grid;
  gap: 8px;
}

.invite-link-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.invite-link-row input {
  flex: 1;
  min-width: 200px;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f8fafc;
  font-family: inherit;
}

.btn-add {
  background: #10b981;
  color: #fff;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  min-height: 44px;
  transition: opacity 0.2s;
}

.btn-add:hover {
  opacity: 0.9;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.admin-table th {
  background: #f5f5f5;
  padding: 12px;
  text-align: left;
  font-weight: 600;
  color: #333;
  border-bottom: 2px solid #eee;
}

.admin-table td {
  padding: 12px;
  border-bottom: 1px solid #eee;
}

.admin-table tr:hover {
  background: #f9f9f9;
}

.btn-edit-small {
  background: #3b82f6;
  color: #fff;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  min-height: 32px;
  min-width: 32px;
  transition: opacity 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-edit-small:hover {
  opacity: 0.9;
}

.btn-delete-small {
  background: #ef4444;
  color: #fff;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  min-height: 32px;
  min-width: 32px;
  transition: opacity 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-delete-small:hover {
  opacity: 0.9;
}

.log-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

.log-badge.success {
  background: #d1fae5;
  color: #065f46;
}

.log-badge.error {
  background: #fee2e2;
  color: #991b1b;
}

.users-list,
.logs-list {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  overflow-x: auto;
}

.export-options,
.notify-options {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.notify-info {
  margin-top: 20px;
  padding: 16px;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 8px;
}

.notify-info p {
  margin: 0 0 8px 0;
  font-weight: 500;
  color: #0369a1;
}

.notify-info ul {
  margin: 0;
  padding-left: 20px;
  color: #0c4a6e;
}

.notify-info li {
  margin: 4px 0;
}

@media (max-width: 900px) {
  .admin-tabs {
    flex-wrap: wrap;
  }

  .admin-table {
    font-size: 12px;
  }

  .admin-table th,
  .admin-table td {
    padding: 8px;
  }
}

/* Photo Upload */
.photo-preview-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid #eee;
}

.photo-status {
  position: absolute;
  top: 4px;
  left: 4px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  z-index: 1;
}

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

.photo-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(239, 68, 68, 0.9);
  color: #fff;
  border: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.photo-remove:hover {
  background: rgba(239, 68, 68, 1);
}

.photo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.photo-gallery-item {
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid #eee;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.photo-gallery-item:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.photo-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* User Profile */
.profile-panel {
  padding: 20px;
}

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

.profile-header h2 {
  margin: 0;
  color: var(--orange);
  font-size: 24px;
}

.profile-header-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.profile-avatar-lg-wrapper {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid rgba(249, 115, 22, 0.3);
  box-shadow: 0 6px 16px rgba(249, 115, 22, 0.2);
}

.profile-avatar-lg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-avatar-lg.hidden {
  display: none;
}

.profile-avatar-lg-wrapper.hidden {
  display: none;
}

.profile-content {
  display: grid;
  gap: 24px;
}

.profile-info {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  overflow: hidden;
}

.info-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f0;
}

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

.info-item strong {
  color: #666;
  font-weight: 500;
  flex: 0 0 auto;
}

.info-item span {
  flex: 1 1 180px;
  min-width: 0;
  text-align: right;
  color: #111827;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.profile-stats {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  overflow: hidden;
}

.profile-stats h3 {
  margin: 0 0 16px 0;
  color: #333;
  font-size: 18px;
}

.profile-stats .stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.stat-card-small {
  background: #f9f9f9;
  border-radius: 8px;
  padding: 16px;
  text-align: center;
  overflow: hidden;
}

.stat-card-small .stat-label {
  font-size: 12px;
  color: #666;
  margin-bottom: 8px;
}

.stat-card-small .stat-value {
  font-size: 24px;
  font-weight: bold;
  color: var(--orange);
  word-break: break-word;
}

.profile-settings {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.profile-settings h3 {
  margin: 0 0 16px 0;
  color: #333;
  font-size: 18px;
}

.settings-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.setting-item {
  display: flex;
  align-items: center;
  padding: 12px;
  background: #f9f9f9;
  border-radius: 8px;
}

.setting-item label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  flex: 1;
}

.setting-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.member-qr {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 70vh;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.08);
}

.member-qr img {
  max-width: 600px;
  width: 90%;
  height: auto;
}

.catalog-container {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 16px;
  min-height: 70vh;
}

.catalog-sidebar {
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: calc(100vh - 200px);
  overflow-y: auto;
}

.catalog-sidebar h3 {
  margin: 0;
  font-size: 18px;
  color: #1f2937;
}

.catalog-search {
  position: relative;
}

.catalog-search input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
}

.catalog-search input:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

.catalog-categories {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.category-btn {
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  text-align: left;
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s;
}

.category-btn:hover {
  background: #f9fafb;
  border-color: var(--orange);
}

.category-btn.active {
  background: var(--orange);
  color: #fff;
  border-color: var(--orange);
}

.catalog-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  overflow-y: auto;
}

.catalog-item {
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  transition: all 0.2s;
}

.catalog-item:hover {
  background: #f9fafb;
  border-color: var(--orange);
  transform: translateX(4px);
}

.catalog-item.active {
  background: #fff7ed;
  border-color: var(--orange);
  border-width: 2px;
}

.catalog-item-title {
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 4px;
  font-size: 14px;
}

.catalog-item-category {
  font-size: 12px;
  color: #6b7280;
}

.catalog-viewer {
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  min-height: 70vh;
}

.catalog-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 600px;
}

.placeholder-content {
  text-align: center;
  color: #6b7280;
}

.placeholder-content h3 {
  margin: 0 0 8px 0;
  font-size: 20px;
}

.placeholder-content p {
  margin: 0;
  font-size: 14px;
}

.catalog-pdf-viewer {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 600px;
}

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

.viewer-header h3 {
  margin: 0;
  font-size: 18px;
  color: #1f2937;
}

.viewer-actions {
  display: flex;
  gap: 8px;
}

.viewer-content {
  flex: 1;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  background: #f9fafb;
  display: flex;
  flex-direction: column;
}

.pdf-viewer-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: auto;
  background: #525252;
}

.pdf-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  flex-wrap: wrap;
}

.btn-toolbar {
  padding: 6px 12px;
  border: 2px solid #e5e7eb;
  border-radius: 6px;
  background: #f9fafb;
  color: #374151;
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s;
}

.btn-toolbar:hover:not(:disabled) {
  background: #f9fafb;
  border-color: var(--orange);
}

.btn-toolbar:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.page-info {
  font-size: 14px;
  color: #4b5563;
  margin: 0 8px;
}

.pdf-search-input {
  flex: 1;
  min-width: 200px;
  padding: 6px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
}

.pdf-search-input:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

.pdf-canvas {
  margin: 0 auto;
  display: block;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  background: #fff;
}

@media (max-width: 900px) {
  .catalog-container {
    grid-template-columns: 1fr;
  }
  
  .catalog-sidebar {
    max-height: 300px;
  }
}

.catalog-hint {
  font-size: 14px;
  color: #4b5563;
}

.catalog-hint a {
  color: var(--orange);
  text-decoration: none;
}

.catalog-hint a:hover {
  text-decoration: underline;
}

.map-controls {
  align-items: center;
}

.map-controls button {
  min-height: 44px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
}

#btnTrackLocation {
  background: #2563eb;
  color: #fff;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

#btnTrackLocation.active {
  background: #1e3a8a;
}

#btnTrackLocation:hover {
  background: #1d4ed8;
}

.visit-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: #fff;
  padding: 24px;
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.06);
}

.form-grid {
  display: grid;
  gap: 16px;
}

.form-grid.triplet {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.form-grid.double {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-field.has-place-suggestions {
  position: relative;
}

.place-suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 30;
  max-height: 240px;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.15);
}

.place-suggestions.hidden {
  display: none;
}

.place-suggestion {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  padding: 10px 14px;
  background: transparent;
  border: none;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease;
}

.place-suggestion:last-child {
  border-bottom: none;
}

.place-suggestion:hover,
.place-suggestion:focus-visible {
  background: #f8fafc;
  outline: none;
}

.place-suggestion-main {
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
}

.place-suggestion-secondary {
  font-size: 12px;
  color: #475569;
  margin-top: 2px;
}

.form-field label {
  font-weight: 600;
  color: #1f2937;
}

.form-field input,
.form-field select,
.form-field textarea {
  padding: 12px 14px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15);
}

.form-field.full-width {
  grid-column: 1 / -1;
}

.form-field textarea {
  min-height: 90px;
  resize: vertical;
}

.hint {
  font-size: 12px;
  color: #6b7280;
}

.chip-input {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  border: 1px dashed #d1d5db;
  border-radius: 12px;
  min-height: 48px;
  background: #f9fafb;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(249, 115, 22, 0.08);
  color: #d97706;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
}

.chip button {
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 14px;
  padding: 0;
  line-height: 1;
}

#repInput {
  flex: 1 1 140px;
  min-width: 120px;
  border: none;
  background: transparent;
  outline: none;
  font-size: 14px;
  font-family: inherit;
}

.geo-card {
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 20px;
  background: linear-gradient(135deg, rgba(249,115,22,0.04), rgba(249,115,22,0.08));
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow: hidden;
}

.geo-top {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.geo-top label {
  font-weight: 600;
  color: #1f2937;
}

.geo-input {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  width: calc(100% - 12px);
  margin: 0 auto;
}

.geo-input input {
  flex: 1 1 220px;
  min-width: 0;
  max-width: 100%;
  padding: 12px 14px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.geo-input .btn-secondary {
  white-space: nowrap;
  padding: 12px 16px;
}

.geo-auto-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  width: calc(100% - 12px);
  margin: 0 auto;
}

.geo-card .auto-field {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #fff;
  border: 1px solid rgba(209, 213, 219, 0.8);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.08);
}

.geo-card .auto-field label {
  display: block;
  font-weight: 600;
  color: #1f2937;
  margin: 0;
}

.geo-card .auto-field input {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 0;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  background: transparent;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.geo-card .auto-field input:focus {
  outline: none;
}

.photo-upload {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.photo-upload-hint {
  font-size: 12px;
  color: #4b5563;
  display: block;
  margin-top: 8px;
  line-height: 1.4;
}

.photo-upload-status {
  font-size: 13px;
  color: #4b5563;
  min-height: 18px;
}

.photo-upload-status.active {
  color: var(--info);
  font-weight: 500;
}

.photo-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
}

.btn-primary {
  align-self: flex-end;
  background: var(--orange);
  color: #fff;
  border: none;
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 16px;
  cursor: pointer;
  font-weight: 600;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(249, 115, 22, 0.25);
}

.map-info {
  min-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: #1f2937;
}

.map-info strong {
  font-size: 16px;
  margin-bottom: 4px;
}

.chip-input:focus-within {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15);
  background: #fff7ed;
}

.overview-card {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.overview-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.overview-header h3 {
  margin: 0;
  font-size: 18px;
}

.overview-subtitle {
  margin: 4px 0 0 0;
  color: #6b7280;
  font-size: 13px;
}

.overview-header-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.overview-header-actions button {
  min-height: 44px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
}

.btn-secondary.outline {
  background: #fff;
  color: var(--orange);
  border: 1px dashed var(--orange);
}

.btn-secondary.outline:hover {
  background: #fff7ed;
  color: var(--orange);
}

.overview-filters {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  align-items: end;
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-field label {
  font-weight: 600;
  color: #1f2937;
}

.filter-field input,
.filter-field select {
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.filter-field input:focus,
.filter-field select:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

.overview-table-wrapper {
  width: 100%;
  overflow-x: auto;
}

.overview-summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #4b5563;
  margin-bottom: 8px;
}

.overview-summary strong {
  font-size: 18px;
  color: var(--orange);
}

.overview-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
}

.overview-table th,
.overview-table td {
  padding: 12px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 14px;
}

.overview-table th {
  background: #f8fafc;
  text-align: left;
  color: #1f2937;
  font-weight: 600;
}

.overview-table tbody tr:hover {
  background: #fff7ed;
}

.align-right {
  text-align: right;
}

/* Extra small devices */
@media (max-width: 480px) {
  .tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  
  .tabs::-webkit-scrollbar {
    display: none;
  }

  main {
    padding: 8px;
  }

  section.tab {
    padding: 12px;
  }

  .visit-form {
    padding: 12px;
  }

  .form-grid.triplet,
  .form-grid.double,
  .overview-filters {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .login-card {
    padding: 20px 16px;
    margin: 12px;
  }
  
  .pending-card {
    padding: 24px 20px;
    margin: 16px;
  }
  
  .chip {
    font-size: 12px;
    padding: 5px 10px;
  }
  
  .photo-preview-grid {
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 8px;
  }
  
  .geo-auto-grid {
    grid-template-columns: 1fr;
    width: 100%;
    margin: 0;
  }
  
  .geo-input {
    width: 100%;
    margin: 0;
  }
  
  .list-filters .row {
    grid-template-columns: 1fr;
  }
  
  .list-filters button {
    width: 100%;
  }
  
  .map-controls .row {
    grid-template-columns: 1fr;
  }
  
  .map-controls button {
    width: 100%;
  }
}
