:root {
  color-scheme: light;
  --bg: #f8fafc;
  --panel: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --accent: #2563eb;
  --accent-soft: #eff6ff;
  --border: #e2e8f0;
  --ring: #93c5fd;
  --ok: #16a34a;
  --warn: #d97706;
  --error: #dc2626;
  --radius: 0.5rem;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}

body.auth-locked {
  overflow: hidden;
}

.login-gate {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(180deg, #2f6eb8 0%, #2a63a8 100%);
}

.login-gate[hidden] {
  display: none !important;
}

.login-gate-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  width: min(100%, 460px);
}

.login-gate-card {
  width: 100%;
  padding: 32px 34px 28px;
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
}

.login-gate-card img.logo {
  display: block;
  max-height: 40px;
  width: auto;
  margin: 0 auto 20px;
}

.login-gate-card h1 {
  margin: 0 0 6px;
  font-size: 1.65rem;
  text-align: center;
  color: #0f2f5f;
}

.login-gate-subtitle {
  margin: 0 0 18px;
  text-align: center;
  color: #5b6f8f;
  font-size: .98rem;
}

.login-gate-help {
  color: var(--muted);
  margin-bottom: 16px;
  text-align: center;
  font-size: .92rem;
}

.login-gate-message {
  min-height: 1.25rem;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: .92rem;
  text-align: center;
}

.login-gate-message.error {
  color: var(--error);
}

.login-gate-release {
  margin: 0;
  color: rgba(255, 255, 255, 0.92);
  font-size: .88rem;
  text-align: center;
  letter-spacing: 0.02em;
}

.login-gate-card .login-form {
  grid-template-columns: 1fr;
  min-width: 0;
  gap: 14px;
}

.login-gate-card .login-actions {
  margin-top: 4px;
}

.login-gate-card .login-actions button {
  width: 100%;
  padding: 12px 16px;
  font-size: 1rem;
}

/* Hub dashboard — login a 2 colonne */
.hub-login-gate {
  padding: 0;
  background: #f0f4f8;
  overflow-y: auto;
}

.hub-login-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  background: #fff;
  box-shadow: 0 0 40px rgba(15, 23, 42, 0.08);
}

.hub-login-container {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 0;
}

.hub-login-brand {
  background: linear-gradient(145deg, #1a202c 0%, #2d3748 100%);
  color: #fff;
  padding: 48px 40px;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.hub-login-brand::before {
  content: "";
  position: absolute;
  top: -40%;
  right: -30%;
  width: 80%;
  height: 80%;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.12) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.hub-login-brand-content {
  position: relative;
  z-index: 1;
  width: 100%;
}

.hub-login-logo-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 40px;
}

.hub-login-logo-img {
  max-height: 44px;
  width: auto;
  filter: brightness(0) invert(1);
  opacity: 0.95;
}

.hub-login-logo-title {
  display: block;
  font-size: 1.65rem;
  font-weight: 700;
  line-height: 1.2;
}

.hub-login-highlight {
  color: #60a5fa;
}

.hub-login-logo-sub {
  display: block;
  font-size: 0.88rem;
  color: #a0aec0;
  margin-top: 2px;
}

.hub-login-illustration {
  text-align: center;
  margin: 12px 0 28px;
}

.hub-login-shield {
  display: block;
  font-size: 4rem;
  margin-bottom: 12px;
  animation: hub-login-float 3s ease-in-out infinite;
}

@keyframes hub-login-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.hub-login-illustration h2 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 600;
}

.hub-login-illustration p {
  margin: 6px 0 0;
  color: #a0aec0;
  font-size: 0.95rem;
}

.hub-login-features {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.88rem;
  color: #cbd5e0;
}

.hub-login-form-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 36px;
  background: #fff;
}

.hub-login-card {
  width: 100%;
  max-width: 400px;
  padding: 0;
  box-shadow: none;
  background: transparent;
}

.hub-login-card-header h1 {
  margin: 0 0 4px;
  font-size: 1.45rem;
  color: #1a202c;
}

.hub-login-card-sub {
  margin: 0 0 20px;
  color: #718096;
  font-size: 0.88rem;
}

.hub-login-alert {
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 0.88rem;
  margin-bottom: 14px;
  line-height: 1.45;
}

.hub-login-alert--error {
  background: #fff5f5;
  border: 1px solid #feb2b2;
  color: #c53030;
}

.hub-login-alert--success {
  background: #f0fff4;
  border: 1px solid #9ae6b4;
  color: #276749;
}

.hub-login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hub-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hub-form-group label {
  font-size: 0.88rem;
  font-weight: 600;
  color: #2d3748;
}

.hub-form-group input {
  padding: 12px 14px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.95rem;
  background: #f7fafc;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.hub-form-group input:focus {
  outline: none;
  border-color: #2563eb;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.hub-password-wrapper {
  position: relative;
}

.hub-password-wrapper input {
  width: 100%;
  padding-right: 44px;
}

.hub-password-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
}

.hub-form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.88rem;
}

.hub-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #4a5568;
  cursor: pointer;
}

.hub-checkbox input {
  width: 16px;
  height: 16px;
  accent-color: #2563eb;
}

.hub-forgot-link {
  background: none;
  border: none;
  padding: 4px 0;
  color: #2563eb;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.hub-forgot-link:hover {
  color: #1a56db;
  border-bottom-color: #1a56db;
}

.hub-btn-login {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 16px;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}

.hub-btn-login:hover:not(:disabled) {
  background: #1a56db;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
}

.hub-btn-login:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.hub-btn-login-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: hub-login-spin 0.75s linear infinite;
}

@keyframes hub-login-spin {
  to { transform: rotate(360deg); }
}

.hub-login-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 20px 0 14px;
  color: #a0aec0;
  font-size: 0.82rem;
}

.hub-login-divider::before,
.hub-login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}

.hub-client-section {
  text-align: center;
}

.hub-client-text {
  margin: 0;
  font-size: 0.88rem;
  color: #4a5568;
}

.hub-client-link {
  color: #2563eb;
  font-weight: 600;
  text-decoration: none;
}

.hub-client-link:hover {
  text-decoration: underline;
}

.hub-support-info {
  text-align: center;
  margin: 14px 0 0;
  font-size: 0.82rem;
  color: #a0aec0;
}

.hub-support-info a {
  color: #2563eb;
  text-decoration: none;
  font-weight: 500;
}

.hub-support-info a:hover {
  text-decoration: underline;
}

.hub-login-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 12px;
  padding: 14px 20px;
  background: #f7fafc;
  border-top: 1px solid #e2e8f0;
  font-size: 0.82rem;
  color: #718096;
}

.hub-login-footer-divider {
  color: #cbd5e0;
}

.hub-recover-dialog {
  border: none;
  border-radius: 16px;
  padding: 0;
  max-width: 440px;
  width: calc(100% - 32px);
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.2);
}

.hub-recover-dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
}

.hub-recover-dialog-card {
  padding: 24px 26px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hub-recover-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.hub-recover-dialog-header h2 {
  margin: 0;
  font-size: 1.1rem;
}

.hub-recover-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: #a0aec0;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}

.hub-recover-close:hover {
  background: #f7fafc;
  color: #4a5568;
}

.hub-recover-dialog-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.hub-recover-dialog-actions .btn-primary {
  flex: 2;
}

.hub-recover-dialog-actions .secondary-button {
  flex: 1;
}

@media (max-width: 900px) {
  .hub-login-container {
    grid-template-columns: 1fr;
  }

  .hub-login-brand {
    padding: 28px 24px;
    min-height: auto;
  }

  .hub-login-illustration {
    display: none;
  }

  .hub-login-logo-row {
    margin-bottom: 16px;
  }

  .hub-login-features {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px 16px;
    padding-top: 16px;
  }

  .hub-login-form-wrapper {
    padding: 28px 20px 32px;
  }
}

@media (max-width: 480px) {
  .hub-form-options {
    flex-direction: column;
    align-items: flex-start;
  }

  .hub-login-footer-divider {
    display: none;
  }
}

.header-user-role {
  display: block;
  margin-top: 2px;
  opacity: .85;
}

.header-user-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
}

.header-settings-link {
  height: auto;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #fff;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.header-settings-link:hover {
  filter: none;
  opacity: 0.9;
}

.header-logout {
  margin-left: 8px;
}

.app-shell {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  min-height: 100vh;
  position: relative;
}

.hub-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(15, 35, 70, 0.45);
}

.side-menu {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  width: 260px;
  height: 100vh;
  padding: 18px 14px;
  background: #142f5f;
  color: #fff;
  transition: width 0.3s ease, padding 0.3s ease;
  flex-shrink: 0;
  overflow: hidden;
  z-index: 160;
}

.side-menu-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 20px;
}

.side-brand {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
  flex: 1;
}

.side-brand-text {
  min-width: 0;
  transition: opacity 0.2s ease;
}

.brand-mark {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, .14);
  font-weight: 800;
  flex-shrink: 0;
}

.side-brand strong,
.side-brand small {
  display: block;
}

.side-brand small {
  margin-top: 2px;
  opacity: .72;
}

.sidebar-toggle {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 8px;
  background: rgba(255, 255, 255, .08);
  color: #fff;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.sidebar-toggle:hover {
  background: rgba(255, 255, 255, .16);
  border-color: rgba(255, 255, 255, .35);
}

.sidebar-toggle-arrow {
  font-size: 0.85rem;
  line-height: 1;
  transition: transform 0.3s ease;
}

.app-shell.sidebar-collapsed .sidebar-toggle-arrow {
  transform: rotate(180deg);
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
  align-content: flex-start;
  justify-content: flex-start;
}

.side-nav .nav-item {
  height: 32px;
  min-height: 32px;
  margin: 0;
  flex-shrink: 0;
}

.side-menu-footer {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, .14);
  text-align: center;
}

.side-menu-version {
  font-size: 0.75rem;
  opacity: 0.72;
  white-space: nowrap;
}

.app-shell.sidebar-collapsed .side-menu {
  width: 72px;
  padding-left: 10px;
  padding-right: 10px;
}

.app-shell.sidebar-collapsed .side-brand-text,
.app-shell.sidebar-collapsed .nav-label,
.app-shell.sidebar-collapsed .side-menu-version {
  opacity: 0;
  width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.app-shell.sidebar-collapsed .side-menu-top {
  flex-direction: column;
  align-items: center;
}

.app-shell.sidebar-collapsed .side-brand {
  justify-content: center;
}

.app-shell.sidebar-collapsed .nav-item {
  justify-content: center;
  padding: 0;
  width: 44px;
  margin: 0 auto;
}

.app-shell.sidebar-collapsed .nav-icon {
  font-size: 1.15rem;
}

.sidebar-toggle-header {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 10px;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  flex-shrink: 0;
}

.sidebar-toggle-header:hover {
  background: rgba(255, 255, 255, .2);
}

.app-header-main {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-start;
  width: 100%;
  height: 32px;
  border-radius: 8px;
  padding: 0 12px;
  font-size: 0.875rem;
  background: transparent;
  color: rgba(255, 255, 255, .82);
  text-align: left;
  margin: 0;
}

.nav-icon {
  flex-shrink: 0;
  width: 1.25rem;
  text-align: center;
  font-size: 1rem;
  line-height: 1;
  opacity: .92;
}

.nav-label {
  flex: 1;
  min-width: 0;
  transition: opacity 0.2s ease;
}

.nav-item:hover,
.nav-item.active {
  filter: none;
  background: rgba(255, 255, 255, .14);
  color: #fff;
}

.app-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.app-content > main {
  flex: 1;
}

.app-footer {
  margin-top: auto;
  padding: 10px 36px 16px;
  border-top: 1px solid var(--border);
  background: var(--panel);
  color: var(--muted);
  font-size: .78rem;
  text-align: center;
}

.app-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  padding: 28px 36px;
  background: linear-gradient(135deg, #183d7a, #315fbd);
  color: #fff;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.notification-bell-wrap {
  position: relative;
}

.notification-bell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  cursor: pointer;
}

.notification-bell:hover {
  background: rgba(255, 255, 255, .22);
}

.notification-bell-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: #f59e0b;
  color: #1e293b;
  font-size: 11px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
}

.notification-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 1200;
  width: min(380px, 92vw);
  max-height: 420px;
  overflow: auto;
  padding: 12px;
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  box-shadow: 0 12px 40px rgba(15, 23, 42, .2);
  border: 1px solid var(--border);
}

.notification-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.notification-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.notification-item {
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  font-size: .92rem;
}

.notification-item.unread {
  background: #fffbeb;
  border-left: 3px solid #f59e0b;
}

.notification-item-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.notification-empty {
  color: var(--muted);
  font-size: .9rem;
  margin: 8px 0 0;
}

.notification-section-label {
  margin: 0 0 6px;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
}

.notification-history-block {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.notification-history-block summary {
  cursor: pointer;
  font-size: .85rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 8px;
}

.notification-history-list .notification-item {
  opacity: .88;
  font-size: .86rem;
}

.notification-history-list .notification-item.unread {
  background: transparent;
  border-left: none;
}

.eyebrow {
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 12px;
  opacity: .8;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: 30px;
}

h2 {
  margin-bottom: 10px;
  font-size: 18px;
}

.subtitle {
  margin-bottom: 0;
  opacity: .86;
}

main {
  padding: 24px 36px 40px;
}

.view-section {
  display: none !important;
}

.view-section.active {
  display: block !important;
}

.grid.view-section.active {
  display: grid !important;
}

.jobs-panel.view-section.active {
  display: flex !important;
  flex-direction: column;
  gap: 18px;
}

.jobs-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.85fr);
  gap: 16px;
  align-items: start;
}

.jobs-list-col,
.jobs-detail-col {
  min-width: 0;
}

.job-stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-bottom: 4px;
  padding: 12px 14px;
  border-radius: 10px;
  background: linear-gradient(180deg, #f0f7ff 0%, #f8fafc 100%);
  border: 1px solid var(--border);
}

.job-stat {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.job-stat--refresh {
  margin-left: auto;
  font-weight: 500;
  color: var(--muted);
}

.job-detail-panel {
  display: flex;
  flex-direction: column;
  min-height: 420px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 2px 10px rgba(15, 35, 70, 0.06);
  overflow: hidden;
}

.job-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
}

.job-detail-header h3 {
  margin: 0;
  font-size: 1rem;
}

.job-detail-summary {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: #fbfdff;
}

.job-detail-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
  margin: 0;
}

.job-detail-facts > div {
  min-width: 0;
}

.job-detail-facts dt {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.job-detail-facts dd {
  margin: 2px 0 0;
  font-size: 0.86rem;
}

.job-detail-exec {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.78rem !important;
}

.job-logs--scroll {
  flex: 1;
  overflow: auto;
  max-height: 360px;
  padding: 12px 16px;
}

.job-log-toolbar {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: #f8fafc;
}

.create-job-panel {
  margin-top: 4px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(180deg, #f5f8ff 0%, #fff 45%);
}

.create-job-panel-title {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.jobs-table--compact {
  min-width: 760px;
}

.jobs-table .col-job-exec {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.78rem;
  white-space: nowrap;
}

.job-row {
  cursor: pointer;
}

.job-row:hover td {
  background: #eef4ff;
}

.job-row--selected td {
  background: #dbeafe !important;
}

.job-row:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: -2px;
}

.job-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

.job-status-badge--success {
  background: #d4edda;
  color: #155724;
}

.job-status-badge--warning {
  background: #fff3cd;
  color: #856404;
}

.job-status-badge--danger {
  background: #f8d7da;
  color: #721c24;
}

.job-status-badge--info {
  background: #cce5ff;
  color: #004085;
}

.job-spinner {
  width: 0.75rem;
  height: 0.75rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: job-spin 0.8s linear infinite;
}

@keyframes job-spin {
  to { transform: rotate(360deg); }
}

.job-icon-btn {
  width: 2rem;
  height: 2rem;
}

.jobs-pagination {
  margin-top: 10px;
}

.jobs-pagination-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.jobs-page-btn {
  min-width: 2rem;
  height: 2rem;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.jobs-page-btn.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.jobs-page-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.jobs-page-ellipsis {
  color: var(--muted);
  padding: 0 4px;
}

.jobs-pagination-meta {
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--muted);
}

@media (max-width: 1100px) {
  .jobs-workspace {
    grid-template-columns: 1fr;
  }

  .job-detail-panel {
    min-height: 320px;
  }

  .job-stat--refresh,
  .jobs-pagination-meta {
    width: 100%;
    margin-left: 0;
  }

  .job-detail-facts {
    grid-template-columns: 1fr;
  }
}

/* Tabelle e pannelli dati sempre sopra i form collassabili */
.view-section > .table-wrap,
.view-section > .cert-panel,
.view-section > .jobs-recent-panel,
.view-section > .job-logs-panel,
.agents-layout > .agents-table-panel {
  flex-shrink: 0;
}

.view-section > .form-disclosure {
  order: 10;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 18px;
  margin-bottom: 22px;
}

.overview-card {
  min-height: 132px;
}

.overview-card-link {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .1s;
}

.overview-card-link:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 20px rgba(49, 95, 189, .12);
}

.overview-card-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.overview-card-link:active {
  transform: translateY(1px);
}

.overview-card strong {
  display: block;
  margin: 8px 0 4px;
  font-size: 34px;
  color: var(--accent);
}

.overview-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.overview-card small {
  color: var(--muted);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 12px 24px rgba(25, 45, 80, .08);
  padding: 20px;
}

.token-panel,
.panel-title,
.status-card,
.token-row,
.job-form,
.profile-form,
.agent-form {
  display: flex;
  align-items: center;
}

.token-panel {
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.jobs-panel {
  margin-bottom: 16px;
}

/* Form espandibili (freccia, chiusi di default) — Job, Agent, Profili, Certificati, … */
.form-disclosure {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fafcff;
  margin-bottom: 14px;
}

.form-disclosure[open] {
  padding-bottom: 4px;
}

.form-disclosure-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  user-select: none;
}

.form-disclosure-summary::-webkit-details-marker {
  display: none;
}

.form-disclosure-chevron {
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 8px solid var(--accent);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.form-disclosure[open] .form-disclosure-chevron {
  transform: rotate(180deg);
}

.form-disclosure-help {
  margin: 0 16px 12px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
}

.form-disclosure-body {
  margin: 0 12px 12px;
}

.form-disclosure .settings-card,
.form-disclosure .certificate-config-card,
.form-disclosure .job-form-card {
  margin: 0 12px 12px;
  border: none;
  background: transparent;
  padding: 0;
}

.agents-package-panel .form-disclosure {
  margin-top: 0;
}

.profile-panel .form-disclosure {
  margin-top: 16px;
}

.view-section[data-view="certificates"] > .form-disclosure:first-of-type {
  margin-top: 12px;
}

.dns-providers-panel .form-disclosure {
  margin-bottom: 16px;
  background: #fff;
}

.jobs-recent-panel {
  margin-top: 8px;
  min-width: 0;
  width: 100%;
}

.jobs-table-wrap {
  overflow-x: auto;
  max-width: 100%;
  margin: 0;
  padding: 0 2px 4px;
  -webkit-overflow-scrolling: touch;
}

.jobs-table {
  width: 100%;
  table-layout: fixed;
  min-width: 920px;
}

.jobs-table th,
.jobs-table td {
  white-space: normal;
  vertical-align: top;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.jobs-table .col-job-id {
  width: 76px;
  white-space: nowrap;
}

.jobs-table .col-job-id code {
  font-size: 12px;
}

.jobs-table .col-job-agent {
  width: 18%;
  min-width: 150px;
  line-height: 1.35;
}

.jobs-table .col-job-type {
  width: 12%;
  min-width: 108px;
  font-size: 12px;
}

.jobs-table .col-job-status {
  width: 92px;
  white-space: nowrap;
}

.jobs-table .col-job-date {
  width: 128px;
  white-space: nowrap;
  font-size: 12px;
  color: var(--muted);
}

.jobs-table .col-job-result {
  min-width: 180px;
  max-width: 320px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text);
}

.jobs-table .col-job-actions {
  width: 168px;
  min-width: 168px;
  white-space: nowrap;
  position: sticky;
  right: 0;
  background: var(--panel);
  box-shadow: -8px 0 12px rgba(15, 23, 42, .06);
  z-index: 1;
}

.jobs-table thead .col-job-actions {
  z-index: 2;
}

.jobs-table tbody tr:nth-child(even) .col-job-actions {
  background: #fbfdff;
}

.jobs-table tbody tr:hover .col-job-actions {
  background: #f5f9ff;
}

.panel-title--actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.panel-title-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.jobs-last-refresh {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.jobs-refresh-hint {
  margin: 4px 0 0;
  font-size: 12px;
}

.profile-panel {
  margin-bottom: 22px;
}

.token-panel p {
  margin-bottom: 0;
  color: var(--muted);
}

.login-panel {
  flex-wrap: wrap;
  align-items: flex-start;
}

.login-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  min-width: min(100%, 520px);
}

.login-form label,
.user-form-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: .9rem;
}

.login-actions,
.user-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.token-advanced {
  width: 100%;
  margin-top: 8px;
  color: var(--muted);
}

.token-advanced summary {
  cursor: pointer;
  margin-bottom: 8px;
}

.user-form-panel {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.user-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.token-row {
  gap: 10px;
  min-width: 420px;
}

.job-form,
.profile-form,
.agent-form,
.certificate-form {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 12px;
  width: 100%;
}

.job-form label,
.profile-form label,
.agent-form label,
.certificate-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.agent-form label[hidden] {
  display: none !important;
}

.job-form .checkbox-label,
.certificate-form .checkbox-label {
  align-content: end;
  grid-template-columns: auto 1fr;
  min-height: 40px;
}

.job-form .checkbox-label input,
.certificate-form .checkbox-label input {
  width: auto;
  height: auto;
}

.job-form button,
.agent-form button,
.certificate-form button {
  align-self: end;
}

.profile-form {
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  margin-top: 16px;
}

.agent-form {
  grid-template-columns: repeat(3, minmax(180px, 1fr));
}

.certificate-form {
  grid-template-columns: repeat(5, minmax(160px, 1fr));
  margin-bottom: 18px;
}

/* Form certificati — layout a sezioni */
.certificate-config-card {
  margin-bottom: 24px;
  padding: 20px 22px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(180deg, #fafcff 0%, #fff 48%);
}

.form-block-title {
  margin: 0 0 6px;
  font-size: 1.15rem;
  color: var(--text);
}

.form-block-hint {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.form-inline-hint {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.45;
}

.form-inline-hint.warn {
  background: #fff8eb;
  border: 1px solid #f5d9a8;
  color: #7a4d00;
}

[data-view="certificates"] .certificate-form {
  display: none;
}

.form-block {
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.form-block:last-of-type {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}

.form-block-subtitle {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
}

.form-grid {
  display: grid;
  gap: 14px 16px;
  align-items: start;
}

.form-grid--1 {
  grid-template-columns: 1fr;
}

.form-grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-field-span-2 {
  grid-column: span 2;
}

.form-field-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.form-field {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.certificate-config-card label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.cert-type-segmented {
  display: flex;
  gap: 0;
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 9px;
  overflow: hidden;
  background: #fff;
}

.cert-type-segment {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  border-right: 1px solid var(--border);
}

.cert-type-segment:last-child {
  border-right: none;
}

.cert-type-segment:has(input:checked) {
  background: var(--accent-soft);
  color: var(--accent);
}

.cert-type-segment input {
  width: auto;
  height: auto;
  margin: 0;
}

.form-conditional-panel {
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px dashed var(--border);
  background: #f8fafc;
}

.form-conditional-panel label {
  margin: 0;
}

.form-field-checkbox {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  align-self: end;
}

.form-field-checkbox span {
  font-weight: 600;
  color: var(--text);
}

.form-actions-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.form-actions-bar button {
  min-width: 200px;
}

.form-actions-message {
  flex: 1;
  min-width: 200px;
  margin: 0;
}

.form-list-heading {
  margin: 8px 0 12px;
  font-size: 1rem;
  font-weight: 700;
}

.cert-panel {
  margin: 20px 0;
  padding: 18px 20px 20px;
  border-radius: 14px;
  border: 2px solid var(--border);
  background: #fff;
  box-shadow: 0 2px 10px rgba(15, 35, 70, 0.06);
}

.cert-panel--issued {
  border-color: #b8e0c4;
  background: linear-gradient(180deg, #f6fff8 0%, #fff 40%);
}

.cert-panel--saved {
  border-color: #c5d4f7;
  background: linear-gradient(180deg, #f5f8ff 0%, #fff 40%);
}

.cert-panel--clients {
  border-color: #e8d4a8;
  background: linear-gradient(180deg, #fffbf3 0%, #fff 45%);
}

.cert-panel-header {
  margin-bottom: 14px;
}

.cert-panel-title {
  margin: 0 0 6px;
  font-size: 1.05rem;
  font-weight: 700;
}

.cert-clients-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.cert-client-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  background: #fff;
}

.cert-client-card h4 {
  margin: 0 0 8px;
  font-size: 15px;
}

.cert-client-card .cert-client-id {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}

.cert-client-card ul {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
}

.col-client strong {
  display: block;
  font-size: 13px;
}

.col-client small {
  color: var(--muted);
  font-size: 11px;
}

.renew-modal-panel {
  width: min(720px, 94vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
}

.renew-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.renew-modal-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.renew-modal-client {
  padding: 10px 14px;
  margin-bottom: 12px;
  border-radius: 10px;
  background: #fff8e8;
  border: 1px solid #f0d090;
  font-size: 14px;
}

.renew-modal-status {
  margin-bottom: 10px;
}

.renew-modal-body {
  flex: 1;
  overflow: auto;
  max-height: 50vh;
  padding: 4px 2px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

textarea {
  width: 100%;
  min-height: 72px;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 8px 12px;
  font: inherit;
  resize: vertical;
  background: #fff;
}

.certificates-table-wrap {
  margin: 0 -4px;
  padding: 0 4px 4px;
}

.certificates-table {
  min-width: 960px;
}

.certificates-table th,
.certificates-table td {
  vertical-align: middle;
}

.certificates-table .col-actions {
  position: sticky;
  right: 0;
  min-width: 150px;
  background: var(--panel);
  box-shadow: -8px 0 12px rgba(15, 23, 42, .06);
  z-index: 1;
}

.certificates-table thead .col-actions {
  z-index: 2;
}

.certificates-table tbody tr:nth-child(even) .col-actions {
  background: #fbfdff;
}

.certificates-table .col-path {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  color: var(--muted);
}

.certificates-table .col-agent {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1100px) {
  .form-grid--3,
  .form-grid--2 {
    grid-template-columns: 1fr;
  }

  .form-field-span-2 {
    grid-column: span 1;
  }

  .col-hide-narrow {
    display: none;
  }

  .certificates-table {
    min-width: 720px;
  }
}

.profile-form button {
  align-self: end;
}

.section-help {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}

input:not([type="checkbox"]):not([type="radio"]),
select {
  width: 100%;
  height: 2.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 0.75rem;
  font: inherit;
  background: #fff;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}

textarea {
  width: 100%;
  min-height: 5rem;
  height: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.625rem 0.75rem;
  font: inherit;
  background: #fff;
  color: var(--text);
  resize: vertical;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

input:not([type="checkbox"]):not([type="radio"]):focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

input[type="checkbox"],
input[type="radio"] {
  width: 1rem;
  height: 1rem;
  margin: 0;
  padding: 0;
  flex-shrink: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

select {
  min-width: 190px;
}

button {
  height: 40px;
  border: 0;
  border-radius: 9px;
  padding: 0 18px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 600;
}

button:hover {
  filter: brightness(1.08);
}

.small-button {
  height: 30px;
  padding: 0 12px;
  font-size: 12px;
}

.secondary-button {
  background: #64748b;
}

.danger-button {
  background: var(--error);
}

.actions-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: flex-start;
  min-width: 280px;
}

.compact-actions {
  min-width: 160px;
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(360px, .75fr);
  gap: 22px;
  margin-bottom: 22px;
}

/* Pagina Agent: tabella a tutta larghezza, form pacchetto sotto */
.agents-layout {
  grid-template-columns: 1fr;
}

.agents-table-panel {
  min-width: 0;
}

.agents-table-wrap {
  overflow-x: auto;
  margin: 0 -4px;
  padding: 0 4px 4px;
}

.agents-table {
  min-width: 1100px;
}

.agents-table th,
.agents-table td {
  white-space: normal;
  vertical-align: top;
}

.agents-table .col-agent-id {
  min-width: 120px;
  max-width: 180px;
  word-break: break-word;
}

.agents-table .col-cliente {
  min-width: 150px;
  max-width: 220px;
}

.agent-client-name {
  display: block;
  font-weight: 600;
  line-height: 1.35;
}

.agent-client-id {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.3;
}

.agents-table .col-host,
.agents-table .col-macchina {
  min-width: 100px;
  max-width: 140px;
}

.agents-table .col-ip {
  min-width: 110px;
  font-size: 13px;
}

.agents-table .col-stato {
  min-width: 140px;
  max-width: 260px;
}

.agent-status-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}

.agent-status-note {
  display: block;
  font-size: 11px;
  line-height: 1.35;
  color: var(--error);
  word-break: break-word;
  overflow-wrap: anywhere;
  max-width: 240px;
}

.dashboard-alert-sublist {
  margin: 6px 0 0 18px;
  padding: 0;
  font-size: 13px;
  line-height: 1.45;
}

.dashboard-alert-sublist li {
  margin: 2px 0;
}

.agents-table .col-checkin {
  min-width: 72px;
}

.agents-table .col-release {
  min-width: 88px;
  max-width: 140px;
  font-size: 0.82rem;
  word-break: break-word;
}

.domain-field-hint {
  margin: -6px 0 12px;
  font-size: 0.82rem;
  line-height: 1.4;
}

.domain-field-hint-info {
  color: var(--muted, #64748b);
}

.domain-field-hint-error,
.domain-field-hint.domain-field-hint-error {
  color: #b91c1c;
  font-weight: 500;
}

input.domain-input-invalid {
  border-color: #dc2626;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.15);
}

.agents-table .col-next {
  min-width: 140px;
  max-width: 200px;
}

.agents-table .col-actions {
  min-width: 300px;
  position: sticky;
  right: 0;
  background: var(--panel);
  box-shadow: -8px 0 12px rgba(15, 23, 42, .06);
  z-index: 1;
}

.agents-table thead .col-actions {
  z-index: 2;
}

.agents-table tbody tr:nth-child(even) .col-actions {
  background: #fbfdff;
}

.agents-table tbody tr:hover .col-actions {
  background: #f5f9ff;
}

.agents-table .actions-cell .small-button {
  white-space: nowrap;
  font-size: 12px;
  padding: 0 10px;
  height: 32px;
}

.agents-layout .agent-form {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.panel-title {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.badge {
  min-width: 32px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 5px 10px;
  text-align: center;
  font-weight: 700;
}

.badge.connector-badge {
  display: inline-block;
  margin-left: 6px;
  font-size: 0.72rem;
  min-width: auto;
  vertical-align: middle;
}

.table-wrap {
  overflow-x: auto;
}

.table-toolbar {
  display: flex;
  justify-content: flex-end;
  margin: 8px 0 12px;
}

.table-toolbar label {
  display: grid;
  gap: 6px;
  min-width: 180px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--border);
  padding: 9px 10px;
  text-align: left;
  white-space: nowrap;
}

tbody tr:nth-child(even) {
  background: #fbfdff;
}

tbody tr:hover {
  background: #f5f9ff;
}

th {
  color: var(--muted);
  font-size: 13px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-width: 78px;
  justify-content: center;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 800;
}

.status-online {
  background: #e8f8ef;
  color: var(--ok);
}

.status-offline {
  background: #fdecea;
  color: var(--error);
}

.status-provisioned {
  background: #fff4df;
  color: var(--warn);
}

.status-suspended {
  background: #f1f5f9;
  color: #475569;
}

.status-machinechange {
  background: #fff1f2;
  color: #be123c;
}

.tenant-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.status-unknown {
  background: var(--accent-soft);
  color: var(--accent);
}

.status-card {
  min-width: 220px;
  gap: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .14);
  padding: 12px 16px;
}

.status-card small {
  display: block;
  margin-top: 3px;
  opacity: .82;
}

.status-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--warn);
  box-shadow: 0 0 0 5px rgba(255, 255, 255, .14);
}

.status-ok {
  background: var(--ok);
}

.status-warn {
  background: var(--warn);
}

.status-error {
  background: var(--error);
}

.col-cert-status {
  width: 28px;
  padding-left: 10px;
  padding-right: 4px;
  text-align: center;
}

.certificates-table .col-cert-status .status-dot {
  display: inline-block;
  vertical-align: middle;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.roles-list {
  display: grid;
  gap: 12px;
}

.roles-quick-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #f8fafc;
  position: sticky;
  top: 0;
  z-index: 2;
}

.roles-quick-nav-link {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
}

.roles-quick-nav-link:hover {
  background: var(--accent);
  color: #fff;
}

.role-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  background: #fbfdff;
}

.role-card strong {
  display: block;
  margin-bottom: 5px;
  color: var(--accent);
}

.role-card p {
  margin-bottom: 10px;
  color: var(--muted);
}

.role-users-block {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.role-users-title {
  margin: 0 0 10px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.role-users-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: grid;
  gap: 8px;
}

.role-user-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #f8fafc;
}

.role-user-avatar {
  display: inline-grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.role-user-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.role-user-name {
  font-size: 0.9rem;
  color: var(--text);
}

.role-user-email {
  font-size: 0.8rem;
  color: var(--muted);
}

.role-user-empty {
  padding: 10px 12px;
  color: var(--muted);
  font-size: 0.875rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.role-users-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.role-user-row .danger-button {
  margin-left: auto;
  flex-shrink: 0;
}

.tenant-form-card h3 {
  margin: 0 0 12px;
  font-size: 1.05rem;
}

.permission-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.permission-list span,
.endpoint-list code {
  border-radius: 999px;
  background: var(--accent-soft);
  color: #244b94;
  padding: 5px 8px;
  font-size: 12px;
}

.endpoint-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.job-message {
  flex-basis: 100%;
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--muted);
}

.job-message:empty {
  display: none;
}

.job-message.error {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  font-weight: 500;
}

.job-message.error::before {
  content: "!";
  display: inline-grid;
  place-items: center;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 999px;
  background: var(--error);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.job-message:not(.error):not(:empty) {
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.job-logs {
  display: grid;
  gap: 12px;
}

.job-log-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  background: #fbfdff;
}

.job-log-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.job-log-head strong {
  color: var(--accent);
}

.job-log-card p {
  margin-bottom: 8px;
}

pre {
  overflow-x: auto;
  border-radius: 10px;
  background: #f1f5fb;
  padding: 10px;
  margin: 0;
  font-size: 12px;
}

.dns-box {
  display: grid;
  gap: 6px;
  border-radius: 10px;
  background: #fff7e6;
  border: 1px solid #ffd899;
  margin: 10px 0;
  padding: 10px;
}

.dns-box-prominent {
  background: #e8f5e9;
  border: 2px solid #2e7d32;
  padding: 14px;
  margin-bottom: 16px;
}

.dns-box-prominent .dns-txt-value {
  font-size: 14px;
  font-weight: 600;
  color: #1b5e20;
  background: #fff;
  padding: 8px;
  border-radius: 6px;
}

.dns-resolvers {
  margin: 10px 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid var(--border);
}

.dns-resolvers ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.dns-resolvers li {
  margin-bottom: 4px;
}

.resolver-ok {
  color: var(--ok);
}

.resolver-warn {
  color: var(--warn);
}

.dns-box code {
  display: block;
  word-break: break-all;
}

.empty,
.error {
  color: var(--muted);
}

.error {
  color: var(--error);
}

/* Wizard operativi (accessibili da azioni rapide dashboard) */
body.expert-mode .operations-hub {
  display: none;
}

.operations-hub h2 {
  margin-top: 0;
}

.operation-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.operation-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-height: 110px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(180deg, #fff, #f8fbff);
  text-align: left;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}

.operation-card:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(49, 95, 189, .12);
}

.operation-card strong {
  font-size: 16px;
}

.operation-card span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.next-step-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.next-step-pill.tone-action {
  background: var(--accent-soft);
  color: var(--accent);
}

.next-step-pill.tone-ok {
  background: #e8f8ef;
  color: var(--ok);
}

.next-step-pill.tone-warn {
  background: #fff4e5;
  color: var(--warn);
}

.wizard-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, .55);
  cursor: default;
}

.wizard-overlay.open {
  display: flex;
}

.wizard-panel {
  width: min(720px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: var(--panel);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, .25);
  padding: 22px 24px;
}

.wizard-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.wizard-header h2 {
  margin: 0;
}

.wizard-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.wizard-close {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font-size: 26px;
  line-height: 1;
  font-weight: 700;
  cursor: pointer;
}

.wizard-close:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.wizard-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.wizard-footer-right {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-left: auto;
}

.wizard-cancel {
  font-weight: 600;
}

.password-field {
  display: flex;
  align-items: stretch;
  gap: 0;
}

.password-field input {
  flex: 1;
  min-width: 0;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.password-toggle {
  flex-shrink: 0;
  width: 42px;
  border: 1px solid var(--border);
  border-left: none;
  border-radius: 0 8px 8px 0;
  background: var(--bg);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.password-toggle.visible {
  background: var(--accent-soft);
}

.cert-type-fieldset {
  margin: 12px 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.cert-type-fieldset legend {
  font-weight: 600;
  padding: 0 6px;
}

.cert-type-option {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 8px 0;
  font-weight: 500;
  cursor: pointer;
}

.wizard-progress {
  height: 8px;
  margin: 16px 0 10px;
  background: var(--bg);
  border-radius: 999px;
  overflow: hidden;
}

.wizard-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #5b8def);
  transition: width .25s;
}

.wizard-step-label {
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

.wizard-body {
  min-height: 120px;
}

.wizard-form {
  display: grid;
  gap: 12px;
}

.wizard-form label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
}

.wizard-form input,
.wizard-form select {
  font-weight: 400;
}

.wizard-help {
  margin-top: 0;
  color: var(--muted);
  line-height: 1.5;
}

.wizard-hint {
  font-size: 13px;
  color: var(--muted);
}

.wizard-hint.warn {
  color: var(--warn);
}

.wizard-status-box {
  padding: 14px;
  border-radius: 12px;
  margin: 12px 0;
  background: var(--bg);
}

.wizard-status-box.ok {
  border: 1px solid #b8e6cb;
  background: #f3fbf6;
}

.wizard-status-box.warn {
  border: 1px solid #f5d9a8;
  background: #fffaf0;
}

  .wizard-checklist {
  margin: 12px 0;
  padding-left: 20px;
  line-height: 1.7;
}

@media (max-width: 768px) {
  .sidebar-toggle-header {
    display: inline-flex;
  }

  .side-menu {
    position: fixed;
    left: 0;
    top: 0;
    width: 260px !important;
    height: 100vh;
    transform: translateX(0);
    transition: transform 0.3s ease;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.18);
  }

  .app-shell.sidebar-collapsed .side-menu {
    transform: translateX(-100%);
  }

  .app-shell:not(.sidebar-collapsed) .hub-sidebar-backdrop {
    display: block;
  }

  .side-nav {
    flex-direction: column;
  }

  .app-shell.sidebar-collapsed .side-brand-text,
  .app-shell.sidebar-collapsed .nav-label,
  .app-shell.sidebar-collapsed .side-menu-version {
    opacity: 1;
    width: auto;
    overflow: visible;
  }

  .app-shell.sidebar-collapsed .nav-item {
    width: 100%;
    justify-content: flex-start;
    padding: 0 12px;
  }
}

@media (max-width: 1100px) {
  .app-header,
  .token-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .token-row {
    min-width: 0;
  }

  .job-form {
    grid-template-columns: 1fr;
  }

  .agent-form,
  .certificate-form {
    grid-template-columns: 1fr;
  }

  .cert-type-segmented {
    flex-direction: column;
    min-height: auto;
  }

  .cert-type-segment {
    border-right: none;
    border-bottom: 1px solid var(--border);
    justify-content: flex-start;
    padding: 10px 12px;
  }

  .cert-type-segment:last-child {
    border-bottom: none;
  }

  .profile-form {
    grid-template-columns: 1fr;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .overview-grid {
    grid-template-columns: 1fr;
  }

  .operation-cards {
    grid-template-columns: 1fr;
  }
}

/* Modale conferma dashboard */
body.modal-open {
  overflow: hidden;
}

.app-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, .45);
}

.app-modal-overlay.open {
  display: flex;
}

.app-modal-panel {
  width: min(480px, 100%);
  max-height: 90vh;
  overflow: auto;
  padding: 22px 24px;
  border-radius: 14px;
  background: var(--panel);
  box-shadow: 0 24px 48px rgba(15, 23, 42, .18);
}

.app-modal-panel h2 {
  margin: 0 0 10px;
  font-size: 20px;
}

.app-modal-message {
  margin-bottom: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.app-modal-message p {
  margin: 0 0 8px;
}

.app-modal-body {
  margin-bottom: 12px;
}

.app-modal-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
}

.modal-form-grid {
  display: grid;
  gap: 12px;
}

.modal-form-grid input[type="text"],
.modal-form-grid input[type="email"],
.modal-form-grid input[type="number"] {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.app-modal-panel:has(.modal-form-grid) {
  width: min(520px, 100%);
}

.app-modal-panel:has(.modal-form-wide) {
  width: min(640px, 100%);
}

.tenant-users-mini-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  margin: 0.5rem 0;
}

.tenant-users-mini-table th,
.tenant-users-mini-table td {
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid var(--border, #2a3344);
  text-align: left;
}

.tenant-manage-section-title {
  margin: 1rem 0 0.5rem;
  font-size: 0.95rem;
  font-weight: 700;
  grid-column: 1 / -1;
}

.modal-form-wide {
  max-height: min(70vh, 520px);
  overflow-y: auto;
}

.modal-select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.app-modal-input-wrap {
  margin-bottom: 14px;
}

.app-modal-input-wrap label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--muted);
}

.app-modal-input-wrap input {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.app-modal-input-wrap input.invalid {
  border-color: var(--error);
}

.modal-expected {
  padding: 10px 12px;
  border-radius: 8px;
  background: #f8fafc;
  font-family: ui-monospace, monospace;
  word-break: break-word;
}

.app-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

.dashboard-alerts {
  margin-top: 18px;
  border-left: 4px solid var(--warn);
}

.dashboard-alerts h2 {
  margin: 0 0 10px;
  font-size: 18px;
  color: #b45309;
}

.dashboard-alerts-list {
  margin: 0;
  padding-left: 20px;
  line-height: 1.6;
}

.dashboard-alerts-list li {
  margin-bottom: 6px;
}

.alert-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}

.cert-type-fieldset {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  margin: 0;
}

.cert-type-fieldset legend {
  padding: 0 6px;
  font-size: 13px;
  color: var(--muted);
}

/* —— Design system (shadcn-inspired) —— */
.settings-card {
  margin-top: 0.75rem;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}

.ui-form-grid,
.tenant-form.ui-form-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1rem 1.25rem;
  width: 100%;
  align-items: end;
}

.ui-form-grid > label,
.ui-form-grid > .form-field,
.ui-form-grid > fieldset {
  grid-column: span 4;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin: 0;
  min-width: 0;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted);
}

.ui-form-grid > label > input,
.ui-form-grid > label > select,
.ui-form-grid > label > textarea {
  font-weight: 400;
  color: var(--text);
}

.ui-form-grid .span-2 { grid-column: span 2; }
.ui-form-grid .span-3 { grid-column: span 3; }
.ui-form-grid > label.span-3 { grid-column: span 3; }
.ui-form-grid .span-4 { grid-column: span 4; }
.ui-form-grid .span-6 { grid-column: span 6; }
.ui-form-grid .span-8 { grid-column: span 8; }
.ui-form-grid .span-12 { grid-column: span 12; }

.ui-form-grid > label.span-2,
.ui-form-grid > label.span-3,
.ui-form-grid > label.span-4,
.ui-form-grid > label.span-6,
.ui-form-grid > label.span-8,
.ui-form-grid > label.span-12 {
  display: flex;
}

.checkbox-label {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  min-height: unset;
  width: auto;
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"],
.checkbox-label input[type="radio"] {
  width: 1rem;
  height: 1rem;
}

.checkbox-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  align-self: end;
  padding-bottom: 0.25rem;
}

.form-actions-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.75rem;
  width: 100%;
}

.form-actions-bar .btn-primary,
.ui-form-grid > button,
.ui-form-grid .form-actions-bar > button {
  width: fit-content;
  min-width: 8rem;
  justify-self: start;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.ui-form-grid.job-form > label,
.ui-form-grid.profile-form > label,
.ui-form-grid.agent-form > label,
.ui-form-grid.dns-provider-form > label {
  grid-column: span 4;
}

.ui-form-grid.job-form,
.ui-form-grid.profile-form,
.ui-form-grid.agent-form,
.ui-form-grid.dns-provider-form {
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.job-form.ui-form-grid .checkbox-label,
.certificate-form .checkbox-label {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  min-height: unset;
  grid-template-columns: unset;
}

.job-form .checkbox-label input,
.certificate-form .checkbox-label input {
  width: 1rem;
  height: 1rem;
}

.ui-form-grid > p.section-help.span-12 {
  grid-column: span 12;
  margin: 0;
  align-self: center;
}

.form-actions-message {
  flex: 1 1 100%;
  max-width: 100%;
}

.panel {
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow-sm);
}

/* Provider DNS: i label figli entrano nella griglia 12 colonne */
.dns-provider-form .dns-provider-fields {
  display: contents;
}

.dns-provider-form .dns-provider-fields[hidden] {
  display: none !important;
}

/* Job: pannelli condizionali (no display:contents — rompe hidden) */
.job-form .job-conditional-panel {
  grid-column: span 12;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1rem 1.25rem;
  align-items: end;
  padding: 12px 14px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: #f8fafc;
}

.job-form .job-conditional-panel[hidden] {
  display: none !important;
}

.job-form .job-conditional-panel > label {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin: 0;
  min-width: 0;
}

.job-form textarea,
.job-form .job-post-challenge-shell {
  width: 100%;
  min-height: 5.5rem;
  height: auto;
  resize: vertical;
  line-height: 1.45;
  padding: 0.625rem 0.75rem;
  font-family: inherit;
  white-space: pre-wrap;
  word-break: break-word;
}

.job-form-card {
  margin-bottom: 1rem;
}

.dns-provider-form label[class*="span-"],
.dns-provider-form .dns-provider-fields label {
  display: flex;
  flex-direction: column;
}

.dns-provider-help {
  margin: 0;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  background: var(--accent-soft);
  border: 1px solid #bfdbfe;
  line-height: 1.5;
}

.dns-providers-panel .panel-title {
  margin-bottom: 0.75rem;
}

.dns-providers-panel .panel-title h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}

.ui-form-grid .form-actions-bar {
  grid-column: span 12;
  align-self: start;
  margin-top: 0.25rem;
}

.ui-form-grid .form-actions-bar button {
  width: fit-content;
  min-width: 7.5rem;
  height: 2.5rem;
}

.password-toggle {
  height: 2.5rem;
  min-height: 2.5rem;
  padding: 0;
}

@media (max-width: 900px) {
  .ui-form-grid > label,
  .ui-form-grid > label.span-2,
  .ui-form-grid > label.span-3,
  .ui-form-grid > label.span-4,
  .ui-form-grid > label.span-6,
  .ui-form-grid .span-2,
  .ui-form-grid .span-3,
  .ui-form-grid .span-4,
  .ui-form-grid .span-6,
  .dns-provider-form label.span-6 {
    grid-column: span 12;
  }
}

/* —— Nav icone, filtri tabella, certificati migliorati —— */
.table-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 14px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f4f7fb;
  border: 1px solid var(--border);
}

.table-filter-bar label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  margin: 0;
}

.table-filter-bar input[type="search"],
.table-filter-bar select {
  min-width: 11rem;
  height: 2.25rem;
  font-size: 0.875rem;
}

.table-filter-search input[type="search"] {
  min-width: 16rem;
}

.table-filter-meta {
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--muted);
  align-self: center;
}

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

.data-table--zebra tbody tr:nth-child(even) {
  background: #f8f9fa;
}

.data-table--zebra tbody tr:hover {
  background: #e9ecef;
  cursor: default;
}

.data-table .col-validity {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 0.78rem;
  text-align: left;
  white-space: normal;
  min-width: 12.5rem;
  line-height: 1.25;
}

.cert-validity-range {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cert-validity-line--to {
  color: var(--muted);
}

.data-table .text-right,
.data-table th.text-right,
.data-table td.text-right {
  text-align: right;
}

.table-foot-meta {
  font-size: 0.8rem;
  color: var(--muted);
  padding: 10px 12px !important;
  background: #f8f9fa;
  border-top: 1px solid var(--border);
}

.cert-section-divider {
  margin: 40px 0 0;
  border: 0;
  border-top: 2px solid var(--border);
}

.cert-panel--saved {
  margin-top: 40px;
}

.cert-panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cert-panel-icon {
  font-size: 1.15rem;
  line-height: 1;
}

.col-cert-identity strong {
  display: block;
  font-size: 0.9rem;
}

.col-cert-identity small {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  margin-top: 2px;
}

.cert-expiry-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.cert-expiry-badge--valid {
  background: #d4edda;
  color: #155724;
}

.cert-expiry-badge--expiring {
  background: #fff3cd;
  color: #856404;
}

.cert-expiry-badge--expired {
  background: #f8d7da;
  color: #721c24;
}

.cert-expiry-badge--not_issued {
  background: #e2e3e5;
  color: #383d41;
}

.auto-renew-badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

button.auto-renew-toggle {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  padding: 0.15rem 0.4rem;
  border-radius: 0.35rem;
  cursor: pointer;
  font: inherit;
  line-height: 1.3;
}

button.auto-renew-toggle:hover,
button.auto-renew-toggle:focus-visible {
  border-color: currentColor;
  outline: none;
  text-decoration: underline;
}

.auto-renew-badge--on {
  color: #155724;
}

.auto-renew-badge--off {
  color: #721c24;
}

.icon-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.icon-action-btn:hover {
  background: #e9ecef;
  border-color: #adb5bd;
}

.icon-action-btn.danger-button:hover {
  background: #f8d7da;
  border-color: #f5c6cb;
}

.actions-cell.icon-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-end;
}

@media (max-width: 900px) {
  .table-filter-meta {
    width: 100%;
    margin-left: 0;
  }

  .certificates-table .col-hide-narrow {
    display: none;
  }
}

/* —— Agent registrati: card grid —— */
.agent-stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 10px;
  background: linear-gradient(180deg, #f0f7ff 0%, #f8fafc 100%);
  border: 1px solid var(--border);
}

.agent-stat {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.agent-stat--refresh {
  margin-left: auto;
  font-weight: 500;
  color: var(--muted);
}

.table-filter-bar--agents .btn-primary {
  align-self: flex-end;
}

.agent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 16px;
  margin-top: 4px;
}

.agent-group-separator {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0 2px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.agent-group-separator::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.agent-card {
  background: #fff;
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: 0 2px 8px rgba(15, 35, 70, 0.06);
  border: 1px solid var(--border);
  border-left: 4px solid #94a3b8;
  transition: box-shadow 0.2s, transform 0.2s;
  overflow: visible;
  position: relative;
}

.agent-card--online {
  border-left-color: #28a745;
}

.agent-card--warn {
  border-left-color: #ffc107;
}

.agent-card--offline {
  border-left-color: #dc3545;
  opacity: 0.82;
}

.agent-card--suspended,
.agent-card--machine-change {
  border-left-color: #6c757d;
}

.agent-card:hover {
  box-shadow: 0 4px 16px rgba(15, 35, 70, 0.1);
  transform: translateY(-2px);
}

.agent-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.agent-card-identity {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.agent-card-id {
  font-size: 1rem;
  word-break: break-word;
}

.agent-card-connector {
  font-size: 0.7rem;
}

.agent-card-checkin {
  flex-shrink: 0;
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
}

.agent-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.agent-status-badge--online { color: #155724; }
.agent-status-badge--offline { color: #721c24; }
.agent-status-badge--warn { color: #856404; }
.agent-status-badge--suspended,
.agent-status-badge--machine-change { color: #495057; }

.agent-card-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.agent-card-dot--pulse-online {
  background: #28a745;
  animation: agent-pulse 2s infinite;
}

.agent-card-dot--offline {
  background: #dc3545;
}

.agent-card-dot--warn {
  background: #ffc107;
  animation: agent-pulse 2s infinite;
}

.agent-card-dot--idle {
  background: #adb5bd;
}

@keyframes agent-pulse {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.9); }
  100% { opacity: 1; transform: scale(1); }
}

.agent-card-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.agent-card-section--client .agent-client-name {
  display: block;
  font-size: 0.95rem;
}

.agent-card-hostname {
  display: block;
  margin-top: 2px;
  font-size: 0.82rem;
  color: var(--muted);
}

.agent-card-section--network,
.agent-card-section--meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.agent-card-meta-line {
  font-size: 0.82rem;
  color: var(--text);
}

.agent-card-step {
  font-size: 0.82rem;
}

.agent-card-diagnosis {
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff3cd;
  color: #856404;
  font-size: 0.78rem;
  line-height: 1.35;
}

.agent-card-diagnosis-title {
  margin: 0;
  font-weight: 700;
}

.agent-card-diagnosis-hint {
  margin: 4px 0 0;
  font-weight: 400;
  opacity: 0.95;
}

.agent-card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #e9ecef;
}

.agent-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 2.1rem;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  line-height: 1.2;
}

.agent-btn--suspend,
.agent-btn--resume {
  background: #ffc107;
  color: #212529;
  border-color: #e0a800;
}

.agent-btn--update {
  background: #17a2b8;
  color: #fff;
  border-color: #138496;
}

.agent-btn--primary {
  background: var(--accent);
  color: #fff;
}

.agent-btn--more {
  background: #f8f9fa;
  color: #212529;
  border-color: var(--border);
  min-width: 2.1rem;
  padding: 0 10px;
  list-style: none;
  gap: 6px;
}

.agent-more-icon {
  font-size: 1.1rem;
  line-height: 1;
}

.agent-more-label {
  font-size: 0.78rem;
  font-weight: 600;
}

.agent-more-menu {
  position: relative;
  margin-left: auto;
}

.agent-more-menu[open] {
  z-index: 40;
}

.agent-more-menu[open] .agent-card {
  z-index: 1;
}

.agent-more-menu > summary {
  list-style: none;
}

.agent-more-menu > summary::-webkit-details-marker {
  display: none;
}

.agent-dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 50;
  min-width: 260px;
  max-width: min(320px, 92vw);
  padding: 6px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(15, 35, 70, 0.12);
}

.agent-dropdown-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  text-align: left;
  font-size: 0.84rem;
  cursor: pointer;
  height: auto;
  min-height: 0;
}

.agent-dropdown-item-label {
  font-weight: 600;
  line-height: 1.25;
}

.agent-dropdown-item-desc {
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.35;
}

.agent-dropdown-item:hover {
  background: #f1f5f9;
}

.agent-dropdown-item--danger {
  color: #dc3545;
}

.agent-dropdown-item--danger .agent-dropdown-item-label {
  font-weight: 700;
}

.agent-dropdown-item--danger .agent-dropdown-item-desc {
  color: #a71d2a;
}

.agent-dropdown-sep {
  margin: 6px 0;
  border: 0;
  border-top: 1px solid var(--border);
}

.agent-grid > .empty,
.agent-grid > .error {
  grid-column: 1 / -1;
}

@media (max-width: 900px) {
  .agent-grid {
    grid-template-columns: 1fr;
  }

  .agent-stat--refresh {
    width: 100%;
    margin-left: 0;
  }

  .agent-card-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .agent-more-menu {
    margin-left: 0;
    width: 100%;
  }

  .agent-btn--more {
    width: 100%;
  }
}

/* —— Clienti e piani —— */
.tenants-section.view-section.active {
  display: flex !important;
  flex-direction: column;
  gap: 16px;
}

.tenant-stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 12px 14px;
  border-radius: 10px;
  background: linear-gradient(180deg, #f0f7ff 0%, #f8fafc 100%);
  border: 1px solid var(--border);
}

.tenant-stat {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.table-filter-bar--tenants .btn-primary {
  align-self: flex-end;
}

.badge--inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  height: 1.35rem;
  margin-left: 6px;
  padding: 0 5px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  vertical-align: middle;
  background: rgba(255, 255, 255, 0.25);
}

.tenants-workspace {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: stretch;
}

.tenants-list-col,
.tenants-detail-col {
  min-width: 0;
  width: 100%;
}

.tenants-table {
  min-width: 520px;
}

.tenant-row {
  cursor: pointer;
}

.tenant-row:hover td {
  background: #eef4ff;
}

.tenant-row--selected td {
  background: #dbeafe !important;
}

.tenant-row:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: -2px;
}

.col-tenant-contacts {
  max-width: 220px;
}

.tenant-users-count {
  display: block;
  font-weight: 600;
  font-size: 0.84rem;
}

.tenant-alert-email {
  display: block;
  margin-top: 2px;
  font-size: 0.78rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tenant-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

.tenant-status-badge--active {
  background: #d4edda;
  color: #155724;
}

.tenant-status-badge--waiting {
  background: #fff3cd;
  color: #856404;
}

.tenant-status-badge--operational {
  background: #cce5ff;
  color: #004085;
}

.tenant-status-badge--inactive {
  background: #e9ecef;
  color: #495057;
}

.tenant-detail-panel {
  display: flex;
  flex-direction: column;
  min-height: 200px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 2px 10px rgba(15, 35, 70, 0.06);
  overflow: hidden;
}

.tenant-detail-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
}

.tenant-detail-header h3 {
  margin: 0;
  font-size: 1.05rem;
}

.tenant-detail-subtitle {
  margin: 4px 0 0;
  font-size: 0.84rem;
  color: var(--muted);
}

.tenant-detail-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  flex: 1;
}

.tenant-detail-status h4 {
  margin: 0 0 8px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.client-status {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tenant-status-item {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
}

.tenant-status-item--active {
  background: #d4edda;
  color: #155724;
}

.tenant-status-item--waiting {
  background: #fff3cd;
  color: #856404;
}

.tenant-status-item--operational {
  background: #cce5ff;
  color: #004085;
}

.tenant-status-item--inactive {
  background: #e9ecef;
  color: #495057;
}

.tenant-status-item--warning {
  background: #fde8e8;
  color: #9b1c1c;
}

.tenant-next-hint {
  margin: 8px 0 0;
}

.client-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-radius: 10px;
  background: #fbfdff;
  border: 1px solid var(--border);
}

.client-info .info-row {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.client-info .label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.client-info .value {
  font-size: 0.88rem;
  word-break: break-word;
}

.client-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 4px;
}

/* —— Scheda cliente (pannello) —— */
.tenant-scheda {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.tenant-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.tenant-metric-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f8fafc;
  transition: box-shadow 0.2s, transform 0.2s;
}

.tenant-metric-card:hover {
  box-shadow: 0 4px 14px rgba(15, 35, 70, 0.08);
  transform: translateY(-1px);
}

.tenant-metric-icon {
  font-size: 1.6rem;
  line-height: 1;
}

.tenant-metric-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.tenant-metric-value {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}

.tenant-metric-label {
  font-size: 0.78rem;
  color: var(--muted);
}

.tenant-scheda-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.tenant-scheda-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.tenant-scheda-card {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fbfdff;
}

.tenant-scheda-card h4 {
  margin: 0 0 14px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
}

.tenant-scheda-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #4a5568;
}

.tenant-scheda-field input {
  width: 100%;
  padding: 9px 11px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 400;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.tenant-scheda-field input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.tenant-scheda-field input:disabled {
  background: #f1f5f9;
  color: #64748b;
  cursor: not-allowed;
}

.tenant-scheda-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.tenant-scheda-details {
  margin-top: 4px;
  border-top: 1px dashed var(--border);
  padding-top: 10px;
}

.tenant-scheda-details summary {
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 600;
  color: #2563eb;
  margin-bottom: 10px;
}

.tenant-scheda-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 0.84rem;
  font-weight: 600;
}

.tenant-limit-item {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #f0f4f8;
}

.tenant-limit-item:last-child {
  border-bottom: none;
}

.tenant-limit-label {
  font-size: 0.82rem;
  color: #4a5568;
}

.tenant-limit-progress {
  height: 6px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
}

.tenant-limit-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}

.tenant-limit-value,
.tenant-limit-used {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

.tenant-limit-max-input {
  width: 4.2rem;
  padding: 4px 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  text-align: right;
}

.tenant-info-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid #f0f4f8;
}

.tenant-info-row:last-child {
  border-bottom: none;
}

.tenant-info-label {
  font-size: 0.82rem;
  color: var(--muted);
}

.tenant-info-value {
  font-size: 0.84rem;
  font-weight: 600;
  text-align: right;
  word-break: break-word;
}

.tenant-client-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tenant-client-tag {
  padding: 5px 14px;
  border: 2px solid #e2e8f0;
  border-radius: 999px;
  background: #f7fafc;
  font-size: 0.8rem;
  font-weight: 600;
  color: #4a5568;
  cursor: pointer;
  transition: all 0.2s;
}

.tenant-client-tag:hover {
  background: #edf2f7;
  border-color: #cbd5e0;
}

.tenant-client-tag--active {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.tenant-scheda-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  padding-top: 14px;
  border-top: 2px solid #e2e8f0;
}

.tenant-scheda-users-actions {
  margin-bottom: 10px;
}

.tenant-scheda-users-empty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.tenant-scheda-modal-status {
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.app-modal-panel:has(.tenant-scheda-modal) {
  width: min(720px, 100%);
}

.tenants-settings-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #f4f7fb;
  border: 1px solid var(--border);
}

.tenants-system-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text);
}

.tenants-settings-divider {
  color: var(--muted);
}

.tenants-settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

@media (max-width: 1100px) {
  .tenant-scheda-body {
    grid-template-columns: 1fr;
  }

  .tenant-metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tenant-detail-panel {
    min-height: 200px;
  }

  .tenants-settings-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .tenants-settings-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 600px) {
  .tenant-metrics-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .tenant-metric-card {
    padding: 10px 12px;
  }

  .tenant-metric-value {
    font-size: 1rem;
  }

  .tenant-scheda-field-row {
    grid-template-columns: 1fr;
  }

  .tenant-scheda-actions {
    flex-direction: column;
  }

  .tenant-scheda-actions .small-button {
    width: 100%;
  }

  .tenant-limit-item {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .tenant-detail-body {
    padding: 14px;
  }
}

@media (max-width: 400px) {
  .tenant-metrics-grid {
    grid-template-columns: 1fr;
  }
}

/* —— Impostazioni di sistema (tab) —— */
.settings-section.view-section.active {
  display: flex !important;
  flex-direction: column;
  gap: 16px;
}

.sr-only,
.settings-message-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.settings-toast-host {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

.settings-toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 35, 70, 0.12);
  animation: settings-toast-in 0.25s ease;
}

.settings-toast.is-hiding {
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.settings-toast--success {
  border-color: #b7e4c7;
  background: #f0fff4;
}

.settings-toast--error {
  border-color: #f5c2c7;
  background: #fff5f5;
}

.settings-toast--info {
  border-color: #b6d4fe;
  background: #f0f7ff;
}

.settings-toast-text {
  flex: 1;
  font-size: 0.9rem;
}

.settings-toast-close {
  border: none;
  background: transparent;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
}

@keyframes settings-toast-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.settings-tabs-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.settings-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px;
  border-radius: 12px;
  background: #f4f7fb;
  border: 1px solid var(--border);
}

.settings-tab {
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 8px 14px;
  background: transparent;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.settings-tab:hover {
  background: #eef4ff;
}

.settings-tab.is-active {
  background: #fff;
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.settings-tabs-mobile {
  display: none;
}

.settings-tab-panels {
  min-width: 0;
}

.settings-tab-panel[hidden] {
  display: none !important;
}

.crm-poll-status {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f8fafc;
}

.crm-poll-status h4 {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
}

.crm-poll-status-pre {
  margin: 0.5rem 0 0;
  padding: 0.65rem 0.75rem;
  max-height: 220px;
  overflow: auto;
  font-size: 0.78rem;
  line-height: 1.35;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  white-space: pre-wrap;
}

.crm-preview-card {
  margin-top: 1.25rem;
}

.crm-preview-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  margin: 0.75rem 0 1rem;
}

.crm-preview-filter {
  margin: 0;
}

.crm-preview-summary {
  font-size: 0.88rem;
  color: var(--text-muted, #64748b);
}

.crm-preview-table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}

.crm-preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.crm-preview-table th,
.crm-preview-table td {
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

.crm-preview-table th {
  background: #f1f5f9;
  font-weight: 600;
  white-space: nowrap;
}

.crm-preview-col-check {
  width: 2.5rem;
}

.crm-preview-col-status {
  width: 2rem;
  text-align: center;
  padding-left: 0.35rem !important;
  padding-right: 0.35rem !important;
}

.crm-renew-dot {
  display: inline-block;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 999px;
  vertical-align: middle;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.12);
}

.crm-renew-dot--red {
  background: #ef4444;
}

.crm-renew-dot--green {
  background: #22c55e;
}

.crm-renew-dot--yellow {
  background: #eab308;
}

.crm-preview-empty {
  text-align: center;
  color: var(--text-muted, #64748b);
  padding: 1.25rem !important;
}

.crm-preview-actions {
  margin-top: 1rem;
}

.crm-toast-host {
  margin-bottom: 1rem;
}

.crm-feedback-message {
  margin-top: 0.75rem;
  min-height: 1.25rem;
}

.crm-feedback-message.error {
  color: var(--error, #dc2626);
}

.crm-preview-row--ready {
  background: #f0fdf4;
}

.crm-preview-row--expiry-mismatch {
  background: #fffbeb;
}

.crm-preview-hub-expiry {
  font-variant-numeric: tabular-nums;
}

.crm-preview-push-btn--mismatch {
  border-color: #d97706;
  color: #92400e;
}

.crm-auto-renew-flag {
  display: inline-block;
  min-width: 2rem;
  font-weight: 600;
  color: #64748b;
}

.crm-auto-renew-flag--on {
  color: #166534;
}

.crm-preview-row-check {
  cursor: pointer;
}

.crm-agent-source {
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 500;
}

.crm-preview-action-cell {
  white-space: nowrap;
}

.crm-preview-action-cell .small-button {
  margin-left: 0.35rem;
  vertical-align: middle;
}

.crm-action-badge {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.crm-action-badge--ready {
  background: #dcfce7;
  color: #166534;
}

.crm-action-badge--skip,
.crm-action-badge--pending {
  background: #fef9c3;
  color: #854d0e;
}

.crm-action-badge--unmapped,
.crm-action-badge--missing {
  background: #fee2e2;
  color: #991b1b;
}

.crm-action-badge--neutral {
  background: #e2e8f0;
  color: #475569;
}

.settings-card--tab {
  padding: 20px 22px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.settings-card--tab h3 {
  margin: 0 0 8px;
  font-size: 1.1rem;
}

.settings-help-text {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.settings-inline-link {
  border: none;
  padding: 0;
  background: none;
  color: var(--accent);
  text-decoration: underline;
  cursor: pointer;
  font: inherit;
}

.settings-form-grid {
  margin-bottom: 16px;
}

.field-hint {
  display: block;
  margin-top: 4px;
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
}

.settings-field-static {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.settings-field-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
}

.settings-tls-toggle {
  margin: 0;
}

.settings-tls-toggle input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.settings-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.settings-badge--info {
  background: #cce5ff;
  color: #004085;
}

.settings-badge--warn {
  background: #fff3cd;
  color: #856404;
}

.settings-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.warning-button {
  background: #fff3cd;
  border: 1px solid #ffecb5;
  color: #856404;
}

.warning-button:hover {
  filter: brightness(0.98);
}

.settings-template-selector {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 12px 16px;
  margin-bottom: 14px;
}

.settings-test-email-hint {
  cursor: help;
}

.settings-placeholders {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: #fbfdff;
}

.settings-placeholders summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--text);
}

.placeholder-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.placeholder-tag {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px;
  background: #fff;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.78rem;
  cursor: pointer;
}

.placeholder-tag:hover {
  background: #eef4ff;
  border-color: #93c5fd;
}

.password-strength {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 0 0 16px;
}

.password-strength-bar {
  flex: 1;
  min-width: 120px;
  height: 8px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.password-strength-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: #94a3b8;
  transition: width 0.2s ease, background 0.2s ease;
}

.password-strength-fill--weak { background: #ef4444; }
.password-strength-fill--medium { background: #f59e0b; }
.password-strength-fill--good { background: #3b82f6; }
.password-strength-fill--strong { background: #16a34a; }

.password-strength-text {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
}

@media (max-width: 900px) {
  .settings-tabs {
    display: none;
  }

  .settings-tabs-mobile {
    display: block;
  }

  .settings-tabs-mobile select {
    width: 100%;
    height: 2.5rem;
  }

  .settings-template-selector {
    grid-template-columns: 1fr;
  }
}

/* —— Profili installazione agent —— */
.profiles-section.view-section.active {
  display: flex !important;
  flex-direction: column;
  gap: 16px;
}

.profile-stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 12px 14px;
  border-radius: 10px;
  background: linear-gradient(180deg, #f0f7ff 0%, #f8fafc 100%);
  border: 1px solid var(--border);
}

.profile-stat {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.table-filter-bar--profiles .btn-primary {
  align-self: flex-end;
}

.profiles-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.85fr);
  gap: 16px;
  align-items: start;
}

.profiles-list-col,
.profiles-detail-col {
  min-width: 0;
}

.profiles-table {
  min-width: 680px;
}

.profile-row {
  cursor: pointer;
}

.profile-row:hover td {
  background: #eef4ff;
}

.profile-row--selected td {
  background: #dbeafe !important;
}

.profile-row-active {
  font-size: 0.75rem;
}

.col-profile-updated {
  white-space: nowrap;
  font-size: 0.82rem;
  color: var(--muted);
}

.profile-mode-badge,
.profile-dest-badge,
.profile-reload-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

.profile-mode-badge--folder {
  background: #e8f4fd;
  color: #0c5460;
}

.profile-mode-badge--deploy {
  background: #ede7f6;
  color: #4527a0;
}

.profile-dest-badge--info {
  background: #cce5ff;
  color: #004085;
}

.profile-dest-badge--muted {
  background: #e9ecef;
  color: #495057;
}

.profile-reload-badge--none {
  background: #f1f3f5;
  color: #495057;
}

.profile-reload-badge--reload {
  background: #fff3cd;
  color: #856404;
}

.profile-reload-badge--restart {
  background: #f8d7da;
  color: #721c24;
}

.profile-detail-panel {
  display: flex;
  flex-direction: column;
  min-height: 420px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 2px 10px rgba(15, 35, 70, 0.06);
  overflow: hidden;
}

.profile-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
}

.profile-detail-header h3 {
  margin: 0;
  font-size: 1rem;
}

.profile-detail-subtitle {
  margin: 4px 0 0;
  font-size: 0.84rem;
  color: var(--muted);
}

.profile-in-use-badge {
  padding: 4px 10px;
  border-radius: 999px;
  background: #d4edda;
  color: #155724;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.profile-detail-body {
  padding: 16px;
  flex: 1;
}

.profile-advanced-fields {
  margin: 4px 0 8px;
  padding: 10px 12px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: #fbfdff;
}

.profile-advanced-fields summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
}

.profile-form-advanced {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
}

.profile-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.profiles-settings-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #f4f7fb;
  border: 1px solid var(--border);
}

.profiles-system-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  font-size: 0.84rem;
  font-weight: 600;
}

.profiles-settings-divider {
  color: var(--muted);
}

.profiles-settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

@media (max-width: 1100px) {
  .profiles-workspace {
    grid-template-columns: 1fr;
  }

  .profile-detail-panel {
    min-height: 280px;
  }

  .profile-form-advanced {
    grid-template-columns: 1fr;
  }

  .profiles-settings-bar {
    flex-direction: column;
    align-items: stretch;
  }
}

/* Dashboard overview */
.dashboard-view {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.dashboard-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 20px;
  padding: 16px 18px;
}

.dashboard-hero h2 {
  margin: 0 0 4px;
  font-size: 1.35rem;
}

.dashboard-welcome {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.dashboard-last-update {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  color: var(--muted);
}

.dashboard-refresh-small {
  font-size: 1rem;
  padding: 4px 8px;
}

.dashboard-metrics {
  margin-bottom: 0;
}

.metric-card {
  min-height: 140px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 18px;
}

.metric-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.metric-icon {
  font-size: 1.1rem;
}

.metric-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.metric-value {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text);
}

.metric-footer {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: auto;
}

.metric-sub {
  font-size: 0.8rem;
  color: var(--muted);
}

.trend {
  font-size: 0.82rem;
  font-weight: 600;
}

.trend-up {
  color: #28a745;
}

.trend-down {
  color: #dc3545;
}

.trend-neutral {
  color: #6c757d;
}

.dashboard-panels {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr);
  gap: 18px;
}

.dashboard-panel-title {
  margin: 0 0 14px;
  font-size: 1rem;
}

.dashboard-chart-bars {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  min-height: 140px;
  padding: 8px 4px 0;
  border-bottom: 1px solid var(--border);
}

.dashboard-bar-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.dashboard-bar-stack {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 100px;
  width: 100%;
  justify-content: center;
}

.dashboard-bar {
  width: 42%;
  min-height: 4px;
  border-radius: 4px 4px 0 0;
  transition: height 0.25s ease;
}

.dashboard-bar--new {
  background: #4a7fd4;
}

.dashboard-bar--renew {
  background: #3cb371;
}

.dashboard-bar-group > span {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: capitalize;
}

.dashboard-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 12px;
  font-size: 0.82rem;
  color: var(--muted);
}

.dashboard-legend-swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  margin-right: 4px;
  vertical-align: -1px;
}

.dashboard-legend-swatch--new {
  background: #4a7fd4;
}

.dashboard-legend-swatch--renew {
  background: #3cb371;
}

.dashboard-expiry-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dashboard-expiry-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  gap: 4px 10px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fafbfd;
}

.dashboard-expiry-item--danger {
  border-left: 4px solid #dc3545;
}

.dashboard-expiry-item--warning {
  border-left: 4px solid #e0a800;
}

.dashboard-expiry-item--success {
  border-left: 4px solid #28a745;
}

.dashboard-expiry-item--neutral {
  border-left: 4px solid #6c757d;
}

.dashboard-expiry-domain {
  grid-column: 1;
  font-weight: 600;
  font-size: 0.88rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-expiry-date {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

.dashboard-expiry-item .btn-renew {
  grid-column: 1;
  justify-self: start;
  font-size: 0.78rem;
  padding: 4px 10px;
}

.dashboard-expiry-empty {
  color: var(--muted);
  font-size: 0.88rem;
  margin: 0;
}

.dashboard-activity-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.dashboard-activity-item {
  display: grid;
  grid-template-columns: 28px 72px minmax(80px, 1fr) auto auto;
  gap: 8px 12px;
  align-items: center;
  padding: 10px 12px;
  font-size: 0.86rem;
  border-bottom: 1px solid var(--border);
  background: #fff;
}

.dashboard-activity-item:last-child {
  border-bottom: none;
}

.dashboard-activity-item:nth-child(even) {
  background: #fafbfd;
}

.dashboard-activity-status {
  text-align: center;
}

.dashboard-activity-id {
  font-family: ui-monospace, monospace;
  font-size: 0.8rem;
  color: var(--muted);
}

.dashboard-activity-agent {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-activity-time {
  color: var(--muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

.dashboard-activity-empty {
  padding: 16px;
  color: var(--muted);
  font-size: 0.88rem;
  margin: 0;
}

.dashboard-view-all {
  display: inline-block;
  margin-top: 12px;
  padding: 0;
  border: none;
  background: none;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  text-align: left;
}

.dashboard-view-all:hover {
  text-decoration: underline;
}

.dashboard-action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn-action {
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s;
}

.btn-action--primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn-action--primary:hover {
  filter: brightness(1.05);
}

.btn-action--secondary {
  background: #fff;
  color: var(--text);
  border-color: var(--border);
}

.btn-action--secondary:hover {
  border-color: var(--accent);
}

.btn-action--tertiary {
  background: #f4f7fb;
  color: var(--text);
  border-color: var(--border);
}

.dashboard-refresh-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: dashboard-spin 0.7s linear infinite;
  vertical-align: -2px;
  margin-right: 6px;
}

.dashboard-refresh-spinner--inline {
  width: 12px;
  height: 12px;
  margin-right: 4px;
}

@keyframes dashboard-spin {
  to { transform: rotate(360deg); }
}

.dashboard-settings-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #f4f7fb;
  border: 1px solid var(--border);
}

.dashboard-system-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  font-size: 0.84rem;
  font-weight: 600;
}

.dashboard-settings-divider {
  color: var(--muted);
}

.dashboard-settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

@media (max-width: 1100px) {
  .dashboard-panels {
    grid-template-columns: 1fr;
  }

  .overview-grid,
  .dashboard-metrics {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }
}

@media (max-width: 640px) {
  .overview-grid,
  .dashboard-metrics {
    grid-template-columns: 1fr;
  }

  .dashboard-activity-item {
    grid-template-columns: 24px 1fr;
    grid-template-rows: auto auto auto;
  }

  .dashboard-activity-id,
  .dashboard-activity-agent,
  .dashboard-activity-type,
  .dashboard-activity-time {
    grid-column: 2;
  }

  .dashboard-expiry-item {
    grid-template-columns: 1fr;
  }

  .dashboard-expiry-date {
    grid-column: 1;
    grid-row: auto;
  }

  .dashboard-settings-bar {
    flex-direction: column;
    align-items: stretch;
  }
}
