/* =========================================================
   VerbaNote Soft Green UI Theme
   Reusable page theme for dashboards, devices, sessions,
   library pages, setup pages, cards, lists and panels.
   ========================================================= */

/* =========================
   Theme Tokens
   ========================= */

:root{
  --app-bg:#f6f6f4;
  --sheet:#ffffff;

  --card:#e7f3e3;
  --card-2:#dff1da;
  --card-3:#edf7ea;

  --text:#171717;
  --muted:#5f6b63;
  --muted2:#768277;

  --green:#2f7d32;
  --green-strong:#1f6b25;
  --danger:#c94040;
  --warning:#7a5500;

  --line:rgba(31,64,35,.10);
  --line-soft:rgba(31,64,35,.07);

  --shadow-soft:0 14px 34px rgba(23,23,23,.08);
  --shadow-light:0 8px 22px rgba(23,23,23,.04);

  --focus:0 0 0 4px rgba(47,125,50,.18);
}

/* =========================
   Page Base
   ========================= */

body{
  background:var(--app-bg);
  color:var(--text);
}

.orb{
  display:none;
}

.dashboard,
.main,
.content{
  background:var(--app-bg);
}

.dashboard{
  position:relative;
  min-height:100vh;
}

/* =========================
   Topbar / Header
   ========================= */

.topbar{
  background:var(--app-bg);
  border-bottom:1px solid var(--line-soft);
}

.page-heading{
  min-width:0;
}

.page-heading h1{
  margin:0;
  font-size:30px;
  font-weight:900;
  line-height:1.05;
  letter-spacing:-.05em;
  color:var(--text);
}

.page-heading p{
  margin:8px 0 0;
  color:var(--muted);
  font-size:13px;
  line-height:1.5;
}

/* =========================
   Buttons
   ========================= */

.sidebar-toggle,
.icon-btn{
  width:44px;
  height:44px;
  border-radius:16px;
  border:1px solid var(--line);
  background:var(--card-3);
  color:var(--text);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  transition:.16s ease;
  position:relative;
  box-shadow:0 8px 20px rgba(23,23,23,.04);
}

.sidebar-toggle:hover,
.icon-btn:hover{
  background:var(--card-2);
  border-color:rgba(47,125,50,.22);
}

.icon-btn.hidden{
  display:none!important;
}

.icon-btn.pulse::after{
  content:"";
  position:absolute;
  inset:-4px;
  border-radius:20px;
  border:1px solid rgba(47,125,50,.35);
  opacity:0;
  animation:pulseRing 1.8s ease-out infinite;
}

.new-session-btn,
.primary-btn,
.start-btn{
  min-height:44px;
  padding:0 18px;
  border-radius:18px;
  border:1px solid rgba(47,125,50,.14);
  background:var(--green);
  color:#fff;
  font-family:inherit;
  font-size:13px;
  font-weight:900;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  cursor:pointer;
  text-decoration:none;
  transition:.15s ease;
  box-shadow:0 12px 24px rgba(47,125,50,.16);
}

.new-session-btn:hover,
.primary-btn:hover,
.start-btn:hover{
  filter:brightness(1.05);
}

.mini-btn,
.secondary-btn,
.session-btn{
  min-height:36px;
  padding:0 13px;
  border-radius:14px;
  border:1px solid var(--line);
  background:#fff;
  color:var(--text);
  font-family:inherit;
  font-size:12px;
  font-weight:900;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  text-decoration:none;
  transition:.15s ease;
}

.mini-btn:hover,
.secondary-btn:hover,
.session-btn:hover{
  background:var(--card-3);
}

.mini-btn.active,
.secondary-btn.active{
  background:var(--card-2);
  border-color:rgba(47,125,50,.18);
  color:var(--green);
}

.mini-btn:disabled,
.secondary-btn:disabled{
  opacity:.55;
  cursor:not-allowed;
}

.start-btn.warn{
  border-color:rgba(179,128,0,.20);
  background:#fff6d9;
  color:var(--warning);
  box-shadow:none;
}

.icon-btn:focus,
.sidebar-toggle:focus,
.new-session-btn:focus,
.primary-btn:focus,
.secondary-btn:focus,
.mini-btn:focus,
.start-btn:focus,
.session-btn:focus,
.session-banner-btn:focus{
  outline:none;
  box-shadow:var(--focus);
}

/* =========================
   Search
   ========================= */

.hero-row{
  display:grid;
  grid-template-columns:1fr;
  gap:18px;
  margin-bottom:22px;
}

.search-row{
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
}

.search-wrap{
  flex:1 1 280px;
  min-height:48px;
  display:flex;
  align-items:center;
  gap:10px;
  padding:0 16px;
  border-radius:18px;
  background:#fff;
  border:1px solid var(--line);
  box-shadow:var(--shadow-light);
  color:var(--muted);
}

.search-wrap input{
  width:100%;
  background:transparent;
  border:none;
  outline:none;
  color:var(--text);
  font:inherit;
  font-size:14px;
  font-weight:600;
}

.search-wrap input::placeholder{
  color:rgba(95,107,99,.68);
}

/* =========================
   Stats
   ========================= */

.stats-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:14px;
}

.stat-card{
  border-radius:22px;
  padding:20px;
  background:var(--card-2);
  border:1px solid rgba(47,125,50,.08);
  box-shadow:var(--shadow-soft);
  min-width:0;
}

.stat-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:14px;
}

.stat-label{
  font-size:13px;
  color:var(--green);
  font-weight:700;
}

.stat-icon{
  width:32px;
  height:32px;
  border-radius:999px;
  display:grid;
  place-items:center;
  background:rgba(47,125,50,.10);
  border:1px solid rgba(47,125,50,.10);
  color:var(--green);
  font-size:13px;
  flex-shrink:0;
}

.stat-value{
  font-size:34px;
  font-weight:900;
  line-height:1;
  letter-spacing:-.05em;
  color:#06290b;
}

/* =========================
   Sections
   ========================= */

.section{
  margin-top:26px;
}

.section-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:14px;
  margin-bottom:14px;
}

.section-title{
  font-size:22px;
  font-weight:900;
  letter-spacing:-.04em;
  color:var(--text);
}

.section-sub{
  margin-top:5px;
  font-size:13px;
  color:var(--muted);
}

/* =========================
   Generic Panels / Cards
   ========================= */

.panel-card,
.session-card{
  border-radius:26px;
  background:#fff;
  border:1px solid var(--line);
  box-shadow:var(--shadow-soft);
  overflow:hidden;
  min-width:0;
}

.panel-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:20px 20px 15px;
  border-bottom:1px solid var(--line-soft);
  background:#fff;
}

.panel-title{
  font-size:16px;
  font-weight:900;
  letter-spacing:-.03em;
  color:var(--text);
}

.panel-link{
  display:inline-flex;
  align-items:center;
  gap:6px;
  color:var(--muted);
  text-decoration:none;
  font-size:12px;
  font-weight:800;
}

.panel-link:hover{
  color:var(--green);
}

/* =========================
   Empty States
   ========================= */

.empty{
  padding:30px 20px;
  text-align:center;
  border-radius:24px;
  border:1px dashed rgba(47,125,50,.20);
  background:var(--card-3);
  color:var(--muted);
  font-size:13px;
  line-height:1.6;
}

.empty strong{
  display:block;
  color:var(--text);
  font-size:16px;
  margin-bottom:6px;
  font-weight:900;
}

/* =========================
   Session Cards
   ========================= */

.live-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:16px;
}

.session-card{
  padding:18px;
  background:var(--card-3);
}

.session-card-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:14px;
}

.session-live-badge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 13px;
  border-radius:999px;
  background:rgba(201,64,64,.10);
  border:1px solid rgba(201,64,64,.12);
  color:#8c2222;
  font-size:11px;
  font-weight:900;
}

.session-live-dot{
  width:8px;
  height:8px;
  border-radius:999px;
  background:var(--danger);
  box-shadow:0 0 0 5px rgba(201,64,64,.12);
  flex:0 0 8px;
}

.session-state-pill{
  min-height:30px;
  padding:0 13px;
  border-radius:999px;
  border:1px solid rgba(47,125,50,.14);
  background:rgba(47,125,50,.08);
  color:var(--green);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:11px;
  font-weight:900;
  white-space:nowrap;
}

.session-title-text{
  margin:0 0 7px;
  font-size:19px;
  font-weight:900;
  line-height:1.2;
  letter-spacing:-.035em;
  color:var(--text);
}

.session-subtitle{
  font-size:13px;
  color:var(--muted);
  line-height:1.5;
  margin-bottom:14px;
}

.session-metrics{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
  margin-bottom:14px;
}

.session-metric{
  border-radius:18px;
  padding:13px;
  background:#fff;
  border:1px solid var(--line-soft);
  min-width:0;
}

.session-metric-label{
  font-size:10px;
  font-weight:900;
  color:var(--muted2);
  text-transform:uppercase;
  letter-spacing:.85px;
  margin-bottom:5px;
}

.session-metric-value{
  font-size:13px;
  font-weight:800;
  line-height:1.35;
  word-break:break-word;
  color:var(--text);
}

.session-actions{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.session-btn{
  min-height:40px;
  padding:0 15px;
  border-radius:15px;
}

.session-btn.primary{
  border-color:rgba(47,125,50,.14);
  background:var(--green);
  color:#fff;
}

/* =========================
   Session Banner
   ========================= */

.session-banner{
  display:none;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:18px;
  border-radius:24px;
  border:1px solid rgba(47,125,50,.10);
  background:var(--card);
  box-shadow:var(--shadow-soft);
}

.session-banner.show{
  display:flex;
}

.session-banner-title{
  font-size:15px;
  font-weight:900;
  margin-bottom:5px;
  color:var(--text);
}

.session-banner-sub{
  font-size:13px;
  color:var(--muted);
  line-height:1.45;
}

.session-banner-btn{
  min-height:40px;
  padding:0 16px;
  border-radius:15px;
  border:1px solid rgba(47,125,50,.12);
  background:#fff;
  color:var(--green);
  font-family:inherit;
  font-size:12px;
  font-weight:900;
  cursor:pointer;
  flex-shrink:0;
}

/* =========================
   Device / List Layout
   ========================= */

.devices-grid{
  display:grid;
  grid-template-columns:2fr 1.15fr;
  gap:16px;
}

.device-list{
  display:flex;
  flex-direction:column;
  background:#fff;
}

.device-row{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  padding:18px 20px;
  border-bottom:1px solid var(--line-soft);
}

.device-row:last-child{
  border-bottom:0;
}

.device-main{
  min-width:0;
  flex:1;
}

.device-row-title{
  margin:0 0 6px;
  font-size:15px;
  font-weight:900;
  line-height:1.25;
  letter-spacing:-.02em;
  color:var(--text);
}

.device-row-id{
  font-size:12px;
  color:var(--muted);
  margin-bottom:7px;
  font-weight:600;
}

.device-row-meta{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  font-size:12px;
  color:var(--muted2);
  line-height:1.4;
}

.device-row-meta span{
  white-space:nowrap;
}

.device-actions{
  margin-top:13px;
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.device-live-box{
  margin-top:12px;
  padding:14px;
  border-radius:20px;
  background:var(--card);
  border:1px solid rgba(47,125,50,.10);
}

.device-live-label{
  font-size:11px;
  font-weight:900;
  color:var(--green);
  margin-bottom:5px;
  letter-spacing:.4px;
}

.device-live-title{
  font-size:14px;
  font-weight:900;
  line-height:1.35;
  color:var(--text);
}

.device-live-sub{
  font-size:12px;
  color:var(--muted);
  margin-top:4px;
  line-height:1.4;
}

/* =========================
   Status Pills
   ========================= */

.status-pill{
  flex-shrink:0;
  min-width:96px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:9px 14px;
  border-radius:999px;
  border:1px solid var(--line);
  background:var(--card-3);
  font-size:12px;
  font-weight:900;
  color:var(--text);
  margin-top:2px;
}

.status-dot{
  width:9px;
  height:9px;
  border-radius:999px;
  flex:0 0 9px;
}

.status-online{
  background:var(--card-2);
  border-color:rgba(47,125,50,.16);
  color:var(--green);
}

.status-online .status-dot{
  background:var(--green);
}

.status-recording{
  background:rgba(201,64,64,.10);
  border-color:rgba(201,64,64,.16);
  color:#8c2222;
}

.status-recording .status-dot{
  background:var(--danger);
}

.status-offline{
  background:#f2f2ef;
  border-color:rgba(23,23,23,.07);
  color:#777;
}

.status-offline .status-dot{
  background:#999;
}

/* =========================
   Toast
   ========================= */

.toast{
  position:fixed;
  left:50%;
  bottom:18px;
  transform:translateX(-50%);
  z-index:10000;
  display:none;
  align-items:center;
  gap:10px;
  max-width:calc(100% - 24px);
  padding:11px 16px;
  border-radius:999px;
  background:#172118;
  border:1px solid rgba(255,255,255,.12);
  box-shadow:0 12px 35px rgba(0,0,0,.18);
  color:#fff;
  font-size:12.5px;
}

/* =========================
   Animations
   ========================= */

@keyframes pulseRing{
  0%{
    transform:scale(.92);
    opacity:0;
  }

  25%{
    opacity:.65;
  }

  100%{
    transform:scale(1.18);
    opacity:0;
  }
}

@keyframes livePulse{
  0%{
    transform:scale(.8);
    opacity:.7;
  }

  100%{
    transform:scale(1.45);
    opacity:0;
  }
}

/* =========================
   Responsive
   ========================= */

@media (max-width:1180px){
  .live-grid,
  .devices-grid{
    grid-template-columns:1fr;
  }
}

@media (max-width:760px){
  .content{
    padding-top:14px;
  }

  .topbar{
    flex-direction:row;
    align-items:flex-start;
    justify-content:space-between;
    padding:16px 16px 18px;
  }

  .topbar-left{
    display:flex;
    align-items:flex-start;
    gap:10px;
    flex:1;
    min-width:0;
  }

  .topbar-right{
    width:auto;
    padding-left:0;
    flex-shrink:0;
  }

  #installBtn{
    margin-top:0;
  }

  .page-heading h1{
    font-size:22px;
  }

  .page-heading p{
    max-width:245px;
    font-size:12px;
    line-height:1.45;
  }

  .search-wrap{
    min-height:44px;
    border-radius:16px;
  }

  .stats-grid{
    display:flex;
    gap:10px;
    overflow-x:auto;
    padding:0 2px 4px;
    scroll-snap-type:x mandatory;
    -webkit-overflow-scrolling:touch;
  }

  .stats-grid::-webkit-scrollbar{
    display:none;
  }

  .stat-card{
    flex:1 1 0;
    min-width:0;
    padding:14px 12px;
    border-radius:20px;
  }

  .stat-top{
    margin-bottom:10px;
  }

  .stat-label{
    font-size:10.5px;
    line-height:1.2;
  }

  .stat-icon{
    width:24px;
    height:24px;
    font-size:10px;
    position:relative;
  }

  .stat-icon::after{
    content:"";
    position:absolute;
    inset:-5px;
    border-radius:999px;
    border:1px solid rgba(47,125,50,.30);
    animation:livePulse 1.8s ease-out infinite;
  }

  .stat-value{
    font-size:25px;
  }

  .section{
    margin-top:32px;
  }

  .section-title{
    font-size:21px;
  }

  .session-banner{
    flex-direction:column;
    align-items:stretch;
  }

  .empty{
    padding:28px 22px;
  }

  .device-row{
    padding:18px 16px;
  }

  .panel-card{
    border-radius:24px;
  }
}

@media (max-width:560px){
  .search-row{
    flex-direction:column;
    align-items:stretch;
  }

  .search-wrap{
    flex-basis:auto;
    width:100%;
  }

  .session-metrics{
    grid-template-columns:1fr;
  }

  .device-row{
    flex-direction:column;
    align-items:stretch;
  }

  .status-pill{
    align-self:flex-start;
    min-width:unset;
  }

  .new-session-btn,
  .primary-btn{
    width:100%;
  }
}

.section[hidden],
#liveSection[hidden]{
  display:none !important;
  margin:0 !important;
  padding:0 !important;
}

#liveSection[hidden]{
  display:none !important;
  margin:0 !important;
  padding:0 !important;
}

#liveSection[hidden] + #devicesSection{
  margin-top:14px !important;
}

@media (max-width:760px){
  #liveSection[hidden] + #devicesSection{
    margin-top:12px !important;
  }
}

.swal2-popup.verbanote-alert{
  border-radius:28px !important;
  background:#f6f6f4 !important;
  color:#171717 !important;
  padding:24px !important;
  box-shadow:0 18px 50px rgba(23,23,23,.16) !important;
}

.swal2-title{
  font-size:22px !important;
  font-weight:900 !important;
  letter-spacing:-.04em !important;
}

.swal2-html-container{
  color:#5f6b63 !important;
  font-size:14px !important;
  line-height:1.55 !important;
}

.swal2-confirm{
  border-radius:16px !important;
  background:#2f7d32 !important;
  font-weight:900 !important;
  padding:12px 18px !important;
}

.swal2-cancel{
  border-radius:16px !important;
  background:#fff !important;
  color:#171717 !important;
  border:1px solid rgba(31,64,35,.10) !important;
  font-weight:900 !important;
  padding:12px 18px !important;
}

@media (max-width:380px){
  .session-title-text{
    font-size:17px;
  }

  .device-row-title{
    font-size:14px;
  }

  .device-row-meta{
    gap:8px;
    font-size:11.5px;
  }

  .mini-btn,
  .start-btn,
  .session-btn{
    font-size:11.5px;
    padding:0 10px;
  }
}