/* ==========================================================
   D-STAR SICILIA / XLX425 - WIDE COMPACT THEME
   Layout senza colonna laterale, pulsanti orizzontali e moduli più larghi.
   Non modifica logica XLXD, CallingHome, hash o configurazione reflector.
   ========================================================== */

:root {
  --rf-bg: #edf3f9;
  --rf-paper: #ffffff;
  --rf-paper-2: #f8fbff;
  --rf-line: #cfdbe8;
  --rf-blue: #1d4ed8;
  --rf-blue-2: #2563eb;
  --rf-blue-3: #60a5fa;
  --rf-navy: #0f172a;
  --rf-navy-2: #172554;
  --rf-text: #0f172a;
  --rf-muted: #64748b;
  --rf-success: #22c55e;
  --rf-warning: #f59e0b;
  --rf-shadow: 0 16px 38px rgba(15, 23, 42, .10);
  --rf-shadow-sm: 0 7px 20px rgba(15, 23, 42, .08);
}

html { min-height: 100%; }

body {
  padding-top: 58px !important;
  margin-bottom: 0 !important;
  min-height: 100vh;
  color: var(--rf-text);
  background:
    radial-gradient(circle at 0% 0%, rgba(37,99,235,.15), transparent 34rem),
    radial-gradient(circle at 80% 5%, rgba(96,165,250,.14), transparent 30rem),
    linear-gradient(180deg, #f8fbff 0%, var(--rf-bg) 100%);
  font-family: Arial, Helvetica, sans-serif;
}

a { color: var(--rf-blue); transition: .18s ease; }
a:hover { color: #1e40af; }

/* Top bar */
.rf-topbar,
.navbar,
.navbar-inverse,
.navbar-fixed-top {
  min-height: 58px;
  background: linear-gradient(90deg, #0f172a 0%, #172554 48%, #1e3a8a 100%) !important;
  border: 0 !important;
  box-shadow: 0 8px 24px rgba(15,23,42,.26);
}

.rf-navbar-brand,
.navbar-inverse .navbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 58px;
  color: #fff !important;
  font-weight: 900;
  letter-spacing: .3px;
  text-transform: uppercase;
}

.rf-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(135deg, #38bdf8, #2563eb);
  box-shadow: 0 0 0 4px rgba(96,165,250,.16);
}

.rf-brand-code {
  display: inline-block;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(147,197,253,.36);
  color: #dbeafe;
  font-size: 12px;
  line-height: 1;
}

.rf-navbar-meta { padding: 10px 14px 0 0; }
.rf-navbar-meta > li { margin-left: 8px; }

.rf-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.08);
  color: #dbeafe;
  font-size: 12px;
  white-space: nowrap;
}

.rf-dot { width: 8px; height: 8px; display: inline-block; border-radius: 50%; }
.rf-dot-online { background: var(--rf-success); box-shadow: 0 0 0 5px rgba(34,197,94,.15); }

/* Wide page wrapper */
.rf-page-wrap {
  width: 100%;
  max-width: 1920px;
  margin: 0 auto;
  padding: 18px 16px 0;
}

/* Compact title area */
.rf-titlebar {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 18px;
  min-height: 126px;
  padding: 20px 24px;
  border: 1px solid rgba(255,255,255,.62);
  border-radius: 18px;
  background:
    radial-gradient(circle at 82% 22%, rgba(147,197,253,.45), transparent 15rem),
    linear-gradient(135deg, #0f172a 0%, #1d4ed8 62%, #2563eb 100%);
  box-shadow: var(--rf-shadow);
  color: #fff;
}

.rf-titlebar:before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255,255,255,.055) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 34px 34px;
  opacity: .7;
}

.rf-title-copy,
.rf-title-status { position: relative; z-index: 2; }
.rf-title-copy { min-width: 320px; }

.rf-eyebrow {
  display: inline-flex;
  padding: 6px 10px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  color: #dbeafe;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .6px;
}

.rf-titlebar h1 {
  margin: 10px 0 5px;
  font-size: clamp(28px, 3.3vw, 48px);
  line-height: 1.02;
  font-weight: 950;
  letter-spacing: -.8px;
}

.rf-titlebar h1 span { color: #bfdbfe; }
.rf-titlebar p { max-width: 760px; margin: 0; color: #dbeafe; font-size: 14px; line-height: 1.5; }

.rf-title-status {
  display: grid;
  grid-template-columns: repeat(3, 120px) 160px;
  align-items: center;
  gap: 10px;
  min-width: 540px;
}

.rf-stat-inline {
  min-height: 72px;
  padding: 12px 13px;
  border-radius: 14px;
  background: rgba(255,255,255,.13);
  border: 1px solid rgba(255,255,255,.20);
  backdrop-filter: blur(8px);
}

.rf-stat-inline span {
  display: block;
  color: #bfdbfe;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.rf-stat-inline strong {
  display: block;
  margin-top: 5px;
  color: #fff;
  font-size: 22px;
  font-weight: 900;
}

/* Animated antenna SVG */
.rf-antenna-svg {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 96px;
}

.rf-antenna-svg svg { width: 160px; height: 120px; overflow: visible; }
.rf-mast,
.rf-base {
  stroke: url(#rfAntennaLine);
  stroke-width: 7;
  stroke-linecap: round;
}
.rf-beacon { fill: #fff; filter: drop-shadow(0 0 10px rgba(255,255,255,.55)); }
.rf-wave {
  fill: none;
  stroke: rgba(255,255,255,.42);
  stroke-width: 3;
  stroke-linecap: round;
  transform-origin: 70px 70px;
  animation: rf-wave-pulse 2.4s ease-out infinite;
}
.rf-wave-2 { animation-delay: .35s; opacity: .75; }
.rf-wave-3 { animation-delay: .7s; opacity: .50; }
@keyframes rf-wave-pulse {
  0% { opacity: 0; transform: scale(.92); }
  22% { opacity: .95; }
  100% { opacity: 0; transform: scale(1.08); }
}
.rf-beacon { animation: rf-beacon-pulse 1.8s ease-in-out infinite; }
@keyframes rf-beacon-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.12); opacity: .86; }
}

/* Button bar like classic XLX dashboards */
.rf-buttonbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 12px 0 14px;
  padding: 10px;
  border: 1px solid #f1c56a;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffd979, #ffc857);
  box-shadow: var(--rf-shadow-sm);
}

.rf-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 34px;
  padding: 8px 13px;
  border: 1px solid #9c6b08;
  border-radius: 4px;
  background: #fff8d7;
  color: #111827 !important;
  font-weight: 850;
  text-decoration: none !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
}

.rf-tab span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(15,23,42,.08);
  font-size: 12px;
}

.rf-tab:hover { background: #ffffff; transform: translateY(-1px); }
.rf-tab.active,
.rf-tab.active-soft {
  background: #7dd3fc;
  border-color: #0369a1;
  color: #082f49 !important;
}

/* Main content */
.rf-content-card {
  padding: 14px;
  border: 1px solid var(--rf-line);
  border-radius: 16px;
  background: rgba(255,255,255,.91);
  box-shadow: var(--rf-shadow-sm);
}

.rf-wide-content { min-height: calc(100vh - 330px); }

/* Users page layout: larger module board */
.rf-users-layout {
  display: flex;
  align-items: flex-start;
}

.rf-users-column,
.rf-modules-column { float: none; }
.rf-users-column { padding-right: 18px; }
.rf-modules-column { padding-left: 18px; }
.rf-modules-scroll { overflow-x: auto; padding-bottom: 4px; }

/* Tables */
.table {
  margin-bottom: 0;
  background: #fff;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
}

.table > tbody > tr > th,
.table > thead > tr > th,
.table > tr > th,
.table th {
  background: #dff5f7 !important;
  color: #0f172a;
  border: 1px solid #b9d7df !important;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: .3px;
  text-align: center;
  vertical-align: middle !important;
}

.table > tbody > tr > td,
.table > tr > td,
.table td {
  border: 1px solid #d5dde6 !important;
  vertical-align: middle !important;
}

.table-striped > tbody > tr:nth-of-type(odd) { background-color: #f8fbff; }
.table-hover > tbody > tr:hover { background-color: #eef6ff; }
.table-center * { text-align: center !important; }
.table-flag { height: 15px; }
.table-status { height: 25px; }

.rf-users-column > table,
.rf-modules-column > .rf-modules-scroll > table {
  border-radius: 10px;
  box-shadow: var(--rf-shadow-sm);
}

.rf-modules-table { min-width: 760px; }
.rf-modules-table > tbody > tr > th,
.rf-modules-table > tr > th,
.rf-modules-table th {
  min-width: 115px;
  padding: 8px 6px !important;
  background: #d8f2f5 !important;
  color: #0b172a !important;
  font-weight: 900;
}

.rf-modules-table td {
  min-width: 115px;
  padding: 0 !important;
  background: #ffffff;
}

.rf-modules-table td table {
  width: 100%;
  border: 0 !important;
  box-shadow: none !important;
}

.rf-modules-table td table td {
  padding: 6px 8px !important;
  border-left: 0 !important;
  border-right: 0 !important;
  background: #f6fdff;
}

.rf-modules-table a {
  display: block;
  padding: 5px 7px;
  border-radius: 4px;
  color: #0f4abf !important;
  background: rgba(226,244,255,.7);
  text-decoration: none !important;
  font-weight: 700;
}

.rf-modules-table a:hover { background: #dbeafe; }

/* Forms and buttons */
input,
select,
.form-control {
  height: 32px;
  border-radius: 4px !important;
  border: 1px solid #9ab6d4 !important;
  box-shadow: none !important;
}

input:focus,
select:focus,
.form-control:focus {
  border-color: var(--rf-blue) !important;
  box-shadow: 0 0 0 3px rgba(37,99,235,.12) !important;
}

button,
.btn,
input[type="submit"] {
  min-height: 32px;
  border-radius: 4px !important;
  background: linear-gradient(135deg, var(--rf-blue-2), #1d4ed8) !important;
  border: 1px solid #1d4ed8 !important;
  color: #fff !important;
  font-weight: 850;
  box-shadow: 0 5px 12px rgba(37,99,235,.22);
}
button:hover,
.btn:hover,
input[type="submit"]:hover { transform: translateY(-1px); }

.FilterField { width: 170px; max-width: 100%; }
.FilterSubmit { margin-left: 5px; }

/* Footer */
.footer {
  position: static !important;
  bottom: auto !important;
  width: 100%;
  height: auto !important;
  min-height: 70px;
  margin-top: 20px;
  padding-left: 0 !important;
  border-top: 0 !important;
}

.rf-footer {
  background: linear-gradient(90deg, #0f172a 0%, #172554 52%, #1e3a8a 100%) !important;
  color: #fff !important;
  text-align: center;
  padding: 16px 0 15px !important;
  box-shadow: 0 -8px 22px rgba(15,23,42,.14);
}
.rf-footer-title { font-size: 14px; font-weight: 900; letter-spacing: .9px; text-transform: uppercase; }
.rf-footer-subtitle { margin-top: 3px; color: #cbd5e1; font-size: 12px; }
.rf-footer-links { margin-top: 6px; color: #93c5fd; }
.rf-footer-links a,
.rf-footer a { color: #bfdbfe !important; font-weight: 750; text-decoration: none !important; }
.rf-footer-links a:hover,
.rf-footer a:hover { color: #fff !important; text-decoration: underline !important; }

/* Tooltips */
a.tip { text-decoration: none; }
a.tip:hover { position: relative; }
a.tip span { display: none; }
a.tip:hover span {
  background: #000;
  opacity: .86;
  border-radius: 8px;
  font-size: 12px;
  white-space: nowrap;
  color: #fff;
  padding: 6px 8px;
  margin: 10px;
  display: block;
  z-index: 50;
  position: absolute;
  top: 10px;
}

/* Hide old sidebar rules if any remain */
.sidebar { display: none !important; }
.main { padding: 0 !important; }

/* Responsive */
@media (max-width: 1320px) {
  .rf-title-status { grid-template-columns: repeat(3, 110px); min-width: 360px; }
  .rf-antenna-svg { display: none; }
}

@media (max-width: 992px) {
  .rf-titlebar { flex-direction: column; }
  .rf-title-status { grid-template-columns: repeat(3, minmax(90px,1fr)); min-width: 0; }
  .rf-users-layout { display: block; }
  .rf-users-column,
  .rf-modules-column { padding-left: 0; padding-right: 0; margin-bottom: 14px; }
}

@media (max-width: 768px) {
  body { padding-top: 58px !important; }
  .rf-navbar-meta { padding: 0 10px 10px; }
  .rf-navbar-meta > li { margin: 5px 0; }
  .rf-meta-pill { width: 100%; }
  .rf-page-wrap { padding: 12px 10px 0; }
  .rf-titlebar { padding: 18px; border-radius: 14px; }
  .rf-titlebar h1 { font-size: 28px; }
  .rf-title-status { grid-template-columns: 1fr; }
  .rf-buttonbar { gap: 6px; }
  .rf-tab { flex: 1 1 auto; }
  .rf-content-card { padding: 10px; overflow-x: auto; }
}

/* ==========================================================
   Extra pages: Lista moduli + Stato server
   ========================================================== */
.rf-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
  padding: 4px 2px 12px;
  border-bottom: 1px solid #dbe7f4;
}
.rf-section-head h2 {
  margin: 4px 0 4px;
  font-size: 26px;
  line-height: 1.15;
  color: var(--rf-navy);
  font-weight: 950;
}
.rf-section-head p { margin: 0; color: var(--rf-muted); }
.rf-eyebrow-dark { color: #1e40af; border-color: rgba(37,99,235,.25); background: rgba(219,234,254,.9); }
.rf-section-badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.rf-section-badges span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 999px;
  color: #0f172a;
  background: #eaf3ff;
  border: 1px solid #c9dcf5;
  font-weight: 850;
}

.rf-modlist-wrap { overflow-x: auto; padding-bottom: 6px; }
.rf-modlist-table { min-width: 1180px; }
.rf-modlist-table th { white-space: nowrap; }
.rf-modlist-table td { text-align: center; }
.rf-module-letter {
  font-weight: 950;
  color: #0f172a;
  font-size: 18px;
}
.rf-module-name {
  min-width: 150px;
  color: #1d4ed8;
  font-weight: 900;
  text-align: left !important;
}
.rf-mod-mapping { min-width: 190px; max-width: 260px; text-align: center; }
.rf-mod-peers { min-width: 155px; max-width: 220px; }
.rf-modlist-table code {
  display: inline-block;
  min-width: 72px;
  padding: 4px 6px;
  border-radius: 6px;
  color: #0f172a;
  background: #eef6ff;
  border: 1px solid #cfe1f6;
  font-weight: 850;
}
.rf-note-box {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  color: #334155;
  background: #fffbea;
  border: 1px solid #fde68a;
}
.rf-note-box code { color: #0f172a; background: rgba(255,255,255,.65); }

.rf-status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.rf-status-card {
  padding: 14px;
  min-height: 112px;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  border: 1px solid #d3e0ef;
  box-shadow: var(--rf-shadow-sm);
}
.rf-status-card span {
  display: block;
  color: #64748b;
  font-weight: 850;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: .5px;
}
.rf-status-card strong {
  display: block;
  margin-top: 7px;
  color: #0f172a;
  font-size: 19px;
  line-height: 1.2;
  word-break: break-word;
}
.rf-status-card small {
  display: block;
  margin-top: 8px;
  color: #64748b;
  font-size: 12px;
  word-break: break-word;
}
.rf-status-row { margin-top: 6px; }
.rf-mini-title {
  margin: 0 0 10px;
  color: #0f172a;
  font-size: 16px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.rf-status-table th,
.rf-status-table td { text-align: left !important; }
.rf-port-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.rf-port-pill {
  display: grid;
  grid-template-columns: 62px 1fr;
  gap: 2px 8px;
  align-items: center;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid #dbe7f4;
  background: #f8fbff;
}
.rf-port-pill strong { grid-row: span 2; color: #0f172a; font-size: 17px; }
.rf-port-pill span { color: #334155; font-weight: 800; }
.rf-port-pill em { color: #64748b; font-style: normal; font-size: 12px; }
.rf-port-pill.ok { border-color: #bbf7d0; background: #f0fdf4; }
.rf-port-pill.ok em { color: #15803d; font-weight: 800; }
.rf-port-pill.warn { border-color: #fed7aa; background: #fff7ed; }
.rf-port-pill.warn em { color: #c2410c; font-weight: 800; }

@media (max-width: 1200px) {
  .rf-status-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rf-port-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  .rf-section-head { display: block; }
  .rf-section-badges { justify-content: flex-start; margin-top: 12px; }
  .rf-status-grid { grid-template-columns: 1fr; }
  .rf-port-grid { grid-template-columns: 1fr; }
}
