﻿html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

/* --- Utility Classes per le Icone --- */
.icon-sm {
  font-size: 18px;
}

/* --- Stili specifici per i controlli Topbar --- */
.culture-select {
  width: auto;
  cursor: pointer;
}

/* --- Stili Globali Base --- */
a {
  color: var(--primary-blue, #2563eb);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #1e3a8a; /* Un blu più scuro per l'hover */
}

/* Centralizziamo il bottone primario con il tuo nuovo stile SaaS */
.btn-primary {
  color: #fff;
  background-color: var(--primary-blue, #2563eb);
  border-color: var(--primary-blue, #2563eb);
}

.btn-primary:hover, .btn-primary:focus {
  background-color: #1d4ed8;
  border-color: #1d4ed8;
}

/* Stile per le tab attive di Bootstrap */
.nav-pills .nav-link.active, .nav-pills .show > .nav-link {
  color: #fff;
  background-color: var(--primary-blue, #2563eb);
}


/* =========================================
   STILI GLOBALI TABELLE E DATATABLES
   ========================================= */

/* Testate delle tabelle (sia normali che datatables) */
.table-modern thead th,
.datatable-table thead th {
  background-color: #f1f5f9 !important;
  border-bottom: 2px solid #e2e8f0 !important;
  color: #64748b !important;
  font-size: 0.75rem !important;
  letter-spacing: 0.8px !important;
  text-transform: uppercase !important;
  font-weight: 600 !important;
}

/* Celle delle tabelle */
.table-modern tbody td,
.datatable-table tbody td {
  border-bottom: 1px solid #f1f5f9 !important;
}

/* Hover righe cliccabili */
.clickable-row {
  cursor: pointer;
  transition: background-color 0.2s;
}
.clickable-row:hover {
  background-color: #f1f5f9 !important;
}

/* Colori specifici righe (Ordini) */
.row-completed { background-color: #f8fafc; opacity: 0.75; transition: opacity 0.2s ease; }
.row-completed:hover { opacity: 1; background-color: #f1f5f9; }
.row-today { background-color: #fef2f2 !important; }
.row-today:hover { background-color: #fee2e2 !important; }
.row-attention { background-color: #fffbeb !important; }
.row-attention:hover { background-color: #fef3c7 !important; }

/* Simple DataTables Overrides */
.datatable-top, .datatable-bottom { padding: 1.5rem 0 !important; }
.datatable-input { border-radius: 50px !important; padding: 8px 18px !important; border: 1px solid #cbd5e1 !important; background-color: #f8fafc !important; outline: none !important; transition: all 0.2s !important; }
.datatable-input:focus { background-color: #fff !important; border-color: var(--primary-blue, #0d6efd) !important; box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.15) !important; }
.datatable-pagination { margin: 0 !important; }
.datatable-pagination a { border-radius: 50px !important; margin: 0 3px !important; border: none !important; color: #64748b !important; font-weight: 500 !important; transition: all 0.2s !important; text-decoration: none !important; }
.datatable-pagination a:hover { background-color: #f1f5f9 !important; color: var(--primary-blue, #0d6efd) !important; }
.datatable-pagination li.active a, .datatable-pagination li.datatable-active a { background-color: var(--primary-blue, #0d6efd) !important; color: white !important; box-shadow: 0 3px 6px rgba(13, 110, 253, 0.2) !important; }
.datatable-selector { border-radius: 8px !important; border: 1px solid #cbd5e1 !important; padding: 4px 10px !important; outline: none !important; }
.datatable-info { color: #64748b !important; }

/* Effetti e Badge */
.transition-hover { transition: opacity 0.2s ease; }
.transition-hover:hover { opacity: 0.7; }
.badge-modern { padding: 0.35em 0.8em; border-radius: 50px; font-weight: 600; font-size: 0.85rem; display: inline-block; white-space: nowrap; }
.badge-yes { background-color: #d1fae5; color: #065f46; border: 1px solid #10b981; }
.badge-no { background-color: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; }

/* =========================================
   STILI GLOBALI FORM, CARD E BOTTONI
   ========================================= */

/* Card moderne centralizzate (sostituisce login-card, form-card, dashboard-card) */
.modern-card {
  background: #ffffff;
  border-radius: 24px;
  box-shadow: 0 10px 40px -10px rgba(0,0,0,0.08);
  padding: 3rem;
  border: 1px solid rgba(0,0,0,0.05);
}

/* Titoli di sezione nei form */
.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1e293b;
  margin-top: 2rem;
  margin-bottom: 1.2rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #f1f5f9;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Sovrascriviamo le label standard di Bootstrap */
.form-label {
  font-weight: 500;
  color: #475569;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
}

/* Input testuali moderni */
.modern-input {
  border-radius: 12px;
  padding: 0.75rem 1.25rem;
  border: 1px solid #cbd5e1;
  background-color: #f8fafc;
  color: #334155;
  transition: all 0.2s ease;
}
.modern-input:focus {
  background-color: #ffffff;
  border-color: var(--primary-blue, #0d6efd);
  box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.15);
  outline: none;
}

.modern-input[readonly] { background-color: #e2e8f0; color: #64748b; cursor: not-allowed; opacity: 0.7; }

/* Bottoni moderni animati */
.modern-btn {
  border-radius: 12px;
  padding: 0.85rem 1.5rem;
  font-weight: 600;
  transition: all 0.2s ease;
}
.btn-primary.modern-btn {
  box-shadow: 0 4px 6px -1px rgba(13, 110, 253, 0.2);
}
.btn-primary.modern-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px -2px rgba(13, 110, 253, 0.3);
}

/* Fix per plugin TomSelect (Stile Moderno) */
.ts-control {
  border-radius: 12px !important;
  border: 1px solid #cbd5e1 !important;
  background-color: #f8fafc !important;
  padding: 0.75rem 1.25rem !important;
}
.ts-control.focus {
  background-color: #ffffff !important;
  border-color: var(--primary-blue, #0d6efd) !important;
  box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.15) !important;
}

.ts-control.disabled { 
  opacity: 0.7; 
  background-color: #e2e8f0 !important; 
  cursor: not-allowed; }

/* Wrapper esclusivo per centrare verticalmente la pagina di Login */
.login-wrapper {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.form-switch .form-check-input {
  width: 3em;
  height: 1.5em;
  cursor: pointer;
}
.form-switch .form-check-label {
  padding-top: 0.2rem;
  margin-left: 0.5rem;
  cursor: pointer;
}

.input-group > .modern-input { border-radius: 12px 0 0 12px !important; }


/* =========================================
   DASHBOARD WIDGETS
   ========================================= */

.dashboard-card {
  background: #ffffff;
  border-radius: 24px;
  box-shadow: 0 10px 40px -10px rgba(0,0,0,0.05);
  padding: 1.5rem;
  border: 1px solid rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
}

.card-title-modern {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Lista Ordini (Timeline Style) */
.order-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  overflow-y: auto;
  max-height: 550px;
  padding-right: 0.5rem;
}
.order-list::-webkit-scrollbar { width: 6px; }
.order-list::-webkit-scrollbar-track { background: #f1f5f9; border-radius: 10px; }
.order-list::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }

.order-item {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 1rem 1.2rem;
  transition: all 0.2s ease;
  text-decoration: none;
  display: block;
}
.order-item:hover {
  border-color: var(--primary-blue, #0d6efd);
  box-shadow: 0 4px 12px rgba(13, 110, 253, 0.08);
  transform: translateY(-2px);
}

.order-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 0.5rem;
}

.order-info-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: #64748b;
  margin-bottom: 0.25rem;
}
.order-info-row .material-icons-round { font-size: 16px; opacity: 0.7; }

/* Carosello Commenti */
.comment-carousel {
  position: relative;
  background-color: #f8fafc;
  border-radius: 16px;
  padding: 1.2rem 2.5rem;
  text-align: center;
  border: 1px solid #e2e8f0;
}
.arrow-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #475569;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.arrow-btn:hover { background-color: #f1f5f9; color: var(--primary-blue, #0d6efd); border-color: var(--primary-blue, #0d6efd); }
.left-arrow { left: -12px; }
.right-arrow { right: -12px; }

/* Dimensione Stelle Ridotta */
.star-rating .material-icons-round { font-size: 1.5rem; color: #e2e8f0; }
.star-rating .material-icons-round.filled { color: #f59e0b; filter: drop-shadow(0 2px 4px rgba(245, 158, 11, 0.3)); }

/* Chart Container */
.chart-container-inner {
  position: relative;
  width: 100%;
  height: 240px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* =========================================
   PAGINE DI DETTAGLIO (DETAILS)
   ========================================= */

/* Tipografia dei dati in sola lettura */
.info-group {
  margin-bottom: 1.5rem;
}
.info-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 0.3rem;
  display: block;
}
.info-value {
  font-size: 1rem;
  font-weight: 500;
  color: #1e293b;
  word-break: break-word;
}

/* Badge di stato aggiuntivi (Ordini) */
.badge-finished { background-color: #d1fae5; color: #065f46; border: 1px solid #10b981; }
.badge-ongoing { background-color: #fef08a; color: #854d0e; border: 1px solid #fde047; }

/* Griglia Servizi Dettaglio Ordine */
.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}
.service-badge-modern {
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.service-badge-modern:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 15px -3px rgba(0,0,0,0.05);
  border-color: #cbd5e1;
}
.service-badge-modern .qty-circle {
  background-color: var(--primary-blue, #0d6efd);
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  box-shadow: 0 4px 6px -1px rgba(13, 110, 253, 0.3);
}
.service-badge-modern .service-name {
  font-weight: 600;
  color: #1e293b;
  font-size: 0.95rem;
  line-height: 1.2;
}


/* =========================================
   COMPONENTI SPECIFICI (Comments)
   ========================================= */


/* Box Citazione (Commenti) */
.remark-box {
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 4px solid var(--primary-blue, #0d6efd);
  padding: 1.5rem 2rem;
  border-radius: 0 16px 16px 0;
  color: #334155;
  font-size: 1.05rem;
  line-height: 1.6;
  position: relative;
}

/* Variante Stelle Grandi per ViewComment */
.star-rating-lg .material-icons-round {
  font-size: 2.8rem;
}