/* =============================================================================
   Chiara Superadmin — Style condiviso v2 (dark navy)
   Palette tratta dal vecchio superadmin.html (pre-refactor).
   Body navy-dark scuro, card trasparenti, accenti teal, testo chiaro.
   ============================================================================= */

:root {
  /* Blu / navy */
  --navy:       #1b2a4a;
  --navy-dark:  #111d33;
  --navy-mid:   #243356;

  /* Teal accenti */
  --teal:       #00acc1;
  --teal-dark:  #007c8f;
  --teal-glow:  rgba(0, 172, 193, 0.15);
  --teal-glow2: rgba(0, 172, 193, 0.08);

  /* Testo */
  --text:       #e8edf5;
  --text-muted: #7a91b8;
  --text-dim:   #4a6080;

  /* Superfici */
  --border:     rgba(255, 255, 255, 0.07);
  --border-hi:  rgba(255, 255, 255, 0.12);
  --card:       rgba(255, 255, 255, 0.04);
  --card-hover: rgba(255, 255, 255, 0.07);

  /* Stati */
  --green:  #00c896;
  --orange: #f59e0b;
  --red:    #f43f5e;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Figtree', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--navy-dark);
  color: var(--text);
  min-height: 100vh;
}

h1, h2, h3, .chiara-brand {
  font-family: 'DM Serif Display', Georgia, serif;
  font-weight: 400;
  margin: 0;
}

a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--teal-dark); }

/* =============================================================================
   TOPBAR
   ============================================================================= */
.chiara-topbar {
  background: var(--navy);
  color: var(--text);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  gap: 20px;
  border-bottom: 1px solid var(--border);
}

.chiara-topbar .chiara-back {
  color: var(--text);
  font-size: 22px;
  padding: 4px 12px;
  border-radius: 6px;
  line-height: 1;
  transition: background 120ms ease, color 120ms ease;
}
.chiara-topbar .chiara-back:hover {
  background: var(--card-hover);
  color: var(--teal);
}

.chiara-topbar .chiara-brand {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 22px;
  line-height: 1;
  color: var(--text);
}

.chiara-topbar .chiara-badge {
  background: var(--teal-glow);
  border: 1px solid var(--teal);
  color: var(--teal);
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.chiara-topbar .chiara-spacer { flex: 1; }

.chiara-topbar .chiara-data {
  font-size: 13px;
  color: var(--text-muted);
}

.chiara-topbar .chiara-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
}
.chiara-topbar .chiara-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  animation: chiara-pulse 2s infinite;
}
@keyframes chiara-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.4; }
}

.chiara-topbar .chiara-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal), var(--teal-dark));
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
}

/* =============================================================================
   PAGE LAYOUT
   ============================================================================= */
.chiara-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 28px;
}

.chiara-page-title {
  font-size: 32px;
  color: var(--text);
  margin-bottom: 6px;
}

.chiara-page-subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 28px;
}

/* =============================================================================
   DASHBOARD — GRID BOTTONI (card trasparenti con hover teal-glow)
   ============================================================================= */
.chiara-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 18px;
  margin-top: 24px;
}

.chiara-btn-dashboard {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  height: 120px;
  font-family: 'Figtree', sans-serif;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.2px;
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease, transform 80ms ease, box-shadow 180ms ease;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8px 14px;
  line-height: 1.3;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

/* Bordo teal sottile in alto, come nelle kpi-card del vecchio superadmin.html */
.chiara-btn-dashboard::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--teal), transparent);
  opacity: 0.6;
  transition: opacity 180ms ease;
}

.chiara-btn-dashboard:hover {
  background: var(--card-hover);
  border-color: var(--teal);
  color: var(--text);
  box-shadow: 0 0 0 3px var(--teal-glow2);
}
.chiara-btn-dashboard:hover::before { opacity: 1; }
.chiara-btn-dashboard:active { transform: translateY(1px); }

/* Bottone Esci — accento rosso su hover */
.chiara-btn-dashboard.chiara-btn-esci::before {
  background: linear-gradient(90deg, var(--red), transparent);
}
.chiara-btn-dashboard.chiara-btn-esci:hover {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.1);
  color: var(--red);
}

/* =============================================================================
   PLACEHOLDER "IN COSTRUZIONE"
   ============================================================================= */
.chiara-placeholder {
  background: var(--card);
  border: 1px dashed var(--border-hi);
  border-radius: 12px;
  padding: 64px 32px;
  text-align: center;
  color: var(--text-muted);
}
.chiara-placeholder h2 {
  color: var(--text);
  font-size: 26px;
  margin-bottom: 12px;
}
.chiara-placeholder p {
  margin: 0;
  font-size: 14px;
  color: var(--text-muted);
}

/* =============================================================================
   LOGIN
   ============================================================================= */
.chiara-login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--navy-dark);
  padding: 24px;
}
.chiara-login-card {
  background: var(--navy);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px 36px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}
.chiara-login-card .chiara-brand {
  font-size: 28px;
  color: var(--text);
  text-align: center;
  margin-bottom: 4px;
}
.chiara-login-card .chiara-subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 28px;
}
.chiara-login-card label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
  margin-top: 16px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
.chiara-login-card input[type="text"],
.chiara-login-card input[type="password"] {
  width: 100%;
  padding: 11px 14px;
  background: var(--navy-dark);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  transition: border-color 120ms ease, box-shadow 120ms ease;
  outline: none;
}
.chiara-login-card input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-glow2);
}
.chiara-login-card input::placeholder {
  color: var(--text-dim);
}
.chiara-login-card .chiara-btn-primary {
  width: 100%;
  background: linear-gradient(135deg, var(--teal-dark), var(--teal));
  color: #fff;
  border: none;
  padding: 12px 18px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 24px;
  transition: opacity 180ms ease;
}
.chiara-login-card .chiara-btn-primary:hover  { opacity: 0.85; }
.chiara-login-card .chiara-btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.chiara-login-card .chiara-error {
  color: var(--red);
  font-size: 13px;
  margin-top: 14px;
  text-align: center;
  display: none;
}
.chiara-login-card .chiara-error.chiara-error-visible { display: block; }

/* =============================================================================
   SCROLLBAR (coerente con vecchio superadmin.html)
   ============================================================================= */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.18);
}

/* =============================================================================
   BADGE BOTTONI DASHBOARD (Fase 1.5)
   Pensato daltonic-safe: pallino verde brillante con bordo bianco, oppure
   badge numerico teal con numero bianco. Assenza di badge = nulla da fare.
   Il significato NON e' codificato solo nel colore: il pallino ha una
   forma/posizione riconoscibili, il badge numerico comunica via numero.
   ============================================================================= */
.chiara-btn-dashboard { position: relative; }

.chiara-btn-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  display: none;               /* nascosto di default: appare solo con modificatore */
  align-items: center;
  justify-content: center;
  line-height: 1;
  pointer-events: none;        /* il badge non blocca il click sul bottone */
}

/* --- Pallino verde: server online --- */
.chiara-btn-badge.chiara-btn-badge--dot {
  display: block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--green);
  border: 2px solid var(--navy-dark);  /* bordo scuro che stacca su card scura */
  box-shadow: 0 0 0 1px rgba(0, 200, 150, 0.35);
}

/* --- Badge conteggio: email, contabilita --- */
.chiara-btn-badge.chiara-btn-badge--count {
  display: inline-flex;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 11px;
  background: var(--teal);
  color: #ffffff;
  font-family: 'Figtree', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2px;
  border: 2px solid var(--navy-dark);   /* stacco sullo sfondo dark del bottone */
  box-shadow: 0 0 0 1px rgba(0, 172, 193, 0.35);
}
