/* BAI Gestionale - app.css */

/* Inter font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* Sidebar menu links */
.menu-link {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .55rem .85rem;
  border-radius: .5rem;
  color: rgb(71 85 105);
  font-weight: 500;
  transition: all .15s ease;
}
.menu-link:hover {
  background: rgb(248 250 252);
  color: rgb(15 23 42);
}
.menu-link.is-active {
  background: linear-gradient(135deg, rgb(255 229 229) 0%, rgb(255 197 197) 100%);
  color: rgb(191 0 0);
  font-weight: 600;
  box-shadow: inset 3px 0 0 rgb(230 0 0);
}
.menu-link.is-active svg {
  color: rgb(230 0 0);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .5rem 1rem;
  border-radius: .5rem;
  font-weight: 500;
  font-size: .875rem;
  transition: all .15s ease;
  border: 1px solid transparent;
  white-space: nowrap;
  cursor: pointer;
}
.btn-primary { background: rgb(230 0 0); color: white; }
.btn-primary:hover { background: rgb(191 0 0); }
.btn-secondary { background: white; color: rgb(51 65 85); border-color: rgb(226 232 240); }
.btn-secondary:hover { background: rgb(248 250 252); border-color: rgb(203 213 225); }
.btn-danger { background: rgb(220 38 38); color: white; }
.btn-danger:hover { background: rgb(185 28 28); }
.btn-success { background: rgb(22 163 74); color: white; }
.btn-success:hover { background: rgb(21 128 61); }
.btn-ghost { background: transparent; color: rgb(71 85 105); }
.btn-ghost:hover { background: rgb(241 245 249); color: rgb(15 23 42); }
.btn-sm { padding: .35rem .65rem; font-size: .8rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* Cards */
.card {
  background: white;
  border: 1px solid rgb(226 232 240);
  border-radius: .75rem;
  box-shadow: 0 1px 2px rgb(0 0 0 / .03);
}
.card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgb(241 245 249);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.card-header h2 { font-size: 1rem; font-weight: 600; }
.card-body { padding: 1.25rem; }

/* Form fields */
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: .55rem .85rem;
  border: 1px solid rgb(203 213 225);
  border-radius: .5rem;
  background: white;
  font-size: .875rem;
  transition: all .15s ease;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: rgb(230 0 0);
  box-shadow: 0 0 0 3px rgb(255 229 229);
}
.form-label {
  display: block;
  font-size: .8rem;
  font-weight: 500;
  color: rgb(51 65 85);
  margin-bottom: .35rem;
}
.form-help { font-size: .75rem; color: rgb(100 116 139); margin-top: .25rem; }

/* Tables */
.tbl {
  width: 100%;
  font-size: .875rem;
  border-collapse: collapse;
}
.tbl thead th {
  text-align: left;
  padding: .75rem 1rem;
  background: rgb(248 250 252);
  border-bottom: 1px solid rgb(226 232 240);
  font-weight: 600;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: rgb(71 85 105);
}
.tbl tbody td {
  padding: .85rem 1rem;
  border-bottom: 1px solid rgb(241 245 249);
}
.tbl tbody tr:hover { background: rgb(248 250 252 / .6); }
.tbl tbody tr:last-child td { border-bottom: 0; }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: .15rem .55rem;
  border-radius: 9999px;
  font-size: .72rem;
  font-weight: 600;
  line-height: 1.4;
}
.badge-verde   { background: rgb(220 252 231); color: rgb(22 101 52); }
.badge-giallo  { background: rgb(254 249 195); color: rgb(133 77 14); }
.badge-arancio { background: rgb(255 237 213); color: rgb(154 52 18); }
.badge-rosso   { background: rgb(254 226 226); color: rgb(153 27 27); }
.badge-blu     { background: rgb(219 234 254); color: rgb(30 64 175); }
.badge-neutral { background: rgb(241 245 249); color: rgb(71 85 105); }
.badge-bai     { background: rgb(255 229 229); color: rgb(191 0 0); }

/* KPI cards */
.kpi {
  background: white;
  border-radius: .85rem;
  padding: 1.1rem 1.25rem;
  border: 1px solid rgb(226 232 240);
  position: relative;
  overflow: hidden;
}
.kpi-label {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: rgb(100 116 139);
  font-weight: 600;
}
.kpi-value {
  font-size: 1.85rem;
  font-weight: 700;
  color: rgb(15 23 42);
  margin-top: .25rem;
}
.kpi-icon {
  position: absolute;
  top: 1rem; right: 1rem;
  width: 2.5rem; height: 2.5rem;
  border-radius: .65rem;
  display: flex; align-items: center; justify-content: center;
}

/* Flash */
.flash {
  padding: .75rem 1rem;
  border-radius: .5rem;
  font-size: .875rem;
  border: 1px solid;
}
.flash-success { background: rgb(220 252 231); color: rgb(22 101 52); border-color: rgb(187 247 208); }
.flash-error   { background: rgb(254 226 226); color: rgb(153 27 27); border-color: rgb(252 165 165); }
.flash-info    { background: rgb(219 234 254); color: rgb(30 64 175); border-color: rgb(191 219 254); }
.flash-warning { background: rgb(254 249 195); color: rgb(133 77 14); border-color: rgb(253 224 71); }

/* Calendar */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: rgb(226 232 240); border: 1px solid rgb(226 232 240); border-radius: .5rem; overflow: hidden; }
.cal-day-head { background: rgb(248 250 252); padding: .5rem; font-size: .75rem; font-weight: 600; text-align: center; color: rgb(71 85 105); }
.cal-day { background: white; min-height: 6rem; padding: .35rem; }
.cal-day.is-other-month { background: rgb(248 250 252 / .5); color: rgb(148 163 184); }
.cal-day.is-today { background: rgb(255 245 245); }
.cal-day-num { font-size: .75rem; font-weight: 600; color: rgb(71 85 105); }
.cal-event { display: block; font-size: .7rem; padding: .15rem .35rem; border-radius: .25rem; margin-top: .25rem; background: rgb(255 229 229); color: rgb(191 0 0); cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-event.tipo-PRIMO_SOCCORSO { background: rgb(219 234 254); color: rgb(30 64 175); }
.cal-event.tipo-BLSD { background: rgb(243 232 255); color: rgb(91 33 182); }
.cal-event.tipo-CARRELLI, .cal-event.tipo-PLE { background: rgb(255 237 213); color: rgb(154 52 18); }
.cal-event.tipo-RLS, .cal-event.tipo-RSPP, .cal-event.tipo-PREPOSTO, .cal-event.tipo-DIRIGENTE { background: rgb(220 252 231); color: rgb(22 101 52); }

/* Login */
.login-box {
  width: 100%;
  max-width: 28rem;
  background: white;
  border-radius: 1rem;
  box-shadow: 0 10px 40px rgb(0 0 0 / .08);
  padding: 2.5rem;
}
