﻿:root{
  --shell-bg:#f3f7fb;
  --shell-bg-2:#eef4fb;
  --shell-panel:#ffffff;
  --shell-panel-soft:rgba(255,255,255,.78);
  --shell-line:#d5e1f0;
  --shell-line-strong:#bfd2e8;
  --shell-text:#142033;
  --shell-muted:#63748a;
  --shell-brand:#0f3d62;
  --shell-accent:#1d70d6;
  --shell-accent-soft:#e9f2ff;
  --shell-alert:#d4572f;
  --shell-success:#17735c;
  --shell-shadow:0 24px 60px rgba(31,53,84,.08);
  --shell-shadow-soft:0 10px 30px rgba(31,53,84,.06);
}

*{
  box-sizing:border-box;
}

html,
body{
  min-height:100%;
}

.noc-body{
  margin:0;
  color:var(--shell-text);
  font-family:"Manrope",ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;
  background:
    radial-gradient(circle at top left, rgba(255,255,255,.95), transparent 26%),
    linear-gradient(135deg, #f9fbfe 0%, var(--shell-bg) 54%, var(--shell-bg-2) 100%);
}

.noc-shell{
  min-height:100vh;
  display:grid;
  grid-template-columns:290px minmax(0,1fr);
}

.noc-sidebar{
  position:sticky;
  top:0;
  height:100vh;
  padding:26px 16px;
  background:linear-gradient(180deg, rgba(255,255,255,.88) 0%, rgba(243,247,251,.94) 100%);
  border-right:1px solid rgba(191,210,232,.65);
  backdrop-filter:blur(10px);
  overflow:auto;
}

.noc-side-stack{
  min-height:calc(100vh - 52px);
  display:flex;
  flex-direction:column;
  gap:18px;
}

.noc-side-hero{
  padding:22px 20px;
  border-radius:26px;
  border:1px solid #cfe0f4;
  background:linear-gradient(180deg, rgba(255,255,255,.96) 0%, rgba(248,251,255,.94) 100%);
  box-shadow:var(--shell-shadow-soft);
}

.noc-side-title{
  font-size:22px;
  font-weight:800;
  line-height:1.1;
  color:#1d2a43;
  letter-spacing:-.03em;
}

.noc-side-sub{
  margin-top:12px;
  font-size:15px;
  line-height:1.55;
  color:#6d7f98;
}

.noc-sidebar-card{
  padding:14px;
  border:1px solid rgba(191,210,232,.78);
  border-radius:28px;
  background:rgba(255,255,255,.86);
  box-shadow:var(--shell-shadow-soft);
}

.noc-sidebar-label{
  padding:4px 10px 8px;
  font-size:12px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.14em;
  color:#8ba0bc;
  margin-bottom:6px;
}

.noc-nav{
  display:flex;
  flex-direction:column;
  gap:6px;
}

.noc-nav-link{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  min-height:52px;
  padding:0 14px;
  border-radius:18px;
  text-decoration:none;
  color:#3a506f;
  font-weight:800;
  font-size:15px;
  transition:transform .16s ease, background .16s ease, border-color .16s ease, box-shadow .16s ease;
  border:1px solid transparent;
}

.noc-nav-link:hover{
  transform:translateY(-1px);
  background:#f7faff;
  border-color:#dce8f8;
}

.noc-nav-link.is-active{
  background:linear-gradient(180deg, #eef4ff 0%, #f7fbff 100%);
  border-color:#c7d9fb;
  box-shadow:0 12px 22px rgba(29,112,214,.10);
  color:#1f4ec8;
}

.noc-nav-text{
  min-width:0;
}

.noc-nav-bullet{
  width:10px;
  height:10px;
  border-radius:50%;
  flex:0 0 10px;
  background:#d4dfed;
  box-shadow:0 0 0 5px rgba(212,223,237,.22);
}

.noc-nav-link.is-active .noc-nav-bullet{
  background:#3f74ec;
  box-shadow:0 0 0 7px rgba(63,116,236,.14);
}

.noc-side-profile{
  margin-top:auto;
  padding:18px 18px 16px;
  border-radius:24px;
  border:1px solid rgba(191,210,232,.78);
  background:rgba(255,255,255,.9);
  box-shadow:var(--shell-shadow-soft);
}

.noc-profile-line{
  font-size:14px;
  line-height:1.7;
  color:#7b8ea9;
}

.noc-profile-line b{
  color:#617998;
}

.noc-profile-logout{
  margin-top:16px;
  width:100%;
  min-height:48px;
  padding:0 18px;
  border:none;
  border-radius:16px;
  background:linear-gradient(180deg, #ff3b3f 0%, #ea2026 100%);
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  font-size:15px;
  font-weight:800;
  line-height:1;
  cursor:pointer;
  box-shadow:0 16px 30px rgba(234,32,38,.18);
  transition:transform .16s ease, opacity .16s ease;
}

.noc-profile-logout:hover{
  opacity:.94;
}

.noc-profile-logout:disabled{
  opacity:.72;
  cursor:not-allowed;
  box-shadow:none;
}

.noc-profile-logout:active{
  transform:translateY(1px);
}

.noc-main{
  min-width:0;
  padding:22px;
}

.noc-topbar{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:20px;
  padding:18px 20px;
  border:1px solid rgba(191,210,232,.75);
  border-radius:28px;
  background:rgba(255,255,255,.76);
  box-shadow:var(--shell-shadow);
  backdrop-filter:blur(12px);
}

.noc-topbar-left{
  display:flex;
  align-items:flex-start;
  gap:16px;
  min-width:0;
}

.noc-menu-toggle{
  display:none;
  width:46px;
  height:46px;
  padding:0;
  border:none;
  border-radius:16px;
  background:#edf4fd;
  cursor:pointer;
  box-shadow:var(--shell-shadow-soft);
}

.noc-menu-toggle span{
  display:block;
  width:18px;
  height:2px;
  margin:4px auto;
  border-radius:999px;
  background:var(--shell-brand);
}

.noc-page-heading{
  min-width:0;
}

.noc-eyebrow{
  font-size:11px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.18em;
  color:var(--shell-accent);
}

.noc-page-heading h1{
  margin:8px 0 0;
  font-size:32px;
  line-height:1.05;
  font-weight:800;
  letter-spacing:-.04em;
  color:var(--shell-brand);
}

.noc-page-heading p{
  margin:8px 0 0;
  max-width:760px;
  color:var(--shell-muted);
  font-size:14px;
  line-height:1.6;
}

.noc-topbar-right{
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.noc-topbar-actions{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.noc-quick-card,
.noc-user{
  min-height:44px;
  padding:0 16px;
  border-radius:999px;
  border:1px solid var(--shell-line);
  background:#fff;
  display:inline-flex;
  align-items:center;
  gap:10px;
  box-shadow:var(--shell-shadow-soft);
  font-size:13px;
  font-weight:800;
}

.noc-user{
  color:var(--shell-brand);
}

.noc-shell-action{
  min-height:44px;
  padding:0 16px;
  border-radius:999px;
  border:1px solid var(--shell-line);
  background:#fff;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  box-shadow:var(--shell-shadow-soft);
  font-size:13px;
  font-weight:800;
  color:var(--shell-brand);
  text-decoration:none;
  cursor:pointer;
  transition:transform .16s ease, border-color .16s ease, background .16s ease;
}

.noc-shell-action:hover{
  transform:translateY(-1px);
  border-color:var(--shell-line-strong);
  background:#f8fbff;
}

.noc-shell-action.is-danger{
  color:#b42318;
  border-color:#f4c7c3;
  background:#fff7f6;
}

.noc-dot{
  width:10px;
  height:10px;
  border-radius:50%;
  background:var(--shell-success);
  box-shadow:0 0 0 6px rgba(23,115,92,.12);
}

.noc-content{
  padding-top:20px;
}

.noc-page-slot{
  min-width:0;
}

.noc-page-slot .wrap{
  width:100%;
  margin:0;
  padding:0;
}

.noc-page-slot > .wrap,
.noc-page-slot > #app,
.noc-page-slot > .grid,
.noc-page-slot > .content{
  display:flex;
  flex-direction:column;
  gap:18px;
}

.noc-page-slot > .header,
.noc-page-slot > .page-head,
.noc-page-slot > .head,
.noc-page-slot > .wrap > .header,
.noc-page-slot > .wrap > .page-head,
.noc-page-slot > .wrap > .head,
.noc-page-slot > #app > .header,
.noc-page-slot > #app > .page-head,
.noc-page-slot > #app > .head{
  margin-top:0;
}

.noc-page-slot > .header,
.noc-page-slot > .page-head,
.noc-page-slot > .head,
.noc-page-slot > .wrap > .header,
.noc-page-slot > .wrap > .page-head,
.noc-page-slot > .wrap > .head,
.noc-page-slot > #app > .header,
.noc-page-slot > #app > .page-head,
.noc-page-slot > #app > .head{
  position:relative;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:18px;
  flex-wrap:wrap;
  padding:22px 24px;
  border:1px solid rgba(191,210,232,.78);
  border-radius:26px;
  background:linear-gradient(180deg, rgba(255,255,255,.86) 0%, rgba(247,250,254,.92) 100%);
  box-shadow:var(--shell-shadow);
  overflow:hidden;
}

.noc-page-slot > .header::before,
.noc-page-slot > .page-head::before,
.noc-page-slot > .head::before,
.noc-page-slot > .wrap > .header::before,
.noc-page-slot > .wrap > .page-head::before,
.noc-page-slot > .wrap > .head::before,
.noc-page-slot > #app > .header::before,
.noc-page-slot > #app > .page-head::before,
.noc-page-slot > #app > .head::before{
  content:"";
  position:absolute;
  inset:auto auto -50px -20px;
  width:240px;
  height:140px;
  background:radial-gradient(circle, rgba(29,112,214,.12) 0%, rgba(29,112,214,0) 70%);
  pointer-events:none;
}

.noc-page-slot .back,
.noc-page-slot .back-link,
.noc-page-slot .back-btn{
  text-decoration:none !important;
}

.noc-page-slot > .header h1,
.noc-page-slot > .page-head h1,
.noc-page-slot > .head h1,
.noc-page-slot > .wrap > .header h1,
.noc-page-slot > .wrap > .page-head h1,
.noc-page-slot > .wrap > .head h1,
.noc-page-slot > #app > .header h1,
.noc-page-slot > #app > .page-head h1,
.noc-page-slot > #app > .head h1,
.noc-page-slot .title h1,
.noc-page-slot .title-box h1,
.noc-page-slot .title-area h1{
  margin:0;
  font-size:30px;
  line-height:1.05;
  font-weight:800;
  letter-spacing:-.04em;
  color:var(--shell-brand);
}

.noc-page-slot > .header .sub,
.noc-page-slot > .page-head .sub,
.noc-page-slot > .head .sub,
.noc-page-slot > .wrap > .header .sub,
.noc-page-slot > .wrap > .page-head .sub,
.noc-page-slot > .wrap > .head .sub,
.noc-page-slot > #app > .header .sub,
.noc-page-slot > #app > .page-head .sub,
.noc-page-slot > #app > .head .sub,
.noc-page-slot .title p,
.noc-page-slot .title-box .sub,
.noc-page-slot .title-area .sub{
  margin-top:8px;
  max-width:920px;
  color:var(--shell-muted);
  font-size:14px;
  line-height:1.6;
}

.noc-page-slot .top-actions,
.noc-page-slot .head-actions,
.noc-page-slot .topbar,
.noc-page-slot .actions,
.noc-page-slot .top-right,
.noc-page-slot .footer-right,
.noc-page-slot .row{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}

.noc-page-slot .grid,
.noc-page-slot .grid-2,
.noc-page-slot .stats,
.noc-page-slot .top-stats,
.noc-page-slot .traffic-status-bar,
.noc-page-slot .page-grid,
.noc-page-slot .history-grid,
.noc-page-slot .diag-grid{
  gap:14px;
}

.noc-page-slot .locked-screen{
  min-height:56vh;
}

.noc-page-slot .locked-card{
  border-radius:28px;
}

.noc-page-slot .panel,
.noc-page-slot .card,
.noc-page-slot .top-card,
.noc-page-slot .status-card,
.noc-page-slot .geo-map-panel,
.noc-page-slot .footer-bar{
  box-shadow:var(--shell-shadow-soft);
  border-color:rgba(191,210,232,.76);
  background:linear-gradient(180deg, rgba(255,255,255,.94) 0%, rgba(250,252,255,.98) 100%);
}

.noc-page-slot .mono,
.noc-page-slot code{
  font-family:"IBM Plex Mono",ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
}

.noc-page-slot .panel,
.noc-page-slot .card,
.noc-page-slot .top-card,
.noc-page-slot .status-card,
.noc-page-slot .history-panel,
.noc-page-slot .diag-section,
.noc-page-slot .geo-map-panel,
.noc-page-slot .table-wrap,
.noc-page-slot .table-card,
.noc-page-slot .toolbar-card{
  border:1px solid rgba(191,210,232,.74);
  border-radius:24px;
  overflow:hidden;
}

.noc-page-slot .card,
.noc-page-slot .panel,
.noc-page-slot .top-card,
.noc-page-slot .status-card{
  transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.noc-page-slot .card:hover,
.noc-page-slot .panel:hover,
.noc-page-slot .top-card:hover,
.noc-page-slot .status-card:hover{
  transform:translateY(-2px);
  border-color:rgba(148,180,221,.95);
  box-shadow:0 20px 42px rgba(31,53,84,.10);
}

.noc-page-slot .content,
.noc-page-slot .panel .content,
.noc-page-slot .card .content,
.noc-page-slot .panel-body,
.noc-page-slot .modal-body{
  padding:18px;
}

.noc-page-slot .head,
.noc-page-slot .card-head,
.noc-page-slot .panel-head,
.noc-page-slot .history-panel-head,
.noc-page-slot .diag-section-head,
.noc-page-slot .modal-head{
  background:linear-gradient(180deg, #fbfdff 0%, #f4f8fd 100%);
  border-bottom:1px solid rgba(213,225,240,.84);
}

.noc-page-slot .head,
.noc-page-slot .panel-head,
.noc-page-slot .history-panel-head,
.noc-page-slot .diag-section-head{
  padding:14px 18px;
}

.noc-page-slot .btn,
.noc-page-slot .back,
.noc-page-slot .back-btn,
.noc-page-slot .back-link,
.noc-page-slot .iface-summary-btn{
  min-height:40px;
  padding:0 16px;
  border-radius:14px;
  box-shadow:0 6px 16px rgba(31,53,84,.06);
}

.noc-page-slot .btn:hover,
.noc-page-slot .back:hover,
.noc-page-slot .back-btn:hover,
.noc-page-slot .iface-summary-btn:hover{
  box-shadow:0 14px 28px rgba(31,53,84,.10);
}

.noc-page-slot .search,
.noc-page-slot input:not([type="checkbox"]):not([type="radio"]),
.noc-page-slot select,
.noc-page-slot textarea{
  min-height:44px;
  border-radius:14px;
  border:1px solid rgba(191,210,232,.86);
  background:#fff;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.65);
}

.noc-page-slot textarea{
  min-height:140px;
  padding:14px;
}

.noc-page-slot input:focus,
.noc-page-slot select:focus,
.noc-page-slot textarea:focus,
.noc-page-slot .search:focus{
  border-color:#a9c4e8;
  box-shadow:0 0 0 4px rgba(29,112,214,.10);
}

.noc-page-slot .badge,
.noc-page-slot .pill,
.noc-page-slot .pill-mini,
.noc-page-slot .hist-info-badge,
.noc-page-slot .toggle,
.noc-page-slot .status-chip{
  min-height:36px;
  border-radius:999px;
  box-shadow:0 4px 12px rgba(31,53,84,.05);
}

.noc-page-slot .notice,
.noc-page-slot .banner,
.noc-page-slot .err{
  border-radius:18px;
  box-shadow:var(--shell-shadow-soft);
}

.noc-page-slot table{
  min-width:980px;
}

.noc-page-slot th{
  background:#f7fafe;
  color:#5e7087;
  border-bottom:1px solid rgba(213,225,240,.92);
}

.noc-page-slot td{
  border-bottom:1px solid rgba(233,240,248,.92);
}

.noc-page-slot tbody tr:hover{
  background:rgba(245,249,255,.78);
}

.noc-page-slot .footer-bar{
  margin-top:6px;
}

.noc-page-slot .stats,
.noc-page-slot .top-stats{
  padding:0;
}

.page-dashboard .noc-topbar{
  border-color:rgba(148,180,221,.9);
}

.page-devices .noc-topbar{
  background:linear-gradient(180deg, rgba(255,255,255,.84) 0%, rgba(247,252,255,.94) 100%);
}

.page-traffic .noc-topbar{
  background:linear-gradient(180deg, rgba(255,255,255,.84) 0%, rgba(242,253,251,.94) 100%);
}

.page-backups .noc-topbar{
  background:linear-gradient(180deg, rgba(255,255,255,.84) 0%, rgba(248,244,255,.94) 100%);
}

@media (max-width:1080px){
  .noc-shell{
    grid-template-columns:1fr;
  }

  .noc-sidebar{
    position:fixed;
    top:0;
    left:0;
    bottom:0;
    width:min(86vw,320px);
    height:auto;
    transform:translateX(-104%);
    transition:transform .2s ease;
    z-index:9999;
  }

  .noc-body.noc-sidebar-open .noc-sidebar{
    transform:translateX(0);
  }

  .noc-body.noc-sidebar-open::before{
    content:"";
    position:fixed;
    inset:0;
    background:rgba(20,32,51,.28);
    z-index:9998;
  }

  .noc-main{
    padding:14px;
  }

  .noc-menu-toggle{
    display:inline-block;
  }

  .noc-topbar{
    padding:16px;
    border-radius:24px;
    flex-direction:column;
  }

  .noc-topbar-right{
    width:100%;
    justify-content:flex-start;
  }

  .noc-topbar-actions{
    width:100%;
    justify-content:flex-start;
  }

  .noc-page-slot > .header,
  .noc-page-slot > .page-head,
  .noc-page-slot > .head,
  .noc-page-slot > .wrap > .header,
  .noc-page-slot > .wrap > .page-head,
  .noc-page-slot > .wrap > .head,
  .noc-page-slot > #app > .header,
  .noc-page-slot > #app > .page-head,
  .noc-page-slot > #app > .head{
    padding:18px;
    border-radius:22px;
  }
}

@media (max-width:720px){
  .noc-page-heading h1{
    font-size:26px;
  }

  .noc-quick-card,
  .noc-user,
  .noc-shell-action{
    width:100%;
    justify-content:flex-start;
  }

  .noc-page-slot > .header h1,
  .noc-page-slot > .page-head h1,
  .noc-page-slot > .head h1,
  .noc-page-slot > .wrap > .header h1,
  .noc-page-slot > .wrap > .page-head h1,
  .noc-page-slot > .wrap > .head h1,
  .noc-page-slot > #app > .header h1,
  .noc-page-slot > #app > .page-head h1,
  .noc-page-slot > #app > .head h1,
  .noc-page-slot .title h1,
  .noc-page-slot .title-box h1,
  .noc-page-slot .title-area h1{
    font-size:24px;
  }
}


:root{
  --bg:#f4f7fb;
  --bg-top:#f8fbff;
  --card:#ffffff;
  --card2:#fcfdff;
  --text:#0f172a;
  --text-strong:#0b1b3a;
  --muted:#64748b;
  --muted2:#94a3b8;
  --border:#dbe3ef;
  --border-strong:#c9d8ea;
  --soft:#eef3f9;

  --ok:#15803d;
  --okBg:#ecfdf3;
  --okBd:#b7e4c7;

  --warn:#a16207;
  --warnBg:#fff8e8;
  --warnBd:#f3d39b;

  --bad:#b91c1c;
  --badBg:#fef2f2;
  --badBd:#fecaca;

  --info:#1d4ed8;
  --infoBg:#eff6ff;
  --infoBd:#bfdbfe;

  --shadow-xs:0 1px 2px rgba(15,23,42,.04);
  --shadow-sm:0 8px 20px rgba(15,23,42,.05);
  --shadow:0 10px 30px rgba(15,23,42,.06);
  --shadow-lg:0 18px 45px rgba(15,23,42,.08);
  --shadow-xl:0 24px 80px rgba(15,23,42,.28);

  --radius:22px;
  --radius-md:18px;
  --radius-sm:14px;
  --radius-xs:10px;

  --trans:.18s ease;
}

*{box-sizing:border-box}

html,body{
  height:100%;
}

body{
  margin:0;
  background:
    radial-gradient(circle at top left, rgba(255,255,255,.9), transparent 28%),
    linear-gradient(180deg,var(--bg-top) 0%, var(--bg) 100%);
  color:var(--text);
  font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
}

/* ===== Layout ===== */
.wrap{
  width:min(100%, 1520px);
  margin:0 auto;
  padding:20px;
}

.header{
  position:relative;
  z-index:2000;
  overflow:visible;
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:18px;
  flex-wrap:wrap;
  margin-bottom:18px;
}

.title-area h1{
  margin:0;
  font-size:26px;
  line-height:1.1;
  letter-spacing:-.02em;
  font-weight:900;
  color:var(--text-strong);
}

.sub,
.title-area .sub{
  margin-top:6px;
  color:var(--muted);
  font-size:14px;
  max-width:980px;
  line-height:1.45;
}

.top-actions{
  position:relative;
  z-index:2001;
  overflow:visible;
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.toolbar{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin-bottom:10px;
}

.panel{
  background:rgba(255,255,255,.88);
  border:1px solid rgba(219,227,239,.95);
  box-shadow:var(--shadow);
  border-radius:24px;
  backdrop-filter:blur(8px);
}

/* ===== Buttons ===== */
.btn,
.link-card,
.admin-menu-btn{
  appearance:none;
  min-height:38px;
  border-radius:14px;
  padding:0 14px;
  font-size:14px;
  font-weight:900;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  text-decoration:none !important;
  white-space:nowrap;
  transition:
    transform var(--trans),
    box-shadow var(--trans),
    border-color var(--trans),
    background var(--trans),
    color var(--trans),
    filter var(--trans);
}

.btn{
  background:#fff;
  color:var(--text);
  border:1px solid var(--border);
  box-shadow:var(--shadow-xs);
}

.btn:hover{
  transform:translateY(-1px);
  box-shadow:var(--shadow-sm);
  border-color:var(--border-strong);
}

.btn:disabled{
  opacity:.55;
  cursor:not-allowed;
  filter:none;
  box-shadow:none;
  transform:none;
}

.btn-ok{
  background:var(--okBg);
  border-color:var(--okBd);
  color:var(--ok);
}

.btn-ok:hover{
  background:#e4f9ee;
}

.btn-warn{
  background:var(--warnBg);
  border-color:var(--warnBd);
  color:var(--warn);
}

.btn-warn:hover{
  background:#fff3d8;
}

.btn-danger{
  background:var(--badBg);
  border-color:var(--badBd);
  color:var(--bad);
}

.btn-danger:hover{
  background:#fee7e7;
}

.btn-info{
  background:var(--infoBg);
  border-color:var(--infoBd);
  color:var(--info);
}

.btn-info:hover{
  background:#e7f1ff;
}

.link-card{
  min-height:42px;
  border-radius:14px;
  padding:10px 12px;
  border:1px solid var(--border);
  display:flex;
  align-items:center;
  font-weight:900;
  background:#fff;
  color:var(--text);
  box-shadow:var(--shadow-xs);
}

.link-card:hover{
  transform:translateY(-1px);
  box-shadow:var(--shadow-sm);
}

.link-card.info{
  background:var(--infoBg);
  border-color:var(--infoBd);
  color:var(--info);
}

.link-card.warn{
  background:var(--warnBg);
  border-color:var(--warnBd);
  color:var(--warn);
}

.link-card.ok{
  background:var(--okBg);
  border-color:var(--okBd);
  color:var(--ok);
}

.link-card.traffic{
  background:#eefaf3;
  border-color:#b7e4c7;
  color:#15803d;
}

#phonesLink,
#devicesLink,
#linkTrafficLink,
#backupsLink,
.link-btn{
  text-decoration:none !important;
}

#phonesLink:hover,
#devicesLink:hover,
#linkTrafficLink:hover,
#backupsLink:hover,
#phonesLink:focus,
#devicesLink:focus,
#linkTrafficLink:focus,
#backupsLink:focus,
#phonesLink:active,
#devicesLink:active,
#linkTrafficLink:active,
#backupsLink:active,
.link-btn:hover,
.link-btn:focus,
.link-btn:active{
  text-decoration:none !important;
}

/* ===== Stats ===== */
.stats{
  display:grid;
  grid-template-columns:repeat(7,minmax(150px,1fr));
  gap:12px;
  padding:14px;
}

.stat{
  min-height:108px;
  background:linear-gradient(180deg,#ffffff 0%, #f9fbfe 100%);
  border:1px solid var(--border);
  border-radius:18px;
  padding:14px 14px 12px;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  transition:
    transform var(--trans),
    box-shadow var(--trans),
    border-color var(--trans);
}

.stat:hover{
  transform:translateY(-2px);
  border-color:var(--border-strong);
  box-shadow:var(--shadow-sm);
}

.stat .label{
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.04em;
  font-weight:900;
  color:var(--muted);
}

.stat .value{
  font-size:18px;
  line-height:1.1;
  font-weight:900;
  color:var(--text-strong);
  margin-top:8px;
  white-space:pre-line;
}

.stat .hint{
  font-size:12px;
  color:var(--muted);
  margin-top:10px;
}

.stat::before{
  content:"";
  display:block;
  width:52px;
  height:5px;
  border-radius:999px;
  margin-bottom:10px;
  background:#dbe7f7;
}

.stat-updated{
  background:linear-gradient(180deg,#f8fbff 0%, #eef6ff 100%);
  border-color:#bfdbfe;
}

.stat-updated::before{
  background:linear-gradient(90deg,#2563eb 0%, #60a5fa 100%);
}

.stat-devices{
  background:linear-gradient(180deg,#f7fcf8 0%, #eefbf2 100%);
  border-color:#bbf7d0;
}

.stat-devices::before{
  background:linear-gradient(90deg,#16a34a 0%, #4ade80 100%);
}

.stat-ifaces{
  background:linear-gradient(180deg,#f8faff 0%, #eef4ff 100%);
  border-color:#c7d2fe;
}

.stat-ifaces::before{
  background:linear-gradient(90deg,#4f46e5 0%, #818cf8 100%);
}

.stat-down{
  background:linear-gradient(180deg,#fff8f8 0%, #fff1f2 100%);
  border-color:#fecdd3;
}

.stat-down::before{
  background:linear-gradient(90deg,#dc2626 0%, #fb7185 100%);
}

.stat-rx{
  background:linear-gradient(180deg,#fffaf5 0%, #fff3e6 100%);
  border-color:#fed7aa;
}

.stat-rx::before{
  background:linear-gradient(90deg,#ea580c 0%, #fb923c 100%);
}

.stat-cpu{
  background:linear-gradient(180deg,#f6fdfb 0%, #e8fbf5 100%);
  border-color:#99f6e4;
}

.stat-cpu::before{
  background:linear-gradient(90deg,#0f766e 0%, #2dd4bf 100%);
}

.stat-notes{
  background:linear-gradient(180deg,#fcf8ff 0%, #f6efff 100%);
  border-color:#e9d5ff;
}

.stat-notes::before{
  background:linear-gradient(90deg,#9333ea 0%, #c084fc 100%);
}

/* ===== Filters ===== */
.filters{
  padding:14px;
}

.filters-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}

.filters-head-title{
  font-size:14px;
  font-weight:900;
  color:var(--text-strong);
}

.filters-head-sub{
  margin-top:4px;
  font-size:12px;
  color:var(--muted);
}

.filters-toggle-btn{
  min-width:140px;
}

.filters-panel-body{
  margin-top:10px;
}

.filters-grid{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:center;
}

.search{
  width:100%;
  min-width:180px;
  height:40px;
  border-radius:14px;
  border:1px solid var(--border);
  background:#fff;
  outline:none;
  padding:0 14px;
  font-size:14px;
  color:var(--text);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.65);
  transition:border-color var(--trans), box-shadow var(--trans), background var(--trans);
}

.search::placeholder{
  color:var(--muted2);
}

.search:focus{
  border-color:#b9c9e3;
  box-shadow:0 0 0 4px rgba(29,78,216,.08);
  background:#fff;
}

.toggle{
  display:inline-flex;
  align-items:center;
  gap:8px;
  min-height:38px;
  padding:0 14px;
  border-radius:999px;
  border:1px solid var(--border);
  background:#fff;
  font-size:13px;
  font-weight:800;
  color:var(--text);
  cursor:pointer;
  user-select:none;
  white-space:nowrap;
  transition:all var(--trans);
}

.toggle:hover{
  border-color:var(--border-strong);
  background:#f8fbff;
}

.toggle input{
  margin:0;
  accent-color:#1d4ed8;
}

.badge,
.hist-info-badge{
  display:inline-flex;
  align-items:center;
  min-height:36px;
  gap:8px;
  padding:0 14px;
  border-radius:999px;
  border:1px solid var(--border);
  background:#fff;
  font-size:13px;
  font-weight:900;
  white-space:nowrap;
  color:var(--text);
  box-shadow:var(--shadow-xs);
}

.hist-info-badge{
  background:var(--infoBg);
  border-color:var(--infoBd);
}

.top-right,
.filters .top-right{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:10px;
  min-width:0;
  margin-left:auto;
  flex-wrap:wrap;
}

.toolbar-actions-divider{
  width:1px;
  height:24px;
  background:var(--border);
  margin:0 4px;
}

.top-right .link-btn{
  position:relative;
  color:inherit;
  display:inline-flex;
  align-items:center;
  gap:6px;
  font-weight:900;
}

.top-right .link-btn + .link-btn{
  margin-left:2px;
  padding-left:14px;
}

.top-right .link-btn + .link-btn::before{
  content:"";
  position:absolute;
  left:0;
  top:50%;
  transform:translateY(-50%);
  width:1px;
  height:18px;
  background:rgba(0,0,0,.15);
  border-radius:2px;
}

.link-btn.link-accent{
  background:#eef6ff;
  border:1px solid #b7d6ff;
  color:#0b5bd3;
  border-radius:999px;
  padding:8px 12px;
  box-shadow:0 6px 14px rgba(11,91,211,.10);
}

.link-btn.link-accent:hover{
  background:#e3f0ff;
  border-color:#9cc5ff;
}

/* ===== Admin ===== */
.admin-shell,
.header-admin-shell{
  position:relative;
  z-index:2002;
  overflow:visible;
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}

#loggedUserBox{
  min-height:42px;
  padding:0 16px;
  border-radius:999px;
  display:inline-flex;
  align-items:center;
  gap:8px;
  font-size:13px;
  font-weight:900;
  box-shadow:0 8px 18px rgba(21,128,61,.10);
}

#loggedUserBox b{
  font-size:13px;
  color:inherit;
}

#logoutBtn{
  min-height:42px;
  padding:0 16px;
  border-radius:14px;
}

.admin-tag{
  display:none;
  align-items:center;
  gap:6px;
  padding:6px 10px;
  border-radius:999px;
  border:1px dashed rgba(0,0,0,.18);
  background:rgba(0,0,0,.03);
  font-weight:900;
  font-size:12px;
  color:rgba(0,0,0,.65);
  white-space:nowrap;
}

.admin-tag.show{
  display:inline-flex;
}

.admin-menu-btn{
  background:#fff;
  border:1px solid var(--border);
  color:#1d4ed8;
  box-shadow:var(--shadow-xs);
}

.admin-menu-btn:hover{
  transform:translateY(-1px);
  box-shadow:var(--shadow-sm);
}

.caret{
  font-size:11px;
  opacity:.8;
  transition:transform var(--trans);
}

.admin-menu-open .caret{
  transform:rotate(180deg);
}

.admin-menu{
  position:absolute;
  top:calc(100% + 10px);
  right:0;
  width:min(420px,calc(100vw - 40px));
  background:#fff;
  border:1px solid var(--border);
  box-shadow:var(--shadow-lg);
  border-radius:20px;
  overflow:hidden;
  display:none;
  z-index:99999;
}

.admin-menu.show{
  display:block;
}

.admin-shell.admin-menu-open,
.header-admin-shell.admin-menu-open{
  z-index:99999;
}

.admin-menu-head{
  padding:16px 16px 12px;
  border-bottom:1px solid var(--border);
  background:linear-gradient(180deg,#fbfdff 0%, #f4f8ff 100%);
}

.admin-chip{
  display:inline-flex;
  align-items:center;
  padding:7px 12px;
  border-radius:999px;
  background:var(--okBg);
  border:1px solid var(--okBd);
  color:var(--ok);
  font-size:12px;
  font-weight:900;
}

.admin-menu-title{
  margin:10px 0 4px;
  font-size:16px;
  font-weight:900;
  color:var(--text-strong);
}

.admin-menu-sub{
  margin:0;
  color:var(--muted);
  font-size:13px;
  line-height:1.45;
}

.admin-menu-body{
  padding:14px;
  display:flex;
  flex-direction:column;
  gap:14px;
}

.admin-group{
  border:1px solid var(--border);
  border-radius:16px;
  padding:12px;
  background:#fff;
}

.admin-group-label{
  font-size:12px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.04em;
  color:var(--muted);
  margin-bottom:10px;
}

.admin-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
}

.admin-grid.single{
  grid-template-columns:1fr;
}

.admin-menu .btn,
.admin-menu .link-card{
  width:100%;
  justify-content:center;
}

/* ===== Alerts ===== */
.err{
  display:none;
  margin:0 0 12px;
  border-radius:16px;
  padding:12px 14px;
  background:var(--badBg);
  border:1px solid var(--badBd);
  color:var(--bad);
  font-weight:800;
  box-shadow:var(--shadow-xs);
}

.banner{
  display:none;
  margin:0 0 16px;
  border-radius:18px;
  padding:14px 16px;
  font-weight:900;
  line-height:1.5;
  border:1px solid transparent;
  box-shadow:var(--shadow);
}

.banner.warn{
  background:var(--warnBg);
  border-color:var(--warnBd);
  color:#a05a00;
}

.banner.danger{
  background:var(--badBg);
  border-color:var(--badBd);
  color:var(--bad);
}

.blink{
  animation:blinkBg 1.1s ease-in-out infinite;
}

@keyframes blinkBg{
  0%,100%{opacity:1}
  50%{opacity:.88}
}

/* ===== Content / Cards ===== */
.content{
  display:flex;
  flex-direction:column;
  gap:14px;
}

.empty{
  background:#fff;
  border:1px dashed var(--border);
  border-radius:18px;
  padding:30px;
  text-align:center;
  color:var(--muted);
  font-weight:800;
}

.card{
  background:linear-gradient(180deg,#ffffff 0%, #fbfdff 100%);
  border:1px solid var(--border);
  box-shadow:var(--shadow);
  border-radius:22px;
  overflow:hidden;
  transition:
    box-shadow var(--trans),
    transform var(--trans),
    border-color var(--trans);
}

.card:hover{
  box-shadow:0 16px 38px rgba(15,23,42,.10);
  border-color:var(--border-strong);
}

.card.collapsed .card-body{
  display:none;
}

.card-head{
  display:flex;
  align-items:flex-start;
  gap:14px;
  padding:14px 16px;
  cursor:pointer;
  user-select:none;
  transition:background var(--trans);
}

.card-head:hover{
  background:linear-gradient(180deg,#fcfeff 0%, #f7fbff 100%);
}

.card-head-main{
  flex:1;
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:12px;
}

.card-title{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:4px;
}

.chev{
  width:28px;
  height:28px;
  border-radius:999px;
  border:1px solid var(--border);
  background:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:11px;
  flex:0 0 28px;
  color:var(--text);
  transition:
    transform var(--trans),
    background var(--trans),
    border-color var(--trans);
}

.card:hover .chev{
  border-color:var(--border-strong);
  background:#f8fbff;
}

.card.collapsed .chev{
  transform:rotate(-90deg);
}

.name{
  font-size:15px;
  font-weight:900;
  color:var(--text-strong);
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}

.meta{
  font-size:13px;
  color:var(--muted);
}

.device-mini-stats,
.card-pills{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:center;
}

.card-pills{
  padding-top:2px;
  justify-content:flex-start;
}

.pill,
.device-mini-pill,
.uptime-pill,
.comm-pill{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:7px 12px;
  border-radius:999px;
  border:1px solid var(--border);
  background:#fff;
  font-size:12px;
  font-weight:900;
  white-space:nowrap;
  box-shadow:var(--shadow-xs);
}

.pill.ok,
.device-mini-pill.ok,
.comm-pill.ok{
  color:var(--ok);
  background:var(--okBg);
  border-color:var(--okBd);
}

.pill.bad,
.device-mini-pill.bad,
.comm-pill.bad{
  color:var(--bad);
  background:var(--badBg);
  border-color:var(--badBd);
}

.pill.warn,
.device-mini-pill.warn,
.comm-pill.warn{
  color:var(--warn);
  background:var(--warnBg);
  border-color:var(--warnBd);
}

.pill.info,
.device-mini-pill.info{
  color:var(--info);
  background:var(--infoBg);
  border-color:var(--infoBd);
}

.comm-dot{
  width:10px;
  height:10px;
  border-radius:50%;
  background:currentColor;
  flex:0 0 10px;
}

.uptime-pill{
  color:#2563eb;
  background:#eef4ff;
  border-color:#c7d8ff;
}

.uptime-pill .icon{
  font-size:12px;
  line-height:1;
}

.card-body{
  padding:0 16px 16px;
  border-top:1px solid rgba(219,227,239,.8);
  background:linear-gradient(180deg,#fbfdff 0%, #ffffff 100%);
}

/* ===== Notes ===== */
.note-box{
  display:inline-flex;
  flex-direction:column;
  gap:3px;
  max-width:320px;
}

.note-text{
  display:inline-block;
  max-width:320px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  padding:6px 9px;
  border-radius:10px;
  background:var(--infoBg);
  color:var(--info);
  border:1px solid var(--infoBd);
  font-size:12px;
  font-weight:800;
}

.note-time{
  color:var(--muted);
  font-size:11px;
  font-weight:700;
}

.note-empty{
  color:var(--muted2);
  font-weight:700;
}

.note-date-only{
  color:var(--text);
  font-weight:800;
  font-size:12px;
}

.note-text-view{
  background:#f8fafc;
  border:1px solid #dde6f0;
  border-radius:12px;
  padding:12px 14px;
  white-space:pre-wrap;
  word-break:break-word;
  min-height:72px;
  font-size:13px;
  line-height:1.5;
  color:#253142;
}

.device-note{
  margin:0 16px 14px;
  padding:12px 14px;
  border:1px solid #dbe5f0;
  background:#f8fbff;
  border-radius:14px;
}

.device-note-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:8px;
  flex-wrap:wrap;
}

.device-note-title{
  font-size:13px;
  font-weight:700;
  color:#213047;
}

.device-note-time{
  font-size:11px;
  color:#6f7d8c;
}

.device-note-text{
  font-size:12px;
  line-height:1.45;
  color:#334155;
  white-space:pre-wrap;
  word-break:break-word;
}

/* ===== Tables ===== */
.table-wrap,
.history-table-wrap,
.diag-table-wrap{
  overflow:auto;
  width:100%;
  border:1px solid var(--border);
  border-radius:18px;
  background:#fff;
  margin-top:14px;
  box-shadow:var(--shadow-xs);
}

table,
.history-table,
.diag-table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  min-width:1000px;
}

thead th,
.diag-table thead th,
.history-table thead th{
  position:sticky;
  top:0;
  z-index:1;
  background:#f8fbff;
  color:#475569;
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.04em;
  font-weight:900;
  text-align:left;
  padding:13px 14px;
  border-bottom:1px solid var(--border);
  white-space:nowrap;
}

tbody td,
.diag-table tbody td,
.history-table tbody td{
  padding:13px 14px;
  font-size:13px;
  border-bottom:1px solid #edf2f7;
  vertical-align:middle;
  white-space:nowrap;
}

tbody tr:last-child td{
  border-bottom:none;
}

tbody tr:hover{
  background:#fbfdff;
}

.row-down{
  background:#fff7f7;
}

.row-rx-warn{
  background:#fffaf0;
}

.row-rx-bad{
  background:#fff2f2;
}

.actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  align-items:center;
}

.muted{color:var(--muted)}
.muted2{color:var(--muted2)}

.mono{
  font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;
  font-variant-numeric:tabular-nums;
}

.okTxt{color:var(--ok);font-weight:900}
.warnTxt{color:var(--warn);font-weight:900}
.badTxt{color:var(--bad);font-weight:900}

/* ===== Hidden by auth ===== */
.file-input{
  display:none;
}

.auth-only{
  display:none;
}

.toggle-port-btn{
  display:none;
}

.toggle-port-btn.show{
  display:inline-flex;
}

.history-btn{
  min-width:132px;
  justify-content:center;
}

/* ===== Map / Tech ===== */
.map-link{
  display:inline-flex;
  align-items:center;
  gap:6px;
  margin-top:0;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid #bfdbfe;
  background:#eff6ff;
  color:#1d4ed8;
  font-size:12px;
  font-weight:900;
  cursor:pointer;
  text-decoration:none;
  transition:all var(--trans);
}

.map-link:hover{
  transform:translateY(-1px);
  background:#e7f1ff;
  border-color:#9cc5ff;
}

.tech-box{
  margin-top:14px;
  background:var(--warnBg);
  border:1px solid var(--warnBd);
  border-radius:18px;
  overflow:hidden;
}

.tech-box-head{
  padding:12px 14px 0;
}

.tech-box-title{
  font-size:13px;
  font-weight:900;
  color:#9a5c00;
}

.tech-box-body{
  padding:8px 14px 14px;
  color:#8a5500;
  font-size:13px;
  line-height:1.5;
}

/* ===== Modal ===== */
.modal-backdrop{
  position:fixed;
  inset:0;
  background:rgba(15,23,42,.45);
  backdrop-filter:blur(3px);
  display:none;
  align-items:center;
  justify-content:center;
  padding:20px;
  z-index:100;
}

.modal{
  width:min(100%,760px);
  max-height:90vh;
  overflow:auto;
  background:#fff;
  border:1px solid var(--border);
  border-radius:24px;
  box-shadow:var(--shadow-lg);
}

.history-modal,
.diag-modal{
  width:min(100%,1180px);
}

.ppp-modal{
  width:min(100%,980px);
  max-height:min(92vh, 980px);
}

.diag-modal{
  max-height:92vh;
}

.modal-head{
  padding:20px 22px 12px;
  border-bottom:1px solid var(--border);
  background:linear-gradient(180deg,#fbfdff 0%, #f8fbff 100%);
}

.modal-title{
  margin:0;
  font-size:20px;
  color:var(--text-strong);
  font-weight:900;
}

.modal-sub{
  margin:6px 0 0;
  font-size:13px;
  color:var(--muted);
}

.modal-body{
  padding:18px 22px;
}

.modal-actions{
  padding:14px 22px 22px;
  display:flex;
  justify-content:flex-end;
  gap:10px;
  flex-wrap:wrap;
}

.form-row{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.form-row label{
  font-size:13px;
  font-weight:900;
  color:#334155;
}

textarea{
  width:100%;
  min-height:180px;
  resize:vertical;
  border-radius:16px;
  border:1px solid var(--border);
  background:#fff;
  padding:14px;
  outline:none;
  font:inherit;
  color:var(--text);
  line-height:1.5;
  transition:border-color var(--trans), box-shadow var(--trans);
}

textarea:focus{
  border-color:#b9c9e3;
  box-shadow:0 0 0 4px rgba(29,78,216,.08);
}

.modal-tip{
  margin-top:12px;
  font-size:13px;
  color:var(--muted);
  line-height:1.45;
}

/* ===== History / Diag ===== */
.history-empty,
.diag-empty{
  border:1px dashed var(--border);
  border-radius:16px;
  padding:22px;
  text-align:center;
  color:var(--muted);
  font-weight:800;
  background:#fbfdff;
}

.history-grid,
.diag-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(160px,1fr));
  gap:12px;
  margin-bottom:14px;
}

.diag-grid{
  grid-template-columns:repeat(6,minmax(140px,1fr));
}

.history-stat,
.diag-stat{
  background:#fff;
  border:1px solid var(--border);
  border-radius:18px;
  padding:14px;
  min-height:94px;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
}

.history-stat .k,
.diag-stat .k{
  font-size:12px;
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:.04em;
  font-weight:900;
}

.history-stat .v,
.diag-stat .v{
  font-size:18px;
  font-weight:900;
  color:var(--text-strong);
  margin-top:8px;
}

.history-stat .s{
  font-size:12px;
  color:var(--muted);
  margin-top:8px;
}

.history-sections{
  display:grid;
  grid-template-columns:1.45fr .9fr;
  gap:14px;
  margin-bottom:14px;
}

.history-panel,
.diag-section{
  background:#fff;
  border:1px solid var(--border);
  border-radius:20px;
  overflow:hidden;
}

.history-panel-head,
.diag-section-head{
  padding:14px 16px;
  border-bottom:1px solid var(--border);
  background:#f8fbff;
  font-size:13px;
  font-weight:900;
  color:#334155;
}

.history-panel-body,
.diag-section-body{
  padding:14px 16px;
}

.history-chart-wrap{
  margin-top:12px;
  border:1px solid var(--border);
  border-radius:18px;
  background:linear-gradient(180deg,#fcfdff 0%, #f8fbff 100%);
  padding:14px;
  min-height:270px;
}

.history-chart{
  width:100%;
  height:240px;
  color:#2563eb;
}

.history-chart svg{
  width:100%;
  height:240px;
  display:block;
}

.mini-muted{
  font-size:12px;
  color:var(--muted);
  line-height:1.45;
}

.history-week-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}

.history-week-card{
  border:1px solid var(--border);
  border-radius:16px;
  background:#fbfdff;
  padding:14px;
}

.history-week-title{
  font-size:13px;
  font-weight:900;
  color:var(--text);
  margin-bottom:10px;
}

.history-week-list{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.history-week-item{
  display:flex;
  justify-content:space-between;
  gap:10px;
  font-size:13px;
  color:var(--text);
}

.diag-kv{
  display:grid;
  grid-template-columns:repeat(2,minmax(220px,1fr));
  gap:12px;
}

.diag-kv-item{
  border:1px solid var(--border);
  border-radius:16px;
  padding:12px 14px;
  background:#fbfdff;
}

.diag-kv-item .k{
  font-size:12px;
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:.04em;
  font-weight:900;
  margin-bottom:7px;
}

.diag-kv-item .v{
  font-size:14px;
  color:var(--text);
  line-height:1.45;
  font-weight:800;
  word-break:break-word;
}

.diag-badge{
  display:inline-flex;
  align-items:center;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--border);
  font-size:12px;
  font-weight:900;
  background:#fff;
  color:var(--text);
}

.diag-badge.ok{
  background:var(--okBg);
  border-color:var(--okBd);
  color:var(--ok);
}

.diag-badge.warn{
  background:var(--warnBg);
  border-color:var(--warnBd);
  color:var(--warn);
}

.diag-badge.bad{
  background:var(--badBg);
  border-color:var(--badBd);
  color:var(--bad);
}

.diag-tech-box{
  border-radius:16px;
  padding:14px 16px;
  font-size:14px;
  line-height:1.5;
  font-weight:800;
}

.diag-tech-box.ok{
  background:var(--okBg);
  border:1px solid var(--okBd);
  color:var(--ok);
}

.diag-tech-box.warn{
  background:var(--warnBg);
  border:1px solid var(--warnBd);
  color:var(--warn);
}

/* ===== Map ===== */
.geo-map-panel{
  background:linear-gradient(180deg,#ffffff 0%, #fbfdff 100%);
  border:1px solid var(--border);
  box-shadow:var(--shadow);
  border-radius:22px;
  padding:16px;
  margin-bottom:14px;
}

.geo-map-panel{
  position:relative;
  z-index:1;
}

.geo-map-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  margin-bottom:12px;
}

.geo-map-title{
  font-size:18px;
  font-weight:900;
  color:var(--text-strong);
}

.geo-map-sub{
  margin-top:4px;
  font-size:13px;
  color:var(--muted);
}

.geo-map-stats{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-bottom:12px;
}

.geo-map-box{
  position:relative;
  z-index:1;
  width:100%;
  height:460px;
  border-radius:18px;
  border:1px solid var(--border);
  overflow:hidden;
  background:#eef3f9;
}

.geo-map-box .leaflet-container{
  width:100%;
  height:100%;
  border-radius:18px;
}

#btnMapAll{
  min-width:160px;
  background:#eff6ff;
  border:1px solid #bfdbfe;
  color:#1d4ed8;
}

#btnMapAll:hover{
  background:#dbeafe;
}

.geo-map-actions{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}

.geo-map-panel.fullscreen{
  position:fixed;
  inset:12px;
  z-index:9999;
  margin:0;
  padding:18px;
  border-radius:24px;
  background:linear-gradient(180deg,#ffffff 0%, #fbfdff 100%);
  box-shadow:var(--shadow-xl);
}

.geo-map-panel.fullscreen .geo-map-box{
  height:calc(100vh - 150px);
  min-height:420px;
}

body.geo-map-fullscreen-open{
  overflow:hidden;
}

body.geo-map-fullscreen-open::before{
  content:"";
  position:fixed;
  inset:0;
  background:rgba(15,23,42,.45);
  z-index:9998;
}

.map-hover-tip{
  min-width:180px;
  line-height:1.35;
}

.map-hover-title{
  font-size:13px;
  font-weight:900;
  color:var(--text);
  margin-bottom:4px;
}

.map-hover-status{
  font-size:12px;
  font-weight:900;
  margin-bottom:4px;
}

.map-hover-status.ok{color:var(--ok)}
.map-hover-status.warn{color:var(--warn)}
.map-hover-status.bad{color:var(--bad)}

.map-hover-detail{
  font-size:11px;
  color:var(--muted);
}

.custom-map-marker{
  background:transparent !important;
  border:none !important;
}

/* ===== Online badge ===== */
#onlineUsersBadge{
  min-height:38px;
  padding:0 14px;
  box-shadow:0 6px 14px rgba(29,78,216,.10);
}

#onlineUsersBadge b{
  font-size:14px;
  color:inherit;
}

/* ===== Floating alerts ===== */
.floating-alert-btn{
  position:fixed;
  top:88px;
  right:20px;
  bottom:auto;
  left:auto;
  z-index:90;
  border:none;
  outline:none;
  cursor:pointer;
  display:flex;
  flex-direction:column;
  align-items:stretch;
  gap:12px;
  min-width:290px;
  max-width:min(92vw,380px);
  padding:16px;
  border-radius:22px;
  background:linear-gradient(180deg,#fff7f7 0%, #ffe4e6 100%);
  border:1px solid #fda4af;
  box-shadow:0 20px 46px rgba(190,24,93,.18);
  color:#881337;
  animation:floatingAlertPulse 1.15s ease-in-out infinite;
}

.floating-alert-btn:hover{
  box-shadow:0 24px 52px rgba(190,24,93,.24);
}

.floating-alert-icon{
  width:46px;
  height:46px;
  border-radius:999px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:linear-gradient(180deg,#ef4444 0%, #dc2626 100%);
  color:#fff;
  font-size:22px;
  font-weight:900;
  flex:0 0 46px;
  box-shadow:0 0 0 8px rgba(244,63,94,.10);
}

.floating-alert-head{
  display:flex;
  align-items:center;
  gap:12px;
  padding-right:28px;
}

.floating-alert-text{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  text-align:left;
  line-height:1.2;
}

.floating-alert-text .t1{
  font-size:15px;
  font-weight:900;
  color:#881337;
}

.floating-alert-text .t2{
  margin-top:4px;
  font-size:13px;
  font-weight:800;
  color:#9f1239;
}

.floating-alert-metrics{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.floating-alert-pill{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:8px 10px;
  border-radius:999px;
  border:1px solid transparent;
  font-size:12px;
  font-weight:800;
  background:#fff;
}

.floating-alert-pill.critical{
  color:#b91c1c;
  background:#fff1f2;
  border-color:#fecdd3;
}

.floating-alert-pill.warn{
  color:#b45309;
  background:#fffbeb;
  border-color:#fde68a;
}

.floating-alert-footer{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}

.floating-alert-hint{
  font-size:12px;
  font-weight:700;
  color:#9f1239;
}

.floating-alert-cta{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:34px;
  padding:0 12px;
  border-radius:999px;
  background:#fff;
  border:1px solid #fecdd3;
  color:#be123c;
  font-size:12px;
  font-weight:900;
}

.floating-alert-dismiss{
  position:absolute;
  top:10px;
  right:10px;
  width:30px;
  height:30px;
  border:none;
  border-radius:999px;
  background:rgba(255,255,255,.85);
  color:#9f1239;
  font-size:18px;
  line-height:1;
  cursor:pointer;
  box-shadow:var(--shadow-xs);
}

.floating-alert-dismiss:hover{
  background:#fff;
}

.floating-alert-btn.minimized{
  min-width:0;
  width:auto;
  max-width:240px;
  gap:8px;
  padding:12px 14px;
}

.floating-alert-btn.minimized .floating-alert-metrics,
.floating-alert-btn.minimized .floating-alert-footer{
  display:none;
}

.floating-alert-btn.minimized .floating-alert-head{
  padding-right:24px;
}

.floating-alert-btn.minimized .floating-alert-text .t1{
  font-size:14px;
}

.floating-alert-btn.minimized .floating-alert-text .t2{
  margin-top:2px;
  font-size:12px;
}

.floating-alert-btn.has-warn-only{
  background:linear-gradient(180deg,#fffdf5 0%, #ffedd5 100%);
  border-color:#fdba74;
  color:#9a3412;
  box-shadow:0 20px 46px rgba(245,158,11,.16);
}

.floating-alert-btn.has-warn-only .floating-alert-icon{
  background:linear-gradient(180deg,#f59e0b 0%, #ea580c 100%);
  box-shadow:0 0 0 8px rgba(245,158,11,.10);
}

.floating-alert-btn.has-warn-only .floating-alert-text .t1,
.floating-alert-btn.has-warn-only .floating-alert-text .t2,
.floating-alert-btn.has-warn-only .floating-alert-hint,
.floating-alert-btn.has-warn-only .floating-alert-dismiss{
  color:#9a3412;
}

.floating-alert-btn.has-warn-only .floating-alert-cta{
  border-color:#fed7aa;
  color:#c2410c;
}

.footer-alert-arrow{
  font-size:28px;
  line-height:1;
  color:#b91c1c;
  font-weight:700;
}

@keyframes floatingAlertPulse{
  0%,100%{
    transform:scale(1);
    box-shadow:0 16px 40px rgba(185,28,28,.22);
  }
  50%{
    transform:scale(1.03);
    box-shadow:0 20px 52px rgba(185,28,28,.34);
  }
}

.alerts-overlay-modal{
  width:min(100%,980px);
  max-height:92vh;
}

.alerts-overlay-summary{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-bottom:14px;
}

.alerts-overlay-filters{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-bottom:14px;
}

.alerts-overlay-list{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.alerts-overlay-item{
  border:1px solid var(--border);
  border-radius:18px;
  background:#fff;
  overflow:hidden;
}

.alerts-overlay-item.danger{
  border-color:var(--badBd);
  background:linear-gradient(180deg,#fffafa 0%, #fff 100%);
}

.alerts-overlay-item.warn{
  border-color:var(--warnBd);
  background:linear-gradient(180deg,#fffdf7 0%, #fff 100%);
}

.alerts-overlay-item-head{
  padding:14px 16px;
  border-bottom:1px solid rgba(0,0,0,.05);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
}

.alerts-overlay-item-title{
  font-size:14px;
  font-weight:900;
  display:flex;
  align-items:center;
  gap:8px;
}

.alerts-overlay-item.danger .alerts-overlay-item-title{
  color:var(--bad);
}

.alerts-overlay-item.warn .alerts-overlay-item-title{
  color:var(--warn);
}

.alerts-overlay-item-body{
  padding:14px 16px 16px;
}

.alerts-overlay-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(220px,1fr));
  gap:12px;
}

.alerts-kv{
  border:1px solid var(--border);
  background:#fbfdff;
  border-radius:14px;
  padding:12px 14px;
}

.alerts-kv .k{
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:.04em;
  font-weight:900;
  color:var(--muted);
  margin-bottom:6px;
}

.alerts-kv .v{
  font-size:14px;
  font-weight:800;
  color:var(--text);
  line-height:1.4;
  word-break:break-word;
}

.alerts-inline-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-top:14px;
}

.alert-focus-pulse{
  animation:alertFocusPulse 1.3s ease-in-out 2;
}

@keyframes alertFocusPulse{
  0%,100%{
    box-shadow:var(--shadow);
    border-color:var(--border);
  }
  50%{
    box-shadow:0 0 0 4px rgba(185,28,28,.12), 0 18px 45px rgba(185,28,28,.16);
    border-color:#fca5a5;
  }
}

/* ===== Footer ===== */
.footer-bar{
  margin-top:24px;
  padding:20px 22px;
  border:1px solid var(--border);
  background:linear-gradient(180deg,#ffffff 0%, #fbfdff 100%);
  border-radius:24px;
  box-shadow:var(--shadow);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  flex-wrap:wrap;
  transition:
    border-color var(--trans),
    box-shadow var(--trans),
    transform var(--trans);
}

.footer-bar:hover{
  border-color:var(--border-strong);
  box-shadow:0 16px 38px rgba(15,23,42,.10);
}

.footer-left{
  display:flex;
  flex-direction:column;
  gap:4px;
}

.footer-title{
  font-size:15px;
  font-weight:900;
  color:var(--text-strong);
}

.footer-sub{
  font-size:13px;
  color:var(--muted);
  line-height:1.5;
}

.footer-right{
  display:flex;
  align-items:center;
  gap:10px;
  margin-left:auto;
}

.back-to-top-btn{
  min-width:160px;
  justify-content:center;
}

.footer-alert-btn{
  top:88px;
  right:18px;
  bottom:auto;
  left:auto;
  min-width:250px;
  max-width:320px;
  padding:14px 18px;
  border-radius:18px;
  background:linear-gradient(135deg,#fff5f5,#ffe4e6);
  border:1px solid #fecaca;
  box-shadow:0 14px 35px rgba(185,28,28,.18);
}

.footer-alert-btn:hover{
  transform:translateY(-2px);
  box-shadow:0 18px 40px rgba(185,28,28,.24);
  filter:none;
}

.footer-alert-btn .floating-alert-icon{
  width:42px;
  height:42px;
  border-radius:999px;
  display:flex;
  align-items:center;
  justify-content:center;
  flex:0 0 42px;
  font-size:18px;
  background:#dc2626;
  color:#fff;
  box-shadow:0 6px 18px rgba(220,38,38,.28);
}

.footer-alert-btn .floating-alert-text{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  text-align:left;
  line-height:1.2;
  flex:1;
}

.footer-alert-btn .floating-alert-text .t1{
  font-size:15px;
  font-weight:900;
  color:#991b1b;
}

.footer-alert-btn .floating-alert-text .t2{
  margin-top:3px;
  font-size:12px;
  font-weight:700;
  color:#7f1d1d;
  opacity:.9;
}

.history-groups{
  display:flex;
  flex-direction:column;
  gap:14px;
}

.history-group{
  border:1px solid var(--border);
  border-radius:16px;
  overflow:hidden;
  background:#fff;
}

.history-group-head{
  padding:12px 14px;
  border-bottom:1px solid var(--border);
  background:linear-gradient(0deg, #fafafa, #ffffff);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
  cursor:pointer;
  user-select:none;
}

.history-group-head:hover{
  background:linear-gradient(0deg, #f5f9ff, #ffffff);
}

.history-group-title{
  display:flex;
  flex-direction:column;
  gap:4px;
}

.history-group-title strong{
  font-size:15px;
}

.history-group-sub{
  color:var(--muted);
  font-size:12px;
}

.history-group-right{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}

.history-group-toggle{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:30px;
  height:30px;
  border-radius:999px;
  border:1px solid #dbeafe;
  background:#eff6ff;
  color:#1d4ed8;
  font-size:14px;
  font-weight:900;
  flex:0 0 auto;
}

.history-group.collapsed .history-group-toggle{
  transform:rotate(-90deg);
}

.history-group.collapsed .history-group-body{
  display:none;
}

.file-download-list{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
}

.file-chip{
  display:inline-flex;
  align-items:center;
  max-width:180px;
  padding:6px 10px;
  border-radius:10px;
  border:1px solid #bfdbfe;
  background:#eff6ff;
  color:#1d4ed8;
  font-size:12px;
  font-weight:900;
  text-decoration:none;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.file-chip:hover{
  background:#dbeafe;
  border-color:#93c5fd;
}

.file-chip.zip{
  border-color:#f3d39b;
  background:#fff8e8;
  color:#a36b00;
}

.file-chip.zip:hover{
  background:#ffefc7;
}

.file-chip.delete{
  border-color:#fecaca;
  background:#fff1f2;
  color:#b00020;
  cursor:pointer;
}

.file-chip.delete:hover{
  background:#ffe6ea;
}

/* ===== Responsive ===== */
@media (max-width:1400px){
  .stats{
    grid-template-columns:repeat(4,minmax(150px,1fr));
  }
}

@media (max-width:980px){
  .wrap{
    padding:14px;
  }

  .top-actions{
    justify-content:flex-start;
  }

  #onlineUsersBadge{
    order:3;
  }

  .stats{
    grid-template-columns:repeat(2,minmax(150px,1fr));
  }

  .history-sections{
    grid-template-columns:1fr;
  }

  .history-grid{
    grid-template-columns:repeat(2,minmax(160px,1fr));
  }

  .diag-grid{
    grid-template-columns:repeat(2,minmax(140px,1fr));
  }

  .diag-kv{
    grid-template-columns:1fr;
  }

  .history-week-grid{
    grid-template-columns:1fr;
  }

  .admin-grid{
    grid-template-columns:1fr;
  }
}

@media (max-width:900px){
  .card-head-main{
    gap:10px;
  }

  .device-mini-stats,
  .card-pills{
    gap:8px;
  }
}

@media (max-width:780px){
  .floating-alert-btn{
    top:12px;
    right:12px;
    left:12px;
    bottom:auto;
    max-width:none;
    min-width:0;
  }

  .floating-alert-footer{
    flex-direction:column;
    align-items:stretch;
  }

  .alerts-overlay-grid{
    grid-template-columns:1fr;
  }
}

@media (max-width:768px){
  .geo-map-box{
    height:360px;
  }

  .geo-map-head{
    align-items:flex-start;
  }

  .footer-bar{
    flex-direction:column;
    align-items:flex-start;
  }

  .footer-right{
    width:100%;
    margin-left:0;
  }

  .back-to-top-btn{
    width:100%;
  }
}

@media (max-width:720px){
  .diag-modal{
    width:min(98vw,98vw);
    max-height:96vh;
  }

  .diag-grid{
    grid-template-columns:repeat(2,1fr);
  }
}

@media (max-width:640px){
  .stats,
  .history-grid,
  .diag-grid{
    grid-template-columns:1fr;
  }

  .modal{
    border-radius:18px;
  }

  .alerts-overlay-filters{
    flex-direction:column;
  }

  .alerts-overlay-filters .btn{
    width:100%;
  }
}

@media (max-width:560px){
  .title-area h1{
    font-size:22px;
  }

  .filters-grid{
    gap:8px;
  }

  .badge,
  .hist-info-badge,
  .toggle{
    width:100%;
    justify-content:flex-start;
  }
}

.link-card.backup{
  background:#f3f0ff;
  border-color:#d8b4fe;
  color:#7c3aed;
}

.file-download-list{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
}

.file-chip{
  display:inline-flex;
  align-items:center;
  max-width:180px;
  padding:6px 10px;
  border-radius:10px;
  border:1px solid var(--infoBd);
  background:var(--infoBg);
  color:var(--info);
  font-size:12px;
  font-weight:900;
  text-decoration:none;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.file-chip:hover{
  background:#dbeafe;
  border-color:#93c5fd;
}

.file-chip.zip{
  border-color:var(--warnBd);
  background:var(--warnBg);
  color:var(--warn);
}

.file-chip.zip:hover{
  background:#ffefc7;
  border-color:#e9b949;
}

.ppp-pill{
  color:#0f766e !important;
  background:#ecfeff !important;
  border-color:#99f6e4 !important;
  gap:4px;
}

.ppp-pill-btn{
  cursor:pointer;
  appearance:none;
  font:inherit;
}

.ppp-pill:hover{
  background:#cffafe !important;
  border-color:#5eead4 !important;
}

.ppp-modal-summary{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-bottom:14px;
}

.ppp-modal-toolbar{
  display:grid;
  grid-template-columns:minmax(260px, 1fr) 220px;
  gap:12px;
  margin-bottom:16px;
}

.ppp-modal-search,
.ppp-modal-sort{
  min-width:0;
}

.ppp-client-list{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(280px, 1fr));
  gap:14px;
}

.ppp-client-card{
  border:1px solid var(--border);
  border-radius:18px;
  padding:16px;
  background:linear-gradient(180deg,#ffffff 0%, #f8fbff 100%);
  box-shadow:0 10px 25px rgba(15,23,42,.05);
}

.ppp-client-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin-bottom:14px;
}

.ppp-client-name{
  font-size:16px;
  font-weight:900;
  color:var(--text-strong);
  word-break:break-word;
}

.ppp-client-grid{
  display:grid;
  grid-template-columns:1fr;
  gap:10px;
}

.ppp-client-field{
  background:#fff;
  border:1px solid #e2e8f0;
  border-radius:14px;
  padding:10px 12px;
}

.ppp-client-label{
  display:block;
  font-size:11px;
  font-weight:800;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:#64748b;
  margin-bottom:4px;
}

.ppp-client-value{
  display:block;
  color:#0f172a;
  font-weight:700;
  word-break:break-all;
}

.ppp-client-status{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:7px 12px;
  border-radius:999px;
  font-weight:800;
  line-height:1.2;
  border:1px solid transparent;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.45);
}

.ppp-client-status::before{
  content:"";
  width:10px;
  height:10px;
  border-radius:50%;
  background:currentColor;
  box-shadow:0 0 0 3px rgba(255,255,255,.45);
  flex-shrink:0;
}

.ppp-client-status.status-active{
  color:#166534;
  background:#dcfce7;
  border-color:#86efac;
}

.ppp-client-status.status-suspended{
  color:#b91c1c;
  background:#fee2e2;
  border-color:#fca5a5;
}

.ppp-client-status.status-exempt{
  color:#9f1239;
  background:#ffe4e6;
  border-color:#fda4af;
}

.ppp-client-status.status-neutral{
  color:#334155;
  background:#e2e8f0;
  border-color:#cbd5e1;
}

.ppp-client-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:14px;
}
.btn-map{
  background:#2b7a0b;
  color:#fff;
  border-color:#2b7a0b;
}
.btn-map:hover{
  background:#246609;
  border-color:#246609;
}

@media (max-width: 720px){
  .ppp-modal-toolbar{
    grid-template-columns:1fr;
  }
}

.ppp-source-cache{
  font-weight:800;
  color:#a16207;
}

.ppp-source-snmp{
  font-weight:800;
  color:#15803d;
}

.ppp-source-generic{
  font-weight:800;
  color:#1d4ed8;
}

.link-card.danger{
  background:#fff1f2;
  border-color:#fecdd3;
  color:#b91c1c;
}
