:root {
    --ink: #e2e8f0;
    --muted: #94a3b8;
    --line: rgba(148, 163, 184, 0.2);
    --glass: rgba(15, 22, 35, 0.64);
    --accent: #f07d2f;
    --accent-soft: #f9a24d;
  }

  * { box-sizing: border-box; }

  body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background:
      radial-gradient(1200px 520px at -10% -10%, rgba(240, 125, 47, 0.16), transparent 60%),
      radial-gradient(900px 480px at 110% -15%, rgba(249, 162, 77, 0.12), transparent 55%),
      linear-gradient(180deg, #0a0d12 0%, #080b10 46%, #06090f 100%);
    font-family: Inter, Lexend, ui-sans-serif, system-ui, sans-serif;
    overflow-x: hidden;
  }

  #dashboard { display: none; }

  .hidden { display: none; }

  .grid-noise {
    background-image:
      linear-gradient(to right, rgba(148, 163, 184, 0.07) 1px, transparent 1px),
      linear-gradient(to bottom, rgba(148, 163, 184, 0.07) 1px, transparent 1px);
    background-size: 46px 46px;
    -webkit-mask-image: radial-gradient(circle at 50% 35%, black 35%, transparent 82%);
    mask-image: radial-gradient(circle at 50% 35%, black 35%, transparent 82%);
  }

  .glass-card {
    background: linear-gradient(180deg, rgba(148, 163, 184, 0.05), rgba(148, 163, 184, 0.02)), var(--glass);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 24px 80px rgba(2, 8, 23, 0.45);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
  }

  .card-border-glow {
    position: relative;
    overflow: hidden;
  }

  .card-border-glow::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, rgba(249, 162, 77, 0.62), rgba(148, 163, 184, 0.18), rgba(148, 163, 184, 0));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0.55;
  }

  #pwd-input.shake { animation: shake 0.35s ease; border-color: #f87171; }
  @keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-7px); }
    75% { transform: translateX(7px); }
  }

  .icon-svg {
    width: 21px;
    height: 21px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
  }

  .icon-svg-sm {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
  }

  .dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: #4ade80;
    box-shadow: 0 0 16px rgba(74, 222, 128, 0.65);
    animation: pulse-dot 1.8s ease-in-out infinite;
  }

  @keyframes pulse-dot {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(0.78); opacity: 0.58; }
  }

  .chart-wrap { height: clamp(210px, 32vw, 290px); }
  .chart-wrap-lg { height: clamp(250px, 36vw, 340px); }

  .table-wrap { overflow-x: auto; }
  table { width: 100%; min-width: 720px; border-collapse: collapse; }
  thead tr { border-bottom: 1px solid var(--line); background: rgba(15, 23, 42, 0.5); }

  th {
    text-align: left;
    padding: 15px 18px;
    font-size: 11px;
    letter-spacing: 1.35px;
    text-transform: uppercase;
    color: #93a4bc;
    font-weight: 600;
  }

  td {
    padding: 18px;
    color: #e2e8f0;
    vertical-align: middle;
  }

  .contact-row {
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
    animation: fadeInRow 0.35s ease both;
    transition: background 0.2s ease;
  }

  .contact-row:hover { background: rgba(240, 125, 47, 0.08); }
  .contact-row:last-child { border-bottom: none; }

  @keyframes fadeInRow {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
  }

  .avatar {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    background: linear-gradient(135deg, var(--accent), #ca5f19);
    box-shadow: 0 8px 24px rgba(240, 125, 47, 0.35);
  }

  .contact-name { color: #f1f5f9; font-weight: 600; }
  .contact-link { color: #c2cfdf; text-decoration: none; transition: color 0.2s ease; }
  .contact-link:hover { color: var(--accent-soft); }

  .date-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid rgba(249, 162, 77, 0.34);
    color: #fbd29f;
    background: rgba(240, 125, 47, 0.12);
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
  }

  .empty-row { text-align: center; padding: 46px !important; color: #93a4bc; }

  .confirm-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 1000;
    background: rgba(2, 6, 23, 0.7);
    -webkit-backdrop-filter: blur(7px);
    backdrop-filter: blur(7px);
  }

  .confirm-overlay.show { display: flex; }

  @media (max-width: 1024px) {
    .chart-wrap { height: 250px; }
    .chart-wrap-lg { height: 290px; }
  }

  @media (max-width: 640px) {
    .chart-wrap { height: 210px; }
    .chart-wrap-lg { height: 240px; }
    th, td { padding: 14px; }
  }