:root{
  color-scheme: dark;

  --sec-text: #e6eefc;
  --sec-text-soft: #9fb2d9;
  --sec-muted: #6f86b3;

  --sec-bg-page:
    radial-gradient(1200px 700px at 14% 10%, rgba(37,99,235,0.22), transparent 55%),
    radial-gradient(1000px 640px at 86% 16%, rgba(14,165,233,0.16), transparent 52%),
    radial-gradient(900px 620px at 50% 100%, rgba(59,130,246,0.10), transparent 60%),
    linear-gradient(180deg, #040816 0%, #08101f 45%, #0a1428 100%);

  --sec-bg-card: rgba(11, 20, 39, 0.72);
  --sec-bg-card-2: rgba(15, 28, 52, 0.72);
  --sec-bg-input: rgba(10, 19, 36, 0.88);

  --sec-bg-sidebar: rgba(8, 18, 36, 0.82);
  --sec-sidebar-border: rgba(96,165,250,0.14);
  --sec-sidebar-inner: rgba(255,255,255,0.03);

  --sec-border: rgba(148, 163, 184, 0.14);
  --sec-border-soft: rgba(148, 163, 184, 0.10);
  --sec-border-weak: rgba(148, 163, 184, 0.06);

  --sec-primary: #3b82f6;
  --sec-primary-2: #2563eb;
  --sec-primary-3: #06b6d4;
  --sec-primary-bg: rgba(59,130,246,0.14);
  --sec-primary-border: rgba(59,130,246,0.34);

  --sec-danger: #fb7185;
  --sec-danger-bg: rgba(244,63,94,0.12);
  --sec-danger-border: rgba(244,63,94,0.24);

  --sec-warning: #f59e0b;
  --sec-warning-bg: rgba(245,158,11,0.12);
  --sec-warning-border: rgba(245,158,11,0.26);

  --sec-ok: #22c55e;
  --sec-ok-bg: rgba(34,197,94,0.12);
  --sec-ok-border: rgba(34,197,94,0.24);

  --sec-radius: 12px;
  --sec-radius-lg: 16px;
  --sec-radius-xl: 20px;

  --sec-shadow: 0 18px 48px rgba(2,8,23,0.42);
  --sec-shadow-soft: 0 10px 28px rgba(2,8,23,0.30);
  --sec-blur: blur(16px);

  --sec-sidebar-width: 280px;
  --sec-topbar-height: 72px;

  /* Scrollbar */
  --sec-scrollbar-size: 12px;
  --sec-scrollbar-track: rgba(8,16,31,0.72);
  --sec-scrollbar-track-border: rgba(96,165,250,0.08);
  --sec-scrollbar-thumb:
    linear-gradient(180deg, rgba(14,165,233,0.72) 0%, rgba(37,99,235,0.78) 55%, rgba(29,78,216,0.84) 100%);
  --sec-scrollbar-thumb-hover:
    linear-gradient(180deg, rgba(34,211,238,0.86) 0%, rgba(59,130,246,0.90) 55%, rgba(37,99,235,0.96) 100%);
  --sec-scrollbar-thumb-active:
    linear-gradient(180deg, rgba(125,211,252,0.95) 0%, rgba(59,130,246,1) 55%, rgba(29,78,216,1) 100%);
}

*{
  box-sizing: border-box;
}

html,
body{
  margin:0;
  padding:0;
  min-height:100%;
  color: var(--sec-text);
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  position: relative;
  overflow-x: hidden;
  background:
    radial-gradient(1000px 600px at 10% 12%, rgba(37,99,235,0.20), transparent 58%),
    radial-gradient(900px 560px at 88% 18%, rgba(14,165,233,0.14), transparent 52%),
    radial-gradient(1200px 700px at 50% 100%, rgba(59,130,246,0.08), transparent 62%),
    linear-gradient(180deg, #040816 0%, #08101f 45%, #0a1428 100%);
  background-attachment: fixed;
  scrollbar-width: thin;
  scrollbar-color: rgba(59,130,246,0.88) rgba(8,16,31,0.76);
}

body{
  min-height:100vh;
}

/* ===== Scrollbar globale ===== */
html::-webkit-scrollbar,
body::-webkit-scrollbar,
.sec-modal-overlay::-webkit-scrollbar,
.sec-modal::-webkit-scrollbar,
.sec-table-wrap::-webkit-scrollbar,
.sec-textarea::-webkit-scrollbar{
  width: var(--sec-scrollbar-size);
  height: var(--sec-scrollbar-size);
}

html::-webkit-scrollbar-track,
body::-webkit-scrollbar-track,
.sec-modal-overlay::-webkit-scrollbar-track,
.sec-modal::-webkit-scrollbar-track,
.sec-table-wrap::-webkit-scrollbar-track,
.sec-textarea::-webkit-scrollbar-track{
  background:
    linear-gradient(180deg, rgba(6,14,28,0.92), rgba(9,18,36,0.88));
  border-left: 1px solid var(--sec-scrollbar-track-border);
  border-radius: 999px;
}

html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb,
.sec-modal-overlay::-webkit-scrollbar-thumb,
.sec-modal::-webkit-scrollbar-thumb,
.sec-table-wrap::-webkit-scrollbar-thumb,
.sec-textarea::-webkit-scrollbar-thumb{
  background: var(--sec-scrollbar-thumb);
  border-radius: 999px;
  border: 2px solid rgba(7,16,31,0.90);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.16),
    0 0 0 1px rgba(96,165,250,0.12),
    0 6px 16px rgba(37,99,235,0.24);
}

html::-webkit-scrollbar-thumb:hover,
body::-webkit-scrollbar-thumb:hover,
.sec-modal-overlay::-webkit-scrollbar-thumb:hover,
.sec-modal::-webkit-scrollbar-thumb:hover,
.sec-table-wrap::-webkit-scrollbar-thumb:hover,
.sec-textarea::-webkit-scrollbar-thumb:hover{
  background: var(--sec-scrollbar-thumb-hover);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.20),
    0 0 0 1px rgba(125,211,252,0.18),
    0 10px 22px rgba(37,99,235,0.34);
}

html::-webkit-scrollbar-thumb:active,
body::-webkit-scrollbar-thumb:active,
.sec-modal-overlay::-webkit-scrollbar-thumb:active,
.sec-modal::-webkit-scrollbar-thumb:active,
.sec-table-wrap::-webkit-scrollbar-thumb:active,
.sec-textarea::-webkit-scrollbar-thumb:active{
  background: var(--sec-scrollbar-thumb-active);
}

html::-webkit-scrollbar-corner,
body::-webkit-scrollbar-corner,
.sec-modal-overlay::-webkit-scrollbar-corner,
.sec-modal::-webkit-scrollbar-corner,
.sec-table-wrap::-webkit-scrollbar-corner,
.sec-textarea::-webkit-scrollbar-corner{
  background: rgba(8,16,31,0.88);
}

/* Sfondo animato globale */
body::before,
body::after{
  content:"";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

body::before{
  background-image:
    linear-gradient(rgba(96,165,250,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(96,165,250,0.05) 1px, transparent 1px);
  background-size: 52px 52px;
  opacity: .55;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.95), rgba(0,0,0,0.55));
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,0.95), rgba(0,0,0,0.55));
}

body::after{
  background:
    radial-gradient(circle at 18% 22%, rgba(34,211,238,0.18) 0 2px, transparent 3px),
    radial-gradient(circle at 78% 18%, rgba(59,130,246,0.18) 0 2px, transparent 3px),
    radial-gradient(circle at 68% 62%, rgba(14,165,233,0.18) 0 2px, transparent 3px),
    radial-gradient(circle at 20% 72%, rgba(96,165,250,0.16) 0 2px, transparent 3px),
    radial-gradient(circle at 84% 78%, rgba(59,130,246,0.16) 0 2px, transparent 3px),
    linear-gradient(
      180deg,
      transparent 0%,
      rgba(56,189,248,0.00) 38%,
      rgba(56,189,248,0.05) 46%,
      rgba(56,189,248,0.14) 50%,
      rgba(56,189,248,0.05) 54%,
      rgba(56,189,248,0.00) 62%,
      transparent 100%
    );
  filter: blur(16px);
  opacity: .95;
  animation: secAppScan 7s linear infinite;
  will-change: transform, opacity;
}

@keyframes secAppScan{
  0%{
    transform: translateY(-35%);
    opacity: .18;
  }
  12%{
    opacity: .95;
  }
  88%{
    opacity: .95;
  }
  100%{
    transform: translateY(35%);
    opacity: .18;
  }
}

a{
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea{
  font: inherit;
}

img{
  max-width: 100%;
  display: block;
}

/* ===== Helpers ===== */
.sec-hidden{
  display:none !important;
}

.sec-mono{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.sec-page{
  padding: 18px;
  color: var(--sec-text);
  position: relative;
  z-index: 1;
}

.sec-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  margin-bottom: 20px;
}

.sec-title{
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #f8fbff;
}

.sec-subtitle{
  font-size: 13px;
  color: rgba(230,238,252,0.72);
  margin-top: 4px;
}

.sec-field{
  display:grid;
  gap:6px;
}

.sec-grid2{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  align-items: start;
}

.sec-grid3{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  align-items: start;
}

.sec-grid4{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  align-items: start;
}

/* ===== App Shell ===== */
.sec-app{
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sec-sidebar-width) 1fr;
  position: relative;
  z-index: 1;
}

.sidebar {
  width: var(--sec-sidebar-width);
  min-width: var(--sec-sidebar-width);
  height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 28px 18px;
  border-right: 1px solid rgba(74, 144, 226, 0.22);
}

.sec-sidebar::before{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  background:
    linear-gradient(180deg, rgba(59,130,246,0.08), rgba(255,255,255,0.01)),
    radial-gradient(circle at 20% 12%, rgba(14,165,233,0.14), transparent 34%);
  opacity:.95;
}

.sec-sidebar::after{
  content:"";
  position:absolute;
  top:0;
  right:0;
  width:1px;
  height:100%;
  background: linear-gradient(
    180deg,
    rgba(96,165,250,0.18),
    rgba(96,165,250,0.02)
  );
  pointer-events:none;
}

.sec-sidebar > *{
  position: relative;
  z-index: 1;
}

.sec-sidebar-brand{
  display:flex;
  align-items:center;
  gap:12px;
  padding: 8px 10px;
  margin-bottom: 18px;
}

.sec-sidebar-logo{
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(135deg, #0ea5e9, #2563eb 55%, #1d4ed8 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.18),
    0 10px 24px rgba(37,99,235,0.30);
}

.sec-sidebar-brand-title{
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #eff6ff;
}

.sec-sidebar-brand-subtitle{
  font-size: 12px;
  color: rgba(191,219,254,0.64);
  margin-top: 2px;
}

.sec-sidebar-nav{
  display:grid;
  gap: 8px;
}

.sec-sidebar-link{
  display:flex;
  align-items:center;
  gap:10px;
  padding: 11px 12px;
  border-radius: 16px;
  color: rgba(219,234,254,0.84);
  border: 1px solid transparent;
  background: transparent;
  transition:
    background .18s ease,
    color .18s ease,
    transform .08s ease,
    border-color .18s ease,
    box-shadow .18s ease;
}

.sec-sidebar-link:hover{
  background: rgba(37,99,235,0.12);
  color: #ffffff;
  border-color: rgba(96,165,250,0.16);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.04),
    0 8px 18px rgba(2,8,23,0.22);
}

.sec-sidebar-link.active{
  background: linear-gradient(135deg, rgba(37,99,235,0.18), rgba(14,165,233,0.10));
  color: #ffffff;
  border-color: rgba(96,165,250,0.28);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.05),
    0 10px 24px rgba(2,8,23,0.24);
  font-weight: 800;
}

.sec-main{
  min-width: 0;
  padding: 18px;
  position: relative;
  z-index: 1;
}

.sec-topbar{
  min-height: var(--sec-topbar-height);
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap: 14px;
  margin-bottom: 18px;
}

.sec-topbar-left{
  display:grid;
  gap: 4px;
}

.sec-topbar-right{
  display:flex;
  align-items:center;
  gap: 10px;
  flex-wrap: wrap;
}

.sec-topbar-card{
  display:flex;
  align-items:center;
  gap:8px;
  padding: 10px 12px;
  background: var(--sec-bg-card);
  border: 1px solid var(--sec-border);
  border-radius: 999px;
  backdrop-filter: var(--sec-blur);
  box-shadow: var(--sec-shadow-soft);
}

/* ===== Cards ===== */
.sec-card{
  border: 1px solid var(--sec-border);
  border-radius: var(--sec-radius-xl);
  overflow: hidden;
  background: var(--sec-bg-card);
  backdrop-filter: var(--sec-blur);
  box-shadow: var(--sec-shadow);
}

.sec-card-head{
  padding: 14px 16px;
  border-bottom: 1px solid var(--sec-border-soft);
  background: var(--sec-bg-card-2);
  font-weight: 800;
  color: var(--sec-text);
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
}

.sec-card-head-title{
  font-size: 15px;
  font-weight: 800;
}

.sec-card-head-subtitle{
  font-size: 12px;
  color: var(--sec-muted);
  font-weight: 500;
  margin-top: 2px;
}

.sec-card-body{
  padding: 16px;
}

.sec-stat-card{
  padding: 16px;
  border-radius: var(--sec-radius-xl);
  border: 1px solid var(--sec-border);
  background: linear-gradient(180deg, rgba(11,20,39,0.78), rgba(9,17,33,0.72));
  backdrop-filter: var(--sec-blur);
  box-shadow: var(--sec-shadow-soft);
}

.sec-stat-label{
  font-size: 12px;
  font-weight: 700;
  color: var(--sec-text-soft);
  margin-bottom: 10px;
}

.sec-stat-value{
  font-size: 30px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.03em;
}

.sec-stat-note{
  margin-top: 8px;
  font-size: 12px;
  color: var(--sec-muted);
}

/* ===== Buttons ===== */
.sec-btn{
  padding:14px 16px;
  border-radius:18px;
  border:1px solid rgba(96,165,250,0.14);
  background: linear-gradient(180deg, rgba(15,28,52,0.95), rgba(10,19,36,0.95));
  color:#e6eefc;
  cursor:pointer;
  user-select:none;
  transition: transform .12s ease, box-shadow .18s ease, filter .18s ease, border-color .18s ease;
  font-weight:800;
  font-size:15px;
  box-shadow: 0 10px 22px rgba(2,8,23,0.22);
}

.sec-btn:hover{
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(2,8,23,0.28);
  border-color: rgba(96,165,250,0.26);
}

.sec-btn:active{
  transform: translateY(0);
}

.sec-btn:disabled{
  opacity:.6;
  cursor:not-allowed;
  transform:none;
  box-shadow:none;
}

.sec-btn-primary{
  border:none;
  color:#ffffff;
  background: linear-gradient(135deg, #0ea5e9 0%, #2563eb 55%, #1d4ed8 100%);
  box-shadow: 0 14px 28px rgba(37,99,235,0.30);
}

.sec-btn-danger{
  border: 1px solid var(--sec-danger-border);
  background: var(--sec-danger-bg);
  color: var(--sec-danger);
}

.sec-btn-block{
  width: 100%;
}

/* ===== Inputs ===== */
.sec-label{
  display:block;
  margin-bottom:8px;
  font-size:13px;
  font-weight:800;
  color:#c7d7f5;
}

.sec-input,
.sec-select,
.sec-textarea{
  width:100%;
  padding:15px 18px;
  border-radius:18px;
  border:1px solid rgba(96,165,250,0.12);
  background: linear-gradient(180deg, rgba(10,19,36,0.96), rgba(8,16,31,0.94));
  color:#e6eefc;
  outline:none;
  transition: border-color .18s ease, box-shadow .18s ease, transform .08s ease, background .18s ease;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03), 0 4px 10px rgba(2,8,23,0.18);
  scrollbar-width: thin;
  scrollbar-color: rgba(59,130,246,0.88) rgba(8,16,31,0.76);
}

.sec-input::placeholder,
.sec-textarea::placeholder{
  color:#6f86b3;
}

.sec-input:focus,
.sec-select:focus,
.sec-textarea:focus{
  border-color: rgba(59,130,246,0.48);
  box-shadow: 0 0 0 5px rgba(37,99,235,0.14), 0 10px 22px rgba(37,99,235,0.14);
  transform: translateY(-1px);
}

.sec-select option{
  background: #0b1426;
  color: var(--sec-text);
}

.sec-textarea{
  min-height: 110px;
  resize: vertical;
}

/* ===== Table ===== */
.sec-table-wrap{
  width: 100%;
  overflow: auto;
  border: 1px solid var(--sec-border-soft);
  border-radius: var(--sec-radius-lg);
  background: rgba(8,16,31,0.58);
  scrollbar-width: thin;
  scrollbar-color: rgba(59,130,246,0.88) rgba(8,16,31,0.76);
}

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

.sec-th{
  padding: 12px 14px;
  font-size: 12px;
  color: var(--sec-text-soft);
  border-bottom: 1px solid var(--sec-border-soft);
  font-weight: 800;
  text-align:left;
  background: rgba(15,28,52,0.72);
  white-space: nowrap;
}

.sec-td{
  padding: 12px 14px;
  border-bottom: 1px solid var(--sec-border-weak);
  color: var(--sec-text);
  background: transparent;
  vertical-align: middle;
}

.sec-row:last-child .sec-td{
  border-bottom: none;
}

/* ===== Badges ===== */
.sec-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(96,165,250,0.12);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.sec-badge-ok{
  background: var(--sec-ok-bg);
  border-color: var(--sec-ok-border);
  color: var(--sec-ok);
}

.sec-badge-off{
  background: rgba(100,116,139,0.10);
  border-color: rgba(100,116,139,0.18);
  color: #94a3b8;
}

.sec-badge-warning{
  background: var(--sec-warning-bg);
  border-color: var(--sec-warning-border);
  color: var(--sec-warning);
}

.sec-badge-danger{
  background: var(--sec-danger-bg);
  border-color: var(--sec-danger-border);
  color: var(--sec-danger);
}

.sec-badge-primary{
  background: var(--sec-primary-bg);
  border-color: var(--sec-primary-border);
  color: #7dd3fc;
}

/* ===== Alert ===== */
.sec-alert{
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid var(--sec-danger-border);
  background: var(--sec-danger-bg);
  border-radius: var(--sec-radius);
  color: #fecdd3;
  font-size: 13px;
  font-weight: 600;
}

.sec-alert-warning{
  border-color: var(--sec-warning-border);
  background: var(--sec-warning-bg);
  color: #fde68a;
}

.sec-alert-ok{
  border-color: var(--sec-ok-border);
  background: var(--sec-ok-bg);
  color: #bbf7d0;
}

/* ===== Modal ===== */
.sec-modal-overlay{
  position: fixed;
  inset: 0;
  background: rgba(2,8,23,0.50);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 28px 16px;
  z-index: 9999;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(59,130,246,0.88) rgba(8,16,31,0.76);
}

.sec-modal{
  width: min(820px, 96vw);
  max-height: calc(100vh - 56px);
  margin: auto 0;
  background: rgba(9,17,33,0.94);
  border-radius: var(--sec-radius-xl);
  border: 1px solid var(--sec-border);
  padding: 16px;
  backdrop-filter: var(--sec-blur);
  -webkit-backdrop-filter: var(--sec-blur);
  box-shadow: 0 24px 60px rgba(2,8,23,0.46);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(59,130,246,0.88) rgba(8,16,31,0.76);
}

.sec-modal-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  margin-bottom: 14px;
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(9,17,33,0.94);
  padding-bottom: 10px;
}

.sec-modal-title{
  font-size: 16px;
  font-weight: 900;
}

.sec-modal-actions{
  display:flex;
  justify-content:flex-end;
  gap:10px;
  margin-top: 16px;
  flex-wrap: wrap;
  position: sticky;
  bottom: 0;
  z-index: 2;
  background: rgba(9,17,33,0.94);
  padding-top: 10px;
}

/* ===== Lists / panels ===== */
.sec-list{
  display:grid;
  gap: 10px;
}

.sec-list-item{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--sec-border-soft);
  border-radius: var(--sec-radius-lg);
  background: rgba(10,19,36,0.70);
}

.sec-list-title{
  font-size: 14px;
  font-weight: 800;
}

.sec-list-subtitle{
  margin-top: 4px;
  font-size: 12px;
  color: var(--sec-muted);
}

/* ===== Auth / Login ===== */
.sec-auth{
  min-height:100vh;
  display:grid;
  place-items:center;
  padding:24px;
  position:relative;
  overflow:hidden;
  background:
    radial-gradient(900px 500px at 18% 18%, rgba(37,99,235,0.20), transparent 58%),
    radial-gradient(700px 420px at 82% 22%, rgba(14,165,233,0.16), transparent 55%),
    radial-gradient(900px 600px at 50% 100%, rgba(29,78,216,0.14), transparent 62%),
    linear-gradient(180deg, #030712 0%, #07101f 48%, #08111f 100%);
}

.sec-auth-bg-grid,
.sec-auth-bg-scan,
.sec-auth-bg-grid-glow,
.sec-auth-bg-dots{
  position:absolute;
  inset:0;
  pointer-events:none;
}

.sec-auth-bg-grid{
  z-index:0;
  background-image:
    linear-gradient(rgba(96,165,250,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(96,165,250,0.05) 1px, transparent 1px);
  background-size: 52px 52px;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,0.95), rgba(0,0,0,0.5));
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.95), rgba(0,0,0,0.5));
}

.sec-auth-bg-scan{
  z-index:1;
  background:
    radial-gradient(circle at 50% 18%, rgba(14,165,233,0.14) 0%, rgba(37,99,235,0.10) 22%, transparent 54%),
    linear-gradient(
      180deg,
      transparent 0%,
      rgba(255,255,255,0.00) 40%,
      rgba(56,189,248,0.04) 46%,
      rgba(56,189,248,0.14) 50%,
      rgba(56,189,248,0.04) 54%,
      rgba(255,255,255,0.00) 60%,
      transparent 100%
    );
  filter: blur(18px);
  opacity: .95;
  animation: secScan 4.8s linear infinite;
  will-change: transform, opacity;
}

.sec-auth-bg-grid-glow{
  z-index:2;
  background-image:
    linear-gradient(rgba(56,189,248,0.22) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56,189,248,0.22) 1px, transparent 1px);
  background-size: 52px 52px;
  opacity: .95;
  mix-blend-mode: screen;
  -webkit-mask-image:
    linear-gradient(
      180deg,
      transparent 0%,
      transparent 43%,
      rgba(255,255,255,0.08) 47%,
      rgba(255,255,255,0.95) 50%,
      rgba(255,255,255,0.08) 53%,
      transparent 57%,
      transparent 100%
    );
  mask-image:
    linear-gradient(
      180deg,
      transparent 0%,
      transparent 43%,
      rgba(255,255,255,0.08) 47%,
      rgba(255,255,255,0.95) 50%,
      rgba(255,255,255,0.08) 53%,
      transparent 57%,
      transparent 100%
    );
  animation: secScan 4.8s linear infinite;
  will-change: transform, opacity;
}

.sec-auth-bg-dots{
  z-index:3;
  background-image:
    radial-gradient(circle at 12% 22%, rgba(34,211,238,0.28) 0 2px, transparent 3px),
    radial-gradient(circle at 78% 18%, rgba(59,130,246,0.26) 0 2px, transparent 3px),
    radial-gradient(circle at 68% 62%, rgba(14,165,233,0.28) 0 2px, transparent 3px),
    radial-gradient(circle at 20% 72%, rgba(96,165,250,0.24) 0 2px, transparent 3px),
    radial-gradient(circle at 84% 78%, rgba(34,211,238,0.24) 0 2px, transparent 3px);
  opacity: .7;
}

@keyframes secScan{
  0%{
    transform: translateY(-38%);
    opacity: .15;
  }
  10%{
    opacity: .95;
  }
  90%{
    opacity: .95;
  }
  100%{
    transform: translateY(38%);
    opacity: .15;
  }
}

.sec-auth-brand{
  position:absolute;
  top:28px;
  left:32px;
  z-index:4;
  display:flex;
  align-items:center;
  gap:14px;
  max-width: calc(100% - 64px);
}

.sec-auth-brand-logo{
  width:54px;
  height:54px;
  border-radius:18px;
  background: linear-gradient(135deg, #06b6d4 0%, #2563eb 48%, #1d4ed8 100%);
  border:1px solid rgba(255,255,255,0.16);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.20),
    0 10px 30px rgba(2,8,23,0.32);
  position:relative;
}

.sec-auth-brand-logo::before{
  content:"";
  position:absolute;
  inset:11px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,0.10);
}

.sec-auth-brand-text{
  display:grid;
  gap:2px;
}

.sec-auth-brand-title{
  font-size:28px;
  font-weight:900;
  letter-spacing:-0.04em;
  color:#ffffff;
  line-height:1;
}

.sec-auth-brand-subtitle{
  font-size:13px;
  color:rgba(191,219,254,0.72);
  font-weight:600;
}

.sec-auth-card{
  position:relative;
  z-index:5;
  width:min(460px, 96vw);
  border-radius:28px;
  padding:22px;
  border:1px solid rgba(96,165,250,0.14);
  background: linear-gradient(180deg, rgba(9,17,33,0.86), rgba(10,19,36,0.78));
  backdrop-filter: blur(18px);
  box-shadow: 0 30px 80px rgba(2,8,23,0.42), inset 0 1px 0 rgba(255,255,255,0.05);
}

.sec-auth-panel-head{
  margin-bottom: 8px;
}

.sec-auth-panel-title{
  font-size:20px;
  font-weight:900;
  color:#eff6ff;
  letter-spacing:-0.03em;
}

.sec-auth-panel-subtitle{
  margin-top:6px;
  font-size:13px;
  color:#8ea6d4;
  line-height:1.45;
}

.sec-auth-block{
  margin-top:18px;
}

.sec-auth-actions{
  margin-top:20px;
}

.sec-auth-error{
  margin-top:10px;
  color: var(--sec-danger);
  font-weight:700;
  font-size: 13px;
}

.sec-auth-help{
  margin-top:14px;
  font-size:13px;
  color: var(--sec-muted);
  line-height: 1.55;
}

/* ===== Documents-like layout ===== */
.sec-shell{
  display:grid;
  grid-template-columns: 380px 1fr;
  gap: 14px;
  margin-top: 14px;
}

.sec-left{
  min-height: 72vh;
}

.sec-right{
  min-height: 72vh;
}

.sec-filters{
  margin-top: 12px;
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.sec-doc-list{
  padding: 10px;
  display:grid;
  gap: 8px;
}

.sec-doc-item{
  text-align:left;
  width:100%;
  border: 1px solid var(--sec-border-soft);
  background: rgba(10,19,36,0.62);
  border-radius: 14px;
  padding: 10px;
  cursor:pointer;
  transition: transform .08s ease, background .12s ease, border-color .12s ease, box-shadow .12s ease;
}

.sec-doc-item:hover{
  transform: translateY(-1px);
  background: rgba(15,28,52,0.82);
  border-color: rgba(96,165,250,0.18);
  box-shadow: 0 8px 18px rgba(2,8,23,0.18);
}

.sec-doc-item.active{
  background: var(--sec-primary-bg);
  border-color: var(--sec-primary-border);
}

.sec-doc-top{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
}

.sec-doc-title{
  display:flex;
  align-items:center;
  gap:10px;
  font-weight: 900;
}

.sec-doc-sub{
  margin-top: 8px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  font-size: 12px;
  color: var(--sec-text-soft);
}

.sec-doc-partner{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  max-width: 230px;
}

.sec-doc-date{
  color: var(--sec-muted);
}

.sec-pill{
  display:inline-flex;
  align-items:center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--sec-border-soft);
  background: rgba(15,28,52,0.70);
  font-weight: 800;
  letter-spacing: .2px;
  font-size: 12px;
}

.sec-detail-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap: 12px;
}

.sec-detail-title{
  display:flex;
  align-items:center;
  gap:10px;
  font-weight: 900;
  font-size: 15px;
}

.sec-detail-meta{
  margin-top: 8px;
  display:flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sec-detail-body{
  padding: 12px;
}

.sec-detail-grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.sec-empty{
  padding: 18px;
  border-radius: 14px;
  border: 1px dashed var(--sec-border);
  background: rgba(10,19,36,0.52);
  color: var(--sec-text-soft);
}

.sec-empty.big{
  padding: 26px;
}

.sec-create-grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.sec-lines-card{
  border: 1px solid var(--sec-border-soft);
  border-radius: 14px;
  padding: 12px;
  background: rgba(10,19,36,0.56);
}

/* ===== Responsive ===== */
@media (max-width: 1100px){
  .sec-shell{
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px){
  .sec-app{
    grid-template-columns: 1fr;
  }

  .sec-sidebar{
    position: relative;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--sec-border-soft);
  }

  .sec-topbar{
    flex-direction: column;
    align-items: flex-start;
  }

  .sec-topbar-right{
    width: 100%;
  }
}

@media (max-width: 900px){
  .sec-detail-grid,
  .sec-create-grid{
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px){
  .sec-page,
  .sec-main{
    padding: 12px;
  }

  .sec-auth{
    place-items: center;
    padding: 110px 16px 32px;
  }

  .sec-auth-brand{
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 32px);
    justify-content: center;
    text-align: center;
    gap: 12px;
  }

  .sec-auth-brand-text{
    justify-items: start;
  }

  .sec-auth-brand-title{
    font-size: 24px;
  }

  .sec-auth-brand-subtitle{
    font-size: 12px;
  }

  .sec-auth-brand-logo{
    width: 46px;
    height: 46px;
    border-radius: 16px;
    flex: 0 0 auto;
  }

  .sec-auth-card{
    width: min(100%, 460px);
    padding: 20px 18px;
    border-radius: 24px;
  }

  .sec-auth-panel-title{
    font-size: 18px;
    line-height: 1.1;
  }

  .sec-auth-panel-subtitle{
    font-size: 13px;
    line-height: 1.5;
  }

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

  .sec-header{
    flex-direction: column;
    align-items: flex-start;
  }

  .sec-topbar-card{
    width: 100%;
    justify-content: flex-start;
  }

  .sec-input,
  .sec-select,
  .sec-textarea{
    padding: 14px 16px;
    border-radius: 16px;
  }

  .sec-btn{
    border-radius: 16px;
  }
}

.sec-dashboard-kpis{
  margin-bottom: 18px;
}

.sec-dashboard-layout{
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(320px, 0.9fr);
  gap: 18px;
  align-items: start;
}

.sec-dashboard-main,
.sec-dashboard-side{
  display: grid;
  gap: 18px;
}

.sec-metric-stack{
  display: grid;
  gap: 10px;
}

.sec-metric-row{
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--sec-border-soft);
  border-radius: var(--sec-radius-lg);
  background: rgba(10,19,36,0.64);
}

.sec-metric-row span{
  color: var(--sec-text-soft);
  font-size: 13px;
  font-weight: 600;
}

.sec-metric-row strong{
  color: var(--sec-text);
  font-size: 14px;
  font-weight: 800;
}

@media (max-width: 1100px){
  .sec-dashboard-layout{
    grid-template-columns: 1fr;
  }
}

.sec-toolbar{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:14px;
}

.sec-table-wrap-top{
  margin-top:16px;
}

.sec-actions-inline{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.sec-btn-sm{
  padding:8px 10px;
  font-size:12px;
  border-radius:12px;
}

.sec-cell-title{
  font-weight:800;
  color:var(--sec-text);
}

.sec-cell-subtitle{
  margin-top:4px;
  font-size:12px;
  color:var(--sec-muted);
}

.sec-stack-badges{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.sec-section-title{
  margin-top:18px;
  margin-bottom:12px;
  font-size:14px;
  font-weight:900;
  color:var(--sec-text);
}

.sec-form-block{
  margin-top:14px;
}

.sec-check-grid{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  align-items:start;
}

.sec-check{
  display:flex;
  align-items:center;
  gap:10px;
  padding:12px 14px;
  border:1px solid var(--sec-border-soft);
  border-radius:14px;
  background:rgba(10,19,36,0.62);
  color:var(--sec-text);
}

.sec-check input{
  width:16px;
  height:16px;
  accent-color:#3b82f6;
}

.sec-modal-large{
  width:min(1080px, 96vw);
  max-height: calc(100vh - 56px);
}

@media (max-width: 640px){
  .sec-toolbar{
    flex-direction:column;
    align-items:stretch;
  }

  .sec-actions-inline{
    flex-direction:column;
  }

  .sec-btn-sm{
    width:100%;
  }

  .sec-modal-overlay{
    padding: 12px;
    align-items: flex-start;
  }

  .sec-modal,
  .sec-modal-large{
    width: 100%;
    max-height: calc(100vh - 24px);
    border-radius: 22px;
    padding: 14px;
  }
}

.sec-filters-3{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap:10px;
}

@media (max-width: 640px){
  .sec-filters-3{
    grid-template-columns: 1fr;
  }
}

.sec-modal-structure-xl{
  width:min(1320px, 97vw);
}

.sec-section-title-flex{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.sec-section-title-sm{
  font-size:13px;
  margin-top:14px;
}

.sec-devices-list{
  display:grid;
  gap:14px;
  margin-top:12px;
}

.sec-device-card{
  border:1px solid var(--sec-border-soft);
  border-radius:16px;
  padding:14px;
  background:rgba(255,255,255,0.42);
  backdrop-filter:blur(6px);
}

.sec-device-head,
.sec-entity-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:12px;
}

.sec-device-title,
.sec-entity-title{
  font-size:14px;
  font-weight:900;
  color:var(--sec-text);
}

.sec-entity-card{
  border:1px solid var(--sec-border-soft);
  border-radius:14px;
  padding:12px;
  background:rgba(255,255,255,0.50);
}

.device-entities-container{
  display:grid;
  gap:10px;
  margin-top:10px;
}

.sec-check-inline{
  min-height:44px;
}

.sec-check-grid-compact{
  margin-top:10px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

@media (max-width: 900px){
  .sec-modal-structure-xl{
    width:min(98vw, 98vw);
  }

  .sec-section-title-flex{
    flex-direction:column;
    align-items:flex-start;
  }
}

.sec-details summary::after {
  content: "▾";
  font-size: 14px;
  opacity: 0.8;
  transition: transform 0.2s ease;
}

.sec-details[open] summary::after {
  transform: rotate(180deg);
}

/* ===== FIX OVERFLOW / MODULI CHE ESCONO A DESTRA ===== */

.sec-main,
.sec-topbar,
.sec-topbar-left,
.sec-topbar-right,
.sec-card,
.sec-card-head,
.sec-card-body,
.sec-header,
.sec-shell,
.sec-left,
.sec-right,
.sec-filters,
.sec-filters-3,
.sec-toolbar,
.sec-grid2,
.sec-grid3,
.sec-grid4,
.sec-create-grid,
.sec-detail-grid,
.sec-check-grid,
.sec-devices-list,
.sec-device-card,
.sec-lines-card,
.sec-stat-card,
.sec-topbar-card {
  min-width: 0;
  max-width: 100%;
}

.sec-card-head,
.sec-topbar,
.sec-header {
  flex-wrap: wrap;
}

.sec-topbar-right,
.sec-actions-inline,
.sec-toolbar,
.sec-stack-badges {
  min-width: 0;
  flex-wrap: wrap;
}

.sec-topbar-card {
  min-width: 0;
  overflow: hidden;
}

.sec-topbar-card span,
.sec-cell-title,
.sec-cell-subtitle,
.sec-doc-partner,
.sec-title,
.sec-subtitle {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.sec-filters,
.sec-create-grid,
.sec-detail-grid,
.sec-grid2,
.sec-grid3,
.sec-grid4,
.sec-check-grid,
.sec-filters-3 {
  width: 100%;
}

.sec-table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

.sec-table {
  width: 100%;
}

.sec-input,
.sec-select,
.sec-textarea,
.sec-btn {
  max-width: 100%;
}

.sec-card-body > * {
  max-width: 100%;
}

@media (max-width: 1280px) {
  .sec-topbar-right {
    width: 100%;
    justify-content: flex-start;
  }
}

/* ============================================================
   SIDEBAR SUBMENU - SecureonSystems
   ============================================================ */

.sidebar {
  width: 280px;
  min-width: 280px;
  height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 28px 18px;
  border-right: 1px solid rgba(74, 144, 226, 0.22);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 34px;
}

.nav-link,
.nav-group-toggle {
  width: 100%;
  min-height: 46px;
  border: 0;
  border-radius: 18px;
  background: transparent;
  color: rgba(225, 234, 255, 0.78);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  cursor: pointer;
  transition: 0.18s ease;
}

.nav-link:hover,
.nav-group-toggle:hover {
  background: rgba(42, 132, 255, 0.10);
  color: #ffffff;
}

.nav-link.active {
  background: linear-gradient(135deg, rgba(47, 139, 255, 0.28), rgba(0, 195, 255, 0.10));
  color: #ffffff;
  border: 1px solid rgba(61, 151, 255, 0.45);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.03);
}

.nav-group {
  display: flex;
  flex-direction: column;
}

.nav-group-toggle {
  color: rgba(154, 178, 221, 0.95);
}

.nav-group.open > .nav-group-toggle {
  color: #ffffff;
  background: rgba(42, 132, 255, 0.08);
}

.nav-chevron {
  font-size: 13px;
  opacity: 0.75;
  transition: transform 0.18s ease;
}

.nav-group.open .nav-chevron {
  transform: rotate(180deg);
}

.nav-submenu {
  display: none;
  flex-direction: column;
  gap: 5px;
  margin: 6px 0 10px 14px;
  padding-left: 12px;
  border-left: 1px solid rgba(88, 157, 255, 0.22);
}

.nav-group.open .nav-submenu {
  display: flex;
}

.nav-sublink {
  min-height: 38px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
  padding-left: 14px;
  color: rgba(204, 218, 245, 0.72);
}

.nav-sublink.active {
  color: #ffffff;
  background: rgba(44, 139, 255, 0.22);
  border: 1px solid rgba(61, 151, 255, 0.35);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo,
.brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: linear-gradient(135deg, #20a4ff, #315dff);
  box-shadow: 0 12px 30px rgba(32, 164, 255, 0.25);
}

.brand-title {
  color: #ffffff;
  font-weight: 800;
  font-size: 18px;
  line-height: 1.1;
}

.brand-subtitle {
  color: rgba(202, 218, 246, 0.68);
  font-size: 13px;
  margin-top: 4px;
}

/* ============================================================
   SIDEBAR / CUSTOMER MENU - SecureonSystems
   Desktop + Mobile
   Da mettere in fondo a style.css
   ============================================================ */

/* ===== Desktop sidebar ===== */

.sidebar {
  width: var(--sec-sidebar-width, 280px);
  min-width: var(--sec-sidebar-width, 280px);
  height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 28px 18px;
  border-right: 1px solid rgba(74, 144, 226, 0.22);
  background:
    radial-gradient(700px 420px at 0% 0%, rgba(37, 99, 235, 0.16), transparent 48%),
    radial-gradient(700px 420px at 100% 100%, rgba(14, 165, 233, 0.10), transparent 52%),
    linear-gradient(180deg, rgba(6, 14, 34, 0.86), rgba(8, 18, 36, 0.82));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.sidebar::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(59, 130, 246, 0.08), rgba(255, 255, 255, 0.01)),
    radial-gradient(circle at 20% 12%, rgba(14, 165, 233, 0.14), transparent 34%);
  opacity: 0.95;
}

.sidebar::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 1px;
  height: 100%;
  background: linear-gradient(
    180deg,
    rgba(96, 165, 250, 0.24),
    rgba(96, 165, 250, 0.04)
  );
  pointer-events: none;
}

.sidebar > * {
  position: relative;
  z-index: 1;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 4px;
}

.brand-logo,
.brand-mark {
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  border-radius: 16px;
  background: linear-gradient(135deg, #20a4ff, #315dff);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.18),
    0 12px 30px rgba(32, 164, 255, 0.25);
}

.brand-title {
  color: #ffffff;
  font-weight: 900;
  font-size: 18px;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.brand-subtitle {
  color: rgba(202, 218, 246, 0.68);
  font-size: 13px;
  margin-top: 4px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 34px;
}

.nav-link,
.nav-group-toggle {
  width: 100%;
  min-height: 46px;
  border: 0;
  border-radius: 18px;
  background: transparent;
  color: rgba(225, 234, 255, 0.78);
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  cursor: pointer;
  transition:
    background 0.18s ease,
    color 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.12s ease;
}

.nav-link:hover,
.nav-group-toggle:hover {
  background: rgba(42, 132, 255, 0.10);
  color: #ffffff;
}

.nav-link.active {
  background: linear-gradient(135deg, rgba(47, 139, 255, 0.28), rgba(0, 195, 255, 0.10));
  color: #ffffff;
  border: 1px solid rgba(61, 151, 255, 0.45);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.03),
    0 12px 28px rgba(2, 8, 24, 0.22);
}

.nav-group {
  display: flex;
  flex-direction: column;
}

.nav-group-toggle {
  color: rgba(154, 178, 221, 0.95);
}

.nav-group.open > .nav-group-toggle {
  color: #ffffff;
  background: rgba(42, 132, 255, 0.08);
}

.nav-chevron {
  font-size: 13px;
  opacity: 0.75;
  transition: transform 0.18s ease;
}

.nav-group.open .nav-chevron {
  transform: rotate(180deg);
}

.nav-submenu {
  display: none;
  flex-direction: column;
  gap: 5px;
  margin: 6px 0 10px 14px;
  padding-left: 12px;
  border-left: 1px solid rgba(88, 157, 255, 0.22);
}

.nav-group.open .nav-submenu {
  display: flex;
}

.nav-sublink {
  min-height: 38px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 700;
  padding-left: 14px;
  color: rgba(204, 218, 245, 0.72);
}

.nav-sublink.active {
  color: #ffffff;
  background: rgba(44, 139, 255, 0.22);
  border: 1px solid rgba(61, 151, 255, 0.35);
}

.nav-link-disabled {
  opacity: 0.42 !important;
  cursor: not-allowed !important;
  pointer-events: auto;
}

/* Compatibilità con vecchie classi sec-sidebar */
.sec-sidebar {
  width: var(--sec-sidebar-width, 280px);
  min-width: var(--sec-sidebar-width, 280px);
}

.sec-sidebar-brand,
.sec-sidebar-nav,
.sec-sidebar-link {
  display: none;
}

/* ===== Mobile top bar ===== */

.customer-mobile-bar {
  display: none;
}

/* ===== Mobile menu ===== */

@media (max-width: 980px) {
  body.customer-menu-open {
    overflow: hidden;
  }

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

  .sec-main {
    padding-top: 92px;
  }

  .customer-mobile-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    min-height: 78px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    z-index: 14000;
    background:
      radial-gradient(700px 280px at 0% 0%, rgba(37, 99, 235, 0.22), transparent 48%),
      linear-gradient(180deg, rgba(6, 14, 34, 0.98), rgba(8, 18, 36, 0.96));
    border-bottom: 1px solid rgba(96, 165, 250, 0.20);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
  }

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

  .customer-mobile-logo {
    width: 54px;
    height: 54px;
    flex: 0 0 auto;
    border-radius: 16px;
    background: linear-gradient(135deg, #20a4ff, #315dff);
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,0.18),
      0 12px 30px rgba(32, 164, 255, 0.25);
  }

  .customer-mobile-brand-title {
    color: #ffffff;
    font-size: 19px;
    font-weight: 900;
    line-height: 1.05;
    letter-spacing: -0.04em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .customer-mobile-brand-subtitle {
    margin-top: 4px;
    color: rgba(202, 218, 246, 0.68);
    font-size: 13px;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .customer-menu-toggle {
    width: 54px;
    height: 54px;
    flex: 0 0 auto;
    border-radius: 18px;
    border: 1px solid rgba(96, 165, 250, 0.24);
    background: rgba(10, 24, 56, 0.84);
    color: #ffffff;
    font-size: 30px;
    line-height: 1;
    font-weight: 400;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,0.06),
      0 14px 30px rgba(2,8,24,0.28);
  }

  .customer-menu-toggle:hover {
    background: rgba(21, 44, 96, 0.92);
  }

  .customer-sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 12900;
    background: rgba(2, 6, 23, 0.68);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.22s ease, visibility 0.22s ease;
  }

  body.customer-menu-open .customer-sidebar-backdrop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  body.customer-menu-open .sec-app {
    z-index: 13000 !important;
  }

  .sidebar {
    position: fixed !important;
    top: 78px !important;
    left: 0 !important;
    bottom: 0 !important;
    width: min(86vw, 360px) !important;
    min-width: 0 !important;
    height: calc(100vh - 78px) !important;
    padding: 24px 18px 32px !important;
    z-index: 13500 !important;
    border-right: 1px solid rgba(96, 165, 250, 0.22) !important;
    border-bottom: none !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    transform: translateX(-105%) !important;
    transition: transform 0.24s ease !important;
    background:
      radial-gradient(700px 420px at 0% 0%, rgba(37, 99, 235, 0.22), transparent 48%),
      radial-gradient(700px 420px at 100% 100%, rgba(14, 165, 233, 0.12), transparent 52%),
      linear-gradient(180deg, rgba(6, 14, 34, 0.99), rgba(8, 18, 36, 0.99)) !important;
    backdrop-filter: blur(18px) !important;
    -webkit-backdrop-filter: blur(18px) !important;
  }

  body.customer-menu-open .sidebar {
    transform: translateX(0) !important;
  }

  .sidebar .brand,
  .sidebar .sidebar-nav,
  .sidebar .nav-link,
  .sidebar .nav-group,
  .sidebar .nav-group-toggle,
  .sidebar .nav-submenu {
    position: relative;
    z-index: 13510 !important;
    opacity: 1 !important;
    visibility: visible !important;
    filter: none !important;
  }

  .sidebar .brand {
    display: none !important;
  }

  .sidebar .sidebar-nav {
    display: flex !important;
    flex-direction: column !important;
    margin-top: 0 !important;
    gap: 10px !important;
  }

  .sidebar .nav-link,
  .sidebar .nav-group-toggle {
    min-height: 54px !important;
    border-radius: 18px !important;
    color: rgba(225, 234, 255, 0.86) !important;
    font-size: 17px !important;
    font-weight: 800 !important;
    padding: 0 18px !important;
  }

  .sidebar .nav-link.active,
  .sidebar .nav-sublink.active {
    color: #ffffff !important;
  }

  .sidebar .nav-submenu {
    margin: 8px 0 12px 18px !important;
    padding-left: 14px !important;
    gap: 6px !important;
  }

  .sidebar .nav-group.open .nav-submenu {
    display: flex !important;
  }

  .sidebar .nav-sublink {
    min-height: 44px !important;
    font-size: 16px !important;
    border-radius: 16px !important;
  }

  .sec-topbar {
    margin-top: 0;
  }
}

/* ===== Small mobile refinement ===== */

@media (max-width: 520px) {
  .customer-mobile-bar {
    min-height: 74px;
    padding: 12px 14px;
  }

  .customer-mobile-logo {
    width: 48px;
    height: 48px;
    border-radius: 15px;
  }

  .customer-mobile-brand-title {
    font-size: 18px;
  }

  .customer-mobile-brand-subtitle {
    font-size: 12px;
  }

  .customer-menu-toggle {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    font-size: 28px;
  }

  .sidebar {
    top: 74px !important;
    height: calc(100vh - 74px) !important;
    width: min(88vw, 340px) !important;
  }

  .sec-main {
    padding-top: 88px;
  }
}