/* Base & Typography */
:root {
  --primary-color: #4f46e5;
  --primary-hover: #4338ca;
  --success-color: #22c55e;
  --danger-color: #ef4444;
  --warning-color: #f59e0b;
  --text-primary: #111827;
  --text-secondary: #4b5563;
  --bg-light: #f9fafb;
  --card-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --card-shadow-hover: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

body {
  background-color: var(--bg-light);
  color: var(--text-primary);
  line-height: 1.5;
}

.container {
  max-width: 1200px;
  padding: 2rem 1rem;
}

/* Cards - Dashboard */
.card {
  background: white;
  border-radius: 1rem;
  box-shadow: var(--card-shadow);
  transition: all 0.2s ease-in-out;
  border: none;
  margin-bottom: 1rem;
}

.company-card {
  position: relative;
  overflow: hidden;
}

.company-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--card-shadow-hover);
}

.company-card .card-body {
  padding: 1.5rem;
}

.active-election {
  background: linear-gradient(to right, var(--success-color) 0.25rem, white 0.25rem);
}

.active-election::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(34, 197, 94, 0.05);
  pointer-events: none;
}

/* Company Search - Dashboard */
.search-container {
    position: relative;
    width: 100%;
}

.search-input {
    padding-left: 2.5rem;
    height: 38px; /* Allinea l'altezza con il pulsante Reset */
}

.search-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.search-container .fa-search {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    z-index: 2;
}

.gap-2 {
    gap: 0.5rem;
}

/* File Upload Section - Company Detail */
.upload-section {
  background: white;
  border-radius: 1rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--card-shadow);
}

.custom-file-label {
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  border: 1px solid #e5e7eb;
  background-color: white;
}

.custom-file-label::after {
  background-color: #f3f4f6;
  border-radius: 0 0.5rem 0.5rem 0;
  padding: 0.75rem 1rem;
}

/* Table Container - Company Detail */
.table-container {
  background: white;
  border-radius: 1rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--card-shadow);
}

/* Tables */
.table {
  margin-bottom: 0;
}

.table thead th {
  background-color: #f9fafb;
  border-bottom: 2px solid #f3f4f6;
  color: var(--text-secondary);
  font-weight: 600;
  padding: 1rem;
}

.table tbody td {
  padding: 1rem;
  vertical-align: middle;
  border-bottom: 1px solid #f3f4f6;
}

.table tbody tr:hover {
  background-color: #f9fafb;
}

/* Buttons */
.btn {
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-weight: 500;
  transition: all 0.15s ease-in-out;
}

.btn-primary {
  background-color: var(--primary-color);
  border: none;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-action {
  min-width: 140px;
  padding: 0.625rem 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.btn-outline-secondary {
  border: 1px solid #e5e7eb;
  color: var(--text-secondary);
}

.btn-outline-secondary:hover {
  background-color: #f3f4f6;
  border-color: #d1d5db;
  color: var(--text-primary);
}

/* Status Buttons */
.btn-status {
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  font-weight: 500;
  transition: all 0.15s ease-in-out;
  min-width: 120px;
  text-align: center;
}

.btn-status-active {
  background-color: #dcfce7;
  color: #15803d;
  border: none;
}

.btn-status-active:hover {
  background-color: #bbf7d0;
  color: #15803d;
}

.btn-status-inactive {
  background-color: #fee2e2;
  color: #b91c1c;
  border: none;
}

.btn-status-inactive:hover {
  background-color: #fecaca;
  color: #b91c1c;
}

/* Alerts */
.alert {
  border-radius: 1rem;
  border: none;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--card-shadow);
}

.alert-success {
  background-color: #dcfce7;
  color: #15803d;
}

.alert-warning {
  background-color: #fef3c7;
  color: #92400e;
}

.alert-danger {
  background-color: #fee2e2;
  color: #b91c1c;
}

.alert-heading {
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.alert ul {
  margin-bottom: 0;
  padding-left: 1.5rem;
}

.alert li {
  margin-bottom: 0.25rem;
}

/* Stats Badge */
.stats-badge {
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  font-size: 0.875rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-right: 0.75rem;
  background-color: #f3f4f6;
  color: var(--text-secondary);
}

.stats-badge i {
  font-size: 0.875rem;
}

.stats-badge.text-success,
.stats-badge.bg-success {
  background-color: #dcfce7 !important;
  color: #15803d;
}

.stats-badge.text-danger {
  background-color: #fee2e2;
  color: #b91c1c;
}

/* Action Column */
.action-column {
  text-align: center;
  white-space: nowrap;
  width: 140px;
}

/* Company Actions - Dashboard */
.company-actions {
  display: flex;
  gap: 0.5rem;
}

/* Empty State - Dashboard */
.text-center.py-5 {
  padding: 3rem 0;
}

.text-center.py-5 .fas {
  color: #9ca3af;
  margin-bottom: 1.5rem;
}

/* Footer */
footer {
  padding: 2rem 0;
  color: var(--text-secondary);
  font-size: 0.875rem;
  border-top: 1px solid #e5e7eb;
  margin-top: 3rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }
  
  .company-card .card-body {
    padding: 1rem;
  }
  
  .company-actions {
    flex-direction: column;
    width: 100%;
    margin-top: 1rem;
  }
  
  .btn-action {
    width: 100%;
  }
  
  .stats-badge {
    margin-bottom: 0.5rem;
  }
  
  .upload-section,
  .table-container {
    padding: 1rem;
  }
  
  .table-responsive {
    border-radius: 0.5rem;
    overflow: hidden;
  }
}

/* Statistics Page Specific Styles */
.stats-card {
  transition: transform 0.2s ease-in-out;
  border-radius: 1rem;
  overflow: hidden;
}

.stats-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--card-shadow-hover);
}

.stats-card .card-body {
  padding: 1.5rem;
}

.stats-card .h2 {
  color: var(--text-primary);
  font-weight: 600;
}

.participation-indicator {
  height: 20px;
  border-radius: 10px;
  background: linear-gradient(to right, var(--success-color) 20%, var(--danger-color) 100%);
  overflow: hidden;
}

.participation-indicator .progress-bar {
  transition: width 0.6s ease;
}

.vote-badge {
  font-size: 1.2rem;
  padding: 0.5rem 1rem;
  border-radius: 50rem;
  background-color: var(--primary-color);
  color: white;
}

.progress {
  background-color: #f3f4f6;
  border-radius: 50rem;
  height: 20px;
}

.progress-bar {
  background-color: var(--primary-color);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 500;
}

.ip-address {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  background-color: #f3f4f6;
  padding: 0.2rem 0.5rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Breadcrumb Styling */
.breadcrumb {
  margin: 0;
  padding: 0;
  background: transparent;
}

.breadcrumb-item a {
  color: var(--primary-color);
  text-decoration: none;
}

.breadcrumb-item a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

.breadcrumb-item.active {
  color: var(--text-secondary);
}

/* Status Indicators */
.text-warning {
  color: var(--warning-color) !important;
}

.h4.text-warning,
.h4.text-success,
.h4.text-primary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
}

/* Label Styling */
.text-muted {
  font-size: 0.875rem;
  color: var(--text-secondary) !important;
}

label.text-muted {
  font-weight: 500;
  margin-bottom: 0.25rem;
}

/* Card Title Variations */
.card-subtitle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .stats-card {
    margin-bottom: 1rem;
  }
  
  .vote-badge {
    font-size: 1rem;
    padding: 0.375rem 0.75rem;
  }
  
  .ip-address {
    font-size: 0.75rem;
  }
  
  .progress {
    height: 16px;
  }
  
  .progress-bar {
    font-size: 0.75rem;
  }
}

/* ... (mantenere tutto il CSS precedente) ... */

/* Login Page Specific Styles */
.login-container {
  max-width: 400px; /* Ridotto da 400px */
  margin: 0 auto;
  padding: 1rem;
}

.login-card {
  background: white;
  border-radius: 0.75rem;
  border: none;
  box-shadow: var(--card-shadow);
  margin-top: 4rem;
  transition: all 0.2s ease-in-out;
}

.login-card:hover {
  box-shadow: var(--card-shadow-hover);
}

.login-card .card-header {
  background-color: white;
  border-bottom: 1px solid var(--bg-light);
  padding: 1rem 1rem 0.75rem;
  border-radius: 0.75rem 0.75rem 0 0;
}

.login-card .card-header h4 {
  color: var(--text-primary);
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
}

.login-card .card-body {
  padding: 1rem;
}

.login-form .form-group {
  margin-bottom: 1rem;
}

.login-form label {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.375rem;
}

.login-form .form-control {
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  border: 1px solid #e5e7eb;
  font-size: 0.875rem;
  transition: all 0.15s ease-in-out;
}

.login-form .form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1);
}

.login-form .btn-primary {
  width: 100%;
  padding: 0.5rem;
  font-weight: 500;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
}

.login-form .alert {
  border: none;
  border-radius: 0.375rem;
  padding: 0.75rem;
  margin-bottom: 1rem;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

/* Responsive adjustments for login */
@media (max-width: 768px) {
  .login-container {
    max-width: 280px; /* Ancora più compatto su mobile */
  }
  
  .login-card {
    margin-top: 3rem;
  }
}