﻿
    :root {
      --primary: #0d9488;
      --primary-dark: #0f766e;
      --primary-light: #14b8a6;
      --primary-glow: rgba(13, 148, 136, 0.06);
      --primary-soft: #e6f4f2;
      --sidebar-bg: #0f172a;
      --sidebar-hover: #1e293b;
      --sidebar-border: rgba(255, 255, 255, 0.06);
      --surface: #ffffff;
      --surface-2: #f8fafc;
      --bg: #f1f5f9;
      --text: #0f172a;
      --muted: #64748b;
      --border: #e2e8f0;
      --danger: #e11d48;
      --danger-light: #fff1f2;
      --warning: #f59e0b;
      --info: #3b82f6;
      --success: #10b981;
      --sidebar-w: 280px;
      --radius: 16px;
      --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.04);
      --shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
      --shadow-lg: 0 12px 30px rgba(15, 23, 42, 0.08);
    }

    * { box-sizing: border-box; margin: 0; padding: 0; }

    body.dashboard-body {
      font-family: "Cairo", "Segoe UI", Tahoma, sans-serif;
      background: var(--bg);
      color: var(--text);
      min-height: 100vh;
      line-height: 1.5;
      direction: rtl;
      position: relative;
      overflow-x: hidden;
    }

    /* Elegant, GPU-accelerated background shifting blobs */
    body.dashboard-body::before {
      content: "";
      position: fixed;
      top: -15%;
      left: -10%;
      width: 45vw;
      height: 45vw;
      background: radial-gradient(circle, rgba(13, 148, 136, 0.04) 0%, transparent 70%);
      z-index: -1;
      pointer-events: none;
      filter: blur(60px);
      animation: bg-float-one 35s infinite alternate ease-in-out;
      will-change: transform;
    }

    body.dashboard-body::after {
      content: "";
      position: fixed;
      bottom: -15%;
      right: -10%;
      width: 50vw;
      height: 50vw;
      background: radial-gradient(circle, rgba(59, 130, 246, 0.045) 0%, transparent 70%);
      z-index: -1;
      pointer-events: none;
      filter: blur(70px);
      animation: bg-float-two 40s infinite alternate ease-in-out;
      will-change: transform;
    }

    @keyframes bg-float-one {
      0% { transform: translate3d(0, 0, 0) scale(1); }
      50% { transform: translate3d(5vw, 5vh, 0) scale(1.08); }
      100% { transform: translate3d(-3vw, 10vh, 0) scale(0.95); }
    }

    @keyframes bg-float-two {
      0% { transform: translate3d(0, 0, 0) scale(1); }
      50% { transform: translate3d(-5vw, -8vh, 0) scale(0.92); }
      100% { transform: translate3d(3vw, 3vh, 0) scale(1.05); }
    }

    .glw-dashboard-wrap {
      display: flex;
      min-height: 100vh;
      width: 100%;
    }

    /* Sidebar - Vertical on Right */
    #sidebar.modern-sidebar {
      width: var(--sidebar-w);
      background: var(--sidebar-bg);
      background-image: 
        radial-gradient(circle at 100% 0%, rgba(13, 148, 136, 0.15), transparent 60%),
        radial-gradient(circle at 0% 100%, rgba(59, 130, 246, 0.08), transparent 60%);
      color: #94a3b8;
      display: flex;
      flex-direction: column;
      position: fixed;
      top: 0; right: 0; bottom: 0;
      z-index: 1040;
      border-left: 1px solid var(--sidebar-border);
      transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .sidebar-brand {
      padding: 1.5rem 1.25rem;
      display: flex;
      align-items: center;
      gap: 0.75rem;
      border-bottom: 1px solid var(--sidebar-border);
    }

    .brand-logo {
      width: 42px; height: 42px;
      border-radius: 12px;
      background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
      display: grid; place-items: center;
      box-shadow: 0 8px 16px rgba(13, 148, 136, 0.25);
      flex-shrink: 0;
      color: #fff;
      font-size: 1.2rem;
      overflow: hidden;
    }

    .brand-logo img {
      width: 30px;
      height: 30px;
      object-fit: contain;
    }

    .brand-info {
      display: flex;
      flex-direction: column;
      line-height: 1.2;
    }

    .brand-title {
      font-size: 1rem;
      font-weight: 800;
      color: #f1f5f9;
    }

    .brand-sub {
      font-size: 0.7rem;
      color: #64748b;
      font-weight: 500;
      margin-top: 2px;
      display: flex;
      align-items: center;
      gap: 4px;
    }

    .sidebar-nav {
      flex: 1;
      overflow-y: auto;
      padding: 1rem 0.75rem;
      scrollbar-width: thin;
      scrollbar-color: #334155 transparent;
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

    .sidebar-nav::-webkit-scrollbar {
      width: 4px;
    }
    .sidebar-nav::-webkit-scrollbar-thumb {
      background: #334155;
      border-radius: 4px;
    }

    /* Accordion Menu Group */
    .menu-group {
      display: flex;
      flex-direction: column;
    }

    .menu-group-header {
      display: flex;
      align-items: center;
      gap: 0.75rem;
      padding: 0.75rem 0.85rem;
      border-radius: 12px;
      cursor: pointer;
      transition: all 0.2s;
    }

    .menu-group-header:hover {
      background: rgba(255, 255, 255, 0.04);
      color: #f1f5f9;
    }

    .group-icon {
      width: 36px; height: 36px;
      border-radius: 10px;
      display: grid; place-items: center;
      font-size: 1rem;
      color: #fff;
      flex-shrink: 0;
    }

    .gradient-purple { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
    .gradient-blue { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
    .gradient-green { background: linear-gradient(135deg, #10b981, #047857); }
    .gradient-pink { background: linear-gradient(135deg, #ec4899, #be185d); }

    .group-title {
      font-size: 0.88rem;
      font-weight: 700;
      color: #cbd5e1;
      flex: 1;
    }

    .toggle-icon {
      font-size: 0.7rem;
      color: #64748b;
      transition: transform 0.25s;
    }

    /* Accordion Open States */
    .menu-items {
      max-height: 0;
      overflow: hidden;
      transition: max-height 0.35s ease;
      display: flex;
      flex-direction: column;
      gap: 2px;
      margin-right: 1.1rem;
      border-right: 1px solid rgba(255, 255, 255, 0.05);
      padding-right: 0.75rem;
    }

    .menu-items.active,
    .menu-group.dropdown-open .menu-items {
      max-height: 1000px;
      margin-top: 4px;
      margin-bottom: 8px;
    }

    .menu-group-header.active .toggle-icon,
    .menu-group.dropdown-open .menu-group-header .toggle-icon {
      transform: rotate(180deg);
    }

    .menu-item {
      display: flex;
      align-items: center;
      gap: 0.65rem;
      padding: 0.55rem 0.75rem;
      border-radius: 8px;
      color: #94a3b8;
      text-decoration: none;
      font-size: 0.82rem;
      font-weight: 600;
      transition: all 0.2s;
    }

    .menu-item i {
      width: 16px;
      text-align: center;
      font-size: 0.9rem;
      color: #64748b;
      transition: color 0.2s;
    }

    .menu-item:hover {
      background: rgba(255, 255, 255, 0.03);
      color: #f1f5f9;
      padding-right: 1rem;
    }

    .menu-item:hover i {
      color: var(--primary-light);
    }

    .menu-item.active {
      background: linear-gradient(90deg, rgba(13, 148, 136, 0.15) 0%, transparent 100%);
      color: #5eead4;
      font-weight: 700;
      border-right: 3px solid var(--primary-light);
    }

    .menu-item.active i {
      color: #5eead4;
    }

    .sidebar-footer {
      padding: 1.25rem;
      border-top: 1px solid var(--sidebar-border);
      font-size: 0.75rem;
      color: #475569;
      display: flex;
      align-items: center;
      gap: 0.5rem;
    }

    .sidebar-footer .dot {
      width: 8px; height: 8px;
      background: var(--success);
      border-radius: 50%;
      box-shadow: 0 0 8px var(--success);
    }

    /* Main Shell Layout */
    .main-shell {
      flex: 1;
      margin-right: var(--sidebar-w);
      min-width: 0;
      display: flex;
      flex-direction: column;
      transition: margin-right 0.3s ease;
    }

    /* Premium Sticky Header */
    .main-header {
      height: 80px;
      background: var(--surface);
      border-bottom: 1px solid var(--border);
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0 2rem;
      position: sticky;
      top: 0;
      z-index: 900;
      box-shadow: 0 1px 3px rgba(15, 23, 42, 0.02);
    }

    .header-right {
      display: flex;
      align-items: center;
      gap: 1rem;
    }

    .header-title-block {
      display: flex;
      flex-direction: column;
    }

    .main-header .page-title {
      font-size: 1.35rem;
      font-weight: 800;
      color: var(--text);
    }

    .main-header .page-sub {
      font-size: 0.8rem;
      color: var(--muted);
      font-weight: 600;
      margin-top: 2px;
    }

    .mobile-burger-btn {
      display: none;
      width: 44px; height: 44px;
      border: 1px solid var(--border);
      border-radius: 12px;
      background: var(--surface-2);
      cursor: pointer;
      color: var(--text);
      font-size: 1.1rem;
      place-items: center;
    }

    .header-left {
      display: flex;
      align-items: center;
      gap: 1.25rem;
    }

    .user-profile {
      display: flex;
      align-items: center;
      gap: 0.75rem;
      padding-left: 1.25rem;
      border-left: 1px solid var(--border);
    }

    .user-avatar {
      width: 44px; height: 44px;
      border-radius: 12px;
      background: linear-gradient(135deg, var(--primary), var(--primary-dark));
      color: #fff;
      display: grid; place-items: center;
      font-weight: 800;
      font-size: 1.1rem;
      box-shadow: 0 4px 10px rgba(13, 148, 136, 0.15);
    }

    .user-details {
      display: flex;
      flex-direction: column;
      line-height: 1.2;
    }

    .user-details .user-name {
      font-weight: 700;
      font-size: 0.9rem;
      color: var(--text);
    }

    .user-details .user-role {
      font-size: 0.75rem;
      color: var(--muted);
      font-weight: 600;
      margin-top: 2px;
    }

    /* Buttons */
    .btn {
      font-family: inherit;
      font-size: 0.85rem;
      font-weight: 700;
      padding: 0.6rem 1.2rem;
      border-radius: 10px;
      border: none;
      cursor: pointer;
      transition: all 0.2s;
      display: inline-flex;
      align-items: center;
      gap: 0.5rem;
    }

    .btn-logout {
      background: var(--danger-light);
      color: var(--danger);
      border: 1px solid rgba(225, 29, 72, 0.15);
    }

    .btn-logout:hover {
      background: var(--danger);
      color: #fff;
      border-color: var(--danger);
      transform: translateY(-1px);
      box-shadow: 0 4px 12px rgba(225, 29, 72, 0.15);
    }

    /* Content Area */
    .glw-main-content {
      padding: 2rem;
      max-width: 1500px;
      width: 100%;
      margin: 0 auto;
      box-sizing: border-box;
      flex: 1;
    }

    .content-container {
      display: flex;
      flex-direction: column;
    }

    .hero {
      background: linear-gradient(135deg, #0d9488 0%, #0f766e 45%, #111827 100%);
      border-radius: 20px;
      padding: 2.5rem 3rem;
      margin-bottom: 2rem;
      color: #fff;
      display: grid;
      grid-template-columns: 1fr auto;
      gap: 2rem;
      align-items: center;
      box-shadow: 0 20px 40px rgba(15, 23, 42, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.1);
      position: relative;
      overflow: hidden;
      border: 1px solid rgba(255, 255, 255, 0.08);
      transition: transform 0.3s ease, box-shadow 0.3s ease;
    }

    .hero:hover {
      transform: translateY(-2px);
      box-shadow: 0 25px 50px rgba(15, 23, 42, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    }

    /* Floating mesh gradient background blobs */
    .hero::before {
      content: "";
      position: absolute;
      top: -30%; left: -10%;
      width: 400px; height: 400px;
      background: radial-gradient(circle, rgba(20, 184, 166, 0.35) 0%, transparent 70%);
      pointer-events: none;
      filter: blur(40px);
      animation: float-blob-hero 8s infinite alternate ease-in-out;
    }

    .hero::after {
      content: "";
      position: absolute;
      bottom: -20%; right: 10%;
      width: 300px; height: 300px;
      background: radial-gradient(circle, rgba(99, 102, 241, 0.2) 0%, transparent 70%);
      pointer-events: none;
      filter: blur(30px);
      animation: float-blob-hero-reverse 12s infinite alternate ease-in-out;
    }

    @keyframes float-blob-hero {
      0% { transform: translate(0, 0) scale(1); }
      100% { transform: translate(30px, -20px) scale(1.1); }
    }

    @keyframes float-blob-hero-reverse {
      0% { transform: translate(0, 0) scale(1); }
      100% { transform: translate(-40px, 30px) scale(1.1); }
    }

    .hero-content { position: relative; z-index: 2; }

    .hero-badge {
      display: inline-flex;
      align-items: center;
      gap: 0.5rem;
      background: rgba(255, 255, 255, 0.08);
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      padding: 0.45rem 1rem;
      border-radius: 99px;
      font-size: 0.75rem;
      font-weight: 700;
      margin-bottom: 1.25rem;
      border: 1px solid rgba(255, 255, 255, 0.12);
      color: rgba(255, 255, 255, 0.95);
    }

    .hero-badge .pulse {
      width: 8px; height: 8px;
      background: #10b981;
      border-radius: 50%;
      animation: pulse-hero 2s infinite;
      box-shadow: 0 0 10px #10b981, 0 0 20px rgba(16, 185, 129, 0.5);
    }

    @keyframes pulse-hero {
      0%, 100% { opacity: 1; transform: scale(1); }
      50% { opacity: 0.5; transform: scale(1.25); }
    }

    .hero h2 {
      font-size: 1.95rem;
      font-weight: 800;
      margin-bottom: 0.4rem;
      line-height: 1.3;
      background: linear-gradient(to left, #ffffff 60%, #cbd5e1 100%);
      -webkit-background-clip: text;
      background-clip: text;
      -webkit-text-fill-color: transparent;
      text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    }

    .hero-lab-card {
      display: flex;
      align-items: center;
      gap: 1rem;
      margin-bottom: 1.35rem;
      padding: 0.9rem 1.15rem;
      background: rgba(255, 255, 255, 0.08);
      border: 1px solid rgba(255, 255, 255, 0.14);
      border-radius: 16px;
      backdrop-filter: blur(14px);
      -webkit-backdrop-filter: blur(14px);
      max-width: 100%;
    }

    .hero-lab-logo-wrap {
      width: 76px;
      height: 76px;
      border-radius: 14px;
      background: rgba(255, 255, 255, 0.96);
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 8px;
      flex-shrink: 0;
      box-shadow: 0 10px 28px rgba(0, 0, 0, 0.14);
    }

    .hero-lab-logo {
      max-width: 100%;
      max-height: 100%;
      object-fit: contain;
      display: block;
    }

    .hero-lab-logo-fallback {
      width: 100%;
      height: 100%;
      display: grid;
      place-items: center;
      color: #0f766e;
      font-size: 1.85rem;
    }

    .hero-lab-text {
      min-width: 0;
      flex: 1;
    }

    .hero-lab-title {
      font-size: 1.28rem;
      font-weight: 800;
      color: #fff;
      margin: 0 0 0.35rem;
      line-height: 1.35;
      word-break: break-word;
    }

    .hero-lab-manager {
      font-size: 0.92rem;
      font-weight: 600;
      color: rgba(255, 255, 255, 0.9);
      margin: 0;
      display: flex;
      align-items: center;
      gap: 0.45rem;
      flex-wrap: wrap;
    }

    .hero-lab-manager i {
      color: #99f6e4;
      font-size: 0.95rem;
    }

    .hero-meta {
      display: flex;
      flex-wrap: wrap;
      gap: 0.85rem;
      font-size: 0.85rem;
      font-weight: 600;
    }

    .hero-meta span {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      background: rgba(255, 255, 255, 0.05);
      border: 1px solid rgba(255, 255, 255, 0.08);
      padding: 0.45rem 0.85rem;
      border-radius: 10px;
      transition: background 0.2s, border-color 0.2s, transform 0.2s;
    }

    .hero-meta span:hover {
      background: rgba(255, 255, 255, 0.1);
      border-color: rgba(255, 255, 255, 0.15);
      transform: translateY(-1px);
    }

    .hero-quote {
      position: relative;
      z-index: 2;
      width: 330px;
      background: rgba(255, 255, 255, 0.07);
      backdrop-filter: blur(20px);
      -webkit-backdrop-filter: blur(20px);
      border: 1px solid rgba(255, 255, 255, 0.1);
      border-radius: 16px;
      padding: 1.25rem 1.5rem;
      box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
      transition: transform 0.3s ease, border-color 0.3s ease;
      overflow: hidden;
    }

    .hero-quote:hover {
      transform: translateY(-2px);
      border-color: rgba(255, 255, 255, 0.18);
    }

    .hero-quote::before {
      content: "\f10d";
      font-family: "Font Awesome 6 Free";
      font-weight: 900;
      position: absolute;
      top: -5px;
      left: 10px;
      font-size: 3.5rem;
      color: rgba(255, 255, 255, 0.03);
      pointer-events: none;
    }

    .hero-quote label {
      font-size: 0.72rem;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      color: var(--primary-light);
      font-weight: 800;
      display: flex;
      align-items: center;
      gap: 6px;
      margin-bottom: 0.5rem;
    }

    .hero-quote p {
      font-size: 0.9rem;
      font-weight: 600;
      line-height: 1.6;
      color: rgba(255, 255, 255, 0.9);
    }

    /* Stats Grid */
    .stats-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 1.5rem;
      margin-bottom: 1.5rem;
    }

    .stat-card {
      background: var(--surface);
      border-radius: 20px;
      padding: 1.5rem 1.75rem;
      box-shadow: 0 4px 20px rgba(15, 23, 42, 0.02);
      border: 1px solid rgba(226, 232, 240, 0.8);
      display: flex;
      flex-direction: column;
      gap: 0.85rem;
      position: relative;
      overflow: hidden;
      transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .stat-card.visits {
      background: linear-gradient(180deg, var(--surface) 0%, rgba(59, 130, 246, 0.015) 100%);
    }
    .stat-card.visits:hover {
      transform: translateY(-5px);
      box-shadow: 0 15px 35px rgba(59, 130, 246, 0.1);
      border-color: rgba(59, 130, 246, 0.2);
    }

    .stat-card.revenue {
      background: linear-gradient(180deg, var(--surface) 0%, rgba(16, 185, 129, 0.015) 100%);
    }
    .stat-card.revenue:hover {
      transform: translateY(-5px);
      box-shadow: 0 15px 35px rgba(16, 185, 129, 0.1);
      border-color: rgba(16, 185, 129, 0.2);
    }

    .stat-card.pending {
      background: linear-gradient(180deg, var(--surface) 0%, rgba(245, 158, 11, 0.015) 100%);
    }
    .stat-card.pending:hover {
      transform: translateY(-5px);
      box-shadow: 0 15px 35px rgba(245, 158, 11, 0.1);
      border-color: rgba(245, 158, 11, 0.2);
    }

    .stat-card.patients {
      background: linear-gradient(180deg, var(--surface) 0%, rgba(139, 92, 246, 0.015) 100%);
    }
    .stat-card.patients:hover {
      transform: translateY(-5px);
      box-shadow: 0 15px 35px rgba(139, 92, 246, 0.1);
      border-color: rgba(139, 92, 246, 0.2);
    }

    .stat-top {
      display: flex;
      align-items: center;
      justify-content: space-between;
      position: relative;
      z-index: 2;
    }

    .stat-icon {
      width: 44px; height: 44px;
      border-radius: 12px;
      display: grid; place-items: center;
      font-size: 1.2rem;
      transition: transform 0.3s ease;
    }

    .stat-card:hover .stat-icon {
      transform: scale(1.1) rotate(3deg);
    }

    .stat-card.visits .stat-icon { background: rgba(59, 130, 246, 0.08); color: #3b82f6; }
    .stat-card.revenue .stat-icon { background: rgba(16, 185, 129, 0.08); color: #10b981; }
    .stat-card.pending .stat-icon { background: rgba(245, 158, 11, 0.08); color: #f59e0b; }
    .stat-card.patients .stat-icon { background: rgba(139, 92, 246, 0.08); color: #8b5cf6; }

    .stat-label {
      font-size: 0.85rem;
      color: var(--muted);
      font-weight: 700;
      margin-bottom: 2px;
    }

    .stat-value {
      font-size: 1.95rem;
      font-weight: 850;
      color: var(--text);
      letter-spacing: -0.02em;
      line-height: 1.1;
    }

    /* Progress bar indicators inside stats cards */
    .stat-progress-container {
      width: 100%;
      height: 4px;
      background: rgba(226, 232, 240, 0.6);
      border-radius: 10px;
      overflow: hidden;
      margin: 2px 0;
    }

    .stat-progress-bar {
      height: 100%;
      border-radius: 10px;
      transition: width 1s ease-out;
    }

    .stat-card.visits .stat-progress-bar { background: #3b82f6; width: 75%; }
    .stat-card.revenue .stat-progress-bar { background: #10b981; width: 60%; }
    .stat-card.pending .stat-progress-bar { background: #f59e0b; width: 40%; }
    .stat-card.patients .stat-progress-bar { background: #8b5cf6; width: 80%; }

    .stat-foot {
      font-size: 0.75rem;
      color: var(--muted);
      padding-top: 0.75rem;
      border-top: 1px solid rgba(226, 232, 240, 0.6);
      font-weight: 600;
      display: flex;
      align-items: center;
      gap: 6px;
      position: relative;
      z-index: 2;
    }

    .stat-foot::before {
      content: "â€¢";
      font-size: 1rem;
      line-height: 0;
    }
    .stat-card.visits .stat-foot::before { color: #3b82f6; }
    .stat-card.revenue .stat-foot::before { color: #10b981; }
    .stat-card.pending .stat-foot::before { color: #f59e0b; }
    .stat-card.patients .stat-foot::before { color: #8b5cf6; }

    /* Highlight collections bar - Premium Glowing Design */
    .stat-highlight {
      background: linear-gradient(135deg, #fffcf0 0%, #fff7d6 100%);
      border: 1px solid rgba(245, 158, 11, 0.2);
      border-radius: 18px;
      padding: 1.25rem 2rem;
      margin-bottom: 2rem;
      display: flex;
      align-items: center;
      justify-content: space-between;
      box-shadow: 0 10px 30px rgba(245, 158, 11, 0.04);
      position: relative;
      overflow: hidden;
      transition: transform 0.2s, box-shadow 0.2s;
    }

    .stat-highlight:hover {
      transform: translateY(-2px);
      box-shadow: 0 15px 35px rgba(245, 158, 11, 0.08);
      border-color: rgba(245, 158, 11, 0.35);
    }

    .stat-highlight::before {
      content: "";
      position: absolute;
      top: 0; right: 0; bottom: 0;
      width: 4px;
      background: linear-gradient(to bottom, #f59e0b, #d97706);
    }

    .stat-highlight span {
      display: flex;
      align-items: center;
      gap: 0.65rem;
      font-weight: 700;
      color: #92400e;
      font-size: 0.95rem;
    }

    .stat-highlight span i {
      font-size: 1.1rem;
      color: #d97706;
      background: rgba(245, 158, 11, 0.1);
      width: 32px; height: 32px;
      border-radius: 50%;
      display: grid;
      place-items: center;
    }

    .stat-highlight strong {
      font-size: 1.35rem;
      color: #78350f;
      font-weight: 850;
      letter-spacing: -0.01em;
      background: linear-gradient(135deg, #92400e 0%, #78350f 100%);
      -webkit-background-clip: text;
      background-clip: text;
      -webkit-text-fill-color: transparent;
    }

    /* Panels Layout */
    .dashboard-grid {
      display: grid;
      grid-template-columns: 1fr 1.5fr;
      gap: 1.5rem;
      align-items: start;
    }

    .insights-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 1.5rem;
      margin-bottom: 1.5rem;
    }

    .rank-list {
      display: flex;
      flex-direction: column;
      gap: 0.85rem;
    }

    .rank-item {
      display: grid;
      grid-template-columns: 28px 1fr auto;
      gap: 0.75rem;
      align-items: center;
    }

    .rank-num {
      width: 28px;
      height: 28px;
      border-radius: 10px;
      display: grid;
      place-items: center;
      font-size: 0.78rem;
      font-weight: 800;
      color: var(--primary-dark);
      background: var(--primary-soft);
    }

    .rank-item:nth-child(1) .rank-num {
      background: linear-gradient(135deg, #fef3c7, #fde68a);
      color: #92400e;
    }

    .rank-item:nth-child(2) .rank-num {
      background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
      color: #475569;
    }

    .rank-item:nth-child(3) .rank-num {
      background: linear-gradient(135deg, #ffedd5, #fed7aa);
      color: #9a3412;
    }

    .rank-body {
      min-width: 0;
    }

    .rank-name {
      font-size: 0.88rem;
      font-weight: 700;
      color: var(--text);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      margin-bottom: 0.35rem;
    }

    .rank-bar-wrap {
      height: 7px;
      border-radius: 999px;
      background: #eef2f7;
      overflow: hidden;
    }

    .rank-bar {
      height: 100%;
      border-radius: inherit;
      background: linear-gradient(90deg, var(--primary), var(--primary-light));
      transition: width 0.6s ease;
    }

    .rank-count {
      font-size: 0.95rem;
      font-weight: 800;
      color: var(--primary-dark);
      min-width: 2.5rem;
      text-align: left;
    }

    .pending-item {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 0.75rem;
      padding: 0.85rem 1rem;
      border-radius: 14px;
      border: 1px solid var(--border);
      background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
      text-decoration: none;
      color: inherit;
      transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    }

    .pending-item:hover {
      transform: translateY(-2px);
      border-color: rgba(245, 158, 11, 0.35);
      box-shadow: 0 8px 20px rgba(245, 158, 11, 0.08);
    }

    .pending-main {
      min-width: 0;
      flex: 1;
    }

    .pending-test {
      font-size: 0.88rem;
      font-weight: 700;
      color: var(--text);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .pending-meta {
      font-size: 0.78rem;
      color: var(--muted);
      margin-top: 0.2rem;
      display: flex;
      gap: 0.5rem;
      flex-wrap: wrap;
    }

    .pending-badge {
      flex-shrink: 0;
      font-size: 0.72rem;
      font-weight: 700;
      padding: 0.35rem 0.65rem;
      border-radius: 999px;
      background: #fff7ed;
      color: #c2410c;
      border: 1px solid #fed7aa;
    }

    .empty-insight {
      text-align: center;
      color: var(--muted);
      padding: 2rem 1rem;
      font-size: 0.92rem;
    }

    .empty-insight i {
      display: block;
      font-size: 2rem;
      margin-bottom: 0.65rem;
      opacity: 0.45;
    }

    .pending-filter-bar {
      display: flex;
      flex-wrap: wrap;
      align-items: flex-end;
      gap: 0.65rem 0.85rem;
      margin-bottom: 1rem;
      padding: 0.9rem 1rem;
      border-radius: 14px;
      background: linear-gradient(180deg, #f0fdfa 0%, #f8fafc 100%);
      border: 1px solid rgba(13, 148, 136, 0.22);
      box-shadow: 0 2px 10px rgba(13, 148, 136, 0.06);
    }

    .panel-head-pending {
      flex-wrap: wrap;
      gap: 0.65rem;
    }

    .pending-head-tools {
      display: flex;
      flex-wrap: wrap;
      gap: 0.45rem;
      align-items: center;
    }

    .panel-pending .panel-body {
      padding-top: 1rem;
    }

    .pending-filter-bar label {
      display: flex;
      flex-direction: column;
      gap: 0.25rem;
      font-size: 0.75rem;
      font-weight: 700;
      color: var(--muted);
    }

    .pending-filter-bar input[type="date"] {
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 0.4rem 0.55rem;
      font-family: inherit;
      font-size: 0.82rem;
      min-width: 140px;
      background: #fff;
    }

    .pending-filter-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 0.45rem;
      align-items: center;
    }

    .btn-pending-filter {
      border: none;
      border-radius: 10px;
      padding: 0.45rem 0.85rem;
      font-family: inherit;
      font-size: 0.78rem;
      font-weight: 700;
      cursor: pointer;
      transition: background 0.2s, transform 0.15s;
    }

    .btn-pending-filter.primary {
      background: var(--primary);
      color: #fff;
    }

    .btn-pending-filter.primary:hover {
      background: var(--primary-dark);
    }

    .btn-pending-filter.ghost {
      background: #fff;
      color: var(--primary-dark);
      border: 1px solid rgba(13, 148, 136, 0.25);
    }

    .btn-pending-filter.ghost:hover {
      background: var(--primary-soft);
    }

    .pending-dual {
      display: flex;
      flex-direction: column;
      gap: 1.25rem;
      max-height: 520px;
      overflow: hidden;
    }

    .pending-block {
      display: flex;
      flex-direction: column;
      min-height: 0;
      flex: 1;
    }

    .pending-list {
      display: flex;
      flex-direction: column;
      gap: 0.65rem;
      max-height: 220px;
      overflow-y: auto;
      padding-left: 2px;
      scrollbar-width: thin;
    }

    .pending-list::-webkit-scrollbar,
    .pending-table-wrap::-webkit-scrollbar {
      width: 6px;
      height: 6px;
    }

    .pending-list::-webkit-scrollbar-thumb,
    .pending-table-wrap::-webkit-scrollbar-thumb {
      background: #cbd5e1;
      border-radius: 999px;
    }

    .pending-block-title {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 0.5rem;
      margin-bottom: 0.75rem;
      font-size: 0.88rem;
      font-weight: 800;
      color: var(--text);
    }

    .pending-block-title .count-pill {
      font-size: 0.72rem;
      font-weight: 700;
      padding: 0.2rem 0.55rem;
      border-radius: 999px;
      background: #fff7ed;
      color: #c2410c;
      border: 1px solid #fed7aa;
    }

    .pending-table-wrap {
      border: 1px solid var(--border);
      border-radius: 14px;
      overflow: auto;
      max-height: 220px;
      scrollbar-width: thin;
    }

    .pending-table {
      width: 100%;
      border-collapse: collapse;
      font-size: 0.82rem;
    }

    .pending-table th {
      position: sticky;
      top: 0;
      background: #f8fafc;
      color: var(--muted);
      font-weight: 700;
      text-align: right;
      padding: 0.65rem 0.75rem;
      border-bottom: 1px solid var(--border);
      white-space: nowrap;
    }

    .pending-table td {
      padding: 0.65rem 0.75rem;
      border-bottom: 1px solid #f1f5f9;
      vertical-align: middle;
    }

    .pending-table tr:last-child td {
      border-bottom: none;
    }

    .pending-table tbody tr:hover {
      background: #f8fafc;
    }

    .pending-table .cell-name {
      font-weight: 700;
      color: var(--text);
      max-width: 140px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .pending-table .cell-parent {
      color: var(--muted);
      font-size: 0.78rem;
      max-width: 120px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .pending-table .btn-enter {
      display: inline-flex;
      align-items: center;
      gap: 0.25rem;
      padding: 0.3rem 0.55rem;
      border-radius: 8px;
      background: var(--primary-soft);
      color: var(--primary-dark);
      font-size: 0.72rem;
      font-weight: 700;
      text-decoration: none;
      white-space: nowrap;
    }

    .pending-table .btn-enter:hover {
      background: #ccfbf1;
    }

    .panel {
      background: var(--surface);
      border-radius: var(--radius);
      border: 1px solid var(--border);
      box-shadow: var(--shadow);
      overflow: hidden;
      transition: box-shadow 0.2s;
    }

    .panel:hover {
      box-shadow: var(--shadow-lg);
    }

    .panel-head {
      padding: 1.25rem 1.5rem;
      border-bottom: 1px solid var(--border);
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 0.5rem;
    }

    .panel-head h3 {
      font-size: 1rem;
      font-weight: 800;
      color: var(--text);
      display: flex;
      align-items: center;
      gap: 0.5rem;
    }

    .panel-head .tag {
      font-size: 0.7rem;
      font-weight: 700;
      color: var(--muted);
      background: var(--surface-2);
      padding: 0.25rem 0.75rem;
      border-radius: 6px;
      border: 1px solid var(--border);
    }

    .panel-body { padding: 1.5rem; }
    .panel-body.flush { padding: 0; }

    .admin-sessions-section {
      margin-bottom: 1.75rem;
      scroll-margin-top: 5rem;
    }
    .admin-sessions-section[hidden] {
      display: none !important;
    }
    .admin-sessions-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 1.25rem;
    }
    @media (max-width: 900px) {
      .admin-sessions-grid { grid-template-columns: 1fr; }
    }
    .sess-stat-row {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 0.75rem;
      margin-bottom: 1rem;
    }
    @media (max-width: 640px) {
      .sess-stat-row { grid-template-columns: repeat(2, 1fr); }
    }
    .sess-mini {
      background: rgba(15, 23, 42, 0.04);
      border-radius: 12px;
      padding: 0.75rem;
      text-align: center;
    }
    .sess-mini strong {
      display: block;
      font-size: 1.35rem;
      color: var(--primary);
    }
    .sess-mini span { font-size: 0.78rem; color: #64748b; }
    .sess-form .form-row {
      margin-bottom: 0.85rem;
    }
    .sess-form label {
      display: block;
      font-size: 0.85rem;
      margin-bottom: 0.35rem;
      color: #475569;
    }
    .sess-form input,
    .sess-form select {
      width: 100%;
      padding: 0.5rem 0.75rem;
      border: 1px solid #e2e8f0;
      border-radius: 10px;
      font-family: inherit;
    }
    .sess-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 0.5rem;
      margin-top: 0.75rem;
    }
    .btn-sess {
      border: none;
      border-radius: 10px;
      padding: 0.45rem 0.9rem;
      font-family: inherit;
      cursor: pointer;
      font-size: 0.85rem;
    }
    .btn-sess.primary { background: var(--primary); color: #fff; }
    .btn-sess.secondary { background: #e0f2fe; color: #0369a1; }
    .btn-sess.warn { background: #fef3c7; color: #b45309; }
    .session-admin-msg {
      display: none;
      margin-top: 0.75rem;
      padding: 0.6rem 1rem;
      border-radius: 10px;
      font-size: 0.9rem;
    }
    .session-admin-msg.ok { background: #d1fae5; color: #065f46; }
    .session-admin-msg.err { background: #fee2e2; color: #991b1b; }
    .sessions-modal {
      display: none;
      position: fixed;
      inset: 0;
      z-index: 2000;
      background: rgba(15, 23, 42, 0.55);
      align-items: center;
      justify-content: center;
      padding: 1rem;
    }
    .sessions-modal.open { display: flex; }
    .sessions-modal-box {
      background: #fff;
      border-radius: 16px;
      max-width: 960px;
      width: 100%;
      max-height: 85vh;
      overflow: hidden;
      display: flex;
      flex-direction: column;
      box-shadow: 0 25px 50px rgba(0,0,0,0.2);
    }
    .sessions-modal-head {
      padding: 1rem 1.25rem;
      border-bottom: 1px solid #e2e8f0;
      display: flex;
      justify-content: space-between;
      align-items: center;
    }
    .sessions-modal-body {
      overflow: auto;
      padding: 1rem 1.25rem;
    }
    .sessions-table {
      width: 100%;
      border-collapse: collapse;
      font-size: 0.82rem;
    }
    .sessions-table th,
    .sessions-table td {
      padding: 0.5rem 0.4rem;
      border-bottom: 1px solid #f1f5f9;
      text-align: right;
    }
    .btn-sess-term,
    .btn-sess-term-all {
      border: none;
      border-radius: 6px;
      padding: 0.25rem 0.45rem;
      font-size: 0.72rem;
      cursor: pointer;
      margin-left: 0.2rem;
    }
    .btn-sess-term { background: #fee2e2; color: #b91c1c; }
    .btn-sess-term-all { background: #fef3c7; color: #b45309; }

    /* Quick actions */
    .quick-list {
      display: flex;
      flex-direction: column;
      gap: 0.75rem;
    }

    .quick-item {
      display: flex;
      align-items: center;
      gap: 1rem;
      padding: 1rem 1.25rem;
      border: 1px solid var(--border);
      border-radius: var(--radius-md);
      text-decoration: none;
      color: var(--text);
      background: var(--surface-2);
      transition: all 0.2s;
    }

    .quick-item:hover {
      border-color: var(--primary);
      background: var(--primary-glow);
      transform: translateX(-4px);
    }

    .quick-item .qi-icon {
      width: 42px; height: 42px;
      border-radius: 10px;
      display: grid; place-items: center;
      font-size: 1.1rem;
      color: #fff;
      flex-shrink: 0;
      box-shadow: var(--shadow-sm);
    }

    .quick-item:nth-child(1) .qi-icon { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
    .quick-item:nth-child(2) .qi-icon { background: linear-gradient(135deg, #10b981, #047857); }
    .quick-item:nth-child(3) .qi-icon { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
    .quick-item:nth-child(4) .qi-icon { background: linear-gradient(135deg, #f59e0b, #b45309); }
    .quick-item:nth-child(5) .qi-icon { background: linear-gradient(135deg, #ec4899, #be185d); }
    .quick-item:nth-child(6) .qi-icon { background: linear-gradient(135deg, #06b6d4, #0891b2); }

    .quick-item .qi-text {
      display: flex;
      flex-direction: column;
      gap: 2px;
    }

    .quick-item .qi-text strong {
      font-size: 0.9rem;
      font-weight: 700;
      color: var(--text);
    }

    .quick-item .qi-text span {
      font-size: 0.75rem;
      color: var(--muted);
      font-weight: 600;
    }

    .quick-item .qi-arrow {
      margin-right: auto;
      color: var(--muted);
      font-size: 1rem;
      transition: transform 0.2s, color 0.2s;
    }

    .quick-item:hover .qi-arrow {
      transform: translateX(-4px);
      color: var(--primary);
    }

    /* Table styling */
    .data-table-container {
      overflow-x: auto;
      width: 100%;
    }

    .data-table {
      width: 100%;
      border-collapse: collapse;
      font-size: 0.88rem;
    }

    .data-table th {
      padding: 1rem 1.5rem;
      text-align: right;
      font-size: 0.78rem;
      font-weight: 700;
      color: var(--muted);
      text-transform: uppercase;
      letter-spacing: 0.05em;
      background: var(--surface-2);
      border-bottom: 1px solid var(--border);
    }

    .data-table td {
      padding: 1rem 1.5rem;
      text-align: right;
      border-bottom: 1px solid var(--border);
      font-weight: 600;
      color: var(--text);
    }

    .data-table tbody tr {
      transition: background 0.2s;
    }

    .data-table tbody tr:hover {
      background: #f8fafc;
    }

    .data-table tbody tr:last-child td {
      border-bottom: none;
    }

    .visit-id {
      font-weight: 800;
      color: var(--primary-dark);
      background: var(--primary-soft);
      padding: 0.25rem 0.6rem;
      border-radius: 6px;
      font-size: 0.8rem;
      font-variant-numeric: tabular-nums;
      display: inline-block;
    }

    .badge {
      display: inline-flex;
      align-items: center;
      gap: 0.35rem;
      padding: 0.35rem 0.75rem;
      border-radius: 20px;
      font-size: 0.75rem;
      font-weight: 700;
    }

    .badge::before {
      content: "";
      width: 6px; height: 6px;
      border-radius: 50%;
    }

    .badge-paid {
      background: #ecfdf5;
      color: #065f46;
    }
    .badge-paid::before {
      background: #10b981;
    }

    .badge-due {
      background: #fffbeb;
      color: #92400e;
    }
    .badge-due::before {
      background: #f59e0b;
    }

    /* Mobile Overlay */
    .sidebar-overlay {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(15, 23, 42, 0.4);
      backdrop-filter: blur(4px);
      z-index: 1030;
      transition: opacity 0.3s;
    }

    .sidebar-overlay.show {
      display: block;
    }

    /* Responsive adjustments */
    @media (max-width: 1200px) {
      .stats-grid { grid-template-columns: repeat(2, 1fr); }
      .insights-grid { grid-template-columns: 1fr; }
      .dashboard-grid { grid-template-columns: 1fr; }
      .hero { grid-template-columns: 1fr; }
      .hero-quote { width: 100%; }
    }

    @media (max-width: 991px) {
      #sidebar.modern-sidebar {
        transform: translateX(100%);
      }
      #sidebar.modern-sidebar.menu-open {
        transform: translateX(0);
      }
      .main-shell {
        margin-right: 0;
      }
      .mobile-burger-btn {
        display: grid;
      }
      .main-header {
        padding: 0 1.25rem;
        height: 70px;
      }
      .main-header .page-title {
        font-size: 1.15rem;
      }
      .main-header .page-sub {
        display: none;
      }
      .user-profile {
        display: none;
      }
      .stats-grid {
        grid-template-columns: repeat(2, 1fr);
      }
    }

    @media (max-width: 576px) {
      .stats-grid {
        grid-template-columns: 1fr;
      }
      .glw-main-content {
        padding: 1.25rem 1rem;
      }
      .hero {
        padding: 1.5rem 1.25rem;
      }
      .hero h2 {
        font-size: 1.4rem;
      }
      .hero-lab-card {
        padding: 0.75rem 0.9rem;
        gap: 0.75rem;
      }
      .hero-lab-logo-wrap {
        width: 62px;
        height: 62px;
      }
      .hero-lab-title {
        font-size: 1.1rem;
      }
      .hero-meta {
        gap: 0.75rem;
        flex-direction: column;
      }
      .stat-highlight {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        padding: 1rem;
      }
    }

    /* Horizontal Navbar layout on Desktop (min-width: 992px) */
    .header-logo-block {
      display: none;
    }

    @media (min-width: 992px) {
      .glw-dashboard-wrap {
        flex-direction: column;
      }

      .main-shell {
        margin-right: 0 !important;
        margin-top: 136px !important; /* Header 80px + Nav 56px */
      }

      .main-header {
        position: fixed !important;
        top: 0 !important;
        right: 0 !important;
        left: 0 !important;
        height: 80px !important;
        z-index: 1050 !important;
        width: 100% !important;
        background: var(--surface) !important;
        border-bottom: 1px solid var(--border) !important;
        box-shadow: var(--shadow-sm) !important;
      }

      .header-logo-block {
        display: flex !important;
        align-items: center;
        gap: 0.75rem;
        margin-left: 2rem;
      }

      .header-logo-block .brand-logo {
        width: 40px;
        height: 40px;
        border-radius: 10px;
        background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
        display: grid;
        place-items: center;
        box-shadow: 0 4px 10px rgba(13, 148, 136, 0.2);
        color: #fff;
        font-size: 1.1rem;
      }

      .header-logo-block .brand-title {
        font-size: 1.05rem;
        font-weight: 800;
        color: var(--text);
      }

      .header-logo-block .brand-sub {
        font-size: 0.7rem;
        color: var(--muted);
        font-weight: 500;
        margin-top: 2px;
        display: flex;
        align-items: center;
        gap: 4px;
      }

      #sidebar.modern-sidebar {
        width: 100% !important;
        height: 56px !important;
        position: fixed !important;
        top: 80px !important;
        bottom: auto !important;
        right: 0 !important;
        left: 0 !important;
        z-index: 1040 !important;
        flex-direction: row !important;
        border-left: none !important;
        border-bottom: 1px solid var(--sidebar-border) !important;
        transform: none !important;
        background: var(--sidebar-bg);
      }

      #sidebar.modern-sidebar .sidebar-brand,
      #sidebar.modern-sidebar .sidebar-footer {
        display: none !important;
      }

      #sidebar.modern-sidebar .sidebar-nav {
        flex-direction: row !important;
        align-items: center !important;
        gap: 1rem !important;
        padding: 0 2rem !important;
        overflow: visible !important;
        width: 100% !important;
      }

      #sidebar.modern-sidebar .menu-group {
        position: relative !important;
        flex-direction: row !important;
      }

      #sidebar.modern-sidebar .menu-group-header {
        padding: 0.5rem 0.75rem !important;
        background: transparent !important;
        color: #cbd5e1 !important;
      }

      #sidebar.modern-sidebar .menu-group-header:hover {
        color: #fff !important;
      }

      #sidebar.modern-sidebar .group-icon {
        width: 28px !important;
        height: 28px !important;
        font-size: 0.85rem !important;
        border-radius: 8px !important;
      }

      #sidebar.modern-sidebar .menu-items {
        position: absolute !important;
        top: 100% !important;
        right: 0 !important;
        background: var(--sidebar-bg) !important;
        border: 1px solid var(--sidebar-border) !important;
        box-shadow: var(--shadow-lg) !important;
        border-radius: 12px !important;
        min-width: 240px !important;
        max-height: 0 !important;
        opacity: 0 !important;
        visibility: hidden !important;
        transform: translateY(10px) !important;
        transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
        z-index: 1000 !important;
        padding: 0.5rem !important;
        margin-right: 0 !important;
        border-right: none !important;
        padding-right: 0.5rem !important;
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 4px !important;
      }

      #sidebar.modern-sidebar .menu-items:has(> :nth-child(8)) {
        grid-template-columns: repeat(2, 220px) !important;
        min-width: 460px !important;
      }

      #sidebar.modern-sidebar .menu-group:hover .menu-items,
      #sidebar.modern-sidebar .menu-group.dropdown-open .menu-items {
        max-height: min(85vh, 820px) !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: translateY(4px) !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
      }

      #sidebar.modern-sidebar .menu-item {
        padding: 0.6rem 0.85rem !important;
        width: 100% !important;
        border-radius: 8px !important;
        white-space: nowrap !important;
      }

      #sidebar.modern-sidebar .menu-item:hover {
        padding-right: 0.85rem !important;
        background: rgba(255, 255, 255, 0.05) !important;
      }

      /* Fix dropdown menu alignment on left side of the navbar */
      #sidebar.modern-sidebar .menu-group:nth-child(n+4) .menu-items {
        right: auto !important;
        left: 0 !important;
      }

      /* Elevate the navbar slightly with a subtle shadow */
      #sidebar.modern-sidebar {
        box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08) !important;
      }
    }

    /* Premium Page Footer Style */
    .dashboard-footer {
      margin-top: 3rem;
      padding: 1.5rem 0;
      border-top: 1px solid var(--border);
      display: flex;
      justify-content: space-between;
      align-items: center;
      font-size: 0.8rem;
      color: var(--muted);
      font-weight: 600;
    }

    .dashboard-footer .version-tag {
      background: var(--surface);
      border: 1px solid var(--border);
      padding: 0.25rem 0.75rem;
      border-radius: 20px;
      font-size: 0.75rem;
      color: var(--text);
    }
    body.dashboard-body {
      background:
        radial-gradient(circle at 12% 8%, rgba(45, 212, 191, 0.18), transparent 30%),
        radial-gradient(circle at 88% 12%, rgba(99, 102, 241, 0.14), transparent 28%),
        linear-gradient(135deg, #eefdf9 0%, #f8fbff 42%, #f2f7ff 100%);
    }

    body.dashboard-body::before {
      width: 58vw;
      height: 58vw;
      background:
        radial-gradient(circle, rgba(20, 184, 166, 0.16) 0%, transparent 62%),
        conic-gradient(from 140deg, rgba(14, 165, 233, 0.08), rgba(20, 184, 166, 0.12), rgba(99, 102, 241, 0.08), rgba(14, 165, 233, 0.08));
      filter: blur(78px);
      opacity: 0.95;
    }

    body.dashboard-body::after {
      width: 62vw;
      height: 62vw;
      background:
        radial-gradient(circle, rgba(79, 70, 229, 0.12) 0%, transparent 62%),
        radial-gradient(circle at 35% 35%, rgba(16, 185, 129, 0.12), transparent 42%);
      filter: blur(90px);
      opacity: 0.9;
    }

    .glw-main-content {
      max-width: 1580px;
    }

    .main-header {
      background: rgba(255, 255, 255, 0.78);
      backdrop-filter: blur(22px) saturate(160%);
      -webkit-backdrop-filter: blur(22px) saturate(160%);
      border-bottom: 1px solid rgba(255, 255, 255, 0.65);
      box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
    }

    .main-header .page-title {
      background: linear-gradient(135deg, #042f2e 0%, #0f766e 45%, #2563eb 100%);
      -webkit-background-clip: text;
      background-clip: text;
      -webkit-text-fill-color: transparent;
      letter-spacing: -0.03em;
    }

    .header-logo-block .brand-logo,
    .brand-logo,
    .user-avatar {
      position: relative;
      isolation: isolate;
    }

    .header-logo-block .brand-logo::after,
    .brand-logo::after,
    .user-avatar::after {
      content: "";
      position: absolute;
      inset: -5px;
      border-radius: inherit;
      background: linear-gradient(135deg, rgba(20, 184, 166, 0.5), rgba(59, 130, 246, 0.25));
      filter: blur(12px);
      z-index: -1;
      opacity: 0.75;
    }

    @media (min-width: 992px) {
      .main-shell {
        margin-top: 146px !important;
      }

      .main-header {
        height: 86px !important;
        background: rgba(255, 255, 255, 0.82) !important;
        border-bottom: 1px solid rgba(226, 232, 240, 0.72) !important;
        box-shadow: 0 14px 42px rgba(15, 23, 42, 0.07) !important;
      }

      #sidebar.modern-sidebar {
        top: 86px !important;
        height: 60px !important;
        background:
          radial-gradient(circle at 8% 50%, rgba(45, 212, 191, 0.18), transparent 26%),
          radial-gradient(circle at 90% 35%, rgba(59, 130, 246, 0.2), transparent 24%),
          linear-gradient(135deg, rgba(2, 6, 23, 0.96), rgba(15, 23, 42, 0.94) 48%, rgba(4, 47, 46, 0.95)) !important;
        border-bottom: 1px solid rgba(94, 234, 212, 0.16) !important;
        box-shadow: 0 18px 42px rgba(15, 23, 42, 0.18) !important;
      }

      #sidebar.modern-sidebar .sidebar-nav {
        justify-content: center !important;
      }

      #sidebar.modern-sidebar .menu-group-header {
        border: 1px solid transparent;
        border-radius: 14px !important;
      }

      #sidebar.modern-sidebar .menu-group-header:hover {
        background: rgba(255, 255, 255, 0.08) !important;
        border-color: rgba(255, 255, 255, 0.1);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
      }

      #sidebar.modern-sidebar .menu-items {
        background: rgba(15, 23, 42, 0.92) !important;
        backdrop-filter: blur(18px) saturate(145%);
        -webkit-backdrop-filter: blur(18px) saturate(145%);
        border: 1px solid rgba(148, 163, 184, 0.18) !important;
        box-shadow: 0 28px 60px rgba(2, 6, 23, 0.32) !important;
      }
    }

    .hero {
      min-height: 330px;
      border-radius: 34px;
      padding: 3rem;
      background:
        linear-gradient(135deg, rgba(4, 47, 46, 0.98) 0%, rgba(13, 148, 136, 0.94) 40%, rgba(30, 64, 175, 0.96) 100%),
        url("data:image/svg+xml,%3Csvg width='160' height='160' viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='rgba(255,255,255,0.14)' stroke-width='1'%3E%3Cpath d='M0 80h160M80 0v160'/%3E%3Ccircle cx='80' cy='80' r='34'/%3E%3Ccircle cx='80' cy='80' r='64'/%3E%3C/g%3E%3C/svg%3E");
      box-shadow:
        0 34px 80px rgba(13, 148, 136, 0.22),
        0 18px 38px rgba(30, 64, 175, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.24);
      border: 1px solid rgba(255, 255, 255, 0.18);
    }

    .hero::before {
      width: 520px;
      height: 520px;
      background:
        radial-gradient(circle, rgba(45, 212, 191, 0.42) 0%, transparent 58%),
        radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.22), transparent 35%);
      filter: blur(28px);
    }

    .hero::after {
      width: 420px;
      height: 420px;
      background:
        radial-gradient(circle, rgba(96, 165, 250, 0.32) 0%, transparent 62%),
        radial-gradient(circle at 62% 42%, rgba(167, 139, 250, 0.24), transparent 38%);
      filter: blur(24px);
    }

    .hero h2 {
      font-size: clamp(1.9rem, 3.2vw, 3.1rem);
      letter-spacing: -0.04em;
    }

    .hero-badge,
    .hero-lab-card,
    .hero-meta span,
    .hero-quote {
      background: rgba(255, 255, 255, 0.13);
      border-color: rgba(255, 255, 255, 0.2);
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
    }

    .hero-lab-card {
      max-width: 760px;
      border-radius: 24px;
      padding: 1.05rem 1.25rem;
    }

    .hero-lab-logo-wrap {
      width: 88px;
      height: 88px;
      border-radius: 22px;
      transform: rotate(-2deg);
    }

    .hero-lab-title {
      font-size: clamp(1.35rem, 2vw, 1.8rem);
    }

    .hero-quote {
      width: 360px;
      border-radius: 26px;
      padding: 1.6rem;
    }

    .stats-grid {
      gap: 1.35rem;
    }

    .stat-card,
    .panel,
    .stat-highlight {
      background: rgba(255, 255, 255, 0.82);
      backdrop-filter: blur(18px) saturate(145%);
      -webkit-backdrop-filter: blur(18px) saturate(145%);
      border: 1px solid rgba(255, 255, 255, 0.72);
      box-shadow:
        0 18px 45px rgba(15, 23, 42, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    }

    .stat-card {
      border-radius: 28px;
      padding: 1.55rem;
    }

    .stat-card::before {
      content: "";
      position: absolute;
      inset: 0;
      opacity: 0;
      transition: opacity 0.3s ease;
      pointer-events: none;
    }

    .stat-card.visits::before { background: radial-gradient(circle at 15% 12%, rgba(59, 130, 246, 0.16), transparent 42%); }
    .stat-card.revenue::before { background: radial-gradient(circle at 15% 12%, rgba(16, 185, 129, 0.18), transparent 42%); }
    .stat-card.pending::before { background: radial-gradient(circle at 15% 12%, rgba(245, 158, 11, 0.18), transparent 42%); }
    .stat-card.patients::before { background: radial-gradient(circle at 15% 12%, rgba(139, 92, 246, 0.18), transparent 42%); }

    .stat-card:hover::before {
      opacity: 1;
    }

    .stat-card:hover {
      transform: translateY(-8px) scale(1.01);
    }

    .stat-icon {
      width: 54px;
      height: 54px;
      border-radius: 18px;
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65), 0 12px 28px rgba(15, 23, 42, 0.08);
    }

    .stat-value {
      font-size: clamp(2rem, 2.6vw, 2.65rem);
      letter-spacing: -0.05em;
    }

    .stat-progress-container {
      height: 7px;
      background: rgba(226, 232, 240, 0.78);
    }

    .stat-progress-bar {
      box-shadow: 0 0 18px currentColor;
    }

    .stat-highlight {
      border-radius: 26px;
      background:
        radial-gradient(circle at 8% 50%, rgba(251, 191, 36, 0.22), transparent 30%),
        linear-gradient(135deg, rgba(255, 251, 235, 0.9), rgba(255, 255, 255, 0.82));
      padding: 1.4rem 2rem;
    }

    .panel {
      border-radius: 28px;
      overflow: hidden;
    }

    .panel-head {
      background: linear-gradient(135deg, rgba(248, 250, 252, 0.92), rgba(255, 255, 255, 0.55));
      border-bottom: 1px solid rgba(226, 232, 240, 0.75);
    }

    .panel-head h3 {
      font-size: 1.08rem;
    }

    .panel-head .tag {
      border-radius: 999px;
      background: rgba(13, 148, 136, 0.08);
      color: var(--primary-dark);
      border-color: rgba(13, 148, 136, 0.16);
    }

    .quick-item {
      border-radius: 20px;
      background: rgba(248, 250, 252, 0.72);
      border-color: rgba(226, 232, 240, 0.8);
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88);
    }

    .quick-item:hover {
      background: rgba(240, 253, 250, 0.9);
      box-shadow: 0 16px 34px rgba(13, 148, 136, 0.1);
      transform: translateX(-6px) translateY(-2px);
    }

    .quick-item .qi-icon {
      width: 50px;
      height: 50px;
      border-radius: 17px;
      box-shadow: 0 12px 28px rgba(15, 23, 42, 0.13);
    }

    .data-table th {
      background: rgba(248, 250, 252, 0.9);
    }

    .data-table tbody tr:hover {
      background: rgba(240, 253, 250, 0.72);
    }

    .visit-id,
    .badge {
      border-radius: 999px;
    }

    .btn-logout {
      border-radius: 16px;
      background: rgba(255, 241, 242, 0.82);
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
    }

    .dashboard-footer {
      border-top-color: rgba(226, 232, 240, 0.68);
    }

    .dashboard-footer .version-tag {
      background: rgba(255, 255, 255, 0.72);
      backdrop-filter: blur(14px);
      -webkit-backdrop-filter: blur(14px);
    }

    @media (max-width: 1200px) {
      .hero {
        min-height: auto;
      }

      .hero-quote {
        width: 100%;
      }
    }

    @media (max-width: 576px) {
      .hero {
        border-radius: 26px;
        padding: 1.5rem;
      }

      .hero-lab-logo-wrap {
        width: 68px;
        height: 68px;
        border-radius: 18px;
      }

      .stat-card,
      .panel,
      .stat-highlight {
        border-radius: 22px;
      }
    }
  
/* Login page */
.login-page { min-height:100vh; display:flex; align-items:center; justify-content:center; position:relative; overflow:hidden; }
.login-bg { position:fixed; inset:0; background: radial-gradient(ellipse 70% 50% at 15% 20%, rgba(13,148,136,0.2), transparent), radial-gradient(ellipse 50% 40% at 85% 80%, rgba(14,165,233,0.15), transparent), linear-gradient(160deg, #0c0a1d 0%, #111827 40%, #0f172a 100%); }
.login-wrapper { position:relative; z-index:1; width:100%; max-width:440px; padding:24px; }
.login-card { background:rgba(255,255,255,0.98); backdrop-filter:blur(24px); border-radius:20px; padding:44px 40px; box-shadow:0 25px 60px rgba(0,0,0,0.3); }
.login-brand { text-align:center; margin-bottom:36px; }
.login-logo { width:68px; height:68px; background:linear-gradient(135deg,var(--primary-light),var(--primary-dark)); border-radius:18px; display:flex; align-items:center; justify-content:center; margin:0 auto 18px; color:#fff; font-size:30px; box-shadow:0 12px 32px rgba(13,148,136,0.35); }
.login-brand h1 { font-size:1.55rem; font-weight:800; margin:0 0 6px; }
.login-brand p { color:var(--muted); margin:0; font-size:0.92rem; }
.login-form .form-control { border-radius:10px; border:1.5px solid var(--border); padding-top:1.1rem; }
.login-form .form-control:focus { border-color:var(--primary); box-shadow:0 0 0 4px rgba(13,148,136,0.1); }
.btn-login { padding:14px; border-radius:10px; font-weight:700; background:linear-gradient(135deg,var(--primary),var(--primary-light)); border:none; color:#fff; transition:transform .15s, box-shadow .15s; }
.btn-login:hover { transform:translateY(-2px); box-shadow:0 10px 28px rgba(13,148,136,0.35); color:#fff; }
.login-footer { text-align:center; margin-top:28px; font-size:0.8rem; color:var(--muted); }

.menu-item.disabled, .quick-item.disabled { opacity:.45; pointer-events:none; cursor:default; }
.btn-logout { text-decoration:none; }

.btn-home {
  text-decoration: none;
  background: var(--primary-soft);
  color: var(--primary-dark);
  border: 1px solid rgba(13, 148, 136, 0.2);
}
.btn-home:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.2);
}
.btn-home.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary-dark);
}

/* Admin forms & labs pages */
.mt-section { margin-top: 1.5rem; }
.page-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-bottom: 1.5rem; }
.page-grid-1 { max-width: 820px; }
@media (max-width: 991px) { .page-grid-2 { grid-template-columns: 1fr; } }

.alert-banner {
  display: flex; align-items: center; gap: 0.65rem;
  padding: 0.85rem 1.15rem; border-radius: 14px;
  font-weight: 700; font-size: 0.88rem; margin-bottom: 1.25rem;
}
.alert-banner.success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-banner.danger  { background: #fff1f2; color: #be123c; border: 1px solid #fecdd3; }

.admin-form { display: flex; flex-direction: column; gap: 0.85rem; }
.form-row { display: flex; flex-direction: column; gap: 0.35rem; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.85rem; }
@media (max-width: 575px) { .form-row-2 { grid-template-columns: 1fr; } }
.form-row label { font-size: 0.78rem; font-weight: 700; color: var(--muted); }
.admin-form input[type="text"],
.admin-form input[type="number"],
.admin-form input[type="password"],
.admin-form select {
  width: 100%; padding: 0.6rem 0.85rem;
  border: 1px solid var(--border); border-radius: 10px;
  font-family: inherit; font-size: 0.88rem; font-weight: 600;
  background: #fff; transition: border-color 0.2s, box-shadow 0.2s;
}
.admin-form input:focus, .admin-form select:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.12);
}
.checkbox-label {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.88rem; font-weight: 600; cursor: pointer;
}
.input-group-custom { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.input-group-custom input { flex: 1; min-width: 120px; }

.btn-form-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.65rem 1.25rem; border: none; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; font-family: inherit; font-size: 0.88rem; font-weight: 700;
  cursor: pointer; transition: transform 0.15s, box-shadow 0.15s;
}
.btn-form-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(13,148,136,0.25); color: #fff; }

.btn-form-ghost {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.6rem 1rem; border-radius: 10px;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border); font-family: inherit;
  font-size: 0.85rem; font-weight: 700; cursor: pointer; text-decoration: none;
}
.btn-form-ghost:hover { background: var(--primary-soft); color: var(--primary-dark); }
.btn-sm { padding: 0.45rem 0.85rem; font-size: 0.8rem; }

.check-list-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  flex-wrap: wrap; margin-bottom: 0.75rem;
}
.check-list {
  max-height: 420px; overflow-y: auto;
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface-2);
}
.check-list-item {
  display: flex; align-items: center; gap: 0.65rem;
  padding: 0.65rem 0.85rem; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background 0.15s;
}
.check-list-item:last-child { border-bottom: none; }
.check-list-item:hover { background: rgba(240, 253, 250, 0.8); }
.check-list-item.is-linked { opacity: 0.65; cursor: default; }
.check-list-text { flex: 1; min-width: 0; }
.check-list-text strong { display: block; font-size: 0.88rem; }
.check-list-text small { color: var(--muted); font-size: 0.78rem; }

.form-actions-inline { display: flex; flex-wrap: wrap; gap: 0.65rem; margin-top: 0.5rem; }
.text-center-muted { text-align: center; color: var(--muted); padding: 2rem !important; }
.text-muted { color: var(--muted); font-size: 0.78rem; }

.table-actions { display: flex; gap: 0.35rem; }
.btn-table {
  width: 34px; height: 34px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface-2);
  color: var(--muted); cursor: pointer; display: grid; place-items: center;
  text-decoration: none; transition: all 0.15s;
}
.btn-table:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.btn-table.copied { border-color: var(--success); color: var(--success); background: #ecfdf5; }
.btn-table-files { color: var(--primary-dark); background: var(--primary-soft); border-color: rgba(13,148,136,0.2); }
.btn-table-files:hover { border-color: var(--primary); color: var(--primary-dark); background: #ccfbf1; }
code { font-size: 0.82rem; color: var(--primary-dark); background: var(--primary-soft); padding: 0.15rem 0.45rem; border-radius: 6px; }
.file-name-cell { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.8rem; color: var(--muted); }
.panel-head-actions { display: flex; align-items: center; gap: 0.65rem; flex-wrap: wrap; }
.mb-section { margin-bottom: 0; }

/* ── Settings pages ── */
.settings-subnav {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  margin-bottom: 1.25rem; padding: 0.5rem;
  background: rgba(248,250,252,0.9);
  border: 1px solid var(--border);
  border-radius: 14px;
}
.settings-subnav a {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.5rem 0.85rem; border-radius: 10px;
  font-size: 0.82rem; font-weight: 700; color: var(--muted);
  text-decoration: none; transition: all 0.15s;
}
.settings-subnav a:hover { background: var(--primary-soft); color: var(--primary-dark); }
.settings-subnav a.active {
  background: var(--primary); color: #fff;
  box-shadow: 0 4px 14px rgba(13,148,136,0.25);
}

.dev-lock-panel {
  max-width: 480px;
  margin: 0 auto;
}

.dev-lock-form {
  max-width: 360px;
  margin: 0 auto;
}

.dev-lock-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.dev-preview-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.dev-preview-box {
  padding: 1rem 1.15rem;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  margin-bottom: 1rem;
}

.dev-preview-portal {
  padding: 0;
  overflow: hidden;
  border-style: solid;
  background: #022c22;
}

.dev-preview-portal .p-dev-bar {
  box-shadow: none;
}

.dev-preview-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.dev-preview-links li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.dev-preview-links a {
  color: var(--primary-dark);
  text-decoration: none;
  word-break: break-all;
}

.dev-preview-links a:hover {
  text-decoration: underline;
}

.developer-credit {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}

.developer-credit a {
  color: var(--primary-dark);
  text-decoration: none;
  font-weight: 700;
}

.developer-credit a:hover {
  text-decoration: underline;
}

.dashboard-footer {
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
}

.login-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.admin-form textarea,
.admin-form input[type="email"],
.admin-form input[type="file"] {
  width: 100%; padding: 0.6rem 0.85rem;
  border: 1px solid var(--border); border-radius: 10px;
  font-family: inherit; font-size: 0.88rem; font-weight: 600;
  background: #fff; transition: border-color 0.2s, box-shadow 0.2s;
}
.admin-form textarea { min-height: 120px; resize: vertical; line-height: 1.6; }
.admin-form textarea:focus,
.admin-form input[type="email"]:focus,
.admin-form input[type="file"]:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.12);
}

.contact-preview-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 0.65rem;
}
.contact-preview-list li {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  padding: 0.75rem 0.9rem; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--border);
}
.contact-preview-list a {
  color: var(--primary-dark); font-weight: 700; font-size: 0.88rem; text-decoration: none;
}

.contacts-list { display: flex; flex-direction: column; gap: 0.85rem; margin-bottom: 1rem; }
.contact-row {
  display: grid; grid-template-columns: 1fr 1fr auto; gap: 0.75rem; align-items: end;
  padding: 0.85rem; border-radius: 14px;
  background: var(--surface-2); border: 1px solid var(--border);
}
@media (max-width: 767px) {
  .contact-row { grid-template-columns: 1fr; }
  .contact-row .btn-contact-remove { justify-self: start; }
}
.contact-row .form-row { margin: 0; }
.btn-contact-remove {
  width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid #fecdd3; background: #fff1f2; color: #be123c;
  cursor: pointer; display: grid; place-items: center;
  transition: background 0.15s, border-color 0.15s;
}
.btn-contact-remove:hover { background: #ffe4e6; border-color: #fda4af; }
.panel-head .btn-sm { padding: 0.45rem 0.9rem; font-size: 0.82rem; }

.settings-stat-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem;
}
@media (max-width: 575px) { .settings-stat-grid { grid-template-columns: 1fr; } }
.settings-stat {
  text-align: center; padding: 1rem 0.75rem;
  border-radius: 14px; background: var(--surface-2);
  border: 1px solid var(--border);
}
.settings-stat-val {
  display: block; font-size: 1.5rem; font-weight: 800;
  color: var(--primary-dark); line-height: 1.2;
}
.settings-stat-lbl { font-size: 0.75rem; color: var(--muted); font-weight: 600; }

.site-preview { text-align: center; }
.site-preview-logo {
  width: 96px; height: 96px; margin: 0 auto 1rem;
  border-radius: 20px; overflow: hidden;
  border: 2px solid var(--border); background: #fff;
  display: grid; place-items: center;
}
.site-preview-logo img { width: 100%; height: 100%; object-fit: contain; }
.site-preview-logo-fallback {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; font-size: 2rem;
  display: flex; align-items: center; justify-content: center;
}
.site-preview h4 { margin: 0 0 0.75rem; font-size: 1.15rem; font-weight: 800; }
.site-preview p {
  margin: 0.35rem 0; font-size: 0.88rem; color: var(--muted);
  display: flex; align-items: center; justify-content: center; gap: 0.4rem;
}
.site-preview-about {
  margin-top: 1rem !important; padding-top: 1rem;
  border-top: 1px solid var(--border);
  text-align: right; line-height: 1.7; justify-content: flex-start !important;
}

/* ── Lab Files Page ── */
.lab-files-page { display: flex; flex-direction: column; gap: 1.35rem; }

.files-hero {
  position: relative; border-radius: 28px; overflow: hidden;
  border: 1px solid rgba(255,255,255,0.2);
  box-shadow: 0 24px 60px rgba(13,148,136,0.18);
}
.files-hero-bg {
  position: absolute; inset: 0;
  background:
    linear-gradient(135deg, #042f2e 0%, #0d9488 45%, #1e40af 100%);
}
.files-hero-bg::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(circle at 85% 15%, rgba(45,212,191,0.35), transparent 45%),
    radial-gradient(circle at 10% 90%, rgba(96,165,250,0.25), transparent 40%);
}
.files-hero-inner {
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; flex-wrap: wrap;
  padding: 2rem 2.25rem;
  color: #fff;
}
.files-back-link {
  display: inline-flex; align-items: center; gap: 0.4rem;
  color: rgba(255,255,255,0.75); font-size: 0.82rem; font-weight: 700;
  text-decoration: none; margin-bottom: 0.85rem; transition: color 0.2s;
}
.files-back-link:hover { color: #fff; }
.files-hero-badge {
  display: inline-flex; align-items: center; gap: 0.45rem;
  background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.18);
  padding: 0.35rem 0.85rem; border-radius: 99px;
  font-size: 0.75rem; font-weight: 700; margin-bottom: 0.75rem;
}
.files-hero-title {
  font-size: clamp(1.35rem, 2.5vw, 1.85rem); font-weight: 800;
  margin: 0 0 0.75rem; letter-spacing: -0.02em;
}
.files-hero-meta {
  display: flex; flex-wrap: wrap; gap: 0.65rem;
}
.files-hero-meta span {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12);
  padding: 0.35rem 0.75rem; border-radius: 10px;
  font-size: 0.8rem; font-weight: 600;
}
.files-hero-stats {
  display: flex; gap: 0.85rem; flex-wrap: wrap;
}
.files-stat {
  background: rgba(255,255,255,0.1); backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.15); border-radius: 18px;
  padding: 1rem 1.25rem; min-width: 110px; text-align: center;
}
.files-stat strong {
  display: block; font-size: 1.35rem; font-weight: 800; line-height: 1.2;
}
.files-stat span { font-size: 0.72rem; opacity: 0.8; font-weight: 600; }

.files-toolbar {
  background: rgba(255,255,255,0.85); backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.8); border-radius: 20px;
  padding: 1rem 1.25rem;
  box-shadow: 0 8px 30px rgba(15,23,42,0.06);
}
.files-search-form {
  display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap;
}
.files-search-field {
  flex: 1; min-width: 180px; position: relative;
  display: flex; align-items: center;
}
.files-search-field i {
  position: absolute; right: 14px; color: var(--muted); font-size: 0.9rem; pointer-events: none;
}
.files-search-field input {
  width: 100%; padding: 0.7rem 2.5rem 0.7rem 1rem;
  border: 1.5px solid var(--border); border-radius: 14px;
  font-family: inherit; font-size: 0.88rem; font-weight: 600;
  background: #fff; transition: border-color 0.2s, box-shadow 0.2s;
}
.files-search-field input:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(13,148,136,0.1);
}
.files-btn {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.7rem 1.25rem; border-radius: 14px;
  font-family: inherit; font-size: 0.88rem; font-weight: 700;
  cursor: pointer; text-decoration: none; border: none; transition: all 0.2s;
  white-space: nowrap;
}
.files-btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; box-shadow: 0 6px 20px rgba(13,148,136,0.25);
}
.files-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 28px rgba(13,148,136,0.3); color: #fff; }
.files-btn-ghost {
  background: var(--surface-2); color: var(--text); border: 1px solid var(--border);
}
.files-btn-ghost:hover { background: #fee2e2; color: #be123c; border-color: #fecdd3; }

.files-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}
.file-card {
  background: rgba(255,255,255,0.88); backdrop-filter: blur(14px);
  border: 1px solid rgba(226,232,240,0.9); border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 8px 28px rgba(15,23,42,0.05);
  transition: transform 0.22s, box-shadow 0.22s, border-color 0.22s;
  display: flex; flex-direction: column;
}
.file-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(13,148,136,0.12);
  border-color: rgba(13,148,136,0.25);
}
.file-card-top {
  display: flex; gap: 1rem; align-items: flex-start;
  padding: 1.25rem 1.25rem 1rem;
}
.file-card-footer {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  border-top: 1px solid rgba(226,232,240,0.9);
  background: linear-gradient(180deg, #fafbfc 0%, #f1f5f9 100%);
}
.file-act {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.3rem; padding: 0.85rem 0.5rem;
  border: none; background: transparent; cursor: pointer;
  text-decoration: none; font-family: inherit;
  transition: background 0.2s, color 0.2s;
  position: relative;
}
.file-act + .file-act,
.file-delete-form + .file-act,
.file-act + .file-delete-form {
  /* handled by grid */
}
.file-delete-form {
  margin: 0; padding: 0; display: contents;
}
.file-delete-form .file-act {
  width: 100%; height: 100%;
}
.file-act:not(:first-child)::before {
  content: "";
  position: absolute;
  right: 0; top: 20%; bottom: 20%;
  width: 1px;
  background: rgba(226,232,240,0.95);
}
.file-act-icon {
  width: 38px; height: 38px; border-radius: 12px;
  display: grid; place-items: center;
  font-size: 0.95rem;
  transition: transform 0.2s, background 0.2s, color 0.2s, box-shadow 0.2s;
}
.file-act-label {
  font-size: 0.68rem; font-weight: 800; letter-spacing: 0.02em;
  transition: color 0.2s;
}
.file-act.view .file-act-icon {
  background: rgba(13,148,136,0.1); color: var(--primary-dark);
}
.file-act.view .file-act-label { color: var(--primary-dark); }
.file-act.view:hover { background: rgba(13,148,136,0.06); }
.file-act.view:hover .file-act-icon {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; box-shadow: 0 6px 16px rgba(13,148,136,0.3);
  transform: translateY(-2px);
}
.file-act.download .file-act-icon {
  background: rgba(16,185,129,0.1); color: #047857;
}
.file-act.download .file-act-label { color: #047857; }
.file-act.download:hover { background: rgba(16,185,129,0.06); }
.file-act.download:hover .file-act-icon {
  background: linear-gradient(135deg, #10b981, #047857);
  color: #fff; box-shadow: 0 6px 16px rgba(16,185,129,0.3);
  transform: translateY(-2px);
}
.file-act.delete .file-act-icon {
  background: linear-gradient(135deg, #fff1f2, #ffe4e6);
  color: #e11d48;
  border: 1px solid rgba(225,29,72,0.15);
}
.file-act.delete .file-act-label { color: #be123c; }
.file-act.delete:hover { background: rgba(225,29,72,0.06); }
.file-act.delete:hover .file-act-icon {
  background: linear-gradient(135deg, #f43f5e, #e11d48);
  color: #fff; border-color: transparent;
  box-shadow: 0 6px 18px rgba(225,29,72,0.35);
  transform: translateY(-2px);
}
.file-act.delete:active .file-act-icon { transform: scale(0.95); }
.file-card-icon {
  width: 56px; height: 56px; flex-shrink: 0; position: relative;
  background: linear-gradient(135deg, #fee2e2, #fecaca);
  border-radius: 16px; display: grid; place-items: center;
  color: #dc2626; font-size: 1.5rem;
  box-shadow: 0 6px 16px rgba(220,38,38,0.15);
}
.file-num {
  position: absolute; top: -6px; left: -6px;
  width: 22px; height: 22px; border-radius: 8px;
  background: var(--primary); color: #fff;
  font-size: 0.68rem; font-weight: 800;
  display: grid; place-items: center;
}
.file-card-body { flex: 1; min-width: 0; }
.file-patient {
  font-size: 1rem; font-weight: 800; margin: 0 0 0.35rem;
  color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.file-name {
  font-size: 0.75rem; color: var(--muted); margin: 0 0 0.65rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600;
}
.file-meta {
  display: flex; flex-wrap: wrap; gap: 0.5rem 0.85rem;
  font-size: 0.72rem; color: var(--muted); font-weight: 600;
}
.file-meta span { display: inline-flex; align-items: center; gap: 0.3rem; }

.files-empty {
  text-align: center; padding: 4rem 2rem;
  background: rgba(255,255,255,0.75); backdrop-filter: blur(14px);
  border: 2px dashed rgba(13,148,136,0.2); border-radius: 28px;
}
.files-empty-icon {
  width: 88px; height: 88px; margin: 0 auto 1.25rem;
  background: linear-gradient(135deg, var(--primary-soft), #ccfbf1);
  border-radius: 24px; display: grid; place-items: center;
  font-size: 2.2rem; color: var(--primary);
  box-shadow: 0 12px 32px rgba(13,148,136,0.12);
}
.files-empty h3 { font-size: 1.25rem; font-weight: 800; margin: 0 0 0.5rem; color: var(--text); }
.files-empty p { color: var(--muted); font-size: 0.9rem; font-weight: 600; line-height: 1.7; max-width: 420px; margin: 0 auto; }
.files-empty code {
  background: var(--primary-soft); color: var(--primary-dark);
  padding: 0.15rem 0.5rem; border-radius: 6px; font-size: 0.82rem;
}

@media (max-width: 767px) {
  .files-hero-inner { padding: 1.5rem; }
  .files-hero-stats { width: 100%; }
  .files-stat { flex: 1; min-width: 0; }
  .patient-group-head { flex-wrap: wrap; }
  .patient-file-row { flex-wrap: wrap; }
  .patient-file-actions { width: 100%; justify-content: flex-end; }
}

/* ── Patient Groups ── */
.patient-groups { display: flex; flex-direction: column; gap: 1.25rem; }

.patient-group {
  background: rgba(255,255,255,0.9); backdrop-filter: blur(14px);
  border: 1px solid rgba(226,232,240,0.95); border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 10px 32px rgba(15,23,42,0.06);
}
.patient-group-head {
  display: flex; align-items: center; gap: 1rem;
  padding: 1.25rem 1.5rem;
  background: linear-gradient(135deg, rgba(13,148,136,0.06), rgba(59,130,246,0.04));
  border-bottom: 1px solid rgba(226,232,240,0.9);
}
.patient-group-avatar {
  width: 48px; height: 48px; flex-shrink: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; font-weight: 800; font-size: 1.1rem;
  display: grid; place-items: center;
  box-shadow: 0 6px 16px rgba(13,148,136,0.25);
}
.patient-group-info { flex: 1; min-width: 0; }
.patient-group-info h3 {
  margin: 0 0 0.25rem; font-size: 1.05rem; font-weight: 800;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.patient-group-info p {
  margin: 0; font-size: 0.78rem; color: var(--muted); font-weight: 600;
}
.patient-today-badge {
  display: inline-flex; align-items: center; gap: 0.35rem;
  background: #ecfdf5; color: #047857;
  border: 1px solid #a7f3d0; border-radius: 99px;
  padding: 0.3rem 0.75rem; font-size: 0.72rem; font-weight: 800;
  white-space: nowrap;
}
.patient-today-badge i { font-size: 0.45rem; }
.patient-files-count {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--primary-soft); color: var(--primary-dark);
  font-size: 0.85rem; font-weight: 800;
  display: grid; place-items: center; flex-shrink: 0;
}

.patient-date-section { padding: 0 1rem 1rem; }
.patient-date-section:first-of-type { padding-top: 1rem; }
.patient-date-head {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.55rem 0.85rem; margin-bottom: 0.5rem;
  background: #f8fafc; border-radius: 12px;
  font-size: 0.82rem; font-weight: 800; color: var(--text);
  border: 1px solid rgba(226,232,240,0.8);
}
.patient-date-head i { color: var(--primary); }
.patient-date-head em {
  margin-right: auto; font-style: normal;
  font-size: 0.72rem; color: var(--muted); font-weight: 700;
}

.patient-files-list { display: flex; flex-direction: column; gap: 0.45rem; }
.patient-file-row {
  display: flex; align-items: center; gap: 0.85rem;
  padding: 0.75rem 0.85rem;
  background: #fff; border: 1px solid rgba(226,232,240,0.9);
  border-radius: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.patient-file-row:hover {
  border-color: rgba(13,148,136,0.25);
  box-shadow: 0 4px 16px rgba(13,148,136,0.08);
}
.patient-file-icon {
  width: 40px; height: 40px; flex-shrink: 0;
  border-radius: 11px;
  background: linear-gradient(135deg, #fee2e2, #fecaca);
  color: #dc2626; display: grid; place-items: center; font-size: 1rem;
}
.patient-file-info { flex: 1; min-width: 0; }
.patient-file-name {
  margin: 0 0 0.2rem; font-size: 0.8rem; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text);
}
.patient-file-meta {
  font-size: 0.72rem; color: var(--muted); font-weight: 600;
  display: inline-flex; align-items: center; gap: 0.25rem;
}
.patient-file-actions {
  display: flex; align-items: center; gap: 0.35rem; flex-shrink: 0;
}
.patient-file-actions .file-delete-form {
  margin: 0; padding: 0; display: flex;
}
.pact {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  border: 1px solid var(--border); background: var(--surface-2);
  color: var(--muted); text-decoration: none;
  cursor: pointer; font-family: inherit; font-size: 0.85rem;
  transition: all 0.15s;
}
.pact.view:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.pact.download:hover { background: #10b981; color: #fff; border-color: #10b981; }
.pact.delete:hover { background: #ef4444; color: #fff; border-color: #ef4444; }

/* Online labs live page */
.hero-online {
  margin-bottom: 1.5rem;
}

.hero-online-desc {
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
  max-width: 640px;
  line-height: 1.7;
}

.hero-badge-live {
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
  border-color: rgba(16, 185, 129, 0.25);
}

.live-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.1);
  color: #047857;
  border-color: rgba(16, 185, 129, 0.2);
}

.pulse-sm {
  width: 7px;
  height: 7px;
}

.stat-foot-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 700;
  transition: color 0.15s;
}

.stat-foot-link:hover {
  color: var(--primary-dark);
}

.online-labs-panel .panel-body {
  padding: 1rem;
}

.online-labs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.85rem;
}

.online-lab-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.95rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.online-lab-card:hover {
  border-color: rgba(16, 185, 129, 0.35);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.online-lab-avatar {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.1rem;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(13, 148, 136, 0.18);
}

.online-lab-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.online-lab-body strong {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.online-lab-meta {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.online-lab-meta code {
  font-size: 0.75rem;
  background: var(--surface-2);
  padding: 1px 6px;
  border-radius: 6px;
}

.online-lab-seen {
  font-size: 0.72rem;
  color: #64748b;
  font-weight: 600;
}

.online-lab-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
  font-size: 0.72rem;
  font-weight: 800;
  flex-shrink: 0;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.online-labs-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--muted);
}

.online-labs-empty i {
  font-size: 2.5rem;
  color: #cbd5e1;
  margin-bottom: 0.75rem;
}

.online-labs-empty strong {
  display: block;
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 0.35rem;
}

.online-labs-empty p {
  font-size: 0.85rem;
  font-weight: 600;
}

@media (max-width: 640px) {
  .online-lab-status span:not(.pulse) {
    display: none;
  }

  .online-lab-status {
    width: 28px;
    height: 28px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
  }
}

.stats-grid-online {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1200px) {
  .stats-grid-online {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 576px) {
  .stats-grid-online {
    grid-template-columns: 1fr;
  }
}

.online-managers-panel {
  margin-top: 1.5rem;
}

.online-manager-avatar {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

.online-manager-status {
  background: rgba(245, 158, 11, 0.12);
  color: #b45309;
  border-color: rgba(245, 158, 11, 0.25);
}

.online-manager-card:hover {
  border-color: rgba(245, 158, 11, 0.35);
}

/* Region manager — assigned labs page */
.region-labs-stats {
  margin-bottom: 1.25rem;
}

.region-labs-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem;
  padding-top: 0.5rem !important;
  padding-bottom: 0.5rem !important;
  border-bottom: 1px solid var(--border);
}

.region-labs-search-wrap {
  flex: 1;
  min-width: min(100%, 280px);
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.85rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.region-labs-search-wrap:focus-within {
  border-color: rgba(13, 148, 136, 0.4);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

.region-labs-search-wrap > i {
  color: var(--muted);
  font-size: 0.85rem;
  flex-shrink: 0;
}

.region-labs-search-wrap input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  outline: none;
}

.region-labs-search-wrap input::placeholder {
  color: #94a3b8;
  font-weight: 500;
}

.region-labs-clear {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.06);
  color: var(--muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.region-labs-clear:hover {
  background: rgba(225, 29, 72, 0.1);
  color: var(--danger);
}

.region-labs-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.region-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.region-filter-btn:hover {
  border-color: rgba(13, 148, 136, 0.25);
  color: var(--text);
}

.region-filter-btn.is-active {
  background: var(--primary-soft);
  border-color: rgba(13, 148, 136, 0.3);
  color: var(--primary-dark);
}

.region-labs-hint {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  margin-bottom: 0.75rem;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.18);
  border-radius: 12px;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.6;
}

.region-labs-hint i {
  color: #3b82f6;
  margin-top: 3px;
  flex-shrink: 0;
}

.region-labs-loading {
  text-align: center;
  padding: 2rem;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.9rem;
}

.region-labs-error {
  background: rgba(225, 29, 72, 0.06);
  border: 1px solid rgba(225, 29, 72, 0.15);
  border-radius: 12px;
  padding: 2rem 1.5rem;
}

.region-labs-error i {
  color: var(--danger);
}

.region-lab-card.is-filtered-out,
.region-lab-card[hidden] {
  display: none !important;
}

.region-labs-grid.is-empty {
  display: none;
}

.region-labs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 0.9rem;
}

.region-lab-card {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.region-lab-card:hover {
  border-color: rgba(13, 148, 136, 0.22);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.region-lab-card.is-online {
  border-color: rgba(16, 185, 129, 0.28);
  background: linear-gradient(180deg, rgba(236, 253, 245, 0.55) 0%, var(--surface) 100%);
}

.region-lab-card-top {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.region-lab-avatar {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.15rem;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.2);
}

.region-lab-card.is-online .region-lab-avatar {
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.region-lab-head {
  flex: 1;
  min-width: 0;
}

.region-lab-head strong {
  display: block;
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.35;
  word-break: break-word;
}

.region-lab-user {
  display: block;
  margin-top: 3px;
  font-size: 0.78rem;
}

.region-lab-user code {
  background: var(--surface-2);
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 0.75rem;
}

.region-lab-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  flex-shrink: 0;
  background: rgba(100, 116, 139, 0.1);
  color: #64748b;
  border: 1px solid rgba(100, 116, 139, 0.15);
}

.region-lab-status.is-on {
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
  border-color: rgba(16, 185, 129, 0.22);
}

.region-lab-meta-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 0;
  padding: 0.65rem 0.75rem;
  background: var(--surface-2);
  border-radius: 12px;
  border: 1px solid var(--border);
}

.region-lab-meta-list li {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  min-width: 0;
}

.region-lab-meta-list li i {
  width: 18px;
  text-align: center;
  color: var(--primary);
  flex-shrink: 0;
  font-size: 0.75rem;
}

.region-lab-meta-list li span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.region-lab-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: auto;
}

.region-lab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 0.65rem;
  border-radius: 11px;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  transition: all 0.15s;
}

.region-lab-btn-open {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.region-lab-btn-open:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: #fff;
}

.region-lab-btn-copy:hover {
  border-color: rgba(13, 148, 136, 0.35);
  color: var(--primary-dark);
  background: var(--primary-soft);
}

.region-lab-btn-copy.copied {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.3);
  color: #047857;
}

.region-labs-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--muted);
}

.region-labs-empty i {
  font-size: 2.5rem;
  color: #cbd5e1;
  margin-bottom: 0.75rem;
}

.region-labs-empty strong {
  display: block;
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 0.35rem;
}

.region-labs-empty p {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

@media (max-width: 640px) {
  .region-labs-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .region-labs-filters {
    justify-content: center;
  }

  .region-labs-grid {
    grid-template-columns: 1fr;
  }

  .region-lab-status span:not(.pulse) {
    display: none;
  }

  .region-lab-status.is-on {
    width: 26px;
    height: 26px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
  }
}

/* ── Desktop upload monitor (dashboard) ── */
.upload-monitor-panel {
  margin-bottom: 1.25rem;
  border-color: rgba(16, 185, 129, 0.18);
  box-shadow: 0 10px 30px rgba(13, 148, 136, 0.08);
}

.upload-monitor-panel .panel-head {
  flex-wrap: wrap;
  gap: 0.75rem;
}

.upload-monitor-head-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.upload-live-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  border: 1px solid transparent;
}

.upload-live-tag.is-active {
  color: #047857;
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.28);
}

.upload-live-tag.is-active .pulse {
  background: #10b981;
}

.upload-live-tag.is-idle {
  color: #64748b;
  background: #f1f5f9;
  border-color: #e2e8f0;
}

.upload-live-tag.is-idle .pulse {
  background: #94a3b8;
  animation: none;
}

.upload-monitor-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(13, 148, 136, 0.04), transparent);
}

.upload-monitor-stat {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.upload-monitor-stat span {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
}

.upload-monitor-stat strong {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text);
}

.upload-monitor-stat small {
  font-size: 0.72rem;
  color: var(--muted);
}

@media (max-width: 900px) {
  .upload-monitor-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .upload-monitor-stats {
    grid-template-columns: 1fr;
  }
}
