/* Design cleanup overrides */

/* Make topbar sticky and refine spacing */
.app-topbar {
  position: sticky;
  top: 0;
  z-index: 1020;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.topbar-menu {
  padding: 8px 16px;
}

/* Logo sizing for cleaner layout */
.app-topbar .logo img {
  height: 36px;
  width: auto;
}

.sidenav-menu .logo img {
  height: 48px;
  width: auto;
}

/* Center the logo container and handle large/small variants */
.sidenav-menu .logo {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 0;
}

.sidenav-menu .logo .logo-lg img {
  height: 48px;
  width: auto;
}

.sidenav-menu .logo .logo-sm img {
  height: 36px !important;
  width: auto;
}


/* Page container breathing room */
.page-container {
  padding: 16px;
}

/* Card consistency */
.card-header {
  padding: 12px 16px;
}

/* Table readability and responsiveness */
.table-container {
  width: 100%;
  overflow-x: auto;
  padding: 12px;
}

.table th,
.table td {
  vertical-align: middle;
}

/* Action buttons spacing */
.actions-column .btn {
  margin-right: 6px;
}

/* Icon buttons alignment */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Topbar search button sizing */
.topbar-search .btn {
  padding: 4px 8px;
}

/* Print page styles (moved from print_voter.php) */
body.print-page {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #fff;
}

/* Fallback: ensure content never sits under the sidebar */
html:not([data-layout="topnav"]) .page-content {
  margin-left: var(--bs-sidenav-width) !important;
}

/* Mobile: no left margin when viewport is small */
@media (max-width: 767.98px) {
  html:not([data-layout="topnav"]) .page-content {
    margin-left: 0 !important;
  }
}

body.print-page {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #fff;
  margin: 0;
  padding: 20px;
}
.print-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
  border: 1px solid #ddd;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
.header {
  text-align: center;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid #007bff;
}
.header h1 {
  color: #007bff;
  margin-bottom: 5px;
}
.voter-photo {
  text-align: center;
  margin-bottom: 20px;
}
.voter-photo img {
  max-width: 150px;
  max-height: 150px;
  border: 1px solid #ddd;
}
.section {
  margin-bottom: 15px;
  page-break-inside: avoid;
}
.section-title {
  background-color: #f8f9fa;
  padding: 5px 10px;
  font-weight: bold;
  border-left: 4px solid #007bff;
  margin-bottom: 10px;
}
.row {
  display: flex;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.col {
  flex: 1;
  min-width: 200px;
  padding: 0 5px;
}
.label {
  font-weight: bold;
  color: #666;
  margin-bottom: 3px;
}
.value {
  padding-left: 10px;
}
.badge {
  display: inline-block;
  padding: 3px 6px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: bold;
}
.footer {
  text-align: center;
}
.no-print.print-actions {
  text-align: right;
  margin-top: 10px;
}
.btn-print, .btn-close-win {
  padding: 5px 15px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}
.btn-print { background: #007bff; color: #fff; }
.btn-close-win { background: #6c757d; color: #fff; }

@media print {
  .sidenav-menu, .app-topbar, .no-print, .print-hidden {
    display: none !important;
  }
  html:not([data-layout="topnav"]) .page-content {
    margin-left: 0 !important;
    padding: 0 !important;
  }
  .page-container {
    padding: 0 !important;
  }
  .card {
    border: none !important;
    box-shadow: none !important;
  }
}
.photo-placeholder {
  width: 150px;
  height: 150px;
  background: #f8f9fa;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #ddd;
  border-radius: 4px;
}
.text-muted-placeholder { color: #6c757d; }
@media print {
  .no-print { display: none !important; }
}

/* View Voters styles (extracted from view-voters.php) */
.actions-column .btn {
  margin: 2px;
  padding: 5px 10px;
  font-size: 12px;
  min-width: 70px;
}
.actions-column .btn i { margin-right: 5px; }
.table th {
  white-space: nowrap;
  position: relative;
  cursor: pointer;
}
.table th:hover { background-color: #f8f9fa; }
.sort-indicator { margin-left: 5px; }
.filter-container {
  background: #f8f9fa;
  padding: 15px;
  margin-bottom: 20px;
  border-radius: 5px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.filter-container .form-control { margin-bottom: 10px; }
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.photo-thumbnail {
  width: 50px;
  height: 50px;
  object-fit: cover;
  cursor: pointer;
  border: 1px solid #ddd;
  border-radius: 4px;
}
.photo-thumbnail:hover { opacity: 0.8; }
@media (max-width: 768px) {
  .actions-column .btn { padding: 5px 8px; min-width: auto; }
  .actions-column .btn span { display: none; }
  .actions-column .btn i { margin-right: 0; }
}

/* Utility classes for images/icons and progress bars */
.voter-photo-lg {
  max-width: 200px;
  max-height: 200px;
  object-fit: cover;
}
.icon-xxl { font-size: 80px; }
.cursor-pointer { cursor: pointer; }
.progress-sm { height: 8px; }
.progress-md { height: 20px; }

/* Upload progress default */
#importProgress { width: 0%; }

/* Dashboard tiles */
.dashboard-tile.card {
  border: none;
  border-radius: 0; /* square corners */
}
.dashboard-tile .card-body {
  aspect-ratio: 1 / 1; /* make square */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.dashboard-tile .metric-label {
  opacity: 0.95;
  font-weight: 600;
}
.dashboard-tile .metric-value {
  font-size: 2.2rem;
  font-weight: 700;
}

.dashboard-hero { padding: 4px 0 12px; }
.hero-title { font-weight: 600; }
.hero-subtitle { font-size: 14px; }
.quick-actions .btn { display: inline-flex; align-items: center; gap: 6px; }
.metric-card { text-decoration: none; color: inherit; }
.metric-card .card { transition: transform .2s ease, box-shadow .2s ease; }
.metric-card .card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,.08); }
.metric-icon { width: 48px; height: 48px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-size: 22px; }
.metric-label { font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: #6c757d; }
.metric-value { font-size: 20px; font-weight: 600; }
.metric-warning { background: #fff3cd; color: #856404; }
.metric-info { background: #d1ecf1; color: #0c5460; }
.metric-success { background: #d4edda; color: #155724; }
.metric-danger { background: #f8d7da; color: #721c24; }
.metric-primary { background: #cfe2ff; color: #084298; }
.metric-secondary { background: #e2e3e5; color: #41464b; }
.metric-dark { background: #d3d3d4; color: #343a40; }

.gradient-warning { background: linear-gradient(135deg, #f8b425, #ffe082) !important; color: #fff; }
.gradient-info { background: linear-gradient(135deg, #17a2b8, #00c6ff) !important; color: #fff; }
.gradient-success { background: linear-gradient(135deg, #28a745, #6bd97a) !important; color: #fff; }
.gradient-danger { background: linear-gradient(135deg, #dc3545, #ff6b6b) !important; color: #fff; }
.gradient-primary { background: linear-gradient(135deg, #4a81d4, #00a2ff) !important; color: #fff; }
.gradient-secondary { background: linear-gradient(135deg, #6c757d, #a8b3bd) !important; color: #fff; }
.gradient-dark { background: linear-gradient(135deg, #343a40, #6c757d) !important; color: #fff; }
.gradient-indigo { background: linear-gradient(135deg, #6610f2, #8a2be2) !important; color: #fff; }
.gradient-teal { background: linear-gradient(135deg, #20c997, #2cd4b8) !important; color: #fff; }
.gradient-warning .metric-label,
.gradient-info .metric-label,
.gradient-success .metric-label,
.gradient-danger .metric-label,
.gradient-primary .metric-label,
.gradient-secondary .metric-label,
.gradient-dark .metric-label { color: rgba(255,255,255,0.85); }
.gradient-indigo .metric-label { color: rgba(255,255,255,0.85); }
.gradient-teal .metric-label { color: rgba(255,255,255,0.85); }
.gradient-warning .metric-value,
.gradient-info .metric-value,
.gradient-success .metric-value,
.gradient-danger .metric-value,
.gradient-primary .metric-value,
.gradient-secondary .metric-value,
.gradient-dark .metric-value { color: #fff; }
.gradient-indigo .metric-value { color: #fff; }
.gradient-teal .metric-value { color: #fff; }
.gradient-warning .metric-icon,
.gradient-info .metric-icon,
.gradient-success .metric-icon,
.gradient-danger .metric-icon,
.gradient-primary .metric-icon,
.gradient-secondary .metric-icon,
.gradient-dark .metric-icon { background: rgba(255,255,255,0.2); color: #fff; }
.gradient-indigo .metric-icon { background: rgba(255,255,255,0.2); color: #fff; }
.gradient-teal .metric-icon { background: rgba(255,255,255,0.2); color: #fff; }

.dashboard-hero { background: linear-gradient(90deg, #4a81d4 0%, #6f42c1 60%, #dc3545 100%); color: #fff; padding: 16px; border-radius: 12px; }
.dashboard-hero .hero-title { color: #fff; }
.dashboard-hero .hero-subtitle { color: rgba(255,255,255,0.85); }
.dashboard-hero .btn { border-color: rgba(255,255,255,0.35); color: #fff; }
.dashboard-link { text-decoration: none !important; display: block; }
