/* ═══════════════════════════════════════════════════════════
   SvxLink Dashboard by CN8VX — css/style.css
   ═══════════════════════════════════════════════════════════ */

/* ─── 1. VARIABLES ──────────────────────────────────────── */

:root {
    --rf-bg:        #0a0e14;
    --rf-panel:     #111820;
    --rf-border:    #1e2d3d;
    --rf-accent:    #00d4ff;
    --accent2:      #0af;
    --rf-green:     #00ff9d;
    --rf-amber:     #ffb020;
    --rf-red:       #ff4444;
    --rf-muted:     #6b8aa0;
    --rf-text:      #c8d8e8;
    --rf-dim:       #2a3a4a;
    --rf-listening: #0088bb;
    --rf-tx:        #ff4444;
    --rf-rx:        #00ff9d;
    --bg-panel:     #024057;
    --bg-panel2:    #1a2332;
    --border:       #1e2d3d;
    --bg-row-alt:   #131c27;
    --tr-hover:     #1a2a3a;
    --lien-color:   #78f5d0;
    --bg-badge:     rgba(0,212,255,0.12);
    --rf-row-tx:    rgba(255, 68, 68, 0.1);


    --danger:       #e03c3c;
    --warn:         #e07a1a;
    --ok:           #00ff9d;
    --bg-footer:    #111820;
    --footer-text:  #4a6580;
    --footer-bar:   #253c55;
    --border-theme: #4a6580;
    --border-module: #0088bb;
    --rf-tg-default: #62ff00;
    --rf-tg-monitor: #a2ff00;
    --rf-tg-active:  #ffdd00;
    --rf-ctcss: #a2ff00;


    --font-ui:      'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-data:    'JetBrains Mono', 'Courier New', monospace;
    --text-head:    #ffffff;
    --rpt-type:     #fdb59a;
}

/* ─── 2. LIGHT MODE (révisé pour lisibilité optimale) ───── */
.light-mode,
.light-mode .dark-bg {
    --rf-bg:        #cae0ef;        
    --rf-panel:     #d3e7fb;
    --rf-border:    #99aecd;
    --rf-accent:    #27464c;
    --accent2:      #0088cc;
    --rf-green:     #128957;
    --rf-amber:     #f59c07;
    --rf-red:       #c23b22;
    --rf-muted:     #1a2a3a;
    --rf-text:      #1f2e3a;
    --rf-dim:       #e2eaf0;
    --rf-listening: #0077aa;
    --rf-tx:        #cc4411;
    --rf-rx:        #2c9e6e;
    --bg-panel:     #98a9b5;
    --bg-panel2:    #d7e1eb;
    --border:       #99aecd;
    --bg-row-alt:   #bdd0e2;
    --tr-hover:     #00d4ff14;
    --lien-color:   #ff7b44;
    --bg-badge:     rgba(0,119,182,0.10);
    --rf-row-tx:    rgba(171, 49, 49, 0.39);

    --danger:       #c23b22;
    --warn:         #c97e00;
    --ok:           #2c9e6e;
    --bg-footer:    #d3e7fb;
    --footer-text:  #5a7794;
    --footer-bar:   #4a6580;
    --border-theme: #8faccc;
    --border-module: #0077b6;
    --rf-tg-default: #2a6803;
    --rf-tg-monitor: #68921e;
    --rf-tg-active:  #b46b06;
    --rf-ctcss:      #1f2e3a;

    --text-head:     #6b8aa0;
    --rpt-type:      #e77a07;
}

/* Réinitialisations light-mode pour éléments spécifiques*/ 
.light-mode .progress-track {
    background: #cdcdcd;
}

/* ─── 3. BASE ────────────────────────────────────────────── */
html { font-size: 15px; scroll-behavior: smooth; }

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    background-color: var(--rf-bg);
    color: var(--rf-text);
}

.dark-bg {
    background: var(--rf-bg);
    padding: 16px;
    font-family: 'Rajdhani', sans-serif;
    color: var(--rf-text);
    min-height: 100dvh;
}

/* ─── 4. LAYOUT GRIDS (version desktop) ──────────────────── */
.grid-top {
    display: grid;
    grid-template-columns: 0.6fr 0.7fr 0.65fr 1fr;
    gap: 10px;
    align-items: stretch;
}
/* ─── AUDIO LEVEL METER ──────────────────────────────────── */
.audio-level-panel {
    /* display: flex; */
    flex-direction: column;
    justify-content: center;
    /* padding: 0 0; */
}

.meter-track {
    position: relative;
    height: 14px;
    border-radius: 7px;
    overflow: hidden;
    background: var(--rf-dim);
    margin: 6px 8px 4px;
}

.meter-scale {
    position: absolute;
    inset: 0;
    opacity: 0.30;
    background: linear-gradient(90deg,
        var(--rf-amber) 0%, var(--rf-amber) 53.3%,
        var(--rf-green) 53.3%, var(--rf-green) 86.7%,
        var(--rf-red) 86.7%, var(--rf-red) 100%);
}

.meter-fill {
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: 0%;
    border-radius: 7px;
    background: var(--rf-amber);
    transition: width 120ms linear, background-color 200ms ease;
}

.meter-readout {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 0 8px 4px;
    font-family: var(--font-data);
    font-size: 13px;
    color: var(--rf-text);
}

.meter-status {
    font-size: 11px;
    color: var(--rf-muted);
}
.grid-main {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    margin-bottom: 10px;
}

.grid-bottom {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 10px;
}

.grid-bottom-left {
    display: grid;
    grid-template-rows: 1fr 1fr;
    gap: 10px;
}

.grid-bottom-right {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.fr-pn {
    margin-bottom: 10px;
    width: auto;
}

/* ─── 5. TOP BAR ─────────────────────────────────────────── */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--rf-border);
    padding-bottom: 12px;
    flex-wrap: wrap;
    gap: 10px;
}

.header-titles {
    font-family: var(--font-ui);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-head);
    letter-spacing: .04em;
    line-height: 1.2;
}

.header-callsign {
    color: var(--rf-accent);
    font-weight: 700;
}

.header-clock-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.3;
}

.header-clock {
    font-family: var(--font-data);
    font-size: 1.0rem;
    font-weight: 600;
    margin-left: 6px;
    margin-right: 10px;
    color: var(--rf-accent);
    letter-spacing: .03em;
    white-space: nowrap;
}

.header-clock-wrap .clock-tz {
    font-size: .7rem;
    margin-left: 6px;
}

.header-subtitle {
    font-size: .8rem;
    color: var(--rf-muted);
    margin-top: 2px;
    letter-spacing: .03em;
}

.repeater-type {
    color: var(--rpt-type);
    font-weight: 700;
}

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

.header-logo {
    height: 70px;
    width: auto;
    border-radius: 50%;
}

.header-logo-text {
    font-family: var(--font-ui);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--rf-accent);
    letter-spacing: .08em;
}

.header-main {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.status-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
    opacity: 0.5;
    animation: none;
}

.status-label.active .status-dot {
    opacity: 1;
    animation: pulse-dot 1.8s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.4; }
}

.status-label {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    border-radius: 20px;
    border: 1px solid transparent;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: background .2s, border-color .2s, color .2s;
}

.status-label.active   {
    background: rgba(0,200,128,.15);
    border-color: var(--ok);
    color: var(--ok);
}
.status-label.inactive {
    background: rgba(224,60,60,.12);
    border-color: var(--danger);
    color: var(--danger);
}
.status-label.failed   {
    background: rgba(224,60,60,.15);
    border-color: var(--warn);
    color: var(--warn);
}

.theme-btn {
    background: none;
    border: 1px solid var(--border-theme);
    border-radius: 8px;
    cursor: pointer;
    padding: 5px 9px;
    font-size: 1.1rem;
    line-height: 1;
    transition: border-color .25s, background .25s, transform .2s;
}

.theme-btn:hover {
    border-color: var(--rf-accent);
    background: rgba(0, 212, 255, 0.08);
}

/* ─── NAVBAR ─────────────────────────────────────────────── */
.dash-nav {
    background: var(--rf-panel);
    border-bottom: 1px solid var(--rf-border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.nav-inner {
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.lang-switch {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.lang-flag {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 4px 6px;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.15s, border-color 0.15s;
}

.lang-flag:hover { opacity: 0.85; }

.lang-flag.active {
    opacity: 1;
    border-color: var(--rf-accent);
}

.nav-menu {
    list-style: none;
    display: flex;
    gap: 0;
    overflow-x: auto;
    margin-block-start: 0px;
    margin-block-end: 0px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.nav-menu::-webkit-scrollbar { display: none; }

.nav-link {
    display: block;
    padding: 11px 16px;
    font-family: var(--font-ui);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--rf-muted);
    letter-spacing: 0.06em;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    white-space: nowrap;
    transition: color 0.18s, border-color 0.18s;
}

.nav-link:hover {
    color: var(--rf-accent);
    text-decoration: none;
}

.nav-link.active {
    color: var(--rf-accent);
}

.nav-link-ext {
    font-size: 0.78rem;
    opacity: 0.7;
}

.nav-link-ext:hover {
    color: var(--rf-amber);
    opacity: 1;
}

/* ─── 6. PANELS (shared base) ────────────────────────────── */
.panel,
.freq-panel,
.module-panel,
.repeater-status-panel {
    background: var(--rf-panel);
    border: 1px solid var(--rf-border);
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

.panel::before,
.freq-panel::before,
.module-panel::before,
.repeater-status-panel::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: var(--rf-accent);
    opacity: 0.4;
}

.panel.green::before { background: var(--rf-green); }
.panel.amber::before { background: var(--rf-amber); }
.panel.red::before   { background: var(--rf-red); }

.repeater-status-panel.red::before   { background: var(--rf-red);   opacity: 1; }
.repeater-status-panel.green::before { background: var(--rf-green); opacity: 1; }

.repeater-status-panel.red   { border-color: var(--rf-red);   background: rgba(255,68,68,0.06); }
.repeater-status-panel.green { border-color: var(--rf-green); background: rgba(0,255,157,0.06); }

.repeater-status-panel.red   .panel-bar { background: rgba(255,68,68,0.15); }
.repeater-status-panel.green .panel-bar { background: rgba(0,255,157,0.15); }

/* ─── 7. PANEL TYPOGRAPHY ────────────────────────────────── */
.panel-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--rf-muted);
    margin-bottom: 6px;
}

.panel-bar {
    background: var(--bg-panel2);
    padding: 5px 2px;
    border-bottom: 1px solid var(--border);
}

.panel-value, .freq-main, .rs-bar, 
.module-list, .activity-log {
    padding: 8px;
    padding-block-end: 0;
}

.node-list {
    padding: 6px 8px;
}

.panel-value {
    font-family: 'Share Tech Mono', monospace;
    font-size: 26px;
    color: var(--rf-accent);
    line-height: 1;
}

.panel-value.green { color: var(--rf-green); }
.panel-value.amber { color: var(--rf-amber); }

.panel-sub {
    font-size: 11px;
    color: var(--rf-muted);
    margin-top: 3px;
    margin-block: 5px;
    margin-left: 10px;
}

.right-block {
    display:flex;
    flex-direction:column;
    gap:10px;
}

.block-icon,
.qth-icon,
.activity-icon {
    font-size: 1.1rem;
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: 8px;
}

.qth-icon {
    font-size: 1rem;
    margin-right: 2px
}

/* ─── 8. FREQUENCY PANEL ─────────────────────────────────── */
.freq-block { flex: 1; }

.freq-main {
    font-family: 'Share Tech Mono', monospace;
    font-size: 32px;
    color: var(--rf-accent);
    text-shadow: 0 0 10px rgba(0,212,255,0.2);
}

/* ─── 9. SQUELCH BAR ─────────────────────────────────────── */
.squelch-bar-wrap { flex: 2; }

.squelch-bar-label {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--rf-muted);
    margin-bottom: 4px;
}

.squelch-bar {
    height: 8px;
    background: var(--rf-dim);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.squelch-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--rf-green) 0%, var(--rf-amber) 75%, var(--rf-red) 100%);
    width: 68%;
    transition: width .3s;
}

.squelch-threshold {
    position: absolute;
    top: 0; bottom: 0;
    width: 2px;
    background: var(--rf-accent);
    left: 30%;
}

/* ─── 10. SPECTRUM ───────────────────────────────────────── */
.spectrum {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 36px;
    margin-top: 8px;
}

.spec-bar {
    flex: 1;
    background: var(--rf-dim);
    border-radius: 2px 2px 0 0;
    min-height: 2px;
    transition: height .2s;
}

canvas#specCanvas { width: 100%; height: 50px; display: block; }

/* ─── 11. MODULES ────────────────────────────────────────── */
.module-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    margin-bottom: 10px;
}

.module-badge {
    background: rgba(0, 212, 255, 0.10);
    border: 1px solid var(--border-module);
    color: var(--rf-accent);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-family: 'Share Tech Mono', monospace;
}
.module-badge.active {
    background: rgba(46, 204, 113, 0.22);
    border-color: #2ecc71;
    color: #2ecc71;
    box-shadow: 0 0 8px rgba(46, 204, 113, 0.45);
    font-weight: bold;
}
.module-badge.warn {
    background: rgba(255, 176, 32, 0.18);
    border-color: var(--rf-amber);
    color: var(--rf-amber);
    box-shadow: 0 0 8px rgba(255, 176, 32, 0.35);
    font-weight: bold;
}
.module-empty {
    color: var(--rf-muted);
    font-size: 12px;
}
/* ─── 12. CALLER LIST ────────────────────────────────────── */
.caller-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 300px;
    overflow-y: auto;
}

.caller-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    background: var(--rf-dim);
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: background .15s;
}

.caller-row:hover { background: var(--rf-border); }

.caller-cs {
    font-family: 'Share Tech Mono', monospace;
    font-size: 14px;
    color: var(--rf-accent);
    min-width: 70px;
}

.caller-name { flex: 1; color: var(--rf-text); font-weight: 500; }

.caller-time {
    font-size: 11px;
    color: var(--rf-muted);
    font-family: 'Share Tech Mono', monospace;
}

.talker-live-icon {
    display: inline-block;
    font-size: 12px;
    color: var(--rf-tx);
    animation: talkerPulse 1.2s ease-in-out infinite;
}

@keyframes talkerPulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.35; }
}

/* ─── 12B. NODES LIST ────────────────────────────────────── */
.node-badge {
    display: inline-block;
    background: rgba(0, 212, 255, 0.10);
    border: 1px solid var(--border-module);
    color: var(--rf-accent);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-family: 'Share Tech Mono', monospace;
    width:80px;
}

.node-badge.transmitting {
    background: rgba(255, 68, 68, 0.30);
    border-color: var(--rf-red);
    color: #fff;
    font-weight: bold;
    box-shadow: 0 0 8px rgba(255, 68, 68, 0.5);
    animation: talkerPulse 1.2s ease-in-out infinite;
    width:80px;
}
.echolink-txing .callsign-link {
    color: var(--rf-red);
    font-weight: bold;
    animation: talkerPulse 1.2s ease-in-out infinite;
}
/* ─── 13. BADGES ─────────────────────────────────────────── */
.badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 3px;
    letter-spacing: 0.5px;
}

.badge-green { background: rgba(0,255,157,0.12);  color: var(--rf-green); }
.badge-amber { background: rgba(255,176,32,0.12); color: var(--rf-amber); }
.badge-blue  { background: var(--bg-badge);  color: var(--rf-accent); }

/* ─── 14. NODE LIST ──────────────────────────────────────── */
.node-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.node-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.node-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.node-name {
    flex: 1;
    color: var(--rf-muted);
    font-family: 'Share Tech Mono', monospace;
    font-size: 12px;
}

.node-ping { color: var(--rf-text); font-size: 11px; }

/* ─── 15. ACTIVITY LOG ───────────────────────────────────── */
.activity-log {
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    color: var(--rf-muted);
    max-height: 220px;
    overflow-y: auto;
    line-height: 1.4;
}

.log-line {
    display: grid;
    grid-template-columns: 58px 52px 1fr;
    gap: 6px;
    align-items: baseline;
    padding: 3px 4px;
    border-bottom: 1px solid var(--rf-border);
}

.log-line:last-child { border-bottom: none; }

.log-line:hover { background: var(--rf-dim); border-radius: 4px; }

.log-time {
    color: var(--rf-muted);
    font-size: 11px;
    white-space: nowrap;
}

.log-type {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 1px 5px;
    border-radius: 3px;
    text-align: center;
    white-space: nowrap;
}

.log-msg {
    color: var(--rf-text);
    font-size: 11px;
    word-break: break-word;
}

.ev-link   { background: rgba(0,212,255,0.10);  color: var(--rf-accent); }
.ev-warn   { background: rgba(255,176,32,0.12); color: var(--rf-amber); }
.ev-module { background: rgba(0,212,255,0.08);  color: var(--rf-accent); }
.ev-info   { background: rgba(74,101,128,0.10); color: var(--rf-muted); }

.activity-log .ts     { color: var(--rf-dim); }
.activity-log .ev-ok  { color: var(--rf-green); }

.activity-log::-webkit-scrollbar { width: 8px; height: 6px; }
.activity-log::-webkit-scrollbar-track { background: transparent; }
.activity-log::-webkit-scrollbar-thumb { background: #253350; border-radius: 3px; }
.activity-log::-webkit-scrollbar-thumb:hover { background: #4a607e; }

#f-date {
    background: var(--rf-bg);
    border: 1px solid var(--rf-border);
    border-radius: 5px;
    color: var(--rf-text);
    font-family: var(--font-data);
    font-size: 12px;
    padding: 5px 9px;
    outline: none;
    transition: border-color .2s;
    cursor: pointer;
}
#f-date:focus { border-color: var(--rf-accent); }
#f-date::-webkit-calendar-picker-indicator {
    filter: invert(0.6) sepia(1) saturate(3) hue-rotate(165deg);
    cursor: pointer;
}

.ev-txstart {
    background: rgba(220, 53, 69, 0.15);
    border: 1px solid rgba(220, 53, 69, 0.5);
    color: #dc3545;
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .5px;
}

.ev-txstop {
    background: rgba(40, 167, 69, 0.15);
    border: 1px solid rgba(40, 167, 69, 0.5);
    color: #28a745;
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .5px;
}

.ev-unlink {
    background: rgba(255, 100, 60, 0.15);
    border: 1px solid rgba(255, 100, 60, 0.5);
    color: #ff6438;
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .5px;
}

/* ─── 16. STAT ROWS ──────────────────────────────────────── */
.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 6px;
    border-bottom: 1px solid var(--rf-border);
    font-size: 12px;
}

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

.stat-row.warn {
    border-left: 2px solid var(--rf-amber);
    padding-left: 6px;
}

.stat-row.crit {
    border-left: 2px solid var(--rf-red);
    padding-left: 6px;
}

.stat-key { color: var(--rf-muted); font-weight: 500; }

.stat-val {
    font-family: 'Share Tech Mono', monospace;
    color: var(--rf-text);
    text-align: right;
    max-width: 55%;
    word-break: break-word;
}

/* ─── 17. VALUE COLOR MODIFIERS ──────────────────────────── */
.val-ok   { color: var(--rf-green); }
.val-warn { color: var(--rf-amber); }
.val-crit { color: var(--rf-red); font-weight: 700; }

.panel-value.val-ok   { color: var(--rf-green); }
.panel-value.val-warn { color: var(--rf-amber); }
.panel-value.val-crit { color: var(--rf-red); text-shadow: 0 0 10px currentColor; }

/* ─── 18. PROGRESS BARS ──────────────────────────────────── */
.progress-wrap { margin: 12px 6px; }

.progress-item { margin-bottom: 8px; }

.progress-label-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 11px;
    color: var(--rf-muted);
}

.progress-track {
    background: var(--rf-border);
    border-radius: 4px;
    height: 5px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-ok      { background: linear-gradient(90deg, #2ecc71, #27ae60); }
.progress-warning { background: linear-gradient(90deg, #f39c12, #e67e22); }
.progress-danger  { background: linear-gradient(90deg, #e74c3c, #c0392b); }

/* ─── 19. CLOCK PANEL ────────────────────────────────────── */
.clock-value {
    font-weight: bold;
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
}

.panel-value.clock-value {
    font-size: 28px;
}

.clock-tz {
    color: var(--rf-muted);
    margin-left: 1px;
    font-family: monospace;
}

#clock-date {
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--rf-muted);
    margin-bottom: 6px;
}

/* ─── 20. MISC ───────────────────────────────────────────── */
.uptime-ring {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.callsign-link {
    font-size: 13px;
    color: var(--accent2);
    font-weight: 600;
    text-decoration: none;
    transition: color .15s;
}

.callsign-link:hover {
    color: var(--lien-color);
    text-decoration: none;
}

.callsign-reflector {
    font-size: 13px;
    color: var(--rpt-type);
    font-weight: 600;
}

.el-connect-mode {
    color: var(--accent2);
    font-weight: 600;
}

.tg-default { color: var(--rf-tg-default); }
.tg-monitor { color: var(--rf-tg-monitor); }
.tg-active { color: var(--rf-tg-active); }
.el-active { color: var(--rf-tg-active); font-size: 11px; }
.node-count { color: var(--rf-tg-monitor); }
.rpt-ctcss { color: var(--rf-ctcss); }

.status-connected {
    color: var(--rf-green);
    font-weight: bold;
}
.status-disconnected {
    color: var(--rf-red);
    font-weight: bold;
}
.status-banned {
    color: var(--rf-amber);
    font-weight: bold;
}

/* ─── 21. REPEATER STATUS PANEL ──────────────────────────── */
.rs-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 8px;
}

.rs-state {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 6px;
    border: 1px solid var(--rf-border);
    background: transparent;
    font-family: 'Share Tech Mono', monospace;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--rf-muted);
    opacity: 0.35;
    transition: opacity .3s, border-color .3s, color .3s, background .3s;
    cursor: default;
    user-select: none;
}

.rs-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.4;
    flex-shrink: 0;
}

.rs-state.active.listening {
    opacity: 1;
    color: var(--rf-listening);
    border-color: var(--rf-listening);
    background: rgba(0, 255, 157, 0.07);
}

.rs-state.active.listening .rs-dot {
    opacity: 1;
    animation: rs-pulse 2s ease-in-out infinite;
}

.rs-state.active.rx {
    opacity: 1;
    color: var(--rf-rx);
    border-color: var(--rf-rx);
    background: rgba(0, 212, 255, 0.08);
}

.rs-state.active.rx .rs-dot {
    opacity: 1;
    animation: rs-pulse 1.1s ease-in-out infinite;
}

.rs-state.active.tx {
    opacity: 1;
    color: var(--rf-tx);
    border-color: var(--rf-tx);
    background: rgba(255, 68, 68, 0.08);
}

.rs-state.active.tx .rs-dot {
    opacity: 1;
    animation: rs-pulse 0.6s ease-in-out infinite;
}

@keyframes rs-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.15; }
}

.rs-desc {
    font-size: 11px;
    color: var(--rf-muted);
    font-family: 'Share Tech Mono', monospace;
    letter-spacing: 0.5px;
    margin-top: 8px;
    margin-bottom: 8px;
    margin-left: 10px;
}

/* ─── 22. REFLECTOR TABLE STYLES ──────────────────────────── */
.reflector-grid {
    display: grid;
    grid-template-rows: 1fr 1fr;
    gap: 10px;
}

.reflector-sidebar {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.panel-full-height {
    grid-row: span 2;
}

.rf-table-container {
    overflow-x: auto;
    max-height: 400px;
    overflow-y: auto;
}

.rf-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    font-family: 'Share Tech Mono', monospace;
}

.rf-table th,
.rf-table td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.rf-table th {
    position: sticky;
    top: 0;
    background: var(--bg-panel);
    z-index: 10;
    color: var(--rf-text);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 1.0rem;
    letter-spacing: 0.5px;
}

.rf-table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background .15s;
}
.rf-table tbody tr:nth-child(even) { 
    background: var(--bg-row-alt); 
}

.rf-table tbody tr:hover { 
    background: var(--tr-hover) 
}

.rf-row-tx {
    background: var(--rf-row-tx);
    animation: rf-pulse 0.5s ease-in-out;
}

.rf-td-time {
    font-family: 'Share Tech Mono', monospace;
    white-space: nowrap;
}

.rf-td-cs {
    font-weight: 500;
}

.rf-td-tg {
    font-family: 'Share Tech Mono', monospace;
}

.rf-td-dur {
    font-family: 'Share Tech Mono', monospace;
    text-align: right;
}

.gateway-name {
    color: var(--rf-muted);
    font-style: italic;
}

/* ─── 23. Footer STYLES ──────────────────────────── */
.fixed-footer {
  position: fixed;
  bottom: 0;
  width: 100%;
  background-color: var(--bg-footer);
  color: var(--footer-text);
  text-align: center;
  font-size: 0.8rem;
  border-top: 1px solid var(--footer-bar);
  z-index: 1000;
}

.fixed-footer a {
  color: var(--accent2);
  font-weight: 600;
  text-decoration: none;
  transition: color .15s;
}

.fixed-footer a:hover {
  color: var(--lien-color);
  text-decoration: none;
}

/* ─── 24. logsvx STYLES ──────────────────────────── */
.log-page-wrap {
	padding: 0 0 80px;
}
.log-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	padding: 12px 14px;
	background: var(--rf-panel);
	border: 1px solid var(--rf-border);
	border-radius: 8px;
	margin-bottom: 12px;
}
.log-toolbar label {
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 1px;
	text-transform: uppercase;
	color: var(--rf-muted);
	margin-right: 4px;
}
.log-toolbar select,.log-toolbar input[type="text"],.log-toolbar input[type="number"] {
	background: var(--rf-bg);
	border: 1px solid var(--rf-border);
	border-radius: 5px;
	color: var(--rf-text);
	font-family: var(--font-data);
	font-size: 12px;
	padding: 5px 9px;
	outline: none;
	transition: border-color .2s;
}
.log-toolbar select:focus, .log-toolbar input:focus {
	border-color: var(--rf-accent);
}
.log-toolbar input[type="text"] {
	width: 110px;
}
.log-toolbar input[type="number"] {
	width: 70px;
}
.log-btn {
	background: rgba(0,212,255,0.1);
	border: 1px solid var(--rf-accent);
	border-radius: 5px;
	color: var(--rf-accent);
	font-size: 12px;
	font-weight: 700;
	padding: 5px 12px;
	cursor: pointer;
	transition: background .2s;
	letter-spacing: .5px;
}
.log-btn:hover {
	background: rgba(0,212,255,0.22);
}
.log-btn.danger {
	border-color: var(--rf-red);
	color: var(--rf-red);
	background: rgba(255,68,68,0.08);
}
.log-btn.danger:hover {
	background: rgba(255,68,68,0.2);
}
.log-btn.green {
	border-color: var(--rf-green);
	color: var(--rf-green);
	background: rgba(0,255,157,0.08);
}
.log-btn.green:hover {
	background: rgba(0,255,157,0.18);
}
.log-btn.amber {
	border-color: var(--rf-amber);
	color: var(--rf-amber);
	background: rgba(255,176,32,0.08);
}
.log-btn.amber:hover {
	background: rgba(255,176,32,0.18);
}

.toolbar-sep {
	flex: 1;
}
.log-stats {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 12px;
}
.log-stat-badge {
	display: flex;
	align-items: center;
	gap: 6px;
	color: var(--accent2);
	padding: 5px 11px;
	border-radius: 20px;
	border: 1px solid var(--rf-border);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .5px;
	cursor: pointer;
	transition: border-color .2s, background .2s;
	text-decoration: none;
}
.log-stat-badge:hover {
	border-color: var(--lien-color);
	background: rgba(0,212,255,0.07);
}
.log-stat-badge.active-filter {
	border-color: var(--rf-accent);
	background: rgba(0,212,255,0.13);
}
.stat-badge-count {
	font-family: var(--font-data);
	font-size: 13px;
}
.log-table-wrap {
	overflow-x: auto;
	border-radius: 8px;
	border: 1px solid var(--rf-border);
}
.log-table {
	width: 100%;
	border-collapse: collapse;
	font-family: var(--font-data);
	font-size: 12px;
}
.log-table th {
	position: sticky;
	top: 0;
	background: var(--rf-panel);
	padding: 9px 12px;
	text-align: left;
	font-weight: 700;
	text-transform: uppercase;
	font-size: 10px;
	letter-spacing: 1px;
	color: var(--rf-muted);
	border-bottom: 1px solid var(--rf-border);
	white-space: nowrap;
	z-index: 10;
}
.log-table td {
	padding: 6px 12px;
	border-bottom: 1px solid rgba(30,45,61,0.6);
	vertical-align: middle;
}
.log-table tbody tr:nth-child(even) {
	background: var(--bg-row-alt);
}
.log-table tbody tr:hover {
	background: var(--tr-hover);
}
.log-table tbody tr.log-row-rx {
	border-left: 2px solid var(--rf-green);
}
.log-table tbody tr.log-row-tx {
	border-left: 2px solid var(--rf-red);
}
.log-table tbody tr.log-row-link {
	border-left: 2px solid var(--rf-accent);
}
.log-table tbody tr.log-row-warn {
	border-left: 2px solid var(--rf-amber);
}
.td-time {
	white-space: nowrap;
	color: var(--rf-muted);
	font-size: 12px;
}
.td-date {
	white-space: nowrap;
	color: var(--rf-muted);
	font-size: 11px;
	opacity: .7;
}
.td-type {
	text-align: center;
	white-space: nowrap;
}
.td-tg {
	font-size: 12px;
	color: var(--rf-accent);
}
.td-msg {
	color: var(--rf-text);
	word-break: break-word;
	max-width: 500px;
}
.td-raw {
	color: var(--rf-muted);
	font-size: 10px;
	word-break: break-all;
	max-width: 350px;
	cursor: pointer;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}
.td-raw:hover {
	color: var(--rf-text);
}
.live-dot {
	display: inline-block;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--rf-green);
	margin-right: 6px;
	animation: pulse-dot 1.6s ease-in-out infinite;
}
.live-dot.paused {
	background: var(--rf-amber);
	animation: none;
}
.log-empty {
	padding: 40px;
	text-align: center;
	color: var(--rf-muted);
	font-size: 14px;
}
.log-entries {
    display: flex;
    align-items: center;
    font-family: var(--font-data);
    font-size: .85rem;
    margin-left: 6px;
    color: var(--rf-muted);
    letter-spacing: .03em;
    white-space: nowrap;
}
.log-entries-icon {
    display: inline-block;
    width: 12px;
    height: 18px;
}
.log-count-badge {
    display: flex;
    align-items: center;
	background: var(--bg-badge);
	border: 1px solid var(--border-module);
	color: var(--rf-accent);
	border-radius: 10px;
	font-size: 10px;
	font-weight: 700;
	padding: 2px 8px;
	font-family: var(--font-data);
    margin-right: 3px;
}
.log-count-badge1 {
	background: var(--bg-badge);
	border: 1px solid var(--border-module);
	color: var(--rf-accent);
	border-radius: 10px;
	font-size: 10px;
	font-weight: 700;
	padding: 2px 8px;
	font-family: var(--font-data);
}
.last-update {
	font-size: 10px;
	color: var(--rf-muted);
	font-family: var(--font-data);
}
.log-panel-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 12px;
}
.log-panel-title {
    display: flex;
	align-items: center;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 1px;
	text-transform: uppercase;
	color: var(--rf-muted);
	gap: 8px;
}

.filtre-date {
    background: rgba(255, 176, 32, .15);
    border-color: var(--rf-amber);
    color: var(--rf-amber);
}

/* ── Pagination ─────────────────────────────────────── */
.info-pag, .pag-info {
	font-size: .78rem;
    color: var(--rf-muted) ;
    font-family: var(--font-data);
}

.pag-info { 
    text-align: center;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 16px 0 6px;
    flex-wrap: wrap;
}

.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 30px;
    padding: 0 8px;
    border-radius: 5px;
    font-size: 12px;
    font-family: var(--font-data);
    font-weight: 600;
    letter-spacing: .5px;
    text-decoration: none;
    border: 1px solid var(--rf-border);
    color: var(--rf-muted);
    background: transparent;
    transition: border-color .15s, color .15s, background .15s;
    white-space: nowrap;
}
.page-btn:hover {
    border-color: var(--rf-accent);
    color: var(--rf-accent);
    background: rgba(0,212,255,.07);
    text-decoration: none;
}
.page-btn.active {
    border-color: var(--rf-accent);
    background: rgba(0,212,255,.15);
    color: var(--rf-accent);
}
.page-btn.disabled {
    opacity: .3;
    pointer-events: none;
}
.page-ellipsis {
    color: var(--rf-muted);
    font-size: 13px;
    padding: 0 4px;
    user-select: none;
}
.pagination-info {
    font-size: 11px;
    color: var(--rf-muted);
    font-family: var(--font-data);
    text-align: center;
    padding: 10px;
}

.pag-live-off {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: .75rem;
	color: var(--rf-amber);
	background: rgba(255, 176, 32, .15);
	border: 1px solid var(--rf-amber);
	border-radius: 6px;
	padding: 4px 10px;
	margin-left: 12px;
	cursor: default;
}

.pag-live-off::before { 
    content: '⏸'; 
    font-size: .85rem; 
    margin-bottom: 3px;
    opacity: 1;
    animation: pulse-dot 1.8s ease-in-out infinite;
}

.pag-live-off:hover {
	background: rgba(255,208,68,0.2);
}

/* Styles spécifiques pour la page Talk Groups */
.tg-header-stats {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tg-stat-card {
    background: var(--rf-panel);
    border: 1px solid var(--rf-border);
    border-radius: 8px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.tg-title {
    text-align: center;
    padding-bottom: 10px;
    margin-block-start: 0px;
    
}

.tg-stat-info {
    display: flex;
    flex-direction: column;
}

.tg-stat-value {
    font-size: 25px;
    text-align: center;
    font-weight: bold;
    font-family: var(--font-data);
}
.tg-total { color: var(--rf-green); }
 
.tg-stat-label {
    font-size: 11px;
    color: var(--rf-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.tg-search-bar {
    margin-bottom: 20px;
}

.tg-search-input {
    width: 100%;
    max-width: 300px;
    background: var(--rf-bg);
    border: 1px solid var(--rf-border);
    border-radius: 6px;
    color: var(--rf-text);
    font-family: var(--font-data);
    font-size: 13px;
    padding: 8px 12px;
    outline: none;
    transition: border-color .2s;
}

.tg-search-input:focus {
    border-color: var(--rf-accent);
}

.tg-search-input::placeholder {
    color: var(--rf-muted);
    opacity: 0.6;
}

.tg-table-container {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid var(--rf-border);
    background: var(--rf-panel);
}

.tg-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-data);
    font-size: 13px;
}

.tg-table th {
    position: sticky;
    top: 0;
    background: var(--bg-panel2);
    padding: 12px 15px;
    text-align: left;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 1px;
    color: var(--rf-muted);
    border-bottom: 1px solid var(--rf-border);
    white-space: nowrap;
    z-index: 10;
}

.tg-table td {
    padding: 10px 15px;
    border-bottom: 1px solid rgba(30, 45, 61, 0.6);
    vertical-align: middle;
}

.tg-table tbody tr:nth-child(even) {
    background: var(--bg-row-alt);
}

.tg-table tbody tr:hover {
    background: var(--tr-hover);
}

.tg-number {
    font-family: var(--font-data);
    font-weight: 600;
    color: var(--rf-accent);
    white-space: nowrap;
}

.tg-name {
    color: var(--rf-text);
    word-break: break-word;
}

.tg-empty {
    text-align: center;
    padding: 40px;
    color: var(--rf-muted);
    font-size: 14px;
}

.no-results {
    text-align: center;
    padding: 40px;
    color: var(--rf-amber);
    font-size: 14px;
}

.cde {
    font-family: "Courier 10 Pitch", monospace;
    font-feature-settings: normal;
    font-variation-settings: normal;
    background-color: var(--bg-row-alt);
    border-radius: .25rem;
    font-size: 1.04em;
    font-weight: 500;
    padding: .15rem .3rem;
}


.tg-note {
    margin-top: 15px;
    padding: 10px;
    text-align: center;
    font-size: 11px;
    color: var(--rf-muted);
    border-top: 1px solid var(--rf-border);
}

/* ──────────────────────────────────────────────────────────
   📱 MEDIA QUERIES – SMARTPHONE (max-width: 768px)
   ═════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    /* Base */
    html { font-size: 14px; }
    .dark-bg { padding: 8px; min-height: 100dvh }
    
    /* Layout : passage en colonne unique */
    .grid-top,
    .grid-main,
    .grid-bottom {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .grid-bottom-left {
        grid-template-rows: auto auto;
        gap: 8px;
    }
    .nav-menu {	padding-inline-start: 0px; }

    /* Top bar : empilage vertical */
    .top-bar {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .header-brand {
        width: 100%;
        justify-content: space-between;
    }
    
    .header-logo { height: 80px; }
    .header-logo-text { font-size: 1rem; }
    .header-main { flex-direction: column; } 
    .header-titles, .header-subtitle { text-align: center; padding-bottom: 5px; }

    .status-row {
        width: 100%;
        justify-content: space-between;
    }
    
    /* Navigation : plus compacte */
    .nav-inner { padding: 0 8px; }
    .nav-link { padding: 8px 12px; font-size: 0.75rem; }
    
    /* Panels */
    .panel, .freq-panel, .module-panel, .repeater-status-panel {
        margin-bottom: 0;
    }
    
    .panel-value { font-size: 20px; }
    .freq-main { font-size: 24px; }
    
    /* Suppression du texte décoratif superflu */
    .panel-sub { margin-left: 5px; }
    
    /* Tableaux : scroll horizontal obligatoire */
    .rf-table-container,
    .log-table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .rf-table,
    .log-table {
        min-width: 600px;  /* force le scroll sur mobile */
    }
    
    /* Activity log : simplifié */
    .log-line {
        grid-template-columns: 48px 44px 1fr;
        gap: 4px;
    }
    
    .log-time { font-size: 10px; }
    .log-type { font-size: 9px; padding: 1px 4px; }
    .log-msg { font-size: 10px; }
    
    /* Reflector */
    .reflector-grid {
        grid-template-rows: auto auto;
        gap: 8px;
    }
    
    .reflector-sidebar { gap: 8px; }
    
    /* RS state panel : plus compact */
    .rs-bar {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .rs-state {
        padding: 4px 10px;
        font-size: 11px;
    }
    
    /* Toolbar logs : adaptative */
    .log-toolbar {
        /*flex-direction: column;*/
        align-items: stretch;
    }
    
    .log-toolbar > * {
        width: 95%;
    }
    
    .log-toolbar input[type="text"],
    .log-toolbar input[type="number"],
    .log-toolbar select { width: 95%; }
    
    .log-btn {
        text-align: center;
        justify-content: center;
        width: 30%;
    }
    .log-btn.danger { width: 22%; }
    
    .toolbar-sep { display: none; }
    
    .tg-search-input { max-width: 300px; }

    /* Stats badges : wrap */
    .log-stats {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    /* Pagination */
    .pagination {
        gap: 2px;
    }
    
    .page-btn {
        min-width: 30px;
        height: 28px;
        font-size: 10px;
    }
    
    .page-ellipsis { font-size: 11px; }
    
    /* Footer fixé */
    .fixed-footer {
        position: fixed;
        font-size: 0.7rem;
        margin-top: 20px;
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    .log-page-wrap { padding-bottom: 0; }
    
    /* Masquer certains éléments trop larges si nécessaire */
    .td-raw { max-width: 120px; }
    
 /* Styles spécifiques pour la page Talk Groups */
    .tg-table th,
    .tg-table td {
        padding: 8px 10px;
    }
    
    .tg-stat-value {
        font-size: 22px;
    }
    
    .tg-stat-icon {
        font-size: 22px;
    }
    
    .tg-stat-card {
        padding: 8px 15px;
    }
}

/* Ajustements pour très petits écrans (≤ 480px) */
@media (max-width: 480px) {
    .status-label { padding: 8px 9px; font-size: 10px; }
    .header-clock { font-family: inherit; font-size: .8rem; }
    .module-badge { padding: 4px 6px; font-size: 10px; }
    .caller-cs { min-width: 55px; font-size: 12px; }
    .caller-name { font-size: 11px; }
    .caller-time { font-size: 9px; }
    .panel-value.clock-value { font-size: 22px; }
    
    .log-table th,
    .log-table td {
        padding: 4px 6px;
    }
    
    .td-time { font-size: 10px; }
    .td-msg { font-size: 10px; }
    
    .pag-live-off {
        margin-left: 0;
        margin-top: 6px;
        font-size: 0.7rem;
        width: 60%;
    }
}
