/* ==========================================================================
   Bodytech - Elite Experience | Area riservata
   Palette: bianco, rosso, grigio, nero.
   ========================================================================== */

:root {
  --bt-red: #e10600;
  --bt-red-dark: #b00400;
  --bt-red-soft: rgba(225, 6, 0, 0.08);

  --bt-black: #111213;
  --bt-black-soft: #1c1e21;

  --bt-grey-900: #2b2e33;
  --bt-grey-700: #52565d;
  --bt-grey-500: #8b9098;
  --bt-grey-300: #d3d6da;
  --bt-grey-200: #e5e7ea;
  --bt-grey-100: #f4f5f6;

  --bt-white: #ffffff;

  --bt-silver: #9aa0a6;
  --bt-gold: var(--bt-red);
  --bt-platinum: var(--bt-black);

  --bt-radius: 10px;
  --bt-shadow: 0 1px 2px rgba(17, 18, 19, 0.04), 0 8px 24px rgba(17, 18, 19, 0.06);
  --bt-shadow-lg: 0 10px 40px rgba(17, 18, 19, 0.14);
}

/* UIkit non fa un reset globale di box-sizing: lo dichiara componente per componente
   (e usa content-box su .uk-container). I componenti di questo file devono quindi
   dichiararlo da sé: senza, "height: 100%" più padding e bordo produce un border-box
   più alto del contenitore, e la card sfora la griglia. */
/* .uk-container è escluso di proposito: UIkit lo vuole content-box (max-width 1200
   + padding laterale) e la navbar è insieme .uk-container e .bt-nav. */
[class^="bt-"]:not(.uk-container),
[class*=" bt-"]:not(.uk-container) {
  box-sizing: border-box;
}

/* Lo sfondo va sulla radice: UIkit dichiara html{background:#fff} e, con una
   radice non trasparente, quello del body non viene propagato al canvas: si
   fermerebbe all'altezza del suo box lasciando bianco il resto della pagina. */
html {
  height: 100%;
  background: var(--bt-grey-100);
}

/* Sulla pagina di login la radice è scura, così anche l'overscroll resta nero. */
html.bt-html-login {
  background: var(--bt-black);
}

body {
  /* min-height, non height: così il box del body avvolge il contenuto invece di
     fermarsi a una viewport. */
  min-height: 100%;
  background: var(--bt-grey-100);
  color: var(--bt-grey-900);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--bt-red); }
a:hover { color: var(--bt-red-dark); }

.bt-page {
  padding: 28px 0 56px;
}

.bt-page__title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--bt-black);
  margin: 0;
  letter-spacing: -0.01em;
}

.bt-page__subtitle {
  color: var(--bt-grey-700);
  margin: 4px 0 0;
  font-size: 0.92rem;
}

.bt-rule {
  width: 40px;
  height: 3px;
  background: var(--bt-red);
  border-radius: 2px;
  margin: 14px 0 24px;
}

/* ------------------------------- Header ---------------------------------- */

.bt-header {
  background: var(--bt-black);
  border-bottom: 3px solid var(--bt-red);
  position: sticky;
  top: 0;
  z-index: 980;
}

.bt-nav {
  min-height: 66px;
}

.bt-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  padding: 8px 0;
}

.bt-brand:hover { text-decoration: none; }

.bt-brand__logo {
  height: 34px;
  width: auto;
  /*max-width: 150px;*/
  display: block;
}

.bt-brand__text {
  color: var(--bt-white);
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-left: 1px solid var(--bt-grey-700);
  padding-left: 12px;
  white-space: nowrap;
}

.bt-brand__text strong { color: var(--bt-red); font-weight: 700; }

.bt-navbar-nav > li > a {
  color: var(--bt-grey-300);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  min-height: 66px;
  border-bottom: 3px solid transparent;
  margin-bottom: -3px;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.bt-navbar-nav > li > a:hover,
.bt-navbar-nav > li.uk-active > a {
  color: var(--bt-white);
  border-bottom-color: var(--bt-red);
}

.bt-nav__user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-left: 20px;
  margin-left: 8px;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.bt-nav__email {
  color: var(--bt-grey-500);
  font-size: 0.8rem;
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bt-logout,
.bt-burger {
  background: none;
  border: 0;
  color: var(--bt-grey-300);
  cursor: pointer;
  padding: 6px;
  line-height: 0;
  border-radius: 6px;
  transition: color 0.15s ease, background 0.15s ease;
}

.bt-logout:hover,
.bt-burger:hover {
  color: var(--bt-white);
  background: var(--bt-red);
}

.bt-offcanvas .uk-offcanvas-bar { background: var(--bt-black); }
.bt-offcanvas__user {
  padding-bottom: 18px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--bt-grey-300);
}
.bt-offcanvas__nav > li > a { color: var(--bt-grey-300); }
.bt-offcanvas__nav > li > a:hover,
.bt-offcanvas__nav > li.uk-active > a { color: var(--bt-white); }

/* ------------------------------- Badge ----------------------------------- */

.bt-badge {
  display: inline-block;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

.bt-badge--admin { background: var(--bt-red); color: var(--bt-white); }
.bt-badge--user { background: var(--bt-grey-200); color: var(--bt-grey-900); }
.bt-badge--on { background: #e8f4ec; color: #14663a; }
.bt-badge--off { background: var(--bt-grey-200); color: var(--bt-grey-700); }

/* ------------------------------- Card ------------------------------------ */

.bt-card {
  background: var(--bt-white);
  border-radius: var(--bt-radius);
  border: 1px solid var(--bt-grey-200);
  box-shadow: var(--bt-shadow);
  padding: 22px;
}

.bt-card--flush { padding: 0; overflow: hidden; }

.bt-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 18px 22px;
  border-bottom: 1px solid var(--bt-grey-200);
}

.bt-card__title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--bt-black);
  margin: 0;
}

.bt-card__body { padding: 22px; }

/* ------------------------------- Stat ------------------------------------ */

.bt-stat {
  background: var(--bt-white);
  border: 1px solid var(--bt-grey-200);
  border-radius: var(--bt-radius);
  box-shadow: var(--bt-shadow);
  padding: 20px 22px;
  position: relative;
  overflow: hidden;
  height: 100%;
}

.bt-stat::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--bt-grey-300);
}

.bt-stat--primary::before { background: var(--bt-red); }
.bt-stat--dark::before { background: var(--bt-black); }

.bt-stat__label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bt-grey-500);
  margin: 0 0 8px;
}

.bt-stat__value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--bt-black);
  line-height: 1.1;
  margin: 0;
  letter-spacing: -0.02em;
}

.bt-stat__hint {
  font-size: 0.78rem;
  color: var(--bt-grey-500);
  margin: 6px 0 0;
}

/* ------------------------------- Target ---------------------------------- */

.bt-target {
  background: var(--bt-white);
  border: 1px solid var(--bt-grey-200);
  border-radius: var(--bt-radius);
  box-shadow: var(--bt-shadow);
  padding: 22px;
  height: 100%;
  display: flex;
  flex-direction: column;
  text-align: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.bt-target:hover {
  transform: translateY(-2px);
  box-shadow: var(--bt-shadow-lg);
}

.bt-target__head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 4px;
}

.bt-target__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.bt-target--silver .bt-target__dot { background: var(--bt-silver); }
.bt-target--gold .bt-target__dot { background: var(--bt-gold); }
.bt-target--platinum .bt-target__dot { background: var(--bt-platinum); }

.bt-target__name {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bt-grey-700);
  margin: 0;
}

.bt-target__chart {
  position: relative;
  width: 100%;
  max-width: 190px;
  margin: 12px auto 6px;
  aspect-ratio: 1 / 1;
}

.bt-target__center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.bt-target__pct {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--bt-black);
  line-height: 1;
  letter-spacing: -0.02em;
}

.bt-target__pct-label {
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bt-grey-500);
  margin-top: 4px;
}

.bt-target__footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px dashed var(--bt-grey-200);
}

.bt-target__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  font-size: 0.85rem;
  padding: 3px 0;
}

.bt-target__row dt { color: var(--bt-grey-500); margin: 0; }
.bt-target__row dd { margin: 0; font-weight: 600; color: var(--bt-black); }

.bt-target__status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.bt-target__status--reached { background: #e8f4ec; color: #14663a; }
.bt-target__status--pending { background: var(--bt-red-soft); color: var(--bt-red-dark); }
.bt-target__status--unassigned { background: var(--bt-red-soft); color: var(--bt-red); }

/* Target non assegnato: niente grafico né valori, solo la dicitura centrata.
   Occupa lo spazio verticale della scheda per restare allineata alle altre. */
.bt-target__unassigned {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 190px;
  padding: 10px 0;
}

/* ------------------------------- Alert ----------------------------------- */

.bt-alert {
  border-radius: var(--bt-radius);
  border-left: 4px solid var(--bt-grey-500);
  background: var(--bt-white);
  box-shadow: var(--bt-shadow);
  padding: 14px 40px 14px 18px;
  color: var(--bt-grey-900);
}

.bt-alert--success { border-left-color: #1a7f43; }
.bt-alert--danger { border-left-color: var(--bt-red); }
.bt-alert--warning { border-left-color: #b8860b; }

/* ------------------------------- Tabelle --------------------------------- */

.bt-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.bt-table {
  margin: 0;
  font-size: 0.85rem;
  white-space: nowrap;
}

.bt-table th {
  background: var(--bt-grey-100);
  color: var(--bt-grey-700);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 2px solid var(--bt-grey-200) !important;
  position: sticky;
  top: 0;
  z-index: 1;
}

.bt-table td { vertical-align: middle; color: var(--bt-grey-900); }
.bt-table tbody tr:hover { background: var(--bt-grey-100); }
.bt-table .bt-num { text-align: right; font-variant-numeric: tabular-nums; }
.bt-table .bt-missing { color: var(--bt-red); font-weight: 600; }

.bt-table tr.bt-row--orphan td { background: var(--bt-red-soft); }

.bt-cell-strong { font-weight: 600; color: var(--bt-black); }

/* ------------------------------- Form ------------------------------------ */

.bt-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--bt-grey-700);
  margin-bottom: 6px;
}

.uk-input, .uk-select, .uk-textarea {
  border-radius: 8px;
  border: 1px solid var(--bt-grey-300);
  background: var(--bt-white);
  height: 44px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.uk-input:focus, .uk-select:focus, .uk-textarea:focus {
  border-color: var(--bt-red);
  box-shadow: 0 0 0 3px var(--bt-red-soft);
  outline: none;
}

.uk-checkbox:checked,
.uk-checkbox:indeterminate {
  background-color: var(--bt-red);
  border-color: var(--bt-red);
}

.uk-checkbox:focus { border-color: var(--bt-red); }

.uk-button-primary {
  background: var(--bt-red);
  color: var(--bt-white);
  border-radius: 8px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
  transition: background 0.15s ease;
}

.uk-button-primary:hover,
.uk-button-primary:focus { background: var(--bt-red-dark); color: var(--bt-white); }

.uk-button-default {
  border-radius: 8px;
  border-color: var(--bt-grey-300);
  color: var(--bt-grey-900);
  background: var(--bt-white);
  text-transform: none;
  font-weight: 600;
}

.uk-button-default:hover { border-color: var(--bt-black); color: var(--bt-black); }

.uk-button-danger { border-radius: 8px; text-transform: none; font-weight: 600; }

.bt-help {
  font-size: 0.76rem;
  color: var(--bt-grey-500);
  margin: 6px 0 0;
}

/* ------------------------------- Login ----------------------------------- */

.bt-body-login {
  background: var(--bt-black);
}

.bt-login {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(225, 6, 0, 0.16), transparent 60%),
    linear-gradient(160deg, var(--bt-black) 0%, var(--bt-black-soft) 55%, #000 100%);
}

/* Senza larghezza esplicita questo flex item si dimensiona sul contenuto più largo
   (il footer), e la card non raggiunge mai i suoi 430px. */
.bt-login__inner {
  width: 100%;
  max-width: 430px;
}

.bt-login__card {
  width: 100%;
  max-width: 430px;
  background: var(--bt-white);
  border-radius: 14px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.bt-login__top {
  border-top: 4px solid var(--bt-red);
  padding: 34px 34px 0;
  text-align: center;
}

/* Segnaposto del logo: sostituire /public/img/logo.svg con il logo definitivo. */
.bt-logo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 92px;
  margin: 0 auto 22px;
  padding: 10px;
  max-width: 260px;
  border: 2px dashed var(--bt-grey-300);
  border-radius: 10px;
  background: var(--bt-grey-100);
}

.bt-logo-placeholder img {
  max-height: 100%;
  max-width: 100%;
  width: auto;
  object-fit: contain;
}

.bt-login__title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--bt-black);
  margin: 0;
  letter-spacing: -0.01em;
}

.bt-login__subtitle {
  color: var(--bt-grey-500);
  font-size: 0.87rem;
  margin: 6px 0 0;
}

.bt-login__body { padding: 26px 34px 34px; }

.bt-login__footer {
  text-align: center;
  color: rgba(255, 255, 255, 0.42);
  font-size: 0.75rem;
  margin-top: 22px;
}

.bt-password-wrap { position: relative; }

.bt-password-toggle {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  background: none;
  border: 0;
  padding: 6px;
  line-height: 0;
  cursor: pointer;
  color: var(--bt-grey-500);
  border-radius: 6px;
}

.bt-password-toggle:hover { color: var(--bt-black); }

.bt-remember {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--bt-grey-700);
  cursor: pointer;
  line-height: 1.35;
}

.bt-remember .uk-checkbox { flex: 0 0 auto; margin-top: 2px; }

/* ------------------------------- Vuoto ----------------------------------- */

.bt-empty {
  text-align: center;
  padding: 56px 24px;
  color: var(--bt-grey-500);
}

.bt-empty__icon { color: var(--bt-grey-300); }
.bt-empty__title { color: var(--bt-black); font-weight: 700; margin: 14px 0 6px; }

/* ------------------------------- Dropzone -------------------------------- */

.bt-drop {
  border: 2px dashed var(--bt-grey-300);
  border-radius: var(--bt-radius);
  background: var(--bt-grey-100);
  padding: 40px 24px;
  text-align: center;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.bt-drop.bt-drop--over,
.bt-drop:hover {
  border-color: var(--bt-red);
  background: var(--bt-red-soft);
}

.bt-drop__file {
  margin-top: 14px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--bt-black);
  word-break: break-all;
}

/* ------------------------------- Responsive ------------------------------ */

@media (max-width: 639px) {
  .bt-page { padding: 20px 0 40px; }
  .bt-page__title { font-size: 1.3rem; }
  .bt-stat__value { font-size: 1.45rem; }
  .bt-card, .bt-stat, .bt-target { padding: 18px; }
  .bt-card__head, .bt-card__body { padding: 16px 18px; }
  .bt-login__top { padding: 26px 22px 0; }
  .bt-login__body { padding: 22px 22px 28px; }

  /* Su schermi stretti logo + scritta superano la viewport e generano scroll
     orizzontale: resta il solo logo, che contiene già il nome. */
  .bt-brand__text { display: none; }
  .bt-brand__logo { max-width: 170px; }
}

/* Lo sfondo non va azzerato qui: UIkit stampa con *{background:0 0!important},
   quindi radice e body sono già trasparenti (foglio bianco). */
@media print {
  .bt-header, .bt-offcanvas { display: none; }
  .bt-card, .bt-stat, .bt-target { box-shadow: none; border: 1px solid #ccc; }
}
