/* dashboard-extra.css — extraído de dashboard.html por csp_fix_m2.py */

    /* ── Reset ─────────────────────────────────────────────── */
    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

    /* ── Variables ──────────────────────────────────────────── */
    :root {
      --bg:        #0f1117;
      --surface:   #1a1d27;
      --surface2:  #222636;
      --accent:    #3b82f6;
      --accent2:   #2563eb;
      --good:      #10b981;
      --warn:      #f59e0b;
      --bad:       #ef4444;
      --text:      #e2e8f0;
      --muted:     #64748b;
      --border:    rgba(255,255,255,0.07);
      --r:         8px;
      --shadow:    0 4px 24px rgba(0,0,0,.45);
    }

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

    /* ── Header ─────────────────────────────────────────────── */
    header {
      background: linear-gradient(135deg, #1a1d27 0%, #111420 100%);
      border-bottom: 1px solid var(--border);
      padding: 0 24px;
      height: 58px;
      display: flex;
      align-items: center;
      gap: 14px;
      position: sticky;
      top: 0;
      z-index: 100;
      box-shadow: 0 2px 12px rgba(0,0,0,.4);
    }
    .logo {
      font-size: 1.05rem;
      font-weight: 700;
      color: var(--accent);
      letter-spacing: -.5px;
      white-space: nowrap;
    }
    .logo span { color: var(--text); }
    .header-divider { color: var(--muted); font-size: .8rem; }
    .header-sep { flex: 1; }

    .status-pill {
      display: flex;
      align-items: center;
      gap: 6px;
      font-size: .75rem;
      color: var(--muted);
      background: var(--surface);
      border: 1px solid var(--border);
      padding: 4px 10px;
      border-radius: 20px;
    }
    .dot {
      width: 7px; height: 7px;
      border-radius: 50%;
      background: var(--muted);
      transition: background .3s, box-shadow .3s;
    }
    .dot.online  { background: var(--good); box-shadow: 0 0 6px var(--good); }
    .dot.offline { background: var(--bad);  box-shadow: 0 0 6px var(--bad); }

    #countdown { font-size: .72rem; color: var(--muted); min-width: 48px; }

    #refreshBtn {
      background: var(--surface2);
      border: 1px solid var(--border);
      color: var(--text);
      padding: 6px 14px;
      border-radius: var(--r);
      cursor: pointer;
      font-size: .8rem;
      transition: background .2s;
      white-space: nowrap;
    }
    #refreshBtn:hover:not(:disabled) { background: var(--accent2); }
    #refreshBtn:disabled { opacity: .5; cursor: not-allowed; }

    /* ── Layout ─────────────────────────────────────────────── */
    .layout {
      display: grid;
      grid-template-columns: 1fr;
      gap: 18px;
      padding: 18px;
      flex: 1;
      min-height: 0;
    }
    @media (min-width: 1024px) {
      .layout {
        grid-template-columns: 1fr 400px;
        align-items: start;
      }
    }

    /* ── Card ────────────────────────────────────────────────── */
    .card {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--r);
      overflow: hidden;
    }
    .card-header {
      padding: 13px 18px;
      border-bottom: 1px solid var(--border);
      display: flex;
      align-items: center;
      gap: 10px;
    }
    .card-title {
      font-size: .88rem;
      font-weight: 600;
      flex: 1;
    }
    .badge {
      background: var(--surface2);
      border: 1px solid var(--border);
      color: var(--muted);
      font-size: .68rem;
      padding: 2px 8px;
      border-radius: 20px;
    }

    /* ── Search ──────────────────────────────────────────────── */
    .search-wrap { padding: 11px 16px; }
    #search {
      width: 100%;
      background: var(--surface2);
      border: 1px solid var(--border);
      color: var(--text);
      padding: 7px 12px;
      border-radius: var(--r);
      font-size: .83rem;
      outline: none;
      transition: border-color .2s;
    }
    #search:focus { border-color: var(--accent); }
    #search::placeholder { color: var(--muted); }

    /* ── Table ───────────────────────────────────────────────── */
    .table-wrap { overflow-x: auto; max-height: calc(100vh - 220px); overflow-y: auto; }
    table { width: 100%; border-collapse: collapse; font-size: .81rem; }
    th {
      text-align: left;
      padding: 9px 14px;
      color: var(--muted);
      font-weight: 500;
      border-bottom: 1px solid var(--border);
      white-space: nowrap;
      position: sticky;
      top: 0;
      background: var(--surface);
    }
    td {
      padding: 9px 14px;
      border-bottom: 1px solid rgba(255,255,255,.04);
      max-width: 180px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    tr.row { cursor: pointer; }
    tr.row:hover td { background: var(--surface2); }
    tr.row.active td {
      background: rgba(59,130,246,.1);
      border-left: 2px solid var(--accent);
    }
    .ago { color: var(--muted); font-size: .73rem; }

    /* ── Empty / Loader ──────────────────────────────────────── */
    .placeholder {
      padding: 44px 24px;
      text-align: center;
      color: var(--muted);
      font-size: .83rem;
      line-height: 1.6;
    }
    .spinner {
      width: 26px; height: 26px;
      border: 3px solid var(--border);
      border-top-color: var(--accent);
      border-radius: 50%;
      animation: spin .65s linear infinite;
      margin: 0 auto 12px;
    }
    @keyframes spin { to { transform: rotate(360deg); } }

    /* ── Detail Panel ────────────────────────────────────────── */
    #detail {
      display: flex;
      flex-direction: column;
      gap: 12px;
    }
    .detail-card {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--r);
      overflow: hidden;
    }
    .detail-section {
      padding: 13px 15px;
    }
    .detail-section + .detail-section {
      border-top: 1px solid var(--border);
    }
    .section-label {
      font-size: .67rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: .08em;
      color: var(--muted);
      margin-bottom: 10px;
    }

    /* Device header block */
    .dev-hdr {
      padding: 14px 16px;
      display: flex;
      align-items: flex-start;
      gap: 12px;
      border-bottom: 1px solid var(--border);
    }
    .dev-icon {
      width: 40px; height: 40px;
      background: rgba(59,130,246,.15);
      border-radius: 8px;
      display: flex; align-items: center; justify-content: center;
      font-size: 1.35rem;
      flex-shrink: 0;
    }
    .dev-name { font-weight: 600; font-size: .92rem; }
    .dev-id   { font-size: .68rem; color: var(--muted); font-family: monospace; margin-top: 3px; word-break: break-all; }

    /* KV rows */
    .kv {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 8px;
      padding: 5px 0;
    }
    .kv + .kv { border-top: 1px solid rgba(255,255,255,.03); }
    .kv-k { font-size: .78rem; color: var(--muted); white-space: nowrap; }
    .kv-v { font-size: .78rem; color: var(--text); text-align: right; font-family: monospace; word-break: break-all; max-width: 210px; }
    .kv-v.nd { color: var(--muted); font-style: italic; font-family: inherit; }

    /* Signal badge */
    .signal {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      padding: 2px 9px;
      border-radius: 4px;
      font-size: .78rem;
      font-weight: 600;
      font-family: monospace;
    }
    .signal.good { background: rgba(16,185,129,.15); color: var(--good); }
    .signal.warn { background: rgba(245,158,11,.15);  color: var(--warn); }
    .signal.bad  { background: rgba(239,68,68,.15);   color: var(--bad); }
    .signal.nd   { background: var(--surface2); color: var(--muted); font-family: inherit; font-weight: 400; font-style: italic; }

    /* Login screen */
    .login-screen {
      display: none; position: fixed; inset: 0;
      background: var(--bg); z-index: 2000;
      align-items: center; justify-content: center;
    }
    .login-screen.visible { display: flex; }
    .login-box {
      background: var(--surface); border-radius: 16px;
      padding: 40px; width: 100%; max-width: 380px;
      box-shadow: 0 8px 40px rgba(0,0,0,.45);
    }
    .login-logo { font-size: 1.4rem; font-weight: 700; color: var(--text); margin-bottom: 6px; }
    .login-logo span { color: var(--accent); }
    .login-subtitle { font-size: .78rem; color: var(--muted); margin-bottom: 28px; }
    .login-label { display: block; font-size: .75rem; color: var(--muted); margin-bottom: 4px; margin-top: 14px; }
    .login-input {
      width: 100%; box-sizing: border-box;
      background: var(--surface2); border: 1px solid var(--border);
      border-radius: 8px; color: var(--text); padding: 10px 12px;
      font-size: .9rem; outline: none;
    }
    .login-input:focus { border-color: var(--accent); }
    .login-btn {
      width: 100%; margin-top: 22px;
      background: var(--accent); color: #fff; border: none;
      border-radius: 8px; padding: 11px; font-size: .95rem;
      cursor: pointer; font-weight: 600;
    }
    .login-btn:hover { opacity: .88; }
    .login-btn:disabled { opacity: .5; cursor: not-allowed; }
    .login-err { color: #ef4444; font-size: .78rem; margin-top: 10px; min-height: 16px; text-align: center; }
    /* Usuario en header */
    .user-info { display: flex; align-items: center; gap: 8px; font-size: .78rem; color: var(--muted); }
    .user-info strong { color: var(--text); }
    .logout-btn { background: none; border: 1px solid var(--border); color: var(--muted); border-radius: 6px; padding: 4px 10px; font-size: .75rem; cursor: pointer; }
    .logout-btn:hover { border-color: var(--accent); color: var(--accent); }

        /* Modal cliente */
    .modal-overlay {
      display: none; position: fixed; inset: 0;
      background: rgba(0,0,0,.55); z-index: 999;
      align-items: center; justify-content: center;
    }
    .modal-overlay.open { display: flex; }
    .modal {
      background: var(--surface); border-radius: 12px;
      padding: 24px; width: 100%; max-width: 420px;
      box-shadow: 0 8px 32px rgba(0,0,0,.4);
    }
    .modal h3 { margin: 0 0 18px; font-size: 1rem; color: var(--text); }
    .modal label { display: block; font-size: .78rem; color: var(--muted); margin-bottom: 4px; margin-top: 12px; }
    .modal input, .modal select {
      width: 100%; box-sizing: border-box;
      background: var(--surface2); border: 1px solid var(--border);
      border-radius: 7px; color: var(--text); padding: 8px 10px;
      font-size: .88rem; outline: none;
    }
    .modal input:focus, .modal select:focus { border-color: var(--accent); }
    .cedula-row { display: flex; gap: 8px; }
    .cedula-row select { width: 80px; flex-shrink: 0; }
    .cedula-row input  { flex: 1; }
    .modal-actions { display: flex; gap: 8px; margin-top: 20px; justify-content: flex-end; }
    .btn-primary { background: var(--accent); color: #fff; border: none; border-radius: 7px; padding: 8px 18px; font-size: .85rem; cursor: pointer; }
    .btn-primary:hover { opacity: .88; }
    .btn-secondary { background: var(--surface2); color: var(--text); border: 1px solid var(--border); border-radius: 7px; padding: 8px 14px; font-size: .85rem; cursor: pointer; }
    .btn-danger { background: #ef4444; color: #fff; border: none; border-radius: 7px; padding: 8px 14px; font-size: .85rem; cursor: pointer; margin-right: auto; }
    .btn-danger:hover { opacity: .88; }
    .link-btn { background: none; border: none; color: var(--accent); font-size: .8rem; cursor: pointer; padding: 4px 0; text-decoration: underline; }
    .link-btn:hover { opacity: .8; }
    .modal-err { color: #ef4444; font-size: .78rem; margin-top: 8px; min-height: 18px; }

    /* WiFi band block */
    .band-block {
      background: var(--surface2);
      border: 1px solid var(--border);
      border-radius: 6px;
      padding: 10px 12px;
      margin-top: 8px;
    }
    .band-title {
      font-size: .74rem;
      font-weight: 600;
      color: var(--accent);
      display: flex;
      align-items: center;
      gap: 6px;
      margin-bottom: 7px;
    }
    .freq-pill {
      font-size: .63rem;
      padding: 1px 6px;
      border-radius: 3px;
      background: rgba(59,130,246,.18);
      color: var(--accent);
      font-weight: 500;
    }

    /* Password toggle */
    .pass-wrap { display: flex; align-items: center; gap: 5px; }
    .pass-text { font-family: monospace; font-size: .78rem; transition: filter .25s; }
    .pass-text.hidden { filter: blur(5px); user-select: none; }
    .eye-btn {
      background: none; border: none;
      color: var(--muted); cursor: pointer;
      padding: 2px 3px; font-size: .85rem;
      line-height: 1;
      transition: color .2s;
    }
    .eye-btn:hover { color: var(--text); }

    /* Empty detail */
    .detail-empty {
      display: flex;
      align-items: center;
      justify-content: center;
      min-height: 240px;
      color: var(--muted);
      font-size: .83rem;
      text-align: center;
    }

    /* ── Toast ───────────────────────────────────────────────── */
    #toast {
      position: fixed;
      bottom: 18px; right: 18px;
      background: var(--surface);
      border: 1px solid var(--border);
      border-left: 3px solid var(--accent);
      padding: 11px 15px;
      border-radius: var(--r);
      font-size: .8rem;
      max-width: 300px;
      box-shadow: var(--shadow);
      transform: translateY(110%);
      transition: transform .3s;
      z-index: 999;
      word-break: break-word;
    }
    #toast.show     { transform: translateY(0); }
    #toast.err      { border-left-color: var(--bad); }
    #toast.success  { border-left-color: var(--good); }
  