:root{
      --black:#000000;
      --white:#ffffff;
      --accent:#b5e3ff;
      --textGrey:#535d60;

      --glass: rgba(255,255,255,.72);
      --glass2: rgba(255,255,255,.58);

      --shadow: 0 1.6rem 3.4rem rgba(8, 35, 68, .18);
      --shadow2: 0 .9rem 2rem rgba(8, 35, 68, .14);

      --radius: 1.25rem;
    }

    /* rem base — TV-optimized (1080p/4K): large, legible from distance */
    html{ font-size: 14px; box-sizing: border-box; }
    *, *::before, *::after{ box-sizing: inherit; }
    @media (min-width: 576px){ html{ font-size: 15px; } }
    @media (min-width: 768px){ html{ font-size: 16px; } }
    @media (min-width: 992px){ html{ font-size: 18px; } }
    @media (min-width: 1200px){ html{ font-size: 20px; } }
    @media (min-width: 1600px){ html{ font-size: 22px; } }
    @media (min-width: 1920px){ html{ font-size: 24px; } }
    @media (min-width: 2560px){ html{ font-size: 26px; } }
    @media (min-width: 3840px){ html{ font-size: 30px; } }

    body{
      font-family: "Poppins", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
      font-weight: 600;
      color: var(--black);
      min-height: 100vh;
      overflow-x: hidden;
      -webkit-overflow-scrolling: touch;
      /* Deep-blue premium organic waves — design reference */
    /* background-image: url("/dashboard-g.jpg"); */
    background-size: cover;
    background-position: center center;
    background-attachment: fixed;
    }
    img{ max-width: 100%; height: auto; }

    /* Organic layers */
    body::before,
    body::after{
      content:"";
      position: fixed;
      inset: -20%;
      z-index: -1;
      pointer-events:none;
      filter: blur(40px);
      opacity: .85;
      transform: rotate(-6deg);
    }
    

    .wrap{
      max-width: 96rem;
      margin: 0 auto;
      padding: 0.6rem 0.75rem 1.5rem;
      width: 100%;
    }
    @media (min-width: 576px){ .wrap{ padding: 0.85rem 1rem 1.75rem; } }
    @media (min-width: 768px){ .wrap{ padding: 1rem 1.1rem 2rem; } }

    /* Glassmorphism: semi-transparent frosted glass so background remains visible */
    .glass{
      background: var(--glass);
      backdrop-filter: blur(14px);
      -webkit-backdrop-filter: blur(14px);
      border: 1px solid rgba(255,255,255,.55);
      box-shadow: var(--shadow);
    }
    .glass-soft{
      background: var(--glass2);
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      border: 1px solid rgba(255,255,255,.5);
      box-shadow: var(--shadow2);
    }

    .pill{
      border-radius: 999px;
      padding: 0.35rem 0.6rem;
      display: inline-flex;
      align-items: center;
      gap: 0.35rem;
      font-weight: 700;
      font-size: 0.75rem;
      border: 1px solid var(--white);
      background: rgba(255,255,255,.7);
      box-shadow: 0 .8rem 1.6rem rgba(8,35,68,.12);
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
    }
    @media (min-width: 576px){ .pill{ padding: .4rem .7rem; font-size: .8rem; gap: .4rem; } }
    @media (min-width: 768px){ .pill{ padding: .45rem .75rem; font-size: .85rem; gap: .45rem; } }
    .pill .dot{
      width: .55rem; height: .55rem; border-radius: 999px;
      background: #22c55e;
      box-shadow: 0 0 0 .18rem rgba(34,197,94,.18);
    }

    .topbar{
      border-radius: 1rem;
      padding: 0.65rem 0.75rem;
      flex-wrap: wrap;
      gap: 0.5rem;
    }
    @media (min-width: 576px){ .topbar{ padding: 0.85rem 0.9rem; border-radius: 1.1rem; } }
    @media (min-width: 768px){ .topbar{ padding: 1rem 1.1rem; border-radius: 1.2rem; } }
    .brand{
      display: flex;
      align-items: center;
      gap: 0.5rem;
      min-width: 0;
    }
    @media (min-width: 768px){ .brand{ min-width: 18rem; gap: .85rem; } }
    .brand .logo{
      display: grid;
      place-items: center;
      overflow: hidden;
      width: 80px;
      height: auto;
      max-height: 2.5rem;
    }
    .brand .logo img{ width: 100%; height: 100%; object-fit: contain; max-height: 2.5rem; }
    @media (min-width: 576px){ .brand .logo{ width: 100px; max-height: 3rem; } .brand .logo img{ max-height: 3rem; } }
    @media (min-width: 768px){ .brand .logo{ width: 250px; max-height: none; border-radius: 1rem; } .brand .logo img{ max-height: none; object-fit: cover; } }
    .brand .brand-text{ line-height: 1.1; }
    .brand .brand-text strong{ font-size: 1.02rem; font-weight:800; }
    .brand .brand-text small{ color: rgba(10,42,58,.65); font-weight: 600; }

    .title{
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 0.4rem;
      font-size: 1rem;
      font-weight: 800;
      color: var(--black);
      letter-spacing: .02em;
      order: 3;
      flex-basis: 100%;
      flex-shrink: 0;
    }
    @media (min-width: 576px){ .title{ font-size: 1.15rem; order: 0; flex-basis: auto; } }
    @media (min-width: 768px){ .title{ font-size: 1.35rem; gap: .6rem; } }
    .title i, .title svg{ color: var(--accent); }
    .title svg{ flex-shrink: 0; width: 1.1em; height: 1.1em; }
    @media (min-width: 768px){ .title svg{ width: 24px; height: 24px; } }

    .datetime{
      text-align: right;
      min-width: 0;
      font-weight: 700;
      font-size: 0.85rem;
    }
    @media (min-width: 576px){ .datetime{ min-width: 10rem; } }
    @media (min-width: 768px){ .datetime{ min-width: 13rem; } }
    .datetime .time{ font-size: 1em; color: var(--black); font-weight: 700; }
    .datetime .date{ font-size: 0.75rem; color: var(--textGrey); font-weight: 600; }
    @media (min-width: 768px){ .datetime .time{ font-size: 1.05rem; } .datetime .date{ font-size: .82rem; } }

    .stats-card{
      border-radius: var(--radius);
      padding: 0.65rem 0.6rem;
      height: 100%;
    }
    .stats-card .gap-3{ gap: 0.5rem !important; }
    @media (min-width: 576px){ .stats-card{ padding: .8rem .85rem; } .stats-card .gap-3{ gap: 0.75rem !important; } }
    @media (min-width: 768px){ .stats-card{ padding: 1.05rem 1.1rem; } .stats-card .gap-3{ gap: 1rem !important; } }
    .stats-icon{
      width: 2.2rem;
      height: 2.2rem;
      border-radius: 0.75rem;
      display:grid;
      place-items:center;
      background: rgba(181,227,255,.55);
      border: 1px solid var(--accent);
      color: var(--black);
    }
    @media (min-width: 576px){ .stats-icon{ width: 2.45rem; height: 2.45rem; border-radius: .85rem; } }
    @media (min-width: 768px){ .stats-icon{ width: 2.7rem; height: 2.7rem; border-radius: .95rem; } }
    .stats-label{
      color: var(--textGrey);
      font-weight: 600;
      font-size: 0.75rem;
    }
    @media (min-width: 576px){ .stats-label{ font-size: .8rem; } }
    @media (min-width: 768px){ .stats-label{ font-size: .85rem; } }
    .stats-value{
      font-size: 1.25rem;
      font-weight: 800;
      margin-top: .1rem;
      color: var(--black);
    }
    @media (min-width: 576px){ .stats-value{ font-size: 1.4rem; } }
    @media (min-width: 768px){ .stats-value{ font-size: 1.55rem; margin-top: .15rem; } }

    .progress-ring{ width: 3rem; height: 3rem; flex-shrink: 0; }
    @media (min-width: 576px){ .progress-ring{ width: 3.1rem; height: 3.1rem; } }
    @media (min-width: 768px){ .progress-ring{ width: 3.4rem; height: 3.4rem; } }

    .toolbar{
      border-radius: 0.9rem;
      padding: 0.5rem 0.6rem;
      display: flex;
      flex-direction: column;
      align-items: stretch;
      gap: 0.5rem;
      flex-wrap: wrap;
    }
    @media (min-width: 576px){ .toolbar{ flex-direction: row; align-items: center; justify-content: space-between; padding: .6rem .7rem; gap: .7rem; border-radius: 1rem; } }
    @media (min-width: 768px){ .toolbar{ padding: .65rem .75rem; gap: .9rem; border-radius: 1.15rem; } }
    .toolbar .group{
      display: flex;
      align-items: center;
      gap: 0.4rem;
      flex-wrap: wrap;
    }
    .toolbar .label{
      display: flex;
      align-items: center;
      gap: 0.35rem;
      color: var(--textGrey);
      font-weight: 800;
      font-size: 0.8rem;
      margin-right: 0.15rem;
    }
    @media (min-width: 576px){ .toolbar .label{ font-size: .85rem; } }
    @media (min-width: 768px){ .toolbar .label{ font-size: .9rem; gap: .45rem; } }
    .btn-pill{
      border-radius: 999px !important;
      padding: 0.4rem 0.65rem !important;
      font-weight: 800;
      font-size: 0.8rem;
      border: 1px solid var(--accent) !important;
      background: rgba(255,255,255,.65) !important;
      color: var(--black) !important;
    }
    @media (min-width: 576px){ .btn-pill{ padding: .45rem .75rem !important; font-size: .85rem; } }
    @media (min-width: 768px){ .btn-pill{ padding: .48rem .85rem !important; font-size: .9rem; } }
    .btn-pill:hover{ filter: brightness(.98); }
    .btn-pill.active{
      background: rgba(181,227,255,.75) !important;
      border-color: var(--accent) !important;
      box-shadow: 0 .7rem 1.2rem rgba(8,35,68,.10);
    }

    .board{ display: flex; flex-direction: column; gap: 0.5rem; }
    @media (min-width: 576px){ .board{ gap: .6rem; } }
    @media (min-width: 768px){ .board{ gap: .75rem; } }

    /* Client row: responsive grid → stacked on small screens */
    .client-row{
      border-radius: 1rem;
      padding: 0.65rem 0.75rem;
      display: flex;
      align-items: center;
      gap: 0.5rem 0.75rem;
    }
    @media (min-width: 576px){
       .client-row{
         padding: 0.8rem 0.9rem; gap: 0.6rem 0.9rem; border-radius: 1.1rem; 
        } 
      }
    @media (min-width: 768px){
      .client-row{
        display: grid;
        grid-template-columns: 1fr 5rem 6rem 1fr;
        column-gap: 0.75rem;
        padding: .9rem 1rem;
        border-radius: 1.2rem;
      }
    }
    @media (min-width: 992px){
      .client-row{ 
        grid-template-columns: 18rem 5rem 6rem 1fr; 
        column-gap: 1rem; 
        padding: .95rem 1.1rem; }
    }
    @media (min-width: 1200px){
      .client-row{ 
        grid-template-columns: 20rem 5rem 6rem 1fr; 
        column-gap: 1.05rem; 
      }
    }
    @media (min-width: 1400px){
      .client-row{ grid-template-columns: 23rem 5rem 6rem 1fr; }
    }
    /* Mobile: compact row — hide progress bar & target; only handle, client, count, +/- */
    .client-row .bar-wrap{ flex: 1 1 100%; min-width: 100%; order: 10; }
    @media (max-width: 767px){
      .client-row .bar-wrap{ display: none !important; }
      .client-row .client{ flex: 1 1 auto; min-width: 0; }
      .client-row .lead-count{ margin-left: auto; }
    }
    @media (min-width: 768px){ .client-row .bar-wrap{ display: grid !important; flex: none; min-width: 0; order: 0; } }

    .handle{
      width: 0.75rem;
      flex-shrink: 0;
      display: grid;
      place-items: center;
      opacity: 0.5;
    }
    @media (min-width: 768px){ .handle{ width: 1rem; opacity: .55; } }
    .handle::before{
      content:"";
      width: .55rem;
      height: 1.4rem;
      background:
        radial-gradient(circle, rgba(10,42,58,.55) 38%, transparent 40%) 0 0 / .27rem .27rem,
        radial-gradient(circle, rgba(10,42,58,.55) 38%, transparent 40%) .28rem .14rem / .27rem .27rem;
      border-radius: .25rem;
      display:block;
    }

    .client{
      width: 100%;
      min-width: 0;
      flex: 1 1 10rem;
      display: grid;
      grid-template-columns: 2.5rem 1fr;
      align-items: center;
      gap: 0.5rem;
    }
    @media (min-width: 576px){ .client{ grid-template-columns: 2.8rem 1fr; gap: .65rem; } }
    @media (min-width: 768px){ .client{ flex: none; grid-template-columns: 3.1rem 1fr; gap: .85rem; } }
    .client .logo-box{
      width: 2.5rem;
      height: 2.5rem;
      border-radius: 0.75rem;
      overflow: hidden;
      border: 1px solid var(--accent);
      background: var(--white);
      box-shadow: 0 .6rem 1.3rem rgba(8,35,68,.10);
      position: relative;
    }
    @media (min-width: 576px){ .client .logo-box{ width: 2.8rem; height: 2.8rem; border-radius: .9rem; } }
    @media (min-width: 768px){ .client .logo-box{ width: 3rem; height: 3rem; border-radius: 1.05rem; } }
    .client .logo-box img{
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
    }
    .client .logo-fallback{
      position:absolute;
      inset:0;
      display:none;
      place-items:center;
      font-weight: 800;
      color: var(--black);
      background: rgba(181,227,255,.45);
    }
    .client .meta{ line-height: 1.15; min-width: 0; }
    .client .name{
      font-weight: 800;
      font-size: 0.9rem;
      color: var(--black);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      max-width: 100%;
    }
    @media (min-width: 576px){ .client .name{ font-size: 1rem; } }
    @media (min-width: 768px){ .client .name{ font-size: 1.05rem; } }
    .client .sub{
      font-size: .78rem;
      color: var(--textGrey);
      font-weight: 700;
      margin-top: .12rem;
    }

    .lead-count{
      font-size: 1.05rem;
      font-weight: 900;
      color: var(--black);
      justify-self: end;
      text-align: right;
      flex-shrink: 0;
    }
    @media (min-width: 768px){ .lead-count{ font-size: 1.2rem; } }

    .controls{
      display:flex;
      gap:.45rem;
      justify-self: center;
    }
    .ctrl-btn{
      width: 2rem;
      height: 2rem;
      border-radius: 0.6rem !important;
      font-size: 1rem;
      border: 1px solid var(--accent) !important;
      background: rgba(255,255,255,.7) !important;
      color: var(--black) !important;
      font-weight: 900;
      display: grid;
      place-items: center;
      box-shadow: 0 .55rem 1.1rem rgba(8,35,68,.10);
    }
    @media (min-width: 576px){ .ctrl-btn{ width: 2.2rem; height: 2.2rem; border-radius: .65rem !important; } }
    @media (min-width: 768px){ .ctrl-btn{ width: 2.35rem; height: 2.35rem; border-radius: .75rem !important; } }
    .ctrl-btn:active{ transform: translateY(1px); }

    .bar-wrap{
      width: 100%;
      min-width: 0;
      display: grid;
      grid-template-columns: 1fr;
      align-items: center;
      gap: 0.5rem;
    }
    @media (min-width: 400px){ .bar-wrap{ grid-template-columns: 1fr 5rem; gap: 0.75rem; } }
    @media (min-width: 576px){ .bar-wrap{ grid-template-columns: 1fr 6rem; gap: 1rem; } }
    @media (min-width: 768px){ .bar-wrap{ grid-template-columns: 1fr 6.8rem; gap: 1.1rem; } }
    .progress-shell{
      position: relative;
      height: 1.4rem;
      border-radius: 999px;
      background: rgba(0,0,0,.08);
      overflow:hidden;
      border: 1px solid rgba(255,255,255,.55);
      box-shadow: inset 0 .2rem .6rem rgba(10,42,58,.08);
      width: 100%;
    }
    @media (min-width: 576px){ .progress-shell{ height: 1.55rem; } }
    @media (min-width: 768px){ .progress-shell{ height: 1.7rem; } }
    .progress-fill{
      position: absolute;
      inset: 0;
      width: 0%;
      border-radius: 999px;
      transition: width 700ms cubic-bezier(.2,.9,.2,1), filter 350ms ease;
      filter: saturate(1.05);
    }
    .progress-label{
      position: absolute;
      inset: 0;
      display: grid;
      place-items: center;
      font-weight: 900;
      color: rgba(255,255,255,.92);
      text-shadow: 0 .1rem .4rem rgba(0,0,0,.18);
      font-size: 0.8rem;
      letter-spacing: .02em;
      line-height: 1;
    }
    @media (min-width: 576px){ .progress-label{ font-size: .88rem; } }
    @media (min-width: 768px){ .progress-label{ font-size: .95rem; } }

    /* Progress: Red low → Yellow/Orange medium → Light green close → Super green at 100% */
    .fill-low{ background: linear-gradient(90deg, #ff6b6b, #ff4d4d); }
    .fill-mid{ background: linear-gradient(90deg, #ff9a6a, #ff7033); }
    .fill-near{ background: linear-gradient(90deg, #ffc94d, #ffb300); }
    .fill-super{
      background: linear-gradient(90deg, #32e293, #15d177);
      box-shadow: 0 0 0.9rem rgba(18,200,116,.22);
    }
    .fill-zero{ background: linear-gradient(90deg, rgba(0,0,0,.12), rgba(0,0,0,.08)); }

    .target{
      text-align: right;
      width: auto;
    }
    .target .label{ font-size: 0.7rem; color: var(--textGrey); font-weight: 800; margin-bottom: .08rem; }
    .target .val{ font-size: 0.95rem; font-weight: 900; color: var(--black); }
    @media (min-width: 576px){ .target .label{ font-size: .75rem; } .target .val{ font-size: 1rem; } }
    @media (min-width: 768px){ .target .label{ font-size: .78rem; } .target .val{ font-size: 1.05rem; } }

    .footer{
      margin-top: 1rem;
      text-align: center;
      color: var(--textGrey);
      font-weight: 800;
      font-size: 0.75rem;
      padding: 0 0.25rem;
    }
    @media (min-width: 576px){ .footer{ font-size: .8rem; margin-top: 1.1rem; } }
    @media (min-width: 768px){ .footer{ font-size: .85rem; margin-top: 1.15rem; } }
    .footer .ok{
      display:inline-flex;
      align-items:center;
      gap:.4rem;
    }
    .footer .ok::before{
      content:"";
      width:.45rem; height:.45rem;
      border-radius:999px;
      background:#22c55e;
      box-shadow: 0 0 0 .18rem rgba(34,197,94,.16);
      display:inline-block;
    }

    /* Management panel */
    .manage-head{
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 0.5rem;
      padding: 0.6rem 0.75rem;
      border-radius: 1rem;
      cursor: pointer;
      user-select: none;
    }
    @media (min-width: 576px){ .manage-head{ padding: .75rem .9rem; gap: .7rem; } }
    @media (min-width: 768px){ .manage-head{ padding: .85rem 1rem; gap: .9rem; border-radius: 1.15rem; } }
    .manage-title{
      display:flex;
      align-items:center;
      gap:.6rem;
      font-weight: 900;
      color: var(--black);
    }
    .manage-title i{ color: var(--accent); }
    .small-muted{ color: var(--textGrey); font-weight: 700; font-size: .85rem; }

    .manage-actions{
      display:flex;
      gap:.5rem;
      flex-wrap: wrap;
      justify-content:flex-end;
    }
    .manage-body{
      border-radius: 1rem;
      padding: 0.65rem 0.75rem 0.9rem;
      margin-top: 0.4rem;
    }
    @media (min-width: 576px){ .manage-body{ padding: .8rem .9rem 1rem; margin-top: .5rem; } }
    @media (min-width: 768px){ .manage-body{ border-radius: 1.15rem; padding: .9rem 1rem 1.1rem; margin-top: .55rem; } }

    .mini-row{
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 0.5rem;
      padding: 0.5rem 0.5rem;
      border-bottom: 1px solid rgba(181,227,255,.35);
    }
    @media (min-width: 576px){ .mini-row{ gap: .65rem; padding: .6rem .65rem; } }
    @media (min-width: 768px){ .mini-row{ gap: .8rem; padding: .65rem; } }
    .mini-row:last-child{ border-bottom: 0; }
    .mini-left{
      display:flex;
      align-items:center;
      gap: .65rem;
      min-width: 0;
    }
    .mini-logo{
      width: 2.3rem;
      height: 2.3rem;
      border-radius: .9rem;
      overflow:hidden;
      border: 1px solid rgba(181,227,255,.75);
      background: rgba(255,255,255,.65);
      flex: 0 0 auto;
    }
    .mini-logo img{ width:100%; height:100%; object-fit: cover; display:block; }
    .mini-name{
      font-weight: 900;
      color: var(--black);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      max-width: 100%;
      font-size: 0.85rem;
    }
    @media (min-width: 576px){ .mini-name{ font-size: 0.9rem; max-width: 20rem; } }
    @media (min-width: 768px){ .mini-name{ font-size: 1rem; max-width: 28rem; } }
    .mini-sub{
      font-size: 0.72rem;
      color: var(--textGrey);
      font-weight: 800;
    }
    @media (min-width: 576px){ .mini-sub{ font-size: .75rem; } }
    @media (min-width: 768px){ .mini-sub{ font-size: .8rem; } }
    .mini-icons{
      display:flex;
      gap:.55rem;
      flex: 0 0 auto;
    }
    .icon-btn{
      width: 2.1rem;
      height: 2.1rem;
      border-radius: .7rem;
      border: 1px solid var(--accent);
      background: rgba(255,255,255,.62);
      display: grid;
      place-items: center;
      color: var(--black);
      box-shadow: 0 .55rem 1.1rem rgba(8,35,68,.08);
      cursor:pointer;
      font-weight: 900;
    }

    /* Celebration overlay */
    #celebrateOverlay{
      position: fixed;
      inset: 0;
      z-index: 9999;
      display:none;
      pointer-events:none;
    }
    #celebrateOverlay .veil{
      position:absolute;
      inset:0;
      background: radial-gradient(900px 500px at 50% 35%, rgba(255,255,255,.35), rgba(255,255,255,0) 70%),
                  rgba(0,0,0,.25);
      backdrop-filter: blur(2px);
      -webkit-backdrop-filter: blur(2px);
    }
    #celebrateCanvas{
      position:absolute;
      inset:0;
      width:100%;
      height:100%;
    }
    #celebrateOverlay .msg{
      position: absolute;
      inset: 0;
      display: grid;
      place-items: center;
      font-weight: 900;
      font-size: 1.5rem;
      color: rgba(255,255,255,.95);
      text-shadow: 0 .3rem 1rem rgba(0,0,0,.35);
      letter-spacing: .02em;
      padding: 1rem;
    }
    @media (min-width: 576px){ #celebrateOverlay .msg{ font-size: 1.75rem; } }
    @media (min-width: 768px){ #celebrateOverlay .msg{ font-size: 2.1rem; } }

    /* Responsive modals */
    .modal-dialog{ max-width: calc(100vw - 2rem); margin: 0.5rem auto; }
    @media (min-width: 576px){ .modal-dialog{ margin: 1.75rem auto; } }

    .btn, button{ touch-action: manipulation; }

    #addAdminModal .modal-dialog{
      max-width: 600px;
    }
    .max-w-600{
      max-width: 600px;
    }