:root {
  --brand: #4a6476;          /* grigio-blu del logo Svicom */
  --brand-dark: #34495a;
  --nav-hover: #eef1f4;
}

/* ---------- Header ---------- */
.app-navbar {
  background: #fff;
  box-shadow: 0 1px 0 rgba(0,0,0,.06), 0 2px 8px rgba(0,0,0,.04);
  min-height: 64px;
  padding-top: 0;
  padding-bottom: 0;
}
.brand-logo { height: 40px; width: auto; display: block; }
.brand-text { color: var(--brand); }
.brand-sep { width: 1px; height: 32px; background: #d6dbe0; margin: 0 16px; }
.brand-product { color: var(--brand); gap: 8px; }
.brand-icon { width: 22px; height: 22px; flex: none; }
.brand-lines { display: flex; flex-direction: column; line-height: 1.15; }
.brand-lines span {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.app-nav .nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: .5rem .85rem !important;
  border-radius: 8px;
  color: #3b4650;
  font-weight: 500;
  transition: background-color .15s ease, color .15s ease;
}
.app-nav .nav-link:hover,
.app-nav .nav-link:focus-visible { background: var(--nav-hover); color: var(--brand-dark); }
.app-nav .nav-link.active { background: var(--nav-hover); color: var(--brand-dark); font-weight: 600; }
.nav-icon { width: 17px; height: 17px; flex: none; }
@media (min-width: 992px) {
  .app-navbar .navbar-nav { align-self: stretch; }
  .app-nav .nav-item { display: flex; align-items: center; }
  /* indicatore sotto la voce attiva, appoggiato al bordo dell'header */
  .app-nav .nav-link.active::after {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: -12px;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: var(--brand-dark);
  }
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: .78rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.user-name { font-size: .9rem; color: #2f3a43; }
.role-pill {
  font-size: .72rem;
  padding: .15rem .5rem;
  border-radius: 6px;
  background: #eef1f4;
  color: #5c6873;
  border: 1px solid #e1e6ea;
}
.app-navbar .btn-danger .nav-icon { width: 15px; height: 15px; }
@media (max-width: 991.98px) {
  .app-nav { padding-top: .5rem; }
  .app-nav .nav-link { width: 100%; }
}
.group-row td {
  background: #f1f3f5 !important;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #5c636a;
  font-weight: 600;
}
.row-disabled td { opacity: .6; }
.group-count {
  display: inline-block;
  min-width: 1.4rem;
  margin-left: .35rem;
  padding: 0 .35rem;
  border-radius: 999px;
  background: #dfe3e7;
  color: #4b5560;
  font-size: .7rem;
  text-align: center;
  letter-spacing: 0;
}
.view-switch .btn { min-width: 7.5rem; }
/* striscia ultimi esiti */
.run-strip { display: inline-flex; gap: 3px; align-items: center; }
.rs { display: inline-block; width: 11px; height: 20px; border-radius: 3px; background: #ced4da; }
a.rs { transition: transform .1s ease; }
a.rs:hover, a.rs:focus-visible { transform: scaleY(1.2); outline: none; }
.rs-empty { background: #f1f3f5; border: 1px dashed #dee2e6; }
.rs-success { background: #2f9e44; }
.rs-warning { background: #f0b400; }
.rs-failed, .rs-lost { background: #d6336c; }
.rs-lost { background-image: repeating-linear-gradient(45deg, transparent 0 3px, rgba(255,255,255,.45) 3px 5px); }
.rs-running { background: #4dabf7; animation: rs-pulse 1.4s ease-in-out infinite; }
@keyframes rs-pulse { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .rs-running { animation: none; } }
.th-link { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.th-link:hover, .th-link.active { color: var(--brand-dark); }
.th-link .th-icon { width: 13px; height: 13px; opacity: .35; }
.th-link:hover .th-icon, .th-link.active .th-icon { opacity: 1; }
.job-desc { max-width: 28rem; }
.stat-card { border-width: 0 0 0 4px; border-style: solid; }
.run-log {
  max-height: 70vh;
  overflow: auto;
  padding: 1rem;
  font-size: .8rem;
  line-height: 1.45;
  background: #1e1f22;
  color: #d4d4d4;
  white-space: pre-wrap;
  word-break: break-word;
  border-radius: 0 0 var(--bs-card-inner-border-radius) var(--bs-card-inner-border-radius);
}
.run-log .log-error { color: #ff8a80; font-weight: 600; }
.run-log .log-warn { color: #ffd54f; }
.run-log .log-ok { color: #a5d6a7; }
.audit-details { white-space: pre-wrap; word-break: break-all; font-size: .75rem; }
