/* ============================================================
   ExtraBanca Network Monitor — UI v2.0
   Font Awesome 6 · Bootstrap 5.3 · Palette ExtraBanca
   ============================================================ */

:root {
    --eb-red:         #C0272D;
    --eb-red-dark:    #9a1f24;
    --eb-red-light:   #fdf0f0;
    --eb-green:       #27AE60;
    --eb-green-light: #eafaf1;
    --eb-blue:        #2980B9;
    --eb-blue-light:  #ebf5fb;
    --eb-orange:      #E67E22;
    --eb-orange-light:#fef9e7;
    --eb-bg:          #f0f2f5;
    --eb-white:       #ffffff;
    --eb-border:      #e2e5ea;
    --eb-text:        #1e2530;
    --eb-muted:       #6b7280;
    --eb-shadow:      0 1px 4px rgba(0,0,0,.08);
    --eb-shadow-md:   0 4px 16px rgba(0,0,0,.10);
    --eb-radius:      10px;
    --navbar-h:       60px;
}

* { box-sizing: border-box; }

body {
    background: var(--eb-bg);
    color: var(--eb-text);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: .9rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ══════════════════════════════════════════
   NAVBAR
══════════════════════════════════════════ */
.navbar-eb {
    background: var(--eb-red);
    border-bottom: none;
    height: var(--navbar-h);
    box-shadow: 0 2px 8px rgba(192,39,45,.3);
    z-index: 1030;
    padding: 0 1.25rem;
}
.navbar-logo {
    height: 26px;
    width: auto;
}
.brand-separator {
    width: 1px; height: 22px;
    background: rgba(255,255,255,.3);
    display: inline-block;
    margin: 0 10px;
}
.brand-title {
    font-size: .95rem;
    font-weight: 700;
    color: rgba(255,255,255,.9);
    letter-spacing: -.01em;
}
.navbar-eb .nav-link {
    color: rgba(255,255,255,.85) !important;
    font-weight: 500;
    font-size: .85rem;
    padding: .45rem .85rem !important;
    border-radius: 8px;
    transition: all .15s;
    display: flex;
    align-items: center;
    gap: 6px;
}
.navbar-eb .nav-link:hover {
    background: rgba(255,255,255,.15);
    color: #fff !important;
}
.navbar-eb .nav-link.active {
    background: rgba(255,255,255,.2);
    color: #fff !important;
    font-weight: 600;
}
.navbar-eb .nav-link .fa-badge-count {
    background: var(--eb-red);
    color: #fff;
    border-radius: 20px;
    font-size: .65rem;
    padding: 1px 6px;
    font-weight: 700;
}

/* Status pills navbar */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: .75rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    white-space: nowrap;
}
.status-pill.online  { background: var(--eb-green-light); color: var(--eb-green); }
.status-pill.warning { background: var(--eb-orange-light); color: var(--eb-orange); }
.status-pill.offline { background: #f3f4f6; color: var(--eb-muted); }

/* User dropdown */
.btn-eb-outline {
    background: rgba(255,255,255,.15);
    color: #fff;
    border: 1.5px solid rgba(255,255,255,.5);
    border-radius: 8px;
    font-weight: 600;
    font-size: .82rem;
    transition: all .15s;
    padding: 5px 14px;
}
.btn-eb-outline:hover { background: rgba(255,255,255,.25); color: #fff; border-color: #fff; }

/* ══════════════════════════════════════════
   BOTTONI
══════════════════════════════════════════ */
.btn-eb {
    background: var(--eb-red);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: .85rem;
    transition: background .15s, transform .1s;
}
.btn-eb:hover  { background: var(--eb-red-dark); color: #fff; }
.btn-eb:active { transform: scale(.97); }

.bg-eb-light { background: var(--eb-red-light) !important; }
.text-eb     { color: var(--eb-red) !important; }

/* ══════════════════════════════════════════
   LAYOUT
══════════════════════════════════════════ */
.page-wrapper {
    flex: 1;
    padding: 1.75rem 1.5rem;
    max-width: 1700px;
    width: 100%;
    margin: 0 auto;
}
.page-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--eb-text);
    display: flex;
    align-items: center;
    gap: 10px;
}
.page-title .title-icon {
    width: 36px; height: 36px;
    background: var(--eb-red-light);
    border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    color: var(--eb-red);
    font-size: 1rem;
}

/* ══════════════════════════════════════════
   STAT CARDS
══════════════════════════════════════════ */
.stat-card {
    background: var(--eb-white);
    border: 1px solid var(--eb-border);
    border-radius: var(--eb-radius);
    padding: 1.25rem 1.4rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--eb-shadow);
    transition: box-shadow .2s, transform .2s;
    position: relative;
    overflow: hidden;
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
}
.stat-card.red::before    { background: var(--eb-red); }
.stat-card.green::before  { background: var(--eb-green); }
.stat-card.blue::before   { background: var(--eb-blue); }
.stat-card.orange::before { background: var(--eb-orange); }
.stat-card.gray::before   { background: #9ca3af; }

.stat-card:hover {
    box-shadow: var(--eb-shadow-md);
    transform: translateY(-2px);
}
.stat-icon {
    width: 52px; height: 52px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}
.stat-icon.red    { background: var(--eb-red-light);    color: var(--eb-red); }
.stat-icon.green  { background: var(--eb-green-light);  color: var(--eb-green); }
.stat-icon.blue   { background: var(--eb-blue-light);   color: var(--eb-blue); }
.stat-icon.orange { background: var(--eb-orange-light); color: var(--eb-orange); }
.stat-icon.gray   { background: #f3f4f6;                color: var(--eb-muted); }

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -.02em;
}
.stat-label {
    font-size: .72rem;
    color: var(--eb-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-top: 3px;
}

/* ══════════════════════════════════════════
   CARD GENERICA
══════════════════════════════════════════ */
.card-eb {
    background: var(--eb-white);
    border: 1px solid var(--eb-border);
    border-radius: var(--eb-radius);
    box-shadow: var(--eb-shadow);
    overflow: hidden;
}
.card-header-eb {
    padding: .9rem 1.25rem;
    border-bottom: 1px solid var(--eb-border);
    font-weight: 700;
    font-size: .88rem;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fafbfc;
    color: var(--eb-text);
}
.card-header-eb .fas,
.card-header-eb .far { color: var(--eb-red); font-size: .95rem; }
.card-body { padding: 1.25rem; }

/* ══════════════════════════════════════════
   TABELLE
══════════════════════════════════════════ */
.table-eb thead th {
    background: #f8f9fb;
    border-bottom: 2px solid var(--eb-red) !important;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--eb-muted);
    padding: .75rem 1rem;
    white-space: nowrap;
}
.table-eb tbody tr { transition: background .1s; }
.table-eb tbody tr:hover { background: var(--eb-red-light) !important; cursor: pointer; }
.table-eb tbody td { padding: .7rem 1rem; vertical-align: middle; border-color: #f0f2f5; }

/* ══════════════════════════════════════════
   BADGE STATUS
══════════════════════════════════════════ */
.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: .72rem;
    font-weight: 700;
}
.badge-status.online   { background: var(--eb-green-light); color: var(--eb-green); }
.badge-status.offline  { background: #f3f4f6; color: var(--eb-muted); }
.badge-status.warning  { background: var(--eb-orange-light); color: var(--eb-orange); }
.badge-status.critical { background: #fdf0f0; color: var(--eb-red); }

/* OS badge */
.os-badge {
    font-size: .68rem;
    padding: 2px 8px;
    border-radius: 5px;
    font-weight: 700;
    text-transform: uppercase;
}
.os-windows { background: #e8f0fe; color: #1a73e8; }
.os-linux   { background: var(--eb-orange-light); color: #c0392b; }
.os-macos   { background: #f3f4f6; color: #374151; }
.os-other   { background: #f3f4f6; color: var(--eb-muted); }

/* ══════════════════════════════════════════
   METRICHE / PROGRESS
══════════════════════════════════════════ */
.metric-bar-wrap { min-width: 80px; }
.metric-bar-wrap .progress { height: 5px; border-radius: 10px; background: #e9ecef; }
.metric-bar-wrap .pct-label { font-size: .7rem; color: var(--eb-muted); margin-top: 2px; }

.temp-ok   { color: var(--eb-green); font-weight: 700; }
.temp-warn { color: var(--eb-orange); font-weight: 700; }
.temp-crit { color: var(--eb-red); font-weight: 700; }

/* ══════════════════════════════════════════
   DEVICE DETAIL
══════════════════════════════════════════ */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: .6rem 1.5rem;
}
.info-item { font-size: .85rem; }
.info-item .label { color: var(--eb-muted); font-size: .72rem; font-weight: 600; text-transform: uppercase; }
.info-item .value { font-weight: 600; color: var(--eb-text); }

/* ══════════════════════════════════════════
   LOGIN PAGE
══════════════════════════════════════════ */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #f0f2f5 0%, #e8eaed 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}
.login-card {
    background: var(--eb-white);
    border-radius: 16px;
    padding: 2.5rem 2.25rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,.12);
    border-top: 4px solid var(--eb-red);
}
.login-card .form-control:focus {
    border-color: var(--eb-red);
    box-shadow: 0 0 0 3px rgba(192,39,45,.12);
}
.login-card .input-group-text {
    background: var(--eb-red-light);
    border-color: #dee2e6;
    color: var(--eb-red);
}

/* ══════════════════════════════════════════
   FOOTER
══════════════════════════════════════════ */
.footer-eb {
    background: var(--eb-white);
    border-top: 1px solid var(--eb-border);
    padding: .7rem 1.5rem;
    margin-top: auto;
    font-size: .78rem;
}

/* ══════════════════════════════════════════
   ALERT LIST
══════════════════════════════════════════ */
.alert-item {
    display: flex;
    gap: 10px;
    padding: .75rem 1.25rem;
    border-bottom: 1px solid #f0f2f5;
    align-items: flex-start;
    transition: background .1s;
}
.alert-item:hover { background: var(--eb-red-light); }
.alert-item:last-child { border-bottom: none; }
.alert-dot {
    width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 5px;
}
.alert-dot.critical { background: var(--eb-red); }
.alert-dot.warning  { background: var(--eb-orange); }

/* ══════════════════════════════════════════
   DATATABLES OVERRIDE
══════════════════════════════════════════ */
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    border: 1px solid var(--eb-border);
    border-radius: 7px;
    padding: .3rem .7rem;
    font-size: .85rem;
}
.dataTables_wrapper .dataTables_filter input:focus {
    outline: none;
    border-color: var(--eb-red);
    box-shadow: 0 0 0 2px rgba(192,39,45,.1);
}
.page-item.active .page-link { background: var(--eb-red); border-color: var(--eb-red); }
.page-link { color: var(--eb-red); }
.page-link:hover { color: var(--eb-red-dark); }

/* ══════════════════════════════════════════
   MISC
══════════════════════════════════════════ */
.spin { animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

code { color: var(--eb-blue); background: var(--eb-blue-light); padding: 1px 6px; border-radius: 4px; font-size: .82rem; }

.breadcrumb { font-size: .82rem; }
.breadcrumb-item a { color: var(--eb-red); text-decoration: none; }
.breadcrumb-item a:hover { text-decoration: underline; }

/* Nav tabs */
.nav-tabs .nav-link { color: var(--eb-muted); font-weight: 500; border-radius: 8px 8px 0 0; }
.nav-tabs .nav-link.active { color: var(--eb-red); font-weight: 700; border-bottom-color: #fff; }
.nav-tabs .nav-link:hover { color: var(--eb-red); }

@media (max-width: 768px) {
    .page-wrapper { padding: 1rem; }
    .stat-value { font-size: 1.5rem !important; }
    .status-pill { display: none; }
}

/* Logo navbar — PNG con sfondo trasparente e testo scuro */
.navbar-logo {
    height: 26px;
    width: auto;
    object-fit: contain;
}

/* Login logo box — sfondo rosso per logo bianco */
.login-logo-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--eb-red);
    border-radius: 10px;
    padding: 10px 24px;
    margin-bottom: 4px;
}

/* Navbar logo dimensioni */
.navbar-logo { height: 28px; width: auto; }
