@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Prompt:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,300;1,400&display=swap');

/* ==========================================================================
       Custom Admin Portal Specific Styles (Ultra-Modern Health Glassmorphism)
       ========================================================================== */
    :root {
      --admin-sidebar-w: 280px;
      --font-base: 'Prompt', 'Inter', 'Noto Sans Thai', 'Sukhumvit Set', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
      --font-latin: 'Inter', 'Prompt', sans-serif;
    }

    body, html, button, input, select, textarea, table, th, td, h1, h2, h3, h4, h5, h6, .brand-title, .brand-sub, .admin-tab-btn, .btn-modern-primary, .btn-modern-secondary, .logs-modern-table *, .log-title-text, .log-rec-name, .log-rec-sub, .log-filter-pill, .premium-custom-trigger, .custom-trigger-label, .custom-trigger-sub, .client-pill, .bot-badge-pill {
      font-family: var(--font-base) !important;
    }

    /* Preserve Font Awesome icons */
    .fa, .fas, .fa-solid, .fa::before, .fas::before, .fa-solid::before {
      font-family: "Font Awesome 6 Free" !important;
      font-weight: 900 !important;
    }
    .fa-regular, .far, .fa-regular::before, .far::before {
      font-family: "Font Awesome 6 Free" !important;
      font-weight: 400 !important;
    }
    .fa-brands, .fab, .fa-brands::before, .fab::before {
      font-family: "Font Awesome 6 Brands" !important;
      font-weight: 400 !important;
    }

    body {
      min-height: 100vh;
      display: flex;
      flex-direction: column;
      background-color: var(--bg-body);
      color: var(--text-primary);
    }

    .admin-layout {
      display: flex;
      flex-direction: column;
      flex: 1;
      width: 100%;
    }

    /* Top Navigation (Compact & Sleek Executive Navbar) */
    .admin-nav {
      position: sticky;
      top: 0;
      z-index: 100;
      background: var(--bg-surface-glass);
      -webkit-backdrop-filter: blur(20px);
      backdrop-filter: blur(20px);
      border-bottom: 1px solid var(--border-color);
      padding: 0 20px;
      height: 56px;
      display: flex;
      align-items: center;
      justify-content: space-between;
    }

    .admin-nav-left {
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .admin-nav .brand {
      display: flex;
      align-items: center;
      gap: 10px;
      text-decoration: none;
    }

    .admin-nav .brand-logo-frame {
      width: 34px;
      height: 34px;
      border-radius: 10px;
      padding: 2.5px;
    }

    .admin-nav .brand-title {
      font-size: 1.05rem;
      line-height: 1.15;
    }

    .admin-nav .brand-sub {
      font-size: 0.68rem;
    }

    .admin-badge-sso {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      padding: 3px 9px;
      background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(79, 70, 229, 0.15));
      border: 1px solid rgba(59, 130, 246, 0.35);
      border-radius: var(--radius-full);
      font-size: 0.70rem;
      font-weight: 700;
      color: #2563eb;
    }

    [data-theme="dark"] .admin-badge-sso {
      color: #60a5fa;
      border-color: rgba(96, 165, 250, 0.35);
    }

    .admin-nav-right {
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .admin-nav .btn-modern-secondary,
    .admin-nav .btn-preview-link {
      padding: 6px 12px;
      font-size: 0.78rem;
      border-radius: 9px;
      gap: 6px;
      display: inline-flex;
      align-items: center;
      text-decoration: none;
      white-space: nowrap;
    }

    .admin-nav .theme-toggle-btn {
      width: 32px;
      height: 32px;
      font-size: 0.88rem;
    }

    @media (max-width: 640px) {
      .admin-nav {
        padding: 0 12px !important;
        height: 48px !important;
      }
      .admin-nav-left {
        gap: 8px !important;
        min-width: 0 !important;
        flex: 1 !important;
      }
      .admin-nav .brand {
        gap: 8px !important;
        min-width: 0 !important;
        flex-shrink: 0 !important;
      }
      .admin-nav .brand-logo-frame {
        width: 30px !important;
        height: 30px !important;
        flex-shrink: 0 !important;
      }
      .admin-nav .brand-text-group {
        min-width: 0 !important;
        flex-shrink: 0 !important;
      }
      .admin-nav .brand-title {
        font-size: 1.05rem !important;
        white-space: nowrap !important;
        overflow: visible !important;
      }
      .admin-nav .brand-sub {
        display: none !important;
      }
      .admin-badge-sso {
        display: none !important;
      }
      .admin-nav-right {
        gap: 6px !important;
        flex-shrink: 0 !important;
      }
      .admin-nav .btn-preview-link {
        width: 32px !important;
        height: 32px !important;
        padding: 0 !important;
        justify-content: center !important;
        border-radius: 8px !important;
      }
      .admin-nav .btn-preview-link .btn-text-preview {
        display: none !important;
      }
      .admin-nav .theme-toggle-btn {
        width: 32px !important;
        height: 32px !important;
        font-size: 0.85rem !important;
      }
    }

    .user-pill {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 3px 8px 3px 4px;
      background: var(--bg-card);
      border: 1px solid var(--border-color);
      border-radius: var(--radius-full);
      box-shadow: var(--shadow-sm);
    }

    .user-avatar-circle {
      width: 26px;
      height: 26px;
      border-radius: 50%;
      background: linear-gradient(135deg, #2563eb, #7c3aed);
      color: #fff;
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: 700;
      font-size: 0.76rem;
    }

    .user-pill-info {
      display: flex;
      flex-direction: column;
      line-height: 1.15;
    }

    .user-pill-name {
      font-size: 0.78rem;
      font-weight: 700;
      color: var(--text-primary);
    }

    .user-pill-role {
      font-size: 0.65rem;
      color: #10b981;
      font-weight: 600;
    }

    .admin-nav .btn-action-icon {
      width: 26px;
      height: 26px;
      font-size: 0.72rem;
      border-radius: 7px;
    }

    /* Content Area */
    .admin-main {
      padding: 32px 24px 60px;
      max-width: 1400px;
      width: 100%;
      margin: 0 auto;
      flex: 1;
    }

    .admin-header-row {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      flex-wrap: wrap;
      gap: 20px;
      margin-bottom: 28px;
    }

    .admin-title-group h1 {
      font-size: 1.85rem;
      font-weight: 800;
      margin: 0 0 6px;
      display: flex;
      align-items: center;
      gap: 12px;
      color: var(--text-primary);
    }

    .admin-title-group p {
      font-size: 0.95rem;
      color: var(--text-secondary);
      margin: 0;
    }

    .admin-header-actions {
      display: flex;
      align-items: center;
      gap: 12px;
    }

    /* Stats Grid */
    .admin-stats-grid {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 18px;
      margin-bottom: 30px;
    }

    .stat-card {
      background: var(--bg-card);
      border: 1px solid var(--border-color);
      border-radius: 14px;
      padding: 18px 20px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
      transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
      position: relative;
      overflow: hidden;
    }

    .stat-card:hover {
      transform: translateY(-2px);
      box-shadow: 0 8px 20px -4px rgba(0, 0, 0, 0.07);
      border-color: #cbd5e1;
    }

    .stat-card-info {
      display: flex;
      flex-direction: column;
      gap: 3px;
    }

    .stat-card-title {
      font-size: 0.80rem;
      font-weight: 600;
      color: var(--text-secondary);
      letter-spacing: 0.01em;
    }

    .stat-card-value {
      font-size: 1.85rem;
      font-weight: 800;
      font-family: 'Plus Jakarta Sans', sans-serif;
      letter-spacing: -0.02em;
      color: var(--text-primary);
      line-height: 1.1;
    }

    .stat-card-icon-box {
      width: 40px;
      height: 40px;
      border-radius: 11px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 1.15rem;
      flex-shrink: 0;
    }

    .stat-icon-total { background: rgba(59, 130, 246, 0.12); color: #2563eb; }
    .stat-icon-open { background: rgba(16, 185, 129, 0.12); color: #059669; }
    .stat-icon-maint { background: rgba(245, 158, 11, 0.12); color: #d97706; }
    .stat-icon-soon { background: rgba(139, 92, 246, 0.12); color: #7c3aed; }

    /* Control Bar & Filter */
    .admin-control-bar {
      background: var(--bg-card);
      border: 1px solid var(--border-color);
      border-radius: 14px;
      padding: 14px 18px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-wrap: wrap;
      gap: 14px;
      margin-bottom: 22px;
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    }

    .search-box {
      position: relative;
      flex: 1;
      min-width: 260px;
      max-width: 400px;
    }

    .search-box i {
      position: absolute;
      left: 13px;
      top: 50%;
      transform: translateY(-50%);
      color: var(--text-muted);
      font-size: 0.88rem;
    }

    .search-input {
      width: 100%;
      padding: 8px 16px 8px 36px;
      background: var(--bg-surface);
      border: 1px solid var(--border-color);
      border-radius: 9px;
      font-size: 0.86rem;
      color: var(--text-primary);
      font-family: inherit;
      outline: none;
      transition: all 0.2s ease;
    }

    .search-input:focus {
      border-color: var(--primary);
      box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
    }

    .status-filter-pills {
      display: flex;
      align-items: center;
      gap: 6px;
      flex-wrap: wrap;
    }

    .filter-btn {
      padding: 6px 14px;
      border-radius: 8px;
      border: 1px solid var(--border-color);
      background: var(--bg-surface);
      color: var(--text-secondary);
      font-size: 0.80rem;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.2s ease;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      font-family: inherit;
    }

    .filter-btn:hover {
      border-color: #cbd5e1;
      color: var(--text-primary);
      background: var(--bg-card);
    }

    .filter-btn.active {
      background: var(--primary);
      border-color: var(--primary);
      color: #ffffff;
      box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
    }

    /* Table Container */
    .admin-table-card {
      background: var(--bg-card);
      border: 1px solid var(--border-color);
      border-radius: var(--radius-xl);
      overflow: hidden;
      box-shadow: var(--shadow-sm);
    }

    .admin-table {
      width: 100%;
      border-collapse: collapse;
      text-align: left;
    }

    .admin-table th {
      background: var(--bg-surface);
      padding: 14px 18px;
      font-size: 0.8rem;
      font-weight: 700;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 0.05em;
      border-bottom: 1px solid var(--border-color);
      white-space: nowrap;
    }

    .admin-table td {
      padding: 18px;
      border-bottom: 1px solid var(--border-color);
      vertical-align: middle;
      font-size: 0.9rem;
    }

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

    .admin-table tr:hover td {
      background-color: var(--bg-surface);
    }

    /* App Cell Component - Luxury Tech Icon & Meta */
    .app-cell {
      display: flex;
      align-items: center;
      gap: 16px;
    }

    .app-icon-thumb {
      width: 48px;
      height: 48px;
      border-radius: 14px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 1.35rem;
      color: #ffffff !important;
      flex-shrink: 0;
      background: var(--tile-gradient, linear-gradient(135deg, #2563eb, #1d4ed8));
      box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12), inset 0 1px 1px rgba(255, 255, 255, 0.35);
      border: 1px solid rgba(255, 255, 255, 0.2);
      transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .app-icon-thumb:hover {
      transform: translateY(-2px) scale(1.06);
      box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
    }

    .app-info {
      display: flex;
      flex-direction: column;
      gap: 3px;
    }

    .app-info-title {
      font-weight: 700;
      font-size: 0.98rem;
      color: var(--text-primary);
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .app-info-desc {
      font-size: 0.8rem;
      color: var(--text-secondary);
      max-width: 360px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      line-height: 1.4;
    }

    .app-url-link {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      font-size: 0.82rem;
      font-weight: 600;
      color: var(--primary);
      text-decoration: none;
      word-break: break-all;
      transition: color 0.15s ease;
    }

    .app-url-link:hover {
      color: #1d4ed8;
      text-decoration: underline;
    }

    /* Segmented Status Toggle - Luxury Pill Group */
    .status-toggle-group {
      display: inline-flex;
      padding: 4px;
      background: var(--bg-surface);
      border: 1.5px solid var(--border-color);
      border-radius: 9999px;
      gap: 3px;
      box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.04);
    }

    .status-btn {
      padding: 5px 13px;
      border-radius: 9999px;
      border: none;
      background: transparent;
      font-size: 0.77rem;
      font-weight: 700;
      cursor: pointer;
      transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
      display: inline-flex;
      align-items: center;
      gap: 5px;
      font-family: inherit;
      color: var(--text-muted);
      white-space: nowrap;
    }

    .status-btn:hover {
      color: var(--text-primary);
      background: rgba(0, 0, 0, 0.04);
    }

    [data-theme="dark"] .status-btn:hover {
      background: rgba(255, 255, 255, 0.06);
    }

    .status-btn.active.open {
      background: linear-gradient(135deg, #10b981 0%, #059669 100%);
      color: #ffffff;
      box-shadow: 0 2px 10px rgba(16, 185, 129, 0.4);
    }

    .status-btn.active.maintenance {
      background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
      color: #ffffff;
      box-shadow: 0 2px 10px rgba(245, 158, 11, 0.4);
    }

    .status-btn.active.coming_soon {
      background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
      color: #ffffff;
      box-shadow: 0 2px 10px rgba(139, 92, 246, 0.4);
    }

    .status-notice-badge {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      margin-top: 6px;
      padding: 4px 10px;
      border-radius: 8px;
      background: rgba(245, 158, 11, 0.12);
      border: 1px solid rgba(245, 158, 11, 0.35);
      color: #d97706;
      font-size: 0.74rem;
      font-weight: 600;
      max-width: 260px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    [data-theme="dark"] .status-notice-badge {
      color: #fbbf24;
      background: rgba(245, 158, 11, 0.18);
    }

    /* Action Buttons in Row */
    .row-actions {
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .btn-action-icon {
      width: 34px;
      height: 34px;
      border-radius: 10px;
      border: 1px solid var(--border-color);
      background: var(--bg-surface);
      color: var(--text-secondary);
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: var(--transition);
      font-size: 0.85rem;
    }

    .btn-action-icon:hover {
      border-color: var(--primary);
      color: var(--primary);
      background: var(--bg-card);
      transform: translateY(-2px);
    }

    .btn-action-icon.btn-danger:hover {
      border-color: #ef4444;
      color: #ef4444;
      background: rgba(239, 68, 68, 0.08);
    }

    /* Primary & Outline Buttons - Sleek Executive Standard */
    .btn-modern-primary {
      display: inline-flex;
      align-items: center;
      gap: 7px;
      padding: 8px 16px;
      background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
      color: #ffffff;
      border: 1px solid rgba(255, 255, 255, 0.12);
      border-radius: 10px;
      font-size: 0.84rem;
      font-weight: 600;
      font-family: inherit;
      cursor: pointer;
      box-shadow: 0 1px 2px rgba(37, 99, 235, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.15);
      transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
      text-decoration: none;
      white-space: nowrap;
    }

    .btn-modern-primary:hover {
      background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
      transform: translateY(-1px);
      box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
    }

    .btn-modern-secondary {
      display: inline-flex;
      align-items: center;
      gap: 7px;
      padding: 8px 15px;
      background: var(--bg-surface);
      color: var(--text-primary);
      border: 1px solid var(--border-color);
      border-radius: 10px;
      font-size: 0.84rem;
      font-weight: 600;
      font-family: inherit;
      cursor: pointer;
      box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
      transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
      text-decoration: none;
      white-space: nowrap;
    }

    .btn-modern-secondary:hover {
      border-color: #cbd5e1;
      background: var(--bg-card);
      color: var(--text-primary);
      transform: translateY(-1px);
      box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    }

    .btn-sm {
      padding: 6px 12px !important;
      font-size: 0.78rem !important;
      border-radius: 8px !important;
    }

    /* Modal System */
    .admin-modal-overlay {
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, 0.65);
      -webkit-backdrop-filter: blur(8px);
      backdrop-filter: blur(8px);
      z-index: 2000;
      display: none;
      align-items: center;
      justify-content: center;
      padding: 20px;
      opacity: 0;
      transition: opacity 0.25s ease;
    }

    .admin-modal-overlay.active,
    .admin-modal-overlay.is-active {
      display: flex;
      opacity: 1;
    }

    .admin-modal-container {
      background: var(--bg-card);
      border: 1px solid var(--border-color);
      border-radius: var(--radius-2xl);
      max-width: 960px;
      width: 100%;
      max-height: 90vh;
      overflow-y: auto;
      box-shadow: var(--shadow-xl);
      display: flex;
      flex-direction: column;
      animation: modalPop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }

    @keyframes modalPop {
      0% { transform: scale(0.95); opacity: 0; }
      100% { transform: scale(1); opacity: 1; }
    }

    .modal-header {
      padding: 20px 26px;
      border-bottom: 1px solid var(--border-color);
      display: flex;
      align-items: center;
      justify-content: space-between;
    }

    .modal-title {
      font-size: 1.25rem;
      font-weight: 800;
      color: var(--text-primary);
      display: flex;
      align-items: center;
      gap: 10px;
      margin: 0;
    }

    .modal-body {
      padding: 26px;
      display: grid;
      grid-template-columns: 1.2fr 0.8fr;
      gap: 28px;
    }

    @media (max-width: 860px) {
      .modal-body {
        grid-template-columns: 1fr;
      }
    }

    .modal-footer {
      padding: 18px 26px;
      border-top: 1px solid var(--border-color);
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 12px;
      background: var(--bg-surface);
    }

    /* Form Fields */
    .form-group {
      margin-bottom: 18px;
    }

    .form-label {
      display: block;
      font-size: 0.85rem;
      font-weight: 700;
      color: var(--text-primary);
      margin-bottom: 7px;
    }

    .form-label span.req {
      color: #ef4444;
    }

    .form-input, .form-textarea, .form-select {
      width: 100%;
      padding: 11px 16px;
      background: var(--bg-surface);
      border: 1px solid var(--border-color);
      border-radius: var(--radius-md);
      font-size: 0.9rem;
      color: var(--text-primary);
      font-family: inherit;
      outline: none;
      transition: var(--transition);
      box-sizing: border-box;
    }

    .form-input:focus, .form-textarea:focus, .form-select:focus {
      border-color: var(--primary);
      box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
    }

    .form-hint {
      font-size: 0.74rem;
      color: var(--text-muted);
      margin-top: 5px;
    }

    /* Icon Quick Picker Grid */
    .icon-picker-grid {
      display: grid;
      grid-template-columns: repeat(8, 1fr);
      gap: 8px;
      max-height: 120px;
      overflow-y: auto;
      padding: 8px;
      background: var(--bg-surface);
      border: 1px solid var(--border-color);
      border-radius: var(--radius-md);
      margin-top: 8px;
    }

    .icon-pick-btn {
      width: 36px;
      height: 36px;
      border-radius: 8px;
      border: 1px solid var(--border-color);
      background: var(--bg-card);
      color: var(--text-primary);
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: var(--transition);
      font-size: 1rem;
    }

    .icon-pick-btn:hover, .icon-pick-btn.selected {
      border-color: var(--primary);
      background: var(--primary);
      color: #ffffff;
      transform: scale(1.1);
    }

    /* Color Palette Picker */
    .color-picker-flex {
      display: flex;
      align-items: center;
      gap: 10px;
      flex-wrap: wrap;
      margin-top: 8px;
    }

    .color-swatch-btn {
      width: 36px;
      height: 36px;
      border-radius: 10px;
      border: 2px solid transparent;
      cursor: pointer;
      transition: var(--transition);
      position: relative;
    }

    .color-swatch-btn.selected {
      border-color: #ffffff;
      box-shadow: 0 0 0 3px var(--primary);
      transform: scale(1.1);
    }

    /* Live Preview Card in Modal */
    .live-preview-box {
      display: flex;
      flex-direction: column;
      gap: 14px;
      position: sticky;
      top: 10px;
    }

    .preview-header-label {
      font-size: 0.8rem;
      font-weight: 700;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 0.06em;
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .live-preview-card-wrap {
      padding: 20px;
      background: var(--bg-surface);
      border: 1px dashed var(--border-color);
      border-radius: var(--radius-2xl);
    }

    /* State Screens (Login & Unauthorized) - Executive Modern Standard */
    #unauthorizedView,
    #dashboardView {
      display: none;
    }

    .state-screen-container {
      display: flex;
      align-items: center;
      justify-content: center;
      min-height: calc(100vh - 80px);
      padding: 30px 16px;
      position: relative;
      width: 100%;
    }

    .state-card,
    .admin-gateway-card {
      position: relative;
      background: var(--bg-card);
      border: 1px solid var(--border-color);
      border-radius: 28px;
      padding: 38px 32px 32px;
      max-width: 480px;
      width: 100%;
      text-align: center;
      box-shadow: 0 20px 48px -12px rgba(15, 23, 42, 0.12), 0 0 1px 1px rgba(59, 130, 246, 0.06);
      -webkit-backdrop-filter: blur(20px);
      backdrop-filter: blur(20px);
      transition: transform 0.25s ease, box-shadow 0.25s ease;
      overflow: hidden;
    }

    .admin-gateway-card::before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      height: 4px;
      background: linear-gradient(90deg, #2563eb, #6366f1, #38bdf8);
    }

    .admin-gateway-card.card-denied::before {
      background: linear-gradient(90deg, #ef4444, #f59e0b, #ec4899);
    }

    [data-theme="dark"] .state-card,
    [data-theme="dark"] .admin-gateway-card {
      background: rgba(18, 25, 43, 0.94);
      border-color: rgba(59, 130, 246, 0.22);
      box-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.7), 0 0 35px -5px rgba(59, 130, 246, 0.15);
    }

    /* Security Gateway Pill Badge */
    .gateway-pill-badge {
      display: inline-flex;
      align-items: center;
      gap: 7px;
      padding: 5px 14px;
      border-radius: var(--radius-full);
      font-size: 0.72rem;
      font-weight: 800;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: #2563eb;
      background: rgba(37, 99, 235, 0.08);
      border: 1px solid rgba(37, 99, 235, 0.2);
      margin-bottom: 22px;
      -webkit-user-select: none;
      -moz-user-select: none;
      -ms-user-select: none;
      user-select: none;
    }

    .gateway-pill-badge.badge-danger {
      color: #dc2626;
      background: rgba(220, 38, 38, 0.08);
      border-color: rgba(220, 38, 38, 0.25);
    }

    [data-theme="dark"] .gateway-pill-badge {
      color: #60a5fa;
      background: rgba(59, 130, 246, 0.15);
      border-color: rgba(96, 165, 250, 0.3);
    }

    [data-theme="dark"] .gateway-pill-badge.badge-danger {
      color: #f87171;
      background: rgba(239, 68, 68, 0.15);
      border-color: rgba(239, 68, 68, 0.3);
    }

    /* Gateway Security Emblem */
    .gateway-emblem-wrapper {
      position: relative;
      width: 86px;
      height: 86px;
      margin: 0 auto 20px;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .emblem-halo-pulse {
      position: absolute;
      inset: -6px;
      border-radius: 28px;
      background: radial-gradient(circle, rgba(37, 99, 235, 0.28) 0%, rgba(99, 102, 241, 0) 70%);
      animation: emblemPulse 3s infinite ease-in-out;
    }

    .emblem-halo-pulse.halo-danger {
      background: radial-gradient(circle, rgba(239, 68, 68, 0.28) 0%, rgba(245, 158, 11, 0) 70%);
    }

    .gateway-emblem-core {
      position: relative;
      width: 72px;
      height: 72px;
      border-radius: 22px;
      background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 50%, #4f46e5 100%);
      color: #ffffff;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 1.9rem;
      box-shadow: 0 12px 24px -6px rgba(37, 99, 235, 0.42), inset 0 1px 1px rgba(255, 255, 255, 0.4);
    }

    .gateway-emblem-core.core-danger {
      background: linear-gradient(135deg, #b91c1c 0%, #dc2626 50%, #ea580c 100%);
      box-shadow: 0 12px 24px -6px rgba(220, 38, 38, 0.42), inset 0 1px 1px rgba(255, 255, 255, 0.4);
    }

    .emblem-micro-badge {
      position: absolute;
      bottom: -2px;
      right: -2px;
      width: 26px;
      height: 26px;
      border-radius: 50%;
      background: #10b981;
      color: #ffffff;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 0.74rem;
      border: 3px solid var(--bg-card);
      box-shadow: 0 2px 6px rgba(16, 185, 129, 0.35);
    }

    .emblem-micro-badge.badge-warning {
      background: #f59e0b;
      box-shadow: 0 2px 6px rgba(245, 158, 11, 0.35);
    }

    @keyframes emblemPulse {
      0%, 100% {
        transform: scale(0.96);
        opacity: 0.6;
      }
      50% {
        transform: scale(1.12);
        opacity: 1;
      }
    }

    /* Gateway Typography */
    .state-title,
    .gateway-heading {
      font-size: 1.55rem;
      font-weight: 800;
      color: var(--text-primary);
      margin: 0 0 6px;
      letter-spacing: -0.01em;
    }

    .gateway-subheading {
      margin-bottom: 12px;
    }

    .gateway-sys-tag {
      display: inline-block;
      font-size: 0.78rem;
      font-weight: 700;
      color: var(--primary);
      background: var(--primary-light);
      padding: 2px 10px;
      border-radius: var(--radius-full);
    }

    .state-desc,
    .gateway-description {
      font-size: 0.92rem;
      color: var(--text-secondary);
      line-height: 1.55;
      margin: 0 0 22px;
    }

    /* Trust Features Box */
    .gateway-features-box {
      background: var(--bg-surface);
      border: 1px solid var(--border-color);
      border-radius: var(--radius-lg);
      padding: 14px 16px;
      margin-bottom: 24px;
      text-align: left;
      display: flex;
      flex-direction: column;
      gap: 12px;
    }

    [data-theme="dark"] .gateway-features-box {
      background: rgba(14, 20, 34, 0.6);
    }

    .gateway-feature-item {
      display: flex;
      align-items: flex-start;
      gap: 12px;
    }

    .gf-icon {
      width: 36px;
      height: 36px;
      border-radius: 10px;
      background: rgba(37, 99, 235, 0.1);
      color: var(--primary);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 0.95rem;
      flex-shrink: 0;
      margin-top: 1px;
    }

    [data-theme="dark"] .gf-icon {
      background: rgba(59, 130, 246, 0.16);
      color: #60a5fa;
    }

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

    .gf-title {
      font-size: 0.85rem;
      font-weight: 700;
      color: var(--text-primary);
      line-height: 1.3;
    }

    .gf-desc {
      font-size: 0.76rem;
      color: var(--text-muted);
      line-height: 1.35;
      margin-top: 2px;
    }

    /* Action Buttons */
    .gateway-actions-group {
      display: flex;
      flex-direction: column;
      gap: 12px;
      margin-bottom: 20px;
    }

    .btn-gateway-primary {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 10px;
      width: 100%;
      padding: 13px 20px;
      background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
      color: #ffffff !important;
      font-size: 0.96rem;
      font-weight: 700;
      border-radius: var(--radius-md);
      text-decoration: none;
      box-shadow: 0 8px 22px -4px rgba(37, 99, 235, 0.45);
      border: 1px solid rgba(255, 255, 255, 0.15);
      transition: all 0.22s ease;
      cursor: pointer;
    }

    .btn-gateway-primary:hover {
      transform: translateY(-2px);
      box-shadow: 0 12px 28px -4px rgba(37, 99, 235, 0.55);
      background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    }

    .btn-gateway-primary:active {
      transform: translateY(0);
    }

    .btn-gateway-icon {
      font-size: 1rem;
    }

    .btn-gateway-arrow {
      font-size: 0.82rem;
      opacity: 0.75;
      transition: transform 0.2s ease;
    }

    .btn-gateway-primary:hover .btn-gateway-arrow {
      transform: translateX(4px);
      opacity: 1;
    }

    .btn-gateway-secondary {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      width: 100%;
      padding: 11px 18px;
      background: var(--bg-surface);
      color: var(--text-secondary) !important;
      font-size: 0.9rem;
      font-weight: 600;
      border: 1px solid var(--border-color);
      border-radius: var(--radius-md);
      text-decoration: none;
      transition: all 0.2s ease;
      cursor: pointer;
    }

    .btn-gateway-secondary:hover {
      background: var(--bg-surface-glass);
      color: var(--text-primary) !important;
      border-color: rgba(59, 130, 246, 0.35);
      transform: translateY(-1px);
    }

    /* Modern User Box in Unauthorized State */
    .state-user-box-modern,
    .state-user-box {
      background: var(--bg-surface);
      border: 1px solid var(--border-color);
      border-radius: var(--radius-lg);
      padding: 16px;
      margin-bottom: 22px;
      text-align: left;
    }

    [data-theme="dark"] .state-user-box-modern,
    [data-theme="dark"] .state-user-box {
      background: rgba(14, 20, 34, 0.6);
    }

    .state-user-header {
      font-size: 0.8rem;
      font-weight: 700;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 0.05em;
      margin-bottom: 12px;
      display: flex;
      align-items: center;
      gap: 6px;
      padding-bottom: 8px;
      border-bottom: 1px dashed var(--border-color);
    }

    .state-user-content {
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

    .state-user-row {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 6px;
    }

    .state-user-row:last-child {
      margin-bottom: 0;
    }

    .su-label {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      font-size: 0.82rem;
      color: var(--text-secondary);
    }

    .su-value,
    .state-user-row strong {
      color: var(--text-primary);
      font-size: 0.88rem;
    }

    .role-tag-amber {
      display: inline-block;
      padding: 2px 10px;
      border-radius: var(--radius-full);
      font-size: 0.74rem;
      font-weight: 700;
      background: rgba(245, 158, 11, 0.15);
      color: #d97706;
      border: 1px solid rgba(245, 158, 11, 0.3);
    }

    [data-theme="dark"] .role-tag-amber {
      color: #fbbf24;
      border-color: rgba(251, 191, 36, 0.3);
    }

    /* Gateway Footer Note */
    .gateway-footer-note {
      font-size: 0.76rem;
      color: var(--text-muted);
      line-height: 1.45;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
    }

    /* Legacy icons preserved for safety */
    .state-icon-large {
      width: 80px;
      height: 80px;
      border-radius: 24px;
      margin: 0 auto 22px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 2.4rem;
    }
    .state-icon-lock {
      background: rgba(37, 99, 235, 0.12);
      color: #2563eb;
    }
    .state-icon-denied {
      background: rgba(239, 68, 68, 0.12);
      color: #ef4444;
    }

    @media (max-width: 640px) {
      .state-screen-container {
        padding: 8px 12px !important;
        min-height: calc(100dvh - 54px) !important;
        min-height: calc(100vh - 54px);
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
      }
      .admin-gateway-card {
        padding: 20px 16px 16px !important;
        border-radius: 20px !important;
        max-width: 350px !important;
        width: 100% !important;
        box-shadow: 0 10px 30px -8px rgba(15, 23, 42, 0.12) !important;
      }
      .gateway-pill-badge {
        margin-bottom: 8px !important;
        padding: 3px 10px !important;
        font-size: 0.68rem !important;
      }
      .gateway-emblem-wrapper {
        width: 54px !important;
        height: 54px !important;
        margin: 0 auto 8px !important;
      }
      .gateway-emblem-core {
        width: 46px !important;
        height: 46px !important;
        font-size: 1.25rem !important;
        border-radius: 14px !important;
      }
      .state-title,
      .gateway-heading {
        font-size: 1.18rem !important;
        margin-bottom: 2px !important;
      }
      .gateway-subheading {
        margin-bottom: 6px !important;
      }
      .gateway-sys-tag {
        font-size: 0.70rem !important;
        padding: 2px 8px !important;
      }
      .state-desc,
      .gateway-description {
        font-size: 0.80rem !important;
        line-height: 1.35 !important;
        margin-bottom: 12px !important;
      }
      .gateway-actions-group {
        gap: 8px !important;
        margin-bottom: 10px !important;
      }
      .btn-gateway-primary {
        padding: 10px 14px !important;
        font-size: 0.88rem !important;
        border-radius: 10px !important;
      }
      .btn-gateway-secondary {
        padding: 8px 12px !important;
        font-size: 0.80rem !important;
        border-radius: 10px !important;
      }
      .gateway-footer-note {
        font-size: 0.70rem !important;
        margin-top: 2px !important;
      }
      .state-user-box-modern,
      .state-user-box {
        padding: 10px 12px !important;
        margin-bottom: 12px !important;
      }
    }

    /* Toast Notification */
    .toast-container {
      position: fixed;
      bottom: 24px;
      right: 24px;
      z-index: 3000;
      display: flex;
      flex-direction: column;
      gap: 10px;
      pointer-events: none;
    }

    .toast-msg {
      pointer-events: auto;
      padding: 14px 20px;
      background: var(--bg-card);
      border: 1px solid var(--border-color);
      border-radius: var(--radius-lg);
      box-shadow: var(--shadow-lg);
      display: flex;
      align-items: center;
      gap: 12px;
      font-size: 0.9rem;
      font-weight: 600;
      color: var(--text-primary);
      animation: toastIn 0.3s ease;
      min-width: 280px;
    }

    @keyframes toastIn {
      0% { transform: translateY(20px); opacity: 0; }
      100% { transform: translateY(0); opacity: 1; }
    }

    .toast-success { border-left: 4px solid #10b981; }
    .toast-success i { color: #10b981; }
    .toast-error { border-left: 4px solid #ef4444; }
    .toast-error i { color: #ef4444; }
    .toast-info { border-left: 4px solid #3b82f6; }
    .toast-info i { color: #3b82f6; }

    /* Custom Theme Colors for Cards & Icon Thumbnails */
    .theme-blue { --tile-gradient: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%); --tile-color: #2563eb; }
    .theme-emerald { --tile-gradient: linear-gradient(135deg, #059669 0%, #047857 100%); --tile-color: #059669; }
    .theme-indigo { --tile-gradient: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%); --tile-color: #4f46e5; }
    .theme-sky { --tile-gradient: linear-gradient(135deg, #0284c7 0%, #0369a1 100%); --tile-color: #0284c7; }
    .theme-amber { --tile-gradient: linear-gradient(135deg, #d97706 0%, #b45309 100%); --tile-color: #d97706; }
    .theme-violet { --tile-gradient: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%); --tile-color: #7c3aed; }
    .theme-teal { --tile-gradient: linear-gradient(135deg, #0d9488 0%, #0f766e 100%); --tile-color: #0d9488; }
    .theme-rose { --tile-gradient: linear-gradient(135deg, #e11d48 0%, #be123c 100%); --tile-color: #e11d48; }
    .theme-purple { --tile-gradient: linear-gradient(135deg, #a855f7 0%, #7e22ce 100%); --tile-color: #9333ea; }
    .theme-orange { --tile-gradient: linear-gradient(135deg, #f97316 0%, #c2410c 100%); --tile-color: #ea580c; }
    .theme-cyan { --tile-gradient: linear-gradient(135deg, #06b6d4 0%, #0e7490 100%); --tile-color: #0891b2; }

    /* Direct Theme Application on Thumbnails */
    .app-icon-thumb.theme-blue, .theme-blue .app-icon-thumb { background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important; }
    .app-icon-thumb.theme-emerald, .theme-emerald .app-icon-thumb { background: linear-gradient(135deg, #059669 0%, #047857 100%) !important; }
    .app-icon-thumb.theme-indigo, .theme-indigo .app-icon-thumb { background: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%) !important; }
    .app-icon-thumb.theme-sky, .theme-sky .app-icon-thumb { background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%) !important; }
    .app-icon-thumb.theme-amber, .theme-amber .app-icon-thumb { background: linear-gradient(135deg, #d97706 0%, #b45309 100%) !important; }
    .app-icon-thumb.theme-violet, .theme-violet .app-icon-thumb { background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%) !important; }
    .app-icon-thumb.theme-teal, .theme-teal .app-icon-thumb { background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%) !important; }
    .app-icon-thumb.theme-rose, .theme-rose .app-icon-thumb { background: linear-gradient(135deg, #e11d48 0%, #be123c 100%) !important; }
    .app-icon-thumb.theme-purple, .theme-purple .app-icon-thumb { background: linear-gradient(135deg, #a855f7 0%, #7e22ce 100%) !important; }
    .app-icon-thumb.theme-orange, .theme-orange .app-icon-thumb { background: linear-gradient(135deg, #f97316 0%, #c2410c 100%) !important; }
    .app-icon-thumb.theme-cyan, .theme-cyan .app-icon-thumb { background: linear-gradient(135deg, #06b6d4 0%, #0e7490 100%) !important; }

    /* Card Status Styles */
    .launch-tile.status-maintenance {
      opacity: 0.92;
      border-color: rgba(245, 158, 11, 0.4);
    }

    .launch-tile.status-coming-soon {
      opacity: 0.9;
      border-color: rgba(139, 92, 246, 0.4);
    }

    .tile-status-chip {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      padding: 3px 10px;
      border-radius: var(--radius-full);
      font-size: 0.72rem;
      font-weight: 700;
      margin-left: auto;
    }

    .chip-maintenance {
      background: rgba(245, 158, 11, 0.15);
      color: #d97706;
      border: 1px solid rgba(245, 158, 11, 0.35);
    }

    .chip-coming-soon {
      background: rgba(139, 92, 246, 0.15);
      color: #7c3aed;
      border: 1px solid rgba(139, 92, 246, 0.35);
    }

    .chip-open {
      background: rgba(16, 185, 129, 0.15);
      color: #059669;
      border: 1px solid rgba(16, 185, 129, 0.35);
    }
/* ==========================================================================
   Admin Utility Classes (Replaces all inline styles for strict CSS compliance)
   ========================================================================== */

#adminUserCapsule,
#loginView,
#unauthorizedView,
#dashboardView,
#prevBadge,
#prevNotice {
  display: none;
}

.d-none { display: none; }
.w-full { width: 100%; }
.btn-full-center { justify-content: center; width: 100%; }

.ml-1 { margin-left: 4px; }
.ml-2 { margin-left: 8px; }
.mt-2 { margin-top: 10px; }
.mt-4 { margin-top: 18px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.m-auto { margin: 0 auto; }

.text-center { text-align: center; }
.text-right { text-align: right; }

.text-primary-brand { color: var(--primary); }
.text-emerald { color: #10b981; }
.text-amber { color: #f59e0b; }
.text-violet { color: #8b5cf6; }
.text-danger { color: #ef4444; }
.text-muted { color: var(--text-muted); }

.font-order { font-weight: 800; font-size: 0.85rem; color: var(--text-muted); }

.icon-dot-open { color: #10b981; font-size: 0.65rem; }
.icon-dot-maint { color: #f59e0b; font-size: 0.65rem; }
.icon-dot-soon { color: #8b5cf6; font-size: 0.65rem; }

.col-order { width: 70px; text-align: center; }
.col-status { width: 250px; }
.col-vis { width: 100px; text-align: center; }
.col-action { width: 120px; text-align: right; }
.col-action-right { justify-content: flex-end; }

.table-loading-cell { text-align: center; padding: 40px; color: var(--text-muted); }
.table-loading-icon { font-size: 1.5rem; margin-bottom: 8px; }

.table-empty-cell { text-align: center; padding: 48px; color: var(--text-muted); }
.table-empty-icon { font-size: 2rem; margin-bottom: 12px; opacity: 0.5; }
.table-empty-text { font-size: 1rem; margin: 0; }

.flex-row-gap-2 { display: flex; gap: 8px; }
.flex-row-gap-3 { display: flex; gap: 12px; }
.flex-row-center-gap-3 { display: flex; gap: 12px; justify-content: center; }
.flex-row-gap-4 { display: flex; gap: 20px; margin-top: 10px; }
.flex-align-gap-2 { display: flex; align-items: center; gap: 8px; }
.flex-col-center-gap-1 { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.flex-gap-xs { display: flex; gap: 2px; }

.btn-order-step { width: 24px; height: 24px; font-size: 0.7rem; }
.btn-order-disabled { opacity: 0.3; }

.form-icon-preview-box { width: 44px; height: 44px; background: #2563eb; }
.checkbox-control-label { display: flex; align-items: center; gap: 8px; font-size: 0.88rem; cursor: pointer; }

.badge-preview-official {
  display: none;
  background: rgba(37, 99, 235, 0.15);
  color: #2563eb;
  border-color: rgba(37, 99, 235, 0.3);
}

.btn-vis { margin: 0 auto; }
.btn-vis-on { margin: 0 auto; color: #10b981; }
.btn-vis-off { margin: 0 auto; color: var(--text-muted); opacity: 0.6; }

.app-badge-pill { font-size: 0.7rem; padding: 2px 8px; }
.app-category-text { font-size: 0.78rem; font-weight: 600; color: var(--primary); }
.app-url-meta { font-size: 0.72rem; color: var(--text-muted); margin-top: 4px; }
.hint-center { text-align: center; }

/* Swatch Presets */
.color-swatch-btn.theme-blue { background: #2563eb; }
.color-swatch-btn.theme-emerald { background: #059669; }
.color-swatch-btn.theme-indigo { background: #4f46e5; }
.color-swatch-btn.theme-sky { background: #0284c7; }
.color-swatch-btn.theme-amber { background: #d97706; }
.color-swatch-btn.theme-violet { background: #7c3aed; }
.color-swatch-btn.theme-teal { background: #0d9488; }
.color-swatch-btn.theme-rose { background: #e11d48; }
.color-swatch-btn.theme-purple { background: #9333ea; }
.color-swatch-btn.theme-orange { background: #ea580c; }
.color-swatch-btn.theme-cyan { background: #0891b2; }

/* ==========================================================================
   Tab Navigation & Gateway Console Extension - Modern Executive Standard
   ========================================================================== */
.admin-tab-bar-container {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 24px;
  width: 100%;
  overflow-x: auto;
  padding-bottom: 2px;
}

.admin-tab-bar {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-surface-glass);
  border: 1px solid var(--border-color);
  padding: 4px;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  max-width: 100%;
}

.admin-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  font-family: inherit;
}

.admin-tab-btn:hover {
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.03);
}

[data-theme="dark"] .admin-tab-btn:hover {
  background: rgba(255, 255, 255, 0.05);
}

.admin-tab-btn.active {
  color: var(--text-primary);
  background: var(--bg-card);
  border-color: rgba(0, 0, 0, 0.06);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
  font-weight: 700;
}

[data-theme="dark"] .admin-tab-btn.active {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  color: #f8fafc;
}

.tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  font-size: 0.70rem;
  font-weight: 700;
  border-radius: 999px;
  background: rgba(100, 116, 139, 0.12);
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.admin-tab-btn.active .tab-badge {
  background: rgba(37, 99, 235, 0.12);
  color: var(--primary);
}

[data-theme="dark"] .admin-tab-btn.active .tab-badge {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

.admin-tab-pane {
  display: none;
  animation: paneFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.admin-tab-pane.active {
  display: block;
}

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

/* Title Badges */
.title-icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.title-icon-badge.discord-badge {
  background: rgba(88, 101, 242, 0.12);
  color: #5865F2;
  border: 1px solid rgba(88, 101, 242, 0.25);
}

/* Gateway Toolbar Row - Executive Command Bar */
.gateway-toolbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  padding: 12px 18px;
  background: var(--bg-surface-glass, rgba(255, 255, 255, 0.88));
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 18px;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.04);
}

[data-theme="dark"] .gateway-toolbar-row {
  background: rgba(15, 23, 42, 0.7);
  border-color: rgba(51, 65, 85, 0.6);
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.3);
}

.gateway-toolbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gateway-hub-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #0f172a;
}

[data-theme="dark"] .gateway-hub-badge {
  color: #f1f5f9;
}

.gateway-hub-pill {
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  font-weight: 700;
  border: 1px solid rgba(16, 185, 129, 0.25);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.gateway-actions-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.gateway-btn-group {
  display: inline-flex;
  align-items: center;
  background: var(--bg-surface, #f1f5f9);
  padding: 3px;
  border-radius: 12px;
  border: 1px solid var(--border-color, #e2e8f0);
  gap: 3px;
}

[data-theme="dark"] .gateway-btn-group {
  background: #1e293b;
  border-color: #334155;
}

.gateway-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 9px;
  border: none;
  background: transparent;
  color: var(--text-secondary, #475569);
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.gateway-nav-btn:hover {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .gateway-nav-btn {
  color: #94a3b8;
}

[data-theme="dark"] .gateway-nav-btn:hover {
  background: #0f172a;
  color: #f8fafc;
}

/* Bot Gateway KPI Summary Grid (Bento Style) */
.bot-kpi-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

@media (max-width: 1100px) {
  .bot-kpi-summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .bot-kpi-summary-grid {
    grid-template-columns: 1fr;
  }
}

.bot-kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  min-height: 124px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.bot-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -4px rgba(0, 0, 0, 0.07);
  border-color: #cbd5e1;
}

.bot-kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.bot-kpi-label {
  font-size: 0.80rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.bot-kpi-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.bot-kpi-icon.icon-blue {
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
  border: 1px solid rgba(37, 99, 235, 0.2);
}

.bot-kpi-icon.icon-emerald {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.bot-kpi-icon.icon-violet {
  background: rgba(124, 58, 237, 0.1);
  color: #7c3aed;
  border: 1px solid rgba(124, 58, 237, 0.2);
}

.bot-kpi-icon.icon-amber {
  background: rgba(217, 119, 6, 0.1);
  color: #d97706;
  border: 1px solid rgba(217, 119, 6, 0.2);
}

.bot-kpi-metric-wrap {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.bot-kpi-value {
  font-size: 1.85rem;
  font-weight: 800;
  font-family: 'Plus Jakarta Sans', sans-serif;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1;
}

.bot-kpi-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.3;
}

/* Section Headers & Live Indicators */
.section-sub-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.section-sub-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-sub-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bot-cluster-header-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-counter-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 700;
}

.gateway-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  font-weight: 600;
  color: #059669;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  padding: 3px 10px;
  border-radius: 999px;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
}

.live-dot.pulse {
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.35);
  animation: beaconPulse 2s infinite;
}

@keyframes beaconPulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); }
  70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Modern Bot Cluster Grid & Cards */
.bot-cluster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.bot-cluster-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.bot-cluster-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px -6px rgba(0, 0, 0, 0.08);
  border-color: #cbd5e1;
}

.bot-cluster-card-accent {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3.5px;
}

.bot-card-top {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.bot-card-header-flex {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.bot-card-avatar-wrap {
  position: relative;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
}

.bot-avatar-modern {
  width: 48px;
  height: 48px;
  border-radius: 13px;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--border-color);
}

.bot-avatar-fallback-modern {
  width: 48px;
  height: 48px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.live-pulse-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--bg-card);
}

.live-pulse-badge.online {
  background: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
}

.live-pulse-badge.standby {
  background: #f59e0b;
}

.live-pulse-badge.offline {
  background: #94a3b8;
}

.bot-card-identity {
  flex: 1;
  min-width: 0;
}

.bot-card-name-line {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.bot-card-name {
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.3;
}

.bot-role-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
}

.bot-role-pill.role-master {
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
  border: 1px solid rgba(37, 99, 235, 0.25);
}

.bot-role-pill.role-custom {
  background: rgba(124, 58, 237, 0.1);
  color: #7c3aed;
  border: 1px solid rgba(124, 58, 237, 0.2);
}

.bot-card-tag-line {
  margin-top: 4px;
}

.bot-tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.74rem;
  font-weight: 600;
  color: #5865F2;
  background: rgba(88, 101, 242, 0.08);
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid rgba(88, 101, 242, 0.2);
}

.bot-card-status-wrap {
  flex-shrink: 0;
}

.bot-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.bot-status-pill.online {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.bot-status-pill.standby {
  background: rgba(245, 158, 11, 0.1);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.bot-status-pill.offline {
  background: rgba(100, 116, 139, 0.1);
  color: #64748b;
  border: 1px solid rgba(100, 116, 139, 0.2);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.ping-ms {
  font-size: 0.68rem;
  opacity: 0.85;
}

.bot-card-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.bot-telemetry-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 10px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 10px;
}

.telemetry-box {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.telemetry-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 4px;
}

.telemetry-val {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.telemetry-sub {
  font-size: 0.70rem;
  font-weight: 400;
  color: var(--text-muted);
}

.telem-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 600;
}

.telem-badge.telem-secure {
  color: #059669;
}

.telem-badge.telem-env {
  color: #2563eb;
}

.telem-badge.telem-fallback {
  color: #64748b;
}

.bot-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}

.btn-card-primary {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 15px;
  border-radius: 11px;
  font-size: 0.83rem;
  font-weight: 700;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.15);
}

.btn-card-primary:hover {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(15, 23, 42, 0.25);
}

[data-theme="dark"] .btn-card-primary {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-card-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 15px;
  border-radius: 11px;
  font-size: 0.83rem;
  font-weight: 600;
  background: #ffffff;
  color: #334155;
  border: 1.5px solid #cbd5e1;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-card-secondary:hover {
  border-color: #94a3b8;
  background: #f8fafc;
  color: #0f172a;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .btn-card-secondary {
  background: #1e293b;
  color: #f1f5f9;
  border-color: #334155;
}

.btn-card-danger {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #fecaca;
  background: var(--bg-surface);
  color: #ef4444;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
  flex-shrink: 0;
}

.btn-card-danger:hover {
  background: #fee2e2;
  border-color: #f87171;
  color: #dc2626;
  transform: translateY(-1px);
}

/* API Clients Section & Data Table Card */
.api-clients-section-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.search-box-mini {
  position: relative;
  display: flex;
  align-items: center;
}

.search-box-mini i {
  position: absolute;
  left: 10px;
  font-size: 0.80rem;
  color: var(--text-muted);
  pointer-events: none;
}

.search-box-mini input {
  padding: 7px 12px 7px 30px;
  font-size: 0.82rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-primary);
  outline: none;
  width: 210px;
  transition: all 0.2s ease;
}

.search-box-mini input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
  width: 250px;
}

.admin-table-card.flush-table {
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: none;
  margin-top: 10px;
}

.client-ident-cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.client-name-title {
  font-size: 0.90rem;
  font-weight: 700;
  color: var(--text-primary);
}

.code-copy-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  width: fit-content;
}

.code-copy-pill.secret-pill {
  background: rgba(241, 245, 249, 0.6);
}

[data-theme="dark"] .code-copy-pill.secret-pill {
  background: rgba(15, 23, 42, 0.4);
}

.code-text {
  font-family: 'SFMono-Regular', Consolas, monospace;
  font-size: 0.78rem;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

.copy-btn-mini {
  padding: 2px 6px;
  font-size: 0.74rem;
  border-radius: 4px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}

.copy-btn-mini:hover {
  color: var(--primary);
  background: rgba(37, 99, 235, 0.08);
}

.webhook-url-box {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 240px;
  padding: 3px 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 6px;
}

.webhook-url-text {
  font-family: 'SFMono-Regular', Consolas, monospace;
  font-size: 0.76rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.text-muted-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.74rem;
  color: var(--text-muted);
  font-style: italic;
}

.bot-badge-cell-wrap {
  cursor: pointer;
  transition: transform 0.15s ease;
}

.bot-badge-cell-wrap:hover {
  transform: scale(1.02);
}

.bot-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.bot-badge-pill.pill-portal {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.bot-badge-pill.pill-strat {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.bot-badge-pill.pill-epitrack {
  background: #fff1f2;
  color: #be123c;
  border: 1px solid #fecdd3;
}

.bot-badge-pill.pill-kpi {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.bot-badge-pill.pill-custom {
  background: #f5f3ff;
  color: #6d28d9;
  border: 1px solid #ddd6fe;
}

/* Toggle Switch Control */
.switch-control {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch-control input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: .3s;
  border-radius: 24px;
}

.switch-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

input:checked + .switch-slider {
  background-color: #10b981;
}

input:checked + .switch-slider:before {
  transform: translateX(20px);
}

/* Log Badges & Interactive Columns */
.log-badge-success {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 0.74rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.log-badge-actioned {
  background: rgba(124, 58, 237, 0.12);
  color: #7c3aed;
  border: 1px solid rgba(124, 58, 237, 0.3);
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 0.74rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 0 10px rgba(124, 58, 237, 0.15);
}

.log-badge-failed {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 0.74rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.log-badge-clicked {
  background: rgba(37, 99, 235, 0.12);
  color: #2563eb;
  border: 1px solid rgba(37, 99, 235, 0.3);
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 0.74rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.log-action-wrap {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.log-action-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.68rem;
  color: var(--text-muted);
}

.log-action-user {
  font-weight: 600;
  color: #2563eb;
}

.log-action-time {
  opacity: 0.8;
}

.log-client-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.log-client-name {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-heading);
}

.log-client-id {
  font-family: 'Fira Code', monospace;
  font-size: 0.68rem;
  color: var(--text-muted);
}

.log-client-badge-test {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  color: #f59e0b;
  font-weight: 600;
}

.log-recipient-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.log-recipient-discord {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.85rem;
}

.log-recipient-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.log-recipient-name {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.pdpa-shield-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(15, 58, 46, 0.08);
  color: #0F3A2E;
  border: 1px solid rgba(15, 58, 46, 0.2);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 0.68rem;
  font-family: 'Fira Code', monospace;
  font-weight: 600;
}

[data-theme='dark'] .pdpa-shield-pill {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.3);
}

/* Documentation & AI Prompt Section */
.docs-view-container {
  background: var(--bg-surface-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}

.docs-hero-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.docs-action-buttons {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.download-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-primary);
}

.download-pill-btn:hover {
  border-color: #2563eb;
  color: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

.download-pill-btn.btn-primary-glow {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  border: none;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
}

.prompt-box {
  background: #0f172a;
  color: #e2e8f0;
  border-radius: var(--radius-md);
  padding: 20px;
  position: relative;
  font-family: 'SFMono-Regular', Consolas, Monaco, monospace;
  font-size: 0.88rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 480px;
  overflow-y: auto;
  border: 1px solid #1e293b;
}

.prompt-box-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #334155;
  color: #94a3b8;
  font-size: 0.82rem;
}

.prompt-box-header span {
  font-weight: 600;
  color: #38bdf8;
}

.code-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.1);
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.code-copy-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

/* Documentation & Modal Helper Classes */
.docs-hero-heading { margin: 0 0 8px; font-size: 1.45rem; font-weight: 800; color: var(--text-primary); }
.docs-hero-sub { margin: 0; color: var(--text-secondary); font-size: 0.95rem; }
.docs-card-padded { background: var(--bg-surface-glass); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 24px; }
.docs-header-flex { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.docs-title-md { margin: 0; font-size: 1.15rem; font-weight: 700; }
.docs-desc-sm { font-size: 0.88rem; margin-bottom: 12px; }

/* ==========================================================================
   Ultra-Premium Modern Modal & Form System
   ========================================================================== */
.modal-w-640 { max-width: 680px; width: 100%; }
.modal-w-600 { max-width: 600px; width: 100%; }

.admin-modal-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.08);
  overflow: hidden;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
}

.modal-header {
  padding: 24px 28px;
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.04) 0%, transparent 100%);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-title i {
  color: var(--primary);
  font-size: 1.2rem;
  background: rgba(37, 99, 235, 0.1);
  padding: 10px;
  border-radius: 12px;
}

.modal-close-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.modal-close-btn:hover {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
  transform: rotate(90deg);
}

.modal-body-form {
  padding: 28px;
}

/* Modern Multi-Column Form Grid */
.form-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 20px 18px;
}

.form-col-12 { grid-column: span 12; }
.form-col-8 { grid-column: span 8; }
.form-col-6 { grid-column: span 6; }
.form-col-4 { grid-column: span 4; }

@media (max-width: 640px) {
  .form-col-6, .form-col-8, .form-col-4 {
    grid-column: span 12;
  }
}

.form-group {
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
}

.form-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.text-danger {
  color: #ef4444;
  margin-left: 2px;
}

/* Input Fields - Ultra Crisp & Modern */
.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-color);
  border-radius: 14px;
  font-size: 0.92rem;
  color: var(--text-primary);
  font-family: inherit;
  outline: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.form-input::placeholder, .form-textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.75;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--primary);
  background: var(--bg-card);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14);
  transform: translateY(-1px);
}

.form-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.4;
}

/* Premium Custom Select Dropdown */
.form-select {
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg2+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23475569'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2.2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%233b82f6'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2.2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 18px;
  padding-right: 42px;
  cursor: pointer;
  font-weight: 500;
}

[data-theme="dark"] .form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2360a5fa'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2.2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
}

/* Secret Key Box with Roll Dice Action */
.field-secret-box {
  display: flex;
  gap: 10px;
  align-items: center;
}

.field-secret-input {
  font-family: 'Fira Code', 'SFMono-Regular', Consolas, monospace !important;
  font-size: 0.88rem !important;
  letter-spacing: 0.02em;
  background: rgba(0, 0, 0, 0.02) !important;
}

[data-theme="dark"] .field-secret-input {
  background: rgba(255, 255, 255, 0.03) !important;
}

.btn-nowrap {
  white-space: nowrap;
  padding: 12px 18px !important;
  border-radius: 14px !important;
  font-weight: 700 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04) !important;
}

.btn-nowrap:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.2) !important;
  border-color: var(--primary) !important;
  color: var(--primary) !important;
}

/* Checkbox Toggle Styled */
.checkbox-field-aligned {
  display: flex;
  align-items: center;
  margin-top: auto;
  padding-bottom: 8px;
}

.checkbox-control-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

.checkbox-control-label input[type="checkbox"] {
  width: 19px;
  height: 19px;
  accent-color: var(--primary);
  border-radius: 6px;
  cursor: pointer;
}

/* Modal Footer Action Bar */
.modal-footer {
  padding: 20px 28px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.modal-footer .btn-modern-primary {
  padding: 12px 28px;
  border-radius: 14px;
  font-size: 0.94rem;
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
}

.modal-footer .btn-modern-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
}

.modal-footer .btn-modern-secondary {
  padding: 11px 22px;
  border-radius: 14px;
  font-size: 0.92rem;
  font-weight: 600;
}





/* End of Bot Cluster & Gateway Console styles (defined above) */


/* Clean PDPA Citizen ID Pill */
.log-cid-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.73rem;
  font-weight: 600;
  font-family: 'SFMono-Regular', Consolas, monospace;
  color: #475569;
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}

.log-cid-pill i {
  color: #64748b;
  font-size: 0.78rem;
}


/* ==========================================================================
   World-Class Notification Logs & Observability UI System
   ========================================================================== */
.logs-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.log-kpi-box {
  background: var(--bg-card, #ffffff);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 16px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: all 0.2s;
}

.log-kpi-box:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px -2px rgba(0, 0, 0, 0.06);
}

.log-kpi-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.kpi-icon-blue { background: #eff6ff; color: #2563eb; }
.kpi-icon-emerald { background: #ecfdf5; color: #059669; }
.kpi-icon-violet { background: #f5f3ff; color: #7c3aed; }
.kpi-icon-amber { background: #fffbeb; color: #d97706; }

.log-kpi-body {
  display: flex;
  flex-direction: column;
}

.log-kpi-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
}

.log-kpi-val {
  font-size: 1.45rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
}

.log-kpi-desc {
  font-size: 0.70rem;
  color: #94a3b8;
  font-weight: 600;
  margin-top: 2px;
}

/* Toolbar */
.logs-filter-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.logs-search-container {
  position: relative;
  flex: 1;
  min-width: 280px;
}

.search-leading-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 0.88rem;
}

.logs-input-search {
  width: 100%;
  background: var(--bg-card, #ffffff);
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 10px 38px 10px 40px;
  font-size: 0.84rem;
  font-family: inherit;
  color: #0f172a;
  transition: all 0.2s;
}

.logs-input-search:focus {
  outline: none;
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.logs-clear-search-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px;
  font-size: 0.82rem;
}

.logs-clear-search-btn:hover { color: #ef4444; }

.logs-filters-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.logs-pills-bar {
  display: flex;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 12px;
  gap: 4px;
}

.log-filter-pill {
  border: none;
  background: transparent;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.log-filter-pill:hover {
  color: #0f172a;
}

.log-filter-pill.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.logs-select-bot {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 0.80rem;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  outline: none;
}

/* Modern Table */
.logs-modern-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.logs-modern-table th {
  background: #f8fafc;
  color: #475569;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  padding: 14px 16px;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}

.log-data-row {
  cursor: pointer;
  transition: background-color 0.15s;
}

.log-data-row:hover {
  background-color: #f8fafc;
}

.log-data-row td {
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

/* Row Components */
.log-time-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.time-bold {
  font-size: 0.82rem;
  font-weight: 800;
  color: #0f172a;
  font-family: monospace;
}

.date-muted {
  font-size: 0.70rem;
  color: #94a3b8;
  font-weight: 600;
}

.client-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 0.76rem;
  font-weight: 700;
}

.client-pill.client-app {
  background: #f8fafc;
  color: #334155;
  border: 1px solid #cbd5e1;
}

.client-pill.client-test {
  background: #fefce8;
  color: #854d0e;
  border: 1px solid #fef08a;
}

.log-rec-card {
  display: flex;
  align-items: center;
  gap: 10px;
}

.log-rec-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.92rem;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.2);
}

.log-rec-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.log-rec-name {
  font-size: 0.84rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
}

.log-rec-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: #64748b;
  flex-wrap: wrap;
}

.log-rec-discord {
  color: #5865F2;
  font-weight: 600;
}

.log-rec-cid {
  font-family: monospace;
  background: #f1f5f9;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
  color: #475569;
}

.log-title-cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-width: 280px;
}

.log-title-text {
  font-size: 0.82rem;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.log-tracking-sub {
  font-size: 0.68rem;
  color: #94a3b8;
  font-family: monospace;
}

.log-delivery-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.log-delivery-badge.success {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.log-delivery-badge.failed {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.log-action-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.log-interactive-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 0.74rem;
  font-weight: 700;
  white-space: nowrap;
}

.log-interactive-chip.chip-approve {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.log-interactive-chip.chip-reject {
  background: #fff1f2;
  color: #be123c;
  border: 1px solid #fecdd3;
}

.log-interactive-chip.chip-ack {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.log-interactive-chip.chip-report {
  background: #f0fdfa;
  color: #0f766e;
  border: 1px solid #99f6e4;
}

.log-interactive-chip.chip-waiting {
  background: #f8fafc;
  color: #94a3b8;
  border: 1px solid #e2e8f0;
}

.log-action-timestamp {
  font-size: 0.68rem;
  color: #64748b;
}

.btn-open-detail {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  margin: 0 auto;
}

.btn-open-detail:hover {
  background: #4f46e5;
  color: #ffffff;
  border-color: #4f46e5;
  transform: translateX(2px);
}

.logs-table-footer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
}

.logs-footer-text {
  font-size: 0.78rem;
  font-weight: 700;
  color: #64748b;
}

/* Modal Styling */
.log-detail-modal-box {
  max-width: 680px;
  width: 95%;
  border-radius: 20px;
}


/* =====================================================================
   🌟 ENTERPRISE APPDIALOG & LUXURY MODALS (MyWellnetPTN Design System)
   ===================================================================== */
.app-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(15, 23, 42, 0.65);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  backdrop-filter: blur(12px) saturate(180%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.app-dialog-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.app-dialog-card {
  position: relative;
  width: 100%;
  max-width: 460px;
  background: #ffffff;
  border-radius: 26px;
  box-shadow: 
    0 25px 50px -12px rgba(15, 23, 42, 0.35),
    0 0 0 1px rgba(226, 232, 240, 0.9),
    0 4px 6px -2px rgba(15, 23, 42, 0.05);
  padding: 2.25rem 2rem 1.75rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transform: scale(0.92) translateY(12px);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}

.app-dialog-card.dialog-anim-in {
  transform: scale(1) translateY(0);
}

.app-dialog-card.dialog-anim-out {
  transform: scale(0.92) translateY(10px);
  opacity: 0;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Icon Aura and Box */
.app-dialog-icon-aura {
  position: relative;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-dialog-icon-box {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  position: relative;
  z-index: 2;
  transition: all 0.3s ease;
}

/* Theme Variations */
.app-dialog-icon-box.theme-danger {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  color: #dc2626;
  border: 3px solid #ffffff;
  box-shadow: 0 12px 28px -6px rgba(220, 38, 38, 0.35);
}

.app-dialog-icon-box.theme-warning {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #d97706;
  border: 3px solid #ffffff;
  box-shadow: 0 12px 28px -6px rgba(217, 119, 6, 0.35);
}

.app-dialog-icon-box.theme-primary {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  color: #2563eb;
  border: 3px solid #ffffff;
  box-shadow: 0 12px 28px -6px rgba(37, 99, 235, 0.35);
}

.app-dialog-icon-box.theme-success {
  background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
  color: #16a34a;
  border: 3px solid #ffffff;
  box-shadow: 0 12px 28px -6px rgba(22, 163, 74, 0.35);
}

/* Dialog Content */
.app-dialog-content {
  width: 100%;
  margin-bottom: 1.75rem;
}

.app-dialog-title {
  font-family: 'Prompt', -apple-system, sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 0.5rem 0;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.app-dialog-subtitle {
  font-size: 0.95rem;
  color: #475569;
  line-height: 1.6;
  margin: 0;
}

.app-dialog-subtitle b {
  color: #0f172a;
  font-weight: 600;
}

.app-dialog-note {
  margin-top: 0.85rem;
  padding: 0.75rem 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  font-size: 0.82rem;
  color: #64748b;
  line-height: 1.5;
  text-align: left;
}

.app-dialog-note b {
  color: #1e293b;
}

/* Prompt Input Group */
.app-dialog-input-group {
  margin-top: 1.25rem;
  text-align: left;
}

.app-dialog-input-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 0.4rem;
}

.app-dialog-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.app-dialog-input-icon {
  position: absolute;
  left: 14px;
  font-size: 0.9rem;
  color: #94a3b8;
  pointer-events: none;
}

.app-dialog-input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  font-size: 0.95rem;
  border: 1.5px solid #cbd5e1;
  border-radius: 14px;
  background: #f8fafc;
  color: #0f172a;
  outline: none;
  font-family: inherit;
  transition: all 0.2s ease;
}

.app-dialog-input:focus {
  background: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Dialog Action Buttons */
.app-dialog-actions {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
}

.app-dialog-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.4rem;
  font-size: 0.92rem;
  font-weight: 600;
  border-radius: 15px;
  border: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: inherit;
  white-space: nowrap;
}

.app-dialog-btn:hover {
  transform: translateY(-2px);
}

.app-dialog-btn:active {
  transform: translateY(0) scale(0.98);
}

.btn-dialog-cancel {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

.btn-dialog-cancel:hover {
  background: #e2e8f0;
  color: #1e293b;
}

.btn-dialog-confirm.btn-theme-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #ffffff;
  box-shadow: 0 8px 20px -4px rgba(220, 38, 38, 0.45);
}
.btn-dialog-confirm.btn-theme-danger:hover {
  box-shadow: 0 12px 24px -4px rgba(220, 38, 38, 0.55);
}

.btn-dialog-confirm.btn-theme-warning {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #ffffff;
  box-shadow: 0 8px 20px -4px rgba(217, 119, 6, 0.45);
}

.btn-dialog-confirm.btn-theme-primary {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #ffffff;
  box-shadow: 0 8px 20px -4px rgba(37, 99, 235, 0.45);
}

.btn-dialog-confirm.btn-theme-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  box-shadow: 0 8px 20px -4px rgba(16, 185, 129, 0.45);
}

/* =====================================================================
   🌟 UPGRADED FLOATING TOASTS (Glassmorphism & Timer Progress)
   ===================================================================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.toast-msg {
  pointer-events: auto;
  min-width: 300px;
  max-width: 420px;
  background: rgba(255, 255, 255, 0.95);
  -webkit-backdrop-filter: blur(14px) saturate(180%);
  backdrop-filter: blur(14px) saturate(180%);
  border-radius: 18px;
  padding: 1rem 1.15rem 1.15rem 1.15rem;
  box-shadow: 
    0 16px 36px -8px rgba(15, 23, 42, 0.22),
    0 0 0 1px rgba(226, 232, 240, 0.9);
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  position: relative;
  overflow: hidden;
  animation: toastSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-msg.toast-leaving {
  opacity: 0;
  transform: translateY(12px) scale(0.96);
}

@keyframes toastSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.toast-icon-wrap {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.toast-body {
  flex: 1;
  min-width: 0;
}

.toast-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.25;
  margin-bottom: 0.2rem;
}

.toast-text {
  font-size: 0.82rem;
  color: #475569;
  line-height: 1.45;
  word-break: break-word;
}

.toast-close-btn {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.15s;
}

.toast-close-btn:hover {
  color: #1e293b;
}

.toast-progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3.5px;
  width: 100%;
  animation: toastProgress linear forwards;
}

@keyframes toastProgress {
  from { width: 100%; }
  to { width: 0%; }
}

/* Toast Theme Specifics */
.toast-success .toast-icon-wrap {
  background: #dcfce7;
  color: #16a34a;
}
.toast-success .toast-progress-bar {
  background: linear-gradient(90deg, #10b981, #059669);
}

.toast-error .toast-icon-wrap {
  background: #fee2e2;
  color: #dc2626;
}
.toast-error .toast-progress-bar {
  background: linear-gradient(90deg, #ef4444, #dc2626);
}

.toast-info .toast-icon-wrap {
  background: #dbeafe;
  color: #2563eb;
}
.toast-info .toast-progress-bar {
  background: linear-gradient(90deg, #3b82f6, #2563eb);
}

.toast-warning .toast-icon-wrap {
  background: #fef3c7;
  color: #d97706;
}
.toast-warning .toast-progress-bar {
  background: linear-gradient(90deg, #f59e0b, #d97706);
}

/* =====================================================================
   🌟 SWEETALERT2 BESPOKE THEME (Enterprise Alignment)
   ===================================================================== */
.swal2-container {
  -webkit-backdrop-filter: blur(12px) saturate(180%) !important;
  backdrop-filter: blur(12px) saturate(180%) !important;
  background: rgba(15, 23, 42, 0.65) !important;
  z-index: 999999 !important;
}

.swal2-popup {
  border-radius: 26px !important;
  padding: 2.25rem 2rem 1.75rem 2rem !important;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.35), 0 0 0 1px rgba(226, 232, 240, 0.9) !important;
  font-family: 'Prompt', 'Inter', -apple-system, sans-serif !important;
  background: #ffffff !important;
  max-width: 480px !important;
}

.swal2-title {
  font-family: 'Prompt', -apple-system, sans-serif !important;
  font-size: 1.3rem !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  padding: 0 !important;
  margin-top: 0.6rem !important;
  line-height: 1.35 !important;
}

.swal2-html-container {
  font-size: 0.95rem !important;
  color: #475569 !important;
  line-height: 1.6 !important;
  margin: 0.85rem 0 0 0 !important;
}

.swal2-actions {
  margin-top: 1.75rem !important;
  gap: 0.85rem !important;
  width: 100% !important;
}

.swal2-confirm {
  border-radius: 15px !important;
  padding: 12px 24px !important;
  font-size: 0.92rem !important;
  font-weight: 600 !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  box-shadow: 0 8px 20px -4px rgba(37, 99, 235, 0.45) !important;
}

.swal2-confirm:hover {
  transform: translateY(-2px) !important;
  filter: brightness(1.05) !important;
}

.swal2-cancel {
  border-radius: 15px !important;
  padding: 12px 22px !important;
  font-size: 0.92rem !important;
  font-weight: 600 !important;
  background: #f1f5f9 !important;
  color: #475569 !important;
  border: 1px solid #e2e8f0 !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.swal2-cancel:hover {
  background: #e2e8f0 !important;
  color: #1e293b !important;
  transform: translateY(-2px) !important;
}


/* =====================================================================
   🌟 PREMIUM DROPDOWN & LOG DETAIL MODAL (Enterprise Observability)
   ===================================================================== */

/* 1. Header Badges & Actions */
.pane-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.pane-icon-badge {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  color: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: 0 4px 12px -2px rgba(37, 99, 235, 0.25);
}

.live-stream-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 9999px;
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.02em;
}

.pulse-dot {
  font-size: 0.5rem;
  animation: pulseDotAnim 1.6s infinite;
}

@keyframes pulseDotAnim {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.3); }
  100% { opacity: 1; transform: scale(1); }
}

/* Header Action Buttons */
.admin-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-modern-danger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: 12px;
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  color: #dc2626;
  border: 1px solid #fca5a5;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: inherit;
}

.btn-modern-danger:hover {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #ffffff;
  border-color: #dc2626;
  transform: translateY(-2px);
  box-shadow: 0 8px 16px -4px rgba(220, 38, 38, 0.4);
}

.btn-modern-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: 12px;
  background: #ffffff;
  color: #334155;
  border: 1px solid #cbd5e1;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: inherit;
}

.btn-modern-secondary:hover {
  background: #f8fafc;
  color: #0f172a;
  border-color: #94a3b8;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px -2px rgba(15, 23, 42, 0.08);
}

/* 2. Premium Custom Dropdown Component */
.premium-dropdown {
  position: relative;
  display: inline-block;
}

.premium-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 14px;
  color: #1e293b;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.premium-dropdown-trigger:hover,
.premium-dropdown-trigger.open {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
  background: #ffffff;
}

.dropdown-trigger-icon {
  color: #3b82f6;
  font-size: 0.95rem;
}

.dropdown-trigger-label {
  white-space: nowrap;
}

.dropdown-trigger-chevron {
  font-size: 0.75rem;
  color: #94a3b8;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.premium-dropdown-trigger.open .dropdown-trigger-chevron {
  transform: rotate(180deg);
  color: #3b82f6;
}

.premium-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 280px;
  background: #ffffff;
  border-radius: 18px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  box-shadow: 
    0 20px 40px -12px rgba(15, 23, 42, 0.2),
    0 2px 6px rgba(15, 23, 42, 0.05);
  padding: 8px;
  z-index: 1000;
  animation: dropdownPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dropdownPop {
  from { opacity: 0; transform: translateY(-8px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.premium-dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}

.premium-dropdown-item:hover {
  background: #f1f5f9;
}

.premium-dropdown-item.active {
  background: #eff6ff;
}

.item-icon-box {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.item-text {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.item-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #0f172a;
}

.item-desc {
  font-size: 0.72rem;
  color: #64748b;
  margin-top: 1px;
}

.item-check {
  font-size: 0.85rem;
  color: #2563eb;
  opacity: 0;
  transition: opacity 0.15s;
}

.premium-dropdown-item.active .item-check {
  opacity: 1;
}

/* 3. Centered Log Detail Modal */
.log-detail-modal-container {
  max-width: 780px !important;
  width: 95% !important;
  border-radius: 24px !important;
  box-shadow: 0 30px 60px -15px rgba(15, 23, 42, 0.45), 0 0 0 1px rgba(226, 232, 240, 0.9) !important;
  background: #ffffff !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
}

.modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
}

.modal-header-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.modal-subtitle-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: monospace;
  font-size: 0.78rem;
  color: #64748b;
  background: #f1f5f9;
  padding: 3px 8px;
  border-radius: 6px;
  margin-top: 4px;
}

.log-detail-modal-body {
  padding: 24px !important;
  max-height: calc(85vh - 140px) !important;
  overflow-y: auto !important;
}

.modal-detail-stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* 4. Delivery Stepper Ribbon */
.log-flow-ribbon {
  display: flex;
  align-items: center;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 14px 20px;
  gap: 12px;
}

.flow-step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  font-weight: 700;
  color: #64748b;
}

.flow-step.completed {
  color: #15803d;
}

.flow-step.failed {
  color: #dc2626;
}

.flow-step.pending {
  color: #d97706;
}

.step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  background: #e2e8f0;
  color: #64748b;
}

.flow-step.completed .step-num {
  background: #dcfce7;
  color: #16a34a;
}

.flow-step.failed .step-num {
  background: #fee2e2;
  color: #dc2626;
}

.flow-step.pending .step-num {
  background: #fef3c7;
  color: #d97706;
}

.flow-divider {
  flex: 1;
  height: 2px;
  background: #e2e8f0;
}

.flow-divider.active {
  background: #10b981;
}

/* 5. 4-Box Metadata Grid */
.log-meta-four-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.meta-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
}

.meta-card-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 6px;
}

.meta-card-val {
  font-size: 0.88rem;
  color: #0f172a;
  margin-top: 4px;
  font-weight: 700;
}

/* 6. Target Profile Card */
.log-target-profile-card {
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background: #ffffff;
}

.profile-avatar {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, #5865F2, #404eed);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  box-shadow: 0 4px 12px -2px rgba(88, 101, 242, 0.35);
}

.profile-info {
  flex: 1;
  min-width: 180px;
}

.profile-name {
  font-size: 0.95rem;
  font-weight: 800;
  color: #0f172a;
}

.profile-sub {
  font-size: 0.8rem;
  color: #64748b;
  margin-top: 2px;
}

.profile-cid-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  font-family: monospace;
  font-weight: 700;
  font-size: 0.85rem;
  color: #1e293b;
}

/* 7. Hyper-Realistic Discord Simulator */
.discord-simulator-container {
  background: #1e1f22;
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

.discord-sim-topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.discord-bot-name {
  color: #f2f3f5;
  font-weight: 700;
  font-size: 0.95rem;
}

.discord-bot-tag {
  background: #5865F2;
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.discord-timestamp {
  color: #949ba4;
  font-size: 0.72rem;
  margin-left: 4px;
}

.discord-embed-card {
  background: #2b2d31;
  border-radius: 4px 10px 10px 4px;
  border-left: 4px solid #5865F2;
  padding: 14px 18px;
  color: #dbdee1;
}

.discord-embed-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.discord-embed-title {
  color: #f2f3f5;
  font-size: 0.98rem;
  font-weight: 800;
}

.discord-embed-desc {
  font-size: 0.85rem;
  line-height: 1.55;
  color: #dbdee1;
}

.discord-embed-footer {
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid #35373c;
  font-size: 0.72rem;
  color: #949ba4;
  font-family: monospace;
}

/* 8. Action Box & Pending Box */
.discord-sim-action-box {
  background: #faf5ff;
  border: 1.5px solid #d8b4fe;
  border-radius: 16px;
  padding: 16px 18px;
}

.action-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.action-box-title {
  font-size: 0.92rem;
  font-weight: 800;
  color: #6b21a8;
  display: flex;
  align-items: center;
  gap: 8px;
}

.action-box-time {
  font-size: 0.76rem;
  font-weight: 700;
  color: #7e22ce;
  background: #f3e8ff;
  padding: 3px 8px;
  border-radius: 6px;
}

.action-box-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  font-size: 0.85rem;
  color: #3b0764;
}

.badge-action-pill {
  background: #ede9fe;
  color: #6d28d9;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
}

.log-modal-field-item {
  background: #ffffff;
  border: 1px solid #e9d5ff;
  border-radius: 10px;
  padding: 8px 12px;
  margin-top: 6px;
  display: flex;
  gap: 8px;
  font-size: 0.82rem;
}

.field-key {
  font-weight: 700;
  color: #6b21a8;
}

.field-val {
  color: #1e1b4b;
}

.discord-sim-pending-box {
  background: #fffbeb;
  border: 1.5px solid #fde68a;
  border-radius: 16px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.discord-sim-pending-box strong {
  color: #92400e;
  font-size: 0.9rem;
}

/* 9. Raw JSON Accordion */
.log-raw-accordion {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 12px 16px;
  transition: all 0.2s ease;
}

.raw-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.84rem;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  list-style: none;
}

.raw-summary::-webkit-details-marker {
  display: none;
}

.raw-code-box {
  margin-top: 12px;
  background: #0f172a;
  color: #38bdf8;
  padding: 14px;
  border-radius: 10px;
  font-family: monospace;
  font-size: 0.76rem;
  max-height: 220px;
  overflow-y: auto;
}

.raw-code-box pre {
  margin: 0;
}

/* 10. Table Detail Button (Icon Action) */
.btn-open-detail {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-open-detail:hover {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 14px -3px rgba(37, 99, 235, 0.4);
}


/* =====================================================================
   🌟 LUXURY MODALS & PREMIUM FORM CONTROLS (MyWellnetPTN Design System)
   ===================================================================== */
.modal-w-600 {
  max-width: 620px !important;
}
.modal-w-650 {
  max-width: 660px !important;
}
.modal-w-700 {
  max-width: 720px !important;
}

.modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
}

.modal-subtitle-text {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 3px;
  line-height: 1.35;
}

/* Fields with Action Button (Randomize Dice) */
.field-with-action {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.field-with-action .form-input {
  flex: 1;
}

.btn-rand-key {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 12px;
  background: #f1f5f9;
  color: #334155;
  border: 1.5px solid #cbd5e1;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-rand-key:hover {
  background: #e2e8f0;
  color: #0f172a;
  border-color: #94a3b8;
  transform: translateY(-1px);
}

.btn-rand-key i {
  color: #3b82f6;
}

/* Premium Select Wrapper */
.select-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.select-wrapper .form-select {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  border-radius: 14px;
  border: 1.5px solid #cbd5e1;
  background: #f8fafc;
  padding: 10px 38px 10px 14px;
  font-size: 0.92rem;
  font-weight: 600;
  color: #1e293b;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
}

.select-wrapper .form-select:hover {
  border-color: #94a3b8;
  background: #ffffff;
}

.select-wrapper .form-select:focus {
  border-color: #3b82f6;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
  outline: none;
}

.select-chevron {
  position: absolute;
  right: 14px;
  font-size: 0.75rem;
  color: #94a3b8;
  pointer-events: none;
  transition: transform 0.2s ease;
}

/* Token Secret Box */
.field-secret-box {
  display: flex;
  align-items: center;
  gap: 8px;
}

.field-secret-input {
  flex: 1;
  font-family: monospace;
}

.btn-token-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 14px;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: 12px;
  background: #f1f5f9;
  color: #334155;
  border: 1.5px solid #cbd5e1;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: all 0.2s ease;
}

.btn-token-action:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.btn-token-verify {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.btn-token-verify:hover {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #ffffff;
  border-color: #2563eb;
  transform: translateY(-1px);
}

/* Color Picker */
.color-picker-input {
  width: 48px;
  height: 40px;
  border-radius: 10px;
  border: 1.5px solid #cbd5e1;
  cursor: pointer;
  padding: 2px;
  background: #ffffff;
}

.color-hex-badge {
  font-size: 0.85rem;
  font-family: monospace;
  font-weight: 700;
  color: #475569;
  background: #f1f5f9;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}


/* ==========================================================================
   Clean Utility & Component Classes (Zero Inline Styles Architecture)
   ========================================================================== */

.d-none {
  display: none !important;
}

.is-hidden {
  display: none !important;
}

.bot-cluster-header {
  margin-bottom: 14px;
}

.bot-cluster-header-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-heading);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.col-time { width: 120px; }
.col-client { width: 140px; }
.col-bot { width: 160px; }
.col-recipient { min-width: 200px; }
.col-content { min-width: 250px; }
.col-status { width: 110px; }
.col-action { width: 170px; }
.col-info { width: 70px; }

.logs-footer-tip {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.form-col-checkbox-wrapper {
  display: flex;
  align-items: flex-end;
  padding-bottom: 8px;
}

.form-checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-heading);
}

.form-checkbox-input {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  cursor: pointer;
}

.color-picker-wrapper {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 4px;
}

.link-discord-portal {
  color: var(--primary);
  text-decoration: underline;
  font-weight: 600;
}

.bot-verify-card {
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  padding: 1rem;
  border-radius: 14px;
  background: rgba(16, 185, 129, 0.08);
  border: 1.5px solid rgba(16, 185, 129, 0.35);
}

.bot-verify-card-inner {
  display: flex;
  align-items: center;
  gap: 14px;
}

.bot-verify-avatar {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  object-fit: cover;
  border: 2px solid #10b981;
}

.bot-verify-info {
  flex: 1;
}

.bot-verify-header-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bot-verify-name {
  color: var(--text-heading);
  font-size: 1rem;
}

.bot-badge-tag {
  background: #5865F2;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
}

.bot-verify-tag {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.bot-verify-status {
  font-size: 0.78rem;
  color: #10b981;
  margin-top: 2px;
  font-weight: 600;
}

.modal-footer-spaced {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.75rem;
}

.modal-footer-actions-right {
  display: flex;
  gap: 10px;
  margin-left: auto;
}

.log-modal-header-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-heading);
}

.log-modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
}

.log-modal-footer-pdpa {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}


/* ==========================================================================
   RECENT FEATURE ENHANCEMENTS (Doc Previews, Discord Simulator, Observability)
   ========================================================================== */

/* =====================================================================
   🌟 2026 LUXURY MODALS & EXPANDED EXECUTIVE WIDTHS (MyWellnetPTN)
   ===================================================================== */
.modal-w-600 {
  max-width: 720px !important;
  width: 95% !important;
}

.modal-w-650 {
  max-width: 800px !important;
  width: 95% !important;
}

.modal-w-700 {
  max-width: 880px !important;
  width: 95% !important;
}

.modal-w-750 {
  max-width: 920px !important;
  width: 95% !important;
}

.modal-w-800 {
  max-width: 960px !important;
  width: 95% !important;
}

.modal-w-850 {
  max-width: 1020px !important;
  width: 95% !important;
}

.modal-w-900 {
  max-width: 1080px !important;
  width: 96% !important;
}

.form-col-checkbox-wrapper {
  display: flex;
  align-items: flex-end;
}

.form-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-heading);
  padding: 10px 18px;
  background: rgba(16, 185, 129, 0.08);
  border: 1.5px solid rgba(16, 185, 129, 0.28);
  border-radius: 14px;
  width: 100%;
  min-height: 48px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.form-checkbox-label:hover {
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(16, 185, 129, 0.45);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.1);
}

/* ==========================================================================
   2026 Executive Luxury Modal & Premium Custom Dropdown Suite
   ========================================================================== */

/* 1. Modal Glassmorphism Overlay & Spring Container */
.admin-modal-overlay {
  position: fixed !important;
  inset: 0 !important;
  background: rgba(15, 23, 42, 0.62) !important;
  -webkit-backdrop-filter: blur(14px) !important;
  backdrop-filter: blur(14px) !important;
  z-index: 2000 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 24px !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transition: opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.28s ease !important;
}

.admin-modal-overlay.active,
.admin-modal-overlay.is-active {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

.admin-modal-container {
  background: var(--bg-card, #ffffff) !important;
  border: 1px solid var(--border-color, rgba(226, 232, 240, 0.95)) !important;
  border-radius: 24px !important;
  box-shadow: 
    0 25px 60px -15px rgba(15, 23, 42, 0.28),
    0 10px 25px -5px rgba(15, 23, 42, 0.1),
    0 0 0 1px rgba(255, 255, 255, 0.9) inset !important;
  transform: scale(0.93) translateY(18px) !important;
  opacity: 0 !important;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.26s cubic-bezier(0.16, 1, 0.3, 1) !important;
  max-height: 90vh !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

[data-theme="dark"] .admin-modal-container {
  background: #0f172a !important;
  border-color: rgba(51, 65, 85, 0.8) !important;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.06) inset !important;
}

.admin-modal-container > form {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

/* =====================================================================
   🌟 2026 Studio App Editor Modal (#appFormModal) - Split Pane Studio
   ===================================================================== */
.modal-app-editor {
  max-width: 1060px !important;
  width: 95% !important;
  height: 860px !important;
  max-height: 92vh !important;
  border-radius: 24px !important;
  box-shadow: 0 30px 80px -15px rgba(15, 23, 42, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.9) inset !important;
}

[data-theme="dark"] .modal-app-editor {
  box-shadow: 0 30px 80px -15px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.08) inset !important;
}

#appFormModal .modal-body {
  display: grid !important;
  grid-template-columns: 1.28fr 0.72fr !important;
  gap: 0 !important;
  padding: 0 !important;
  overflow: hidden !important; /* CRITICAL: Entire modal never scrolls as a unit */
  flex: 1 !important;
  min-height: 0 !important;
}

#appFormModal .modal-form-col {
  padding: 24px 26px !important;
  overflow-y: auto !important; /* Only form scrolls */
  flex: 1 !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 16px !important;
  background: #ffffff !important;
}

[data-theme="dark"] #appFormModal .modal-form-col {
  background: #0f172a !important;
}

#appFormModal .modal-form-col::-webkit-scrollbar {
  width: 6px;
}
#appFormModal .modal-form-col::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 6px;
}
[data-theme="dark"] #appFormModal .modal-form-col::-webkit-scrollbar-thumb {
  background: #334155;
}

/* Section Cards inside Form */
.modal-section-card {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 16px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.2s ease;
}

[data-theme="dark"] .modal-section-card {
  background: rgba(30, 41, 59, 0.45);
  border-color: rgba(51, 65, 85, 0.6);
}

.modal-section-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #2563eb;
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding-bottom: 2px;
}

[data-theme="dark"] .modal-section-title {
  color: #60a5fa;
}

.form-row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.form-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #334155;
  display: flex;
  align-items: center;
  gap: 4px;
}

[data-theme="dark"] .form-label {
  color: #cbd5e1;
}

.form-label .req {
  color: #ef4444;
  font-weight: 800;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.input-with-icon .input-adornment {
  position: absolute;
  right: 12px;
  color: #94a3b8;
  font-size: 0.88rem;
  pointer-events: none;
}

.input-with-icon .form-input {
  padding-right: 36px !important;
}

#appFormModal .form-input,
#appFormModal .form-textarea,
#appFormModal .form-select {
  padding: 8px 12px !important;
  border-radius: 10px !important;
  border: 1.5px solid #cbd5e1 !important;
  font-size: 0.875rem !important;
  color: #0f172a !important;
  background: #ffffff !important;
  font-family: inherit !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  line-height: 1.4 !important;
}

[data-theme="dark"] #appFormModal .form-input,
[data-theme="dark"] #appFormModal .form-textarea,
[data-theme="dark"] #appFormModal .form-select {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #f1f5f9 !important;
}

#appFormModal .form-input:focus,
#appFormModal .form-textarea:focus,
#appFormModal .form-select:focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
  outline: none !important;
}

#appFormModal .form-input[readonly] {
  background: #f1f5f9 !important;
  color: #64748b !important;
  cursor: not-allowed;
  border-color: #e2e8f0 !important;
}

[data-theme="dark"] #appFormModal .form-input[readonly] {
  background: #1e293b !important;
  color: #94a3b8 !important;
  border-color: #334155 !important;
}

/* Icon Row & Grid */
.icon-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-icon-preview-box {
  width: 40px !important;
  height: 40px !important;
  border-radius: 10px !important;
  background: linear-gradient(135deg, #1e40af 0%, #2563eb 100%) !important;
  color: #ffffff !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 1.15rem !important;
  flex-shrink: 0 !important;
  box-shadow: 0 3px 8px rgba(37, 99, 235, 0.25) !important;
}

.icon-picker-grid {
  display: grid !important;
  grid-template-columns: repeat(8, 1fr) !important;
  gap: 6px !important;
  max-height: 110px !important;
  overflow-y: auto !important;
  padding: 8px !important;
  background: #ffffff !important;
  border: 1.5px solid #e2e8f0 !important;
  border-radius: 10px !important;
  margin-top: 6px !important;
}

[data-theme="dark"] .icon-picker-grid {
  background: #1e293b !important;
  border-color: #334155 !important;
}

.icon-picker-grid::-webkit-scrollbar {
  width: 4px;
}
.icon-picker-grid::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.icon-pick-btn {
  width: 32px !important;
  height: 32px !important;
  border-radius: 7px !important;
  border: 1px solid #e2e8f0 !important;
  background: #f8fafc !important;
  color: #475569 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: all 0.18s ease !important;
  font-size: 0.9rem !important;
}

[data-theme="dark"] .icon-pick-btn {
  background: #0f172a !important;
  border-color: #334155 !important;
  color: #94a3b8 !important;
}

.icon-pick-btn:hover {
  background: #eff6ff !important;
  color: #2563eb !important;
  border-color: #93c5fd !important;
  transform: translateY(-1px) scale(1.08) !important;
}

.icon-pick-btn.selected {
  background: #2563eb !important;
  color: #ffffff !important;
  border-color: #2563eb !important;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35) !important;
  transform: scale(1.08) !important;
}

/* Color Swatches */
.color-picker-flex {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-wrap: wrap !important;
  margin-top: 6px !important;
}

.color-swatch-btn {
  width: 28px !important;
  height: 28px !important;
  border-radius: 50% !important;
  border: 2px solid transparent !important;
  cursor: pointer !important;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
  position: relative !important;
  padding: 0 !important;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.12) !important;
}

.color-swatch-btn:hover {
  transform: scale(1.18) !important;
}

.color-swatch-btn.selected {
  border-color: #ffffff !important;
  box-shadow: 0 0 0 3px #2563eb, 0 4px 10px rgba(0, 0, 0, 0.2) !important;
  transform: scale(1.15) !important;
}

.color-swatch-btn.selected::after {
  content: "✓";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

/* Modern Toggle Cards */
.form-switches-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.modern-toggle-card {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-user-select: none;
  user-select: none;
}

[data-theme="dark"] .modern-toggle-card {
  background: rgba(30, 41, 59, 0.45);
  border-color: rgba(51, 65, 85, 0.6);
}

.modern-toggle-card input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: #2563eb;
  margin-right: 10px;
  cursor: pointer;
}

.modern-toggle-card:has(input:checked) {
  background: #eff6ff;
  border-color: #bfdbfe;
}

[data-theme="dark"] .modern-toggle-card:has(input:checked) {
  background: rgba(37, 99, 235, 0.12);
  border-color: rgba(37, 99, 235, 0.35);
}

.toggle-card-body {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toggle-card-icon {
  color: #64748b;
  font-size: 0.95rem;
}

.modern-toggle-card:has(input:checked) .toggle-card-icon {
  color: #2563eb;
}

.toggle-card-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #1e293b;
}

[data-theme="dark"] .toggle-card-title {
  color: #f1f5f9;
}

.toggle-card-desc {
  font-size: 0.7rem;
  color: #64748b;
}

/* Compact Dropdown in Modal */
#appFormModal .premium-custom-trigger {
  min-height: 40px !important;
  padding: 6px 12px !important;
  border-radius: 10px !important;
}

#appFormModal .custom-trigger-texts {
  line-height: 1.2 !important;
}

#appFormModal .custom-trigger-sub {
  display: none !important;
}

/* Right Column: Live Preview Studio (Pinned, Never Cut Off) */
#appFormModal .live-preview-box {
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%) !important;
  border-left: 1px solid #e2e8f0 !important;
  padding: 24px 22px !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
  gap: 16px !important;
  min-width: 0 !important;
  overflow: hidden !important;
  position: relative !important;
}

[data-theme="dark"] #appFormModal .live-preview-box {
  background: linear-gradient(180deg, #0b1120 0%, #070c16 100%) !important;
  border-left-color: rgba(51, 65, 85, 0.6) !important;
}

.preview-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

[data-theme="dark"] .preview-header-bar {
  border-bottom-color: rgba(51, 65, 85, 0.6);
}

.preview-badge-pulse {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #059669;
  background: rgba(16, 185, 129, 0.1);
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.preview-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulseGreenStudio 2s infinite;
}

@keyframes pulseGreenStudio {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.preview-stage-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
}

.live-preview-stage {
  padding: 16px;
  background: #ffffff;
  border-radius: 18px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.04);
}

[data-theme="dark"] .live-preview-stage {
  background: rgba(15, 23, 42, 0.7);
  border-color: rgba(51, 65, 85, 0.6);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
}

.live-preview-stage .launch-tile {
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04) !important;
  border: 1px solid #e2e8f0 !important;
  padding: 20px !important;
  cursor: default !important;
}

[data-theme="dark"] .live-preview-stage .launch-tile {
  border-color: rgba(255, 255, 255, 0.08) !important;
  background: rgba(30, 41, 59, 0.7) !important;
}

/* Theme color dynamic gradient binding on preview tile icon */
.launch-tile.theme-blue #prevIconBox { background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%) !important; }
.launch-tile.theme-emerald #prevIconBox { background: linear-gradient(135deg, #047857 0%, #059669 100%) !important; }
.launch-tile.theme-indigo #prevIconBox { background: linear-gradient(135deg, #3730a3 0%, #4f46e5 100%) !important; }
.launch-tile.theme-sky #prevIconBox { background: linear-gradient(135deg, #0369a1 0%, #0284c7 100%) !important; }
.launch-tile.theme-amber #prevIconBox { background: linear-gradient(135deg, #b45309 0%, #d97706 100%) !important; }
.launch-tile.theme-violet #prevIconBox { background: linear-gradient(135deg, #6d28d9 0%, #7c3aed 100%) !important; }
.launch-tile.theme-teal #prevIconBox { background: linear-gradient(135deg, #0f766e 0%, #0d9488 100%) !important; }
.launch-tile.theme-rose #prevIconBox { background: linear-gradient(135deg, #be123c 0%, #e11d48 100%) !important; }
.launch-tile.theme-purple #prevIconBox { background: linear-gradient(135deg, #7e22ce 0%, #9333ea 100%) !important; }
.launch-tile.theme-orange #prevIconBox { background: linear-gradient(135deg, #c2410c 0%, #ea580c 100%) !important; }
.launch-tile.theme-cyan #prevIconBox { background: linear-gradient(135deg, #0e7490 0%, #0891b2 100%) !important; }

.preview-meta-panel {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

[data-theme="dark"] .preview-meta-panel {
  background: #0f172a;
  border-color: rgba(51, 65, 85, 0.6);
}

.preview-meta-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
}

.preview-meta-item .meta-label {
  color: #64748b;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.preview-meta-item .meta-val {
  font-family: monospace;
  color: #2563eb;
  font-weight: 700;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

[data-theme="dark"] .preview-meta-item .meta-val {
  color: #60a5fa;
}

.preview-meta-chips {
  display: flex;
  align-items: center;
  gap: 8px;
}

.meta-tag {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  background: #f1f5f9;
  color: #475569;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

[data-theme="dark"] .meta-tag {
  background: #1e293b;
  color: #94a3b8;
}

.preview-sync-hint {
  font-size: 0.72rem;
  color: #64748b;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: auto;
}

@media (max-width: 960px) {
  .modal-app-editor {
    height: auto !important;
    max-height: 94vh !important;
  }
  #appFormModal .modal-body {
    grid-template-columns: 1fr !important;
    overflow-y: auto !important;
  }
  #appFormModal .modal-form-col {
    overflow-y: visible !important;
    max-height: none !important;
  }
  #appFormModal .live-preview-box {
    border-left: none !important;
    border-top: 1px solid #e2e8f0 !important;
    overflow: visible !important;
  }
}

.modal-body-form {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

.modal-body-form .form-grid {
  padding: 24px 28px !important;
  overflow-y: auto !important;
  flex: 1 !important;
  min-height: 0 !important;
}

.admin-modal-overlay.active .admin-modal-container,
.admin-modal-overlay.is-active .admin-modal-container {
  transform: scale(1) translateY(0) !important;
  opacity: 1 !important;
}

.modal-header {
  padding: 24px 34px !important;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%) !important;
  border-bottom: 1px solid #f1f5f9 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  border-top-left-radius: 24px !important;
  border-top-right-radius: 24px !important;
}

.modal-title-wrap {
  display: flex !important;
  align-items: center !important;
  gap: 14px !important;
}

.modal-header-icon-box {
  width: 48px !important;
  height: 48px !important;
  border-radius: 16px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 1.35rem !important;
  flex-shrink: 0 !important;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

.modal-header-icon-box.icon-box-blue,
.modal-header-icon-box.bg-blue-subtle {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.12) 0%, rgba(59, 130, 246, 0.05) 100%) !important;
  color: #2563eb !important;
  border: 1.5px solid rgba(37, 99, 235, 0.18) !important;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08) !important;
}

.modal-header-icon-box.icon-box-amber,
.modal-header-icon-box.bg-amber-subtle {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.14) 0%, rgba(217, 119, 6, 0.06) 100%) !important;
  color: #d97706 !important;
  border: 1.5px solid rgba(245, 158, 11, 0.22) !important;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.1) !important;
}

.modal-header-icon-box.icon-box-indigo,
.modal-header-icon-box.bg-indigo-subtle {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(79, 70, 229, 0.05) 100%) !important;
  color: #4f46e5 !important;
  border: 1.5px solid rgba(99, 102, 241, 0.18) !important;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.08) !important;
}

.modal-header-icon-box.icon-box-emerald,
.modal-header-icon-box.bg-emerald-subtle {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(5, 150, 105, 0.05) 100%) !important;
  color: #059669 !important;
  border: 1.5px solid rgba(16, 185, 129, 0.18) !important;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.08) !important;
}

.modal-title {
  font-size: 1.25rem !important;
  font-weight: 800 !important;
  color: #0f172a !important;
  letter-spacing: -0.02em !important;
  line-height: 1.3 !important;
  margin: 0 !important;
}

.modal-subtitle-text {
  display: block !important;
  font-size: 0.8rem !important;
  color: #64748b !important;
  font-weight: 500 !important;
  margin-top: 3px !important;
  line-height: 1.35 !important;
}

.modal-close-btn {
  width: 38px !important;
  height: 38px !important;
  border-radius: 12px !important;
  border: 1px solid #e2e8f0 !important;
  background: #f8fafc !important;
  color: #64748b !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  font-size: 1rem !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.modal-close-btn:hover {
  background: #fee2e2 !important;
  color: #ef4444 !important;
  border-color: #fca5a5 !important;
  transform: rotate(90deg) scale(1.06) !important;
}

/* 2. Sleek Dice Randomize Button (.btn-rand-key) */
.btn-rand-key {
  display: inline-flex !important;
  align-items: center !important;
  gap: 7px !important;
  padding: 10px 16px !important;
  font-size: 0.88rem !important;
  font-weight: 700 !important;
  border-radius: 14px !important;
  background: linear-gradient(135deg, #f0f7ff 0%, #e0f2fe 100%) !important;
  color: #0284c7 !important;
  border: 1.5px solid #bae6fd !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  font-family: inherit !important;
  box-shadow: 0 2px 5px rgba(14, 165, 233, 0.08) !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.btn-rand-key:hover {
  background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%) !important;
  color: #0369a1 !important;
  border-color: #7dd3fc !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.18) !important;
}

.btn-rand-key:active {
  transform: scale(0.96) !important;
}

.btn-rand-key i {
  color: #0284c7 !important;
  font-size: 0.95rem !important;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

.btn-rand-key:hover i {
  transform: rotate(180deg) !important;
}

/* 3. Luxury Form Inputs & Focus Rings */
.form-input, .form-textarea {
  border: 1.5px solid #e2e8f0 !important;
  border-radius: 14px !important;
  background: #ffffff !important;
  color: #0f172a !important;
  font-family: inherit !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.form-input:hover, .form-textarea:hover {
  border-color: #cbd5e1 !important;
}

.form-input:focus, .form-textarea:focus {
  border-color: #3b82f6 !important;
  background: #ffffff !important;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12), 0 2px 6px rgba(0, 0, 0, 0.03) !important;
  outline: none !important;
}

/* 4. Modal Footer Buttons */
.modal-footer {
  padding: 22px 34px !important;
  background: #ffffff !important;
  border-top: 1px solid #f1f5f9 !important;
  border-bottom-left-radius: 24px !important;
  border-bottom-right-radius: 24px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 12px !important;
}

.modal-footer .btn-modern-secondary {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 11px 22px !important;
  font-size: 0.92rem !important;
  font-weight: 700 !important;
  border-radius: 14px !important;
  background: #f8fafc !important;
  color: #475569 !important;
  border: 1.5px solid #e2e8f0 !important;
  cursor: pointer !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  font-family: inherit !important;
}

.modal-footer .btn-modern-secondary:hover {
  background: #f1f5f9 !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.05) !important;
}

.modal-footer .btn-modern-primary {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 11px 26px !important;
  font-size: 0.94rem !important;
  font-weight: 700 !important;
  border-radius: 14px !important;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
  color: #ffffff !important;
  border: none !important;
  cursor: pointer !important;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.38), 0 1px 2px rgba(0, 0, 0, 0.08) !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  font-family: inherit !important;
}

.modal-footer .btn-modern-primary:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.48) !important;
}

.modal-footer .btn-modern-primary:active {
  transform: scale(0.98) !important;
}

/* 5. Luxury Custom Dropdown Component */
.premium-native-select-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.select-wrapper {
  position: relative !important;
  width: 100% !important;
}

.select-wrapper > .select-chevron {
  display: none !important;
}

.premium-custom-dropdown {
  position: relative;
  width: 100%;
}

.premium-custom-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 7px 14px;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
}

.premium-custom-trigger:hover {
  border-color: #94a3b8;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.premium-custom-trigger.open,
.premium-custom-trigger:focus-visible {
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12), 0 2px 8px rgba(15, 23, 42, 0.06);
  outline: none;
}

.custom-trigger-content {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.custom-trigger-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.custom-trigger-texts {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.custom-trigger-label {
  font-size: 0.92rem;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.custom-trigger-sub {
  font-size: 0.76rem;
  color: #64748b;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.custom-trigger-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin-left: 10px;
}

.custom-trigger-chevron {
  font-size: 0.8rem;
  color: #94a3b8;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.2s ease;
}

.premium-custom-trigger.open .custom-trigger-chevron {
  transform: rotate(180deg);
  color: #2563eb;
}

/* Floating Menu Popover */
.premium-custom-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 1050;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 18px;
  box-shadow: 0 20px 45px -10px rgba(15, 23, 42, 0.22), 0 0 0 1px rgba(0, 0, 0, 0.04);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-8px) scale(0.98);
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.2s;
}

.premium-custom-menu.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.custom-menu-search {
  position: relative;
  padding: 6px 8px 10px;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 6px;
}

.custom-menu-search .search-icon {
  position: absolute;
  left: 20px;
  top: 18px;
  font-size: 0.82rem;
  color: #94a3b8;
}

.custom-menu-search-input {
  width: 100%;
  padding: 8px 12px 8px 34px;
  font-size: 0.86rem;
  font-family: inherit;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  color: #0f172a;
  transition: all 0.15s ease;
}

.custom-menu-search-input:focus {
  background: #ffffff;
  border-color: #3b82f6;
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.custom-menu-options-list {
  max-height: 260px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-right: 2px;
}

.custom-menu-options-list::-webkit-scrollbar {
  width: 5px;
}

.custom-menu-options-list::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 99px;
}

.premium-custom-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  -webkit-user-select: none;
  user-select: none;
}

.premium-custom-option:hover {
  background: #f8fafc;
  transform: translateX(2px);
}

.premium-custom-option.active {
  background: #eff6ff;
}

.custom-option-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.custom-option-icon-box {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  flex-shrink: 0;
}

.custom-option-texts {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.custom-option-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.custom-option-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.premium-custom-option.active .custom-option-title {
  color: #2563eb;
}

.custom-option-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 6px;
  background: #f1f5f9;
  color: #475569;
  font-family: monospace;
}

.custom-option-subtext {
  font-size: 0.77rem;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.custom-option-status-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin-left: 10px;
}

.custom-option-check {
  font-size: 0.85rem;
  color: #2563eb;
  opacity: 0;
  transform: scale(0.7);
  transition: all 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.premium-custom-option.active .custom-option-check {
  opacity: 1;
  transform: scale(1);
}

.custom-option-empty {
  padding: 24px 12px;
  text-align: center;
  color: #94a3b8;
  font-size: 0.88rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

/* Status dots & badges */
.status-online-dot {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #059669;
  background: rgba(16, 185, 129, 0.1);
  padding: 2px 8px;
  border-radius: 99px;
}

.status-online-dot i {
  font-size: 0.45rem;
  color: #10b981;
}

.status-offline-dot {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #dc2626;
  background: rgba(239, 68, 68, 0.1);
  padding: 2px 8px;
  border-radius: 99px;
}

.status-offline-dot i {
  font-size: 0.45rem;
  color: #ef4444;
}

.status-warning-dot {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #d97706;
  background: rgba(245, 158, 11, 0.1);
  padding: 2px 8px;
  border-radius: 99px;
}

.status-warning-dot i {
  font-size: 0.45rem;
  color: #f59e0b;
}

.status-info-dot {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #4f46e5;
  background: rgba(99, 102, 241, 0.1);
  padding: 2px 8px;
  border-radius: 99px;
}

.status-info-dot i {
  font-size: 0.45rem;
  color: #6366f1;
}

.status-verified-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.74rem;
  font-weight: 700;
  color: #059669;
  background: rgba(16, 185, 129, 0.1);
  padding: 2px 8px;
  border-radius: 99px;
}

/* ==========================================================================
   2026 Executive Observability & Delivery Audit Suite (Tab 3: PaneLogs)
   ========================================================================== */

/* Header Area */
.admin-pane-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.pane-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-heading, #0f172a);
  margin: 0 0 6px 0;
  letter-spacing: -0.02em;
}

[data-theme="dark"] .pane-title-wrap {
  color: #f8fafc;
}

.pane-icon-badge {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.15) 0%, rgba(99, 102, 241, 0.2) 100%);
  color: #2563eb;
  font-size: 1.15rem;
  border: 1px solid rgba(99, 102, 241, 0.25);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.12);
}

[data-theme="dark"] .pane-icon-badge {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(99, 102, 241, 0.25) 100%);
  color: #60a5fa;
  border-color: rgba(99, 102, 241, 0.35);
}

.live-stream-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: 9999px;
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.3);
  vertical-align: middle;
}

[data-theme="dark"] .live-stream-badge {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.4);
}

.pulse-dot {
  font-size: 0.5rem;
  color: #10b981;
  animation: livePulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes livePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.25); }
}

.pane-desc {
  font-size: 0.88rem;
  color: var(--text-muted, #64748b);
  margin: 0;
  line-height: 1.5;
  max-width: 680px;
}

/* Header Action Buttons */
.btn-header-refresh {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 9px 18px !important;
  font-size: 0.86rem !important;
  font-weight: 700 !important;
  border-radius: 12px !important;
  background: #ffffff !important;
  color: #1e293b !important;
  border: 1.5px solid #cbd5e1 !important;
  cursor: pointer !important;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04) !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  font-family: inherit !important;
}

.btn-header-refresh:hover {
  background: #f8fafc !important;
  border-color: #3b82f6 !important;
  color: #2563eb !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.15) !important;
}

[data-theme="dark"] .btn-header-refresh {
  background: #1e293b !important;
  color: #f1f5f9 !important;
  border-color: #334155 !important;
}

[data-theme="dark"] .btn-header-refresh:hover {
  background: #334155 !important;
  border-color: #60a5fa !important;
  color: #60a5fa !important;
}

.btn-header-danger {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 9px 18px !important;
  font-size: 0.86rem !important;
  font-weight: 700 !important;
  border-radius: 12px !important;
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%) !important;
  color: #dc2626 !important;
  border: 1.5px solid #fca5a5 !important;
  cursor: pointer !important;
  box-shadow: 0 2px 6px rgba(220, 38, 38, 0.05) !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  font-family: inherit !important;
}

.btn-header-danger:hover {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
  color: #ffffff !important;
  border-color: #dc2626 !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 18px rgba(220, 38, 38, 0.25) !important;
}

[data-theme="dark"] .btn-header-danger {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #f87171 !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
}

/* 4 Quick Metric Cards (KPIs) */
.logs-kpi-grid {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 16px !important;
  margin-bottom: 24px !important;
}

@media (max-width: 1200px) {
  .logs-kpi-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 640px) {
  .logs-kpi-grid {
    grid-template-columns: 1fr !important;
  }
}

.log-kpi-box {
  background: #ffffff !important;
  border: 1px solid rgba(226, 232, 240, 0.9) !important;
  border-radius: 18px !important;
  padding: 18px 20px !important;
  display: flex !important;
  align-items: center !important;
  gap: 16px !important;
  box-shadow: 0 4px 18px -2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.02) !important;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
  position: relative !important;
  overflow: hidden !important;
}

.log-kpi-box:hover {
  transform: translateY(-3px) !important;
  box-shadow: 0 12px 28px -4px rgba(15, 23, 42, 0.08) !important;
  border-color: #cbd5e1 !important;
}

[data-theme="dark"] .log-kpi-box {
  background: #111827 !important;
  border-color: #1f2937 !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25) !important;
}

[data-theme="dark"] .log-kpi-box:hover {
  border-color: #374151 !important;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4) !important;
}

.log-kpi-icon {
  width: 50px !important;
  height: 50px !important;
  border-radius: 14px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 1.3rem !important;
  flex-shrink: 0 !important;
}

.kpi-icon-blue {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.12) 0%, rgba(59, 130, 246, 0.2) 100%) !important;
  color: #2563eb !important;
  border: 1px solid rgba(37, 99, 235, 0.25) !important;
}

.kpi-icon-emerald {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(52, 211, 153, 0.2) 100%) !important;
  color: #059669 !important;
  border: 1px solid rgba(16, 185, 129, 0.25) !important;
}

.kpi-icon-violet {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.12) 0%, rgba(167, 139, 250, 0.2) 100%) !important;
  color: #7c3aed !important;
  border: 1px solid rgba(124, 58, 237, 0.25) !important;
}

.kpi-icon-amber {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12) 0%, rgba(251, 191, 36, 0.2) 100%) !important;
  color: #d97706 !important;
  border: 1px solid rgba(245, 158, 11, 0.25) !important;
}

[data-theme="dark"] .kpi-icon-blue { color: #60a5fa !important; border-color: rgba(96, 165, 250, 0.3) !important; }

[data-theme="dark"] .kpi-icon-emerald { color: #34d399 !important; border-color: rgba(52, 211, 153, 0.3) !important; }

[data-theme="dark"] .kpi-icon-violet { color: #a78bfa !important; border-color: rgba(167, 139, 250, 0.3) !important; }

[data-theme="dark"] .kpi-icon-amber { color: #fbbf24 !important; border-color: rgba(251, 191, 36, 0.3) !important; }

.log-kpi-body {
  display: flex !important;
  flex-direction: column !important;
  gap: 2px !important;
  flex: 1 !important;
  min-width: 0 !important;
}

.log-kpi-label {
  font-size: 0.78rem !important;
  font-weight: 700 !important;
  color: var(--text-muted, #64748b) !important;
  letter-spacing: 0.02em !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.log-kpi-val {
  font-size: 1.85rem !important;
  font-weight: 800 !important;
  color: var(--text-heading, #0f172a) !important;
  line-height: 1.15 !important;
  font-family: 'Outfit', sans-serif !important;
  letter-spacing: -0.02em !important;
}

[data-theme="dark"] .log-kpi-val {
  color: #f8fafc !important;
}

.log-kpi-val.text-emerald { color: #059669 !important; }

[data-theme="dark"] .log-kpi-val.text-emerald { color: #10b981 !important; }

.log-kpi-val.text-violet { color: #7c3aed !important; }

[data-theme="dark"] .log-kpi-val.text-violet { color: #a78bfa !important; }

.log-kpi-val.text-amber { color: #d97706 !important; }

[data-theme="dark"] .log-kpi-val.text-amber { color: #fbbf24 !important; }

.log-kpi-desc {
  font-size: 0.74rem !important;
  font-weight: 600 !important;
  color: var(--text-muted, #94a3b8) !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  margin-top: 3px !important;
}

.log-kpi-desc.text-emerald { color: #059669 !important; }

[data-theme="dark"] .log-kpi-desc.text-emerald { color: #34d399 !important; }

.log-kpi-desc.text-violet { color: #7c3aed !important; }

[data-theme="dark"] .log-kpi-desc.text-violet { color: #a78bfa !important; }

/* Filter & Search Toolbar */
.logs-filter-toolbar {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 18px !important;
  padding: 14px 18px !important;
  margin-bottom: 20px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 16px !important;
  flex-wrap: wrap !important;
  box-shadow: 0 4px 16px -2px rgba(15, 23, 42, 0.04) !important;
}

[data-theme="dark"] .logs-filter-toolbar {
  background: #111827 !important;
  border-color: #1f2937 !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2) !important;
}

.logs-search-container {
  position: relative !important;
  flex: 1 !important;
  min-width: 280px !important;
  max-width: 480px !important;
  display: flex !important;
  align-items: center !important;
}

.search-leading-icon {
  position: absolute !important;
  left: 14px !important;
  color: #94a3b8 !important;
  font-size: 0.95rem !important;
  pointer-events: none !important;
}

.logs-input-search {
  width: 100% !important;
  padding: 10px 40px 10px 42px !important;
  border-radius: 12px !important;
  border: 1.5px solid #cbd5e1 !important;
  background: #f8fafc !important;
  color: #1e293b !important;
  font-size: 0.88rem !important;
  font-weight: 500 !important;
  font-family: inherit !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  outline: none !important;
}

.logs-input-search:focus {
  background: #ffffff !important;
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15) !important;
}

[data-theme="dark"] .logs-input-search {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #f1f5f9 !important;
}

[data-theme="dark"] .logs-input-search:focus {
  background: #0f172a !important;
  border-color: #60a5fa !important;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2) !important;
}

.logs-clear-search-btn {
  position: absolute !important;
  right: 12px !important;
  background: none !important;
  border: none !important;
  color: #94a3b8 !important;
  cursor: pointer !important;
  padding: 4px !important;
  font-size: 0.9rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: color 0.15s !important;
}

.logs-clear-search-btn:hover {
  color: #ef4444 !important;
}

.logs-clear-search-btn.is-hidden {
  display: none !important;
}

.logs-filters-wrap {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  flex-wrap: wrap !important;
}

/* Filter Pills Bar (Segmented Control) */
.logs-pills-bar {
  display: inline-flex !important;
  align-items: center !important;
  background: #f1f5f9 !important;
  padding: 4px !important;
  border-radius: 14px !important;
  gap: 4px !important;
  border: 1.5px solid #e2e8f0 !important;
}

[data-theme="dark"] .logs-pills-bar {
  background: #1e293b !important;
  border-color: #334155 !important;
}

.log-filter-pill {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 7px 15px !important;
  border-radius: 10px !important;
  font-size: 0.82rem !important;
  font-weight: 700 !important;
  color: #64748b !important;
  border: none !important;
  background: transparent !important;
  cursor: pointer !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  font-family: inherit !important;
  white-space: nowrap !important;
}

.log-filter-pill:hover {
  color: #1e293b !important;
  background: rgba(255, 255, 255, 0.6) !important;
}

[data-theme="dark"] .log-filter-pill {
  color: #94a3b8 !important;
}

[data-theme="dark"] .log-filter-pill:hover {
  color: #f1f5f9 !important;
  background: rgba(255, 255, 255, 0.08) !important;
}

.log-filter-pill.active {
  background: #ffffff !important;
  color: #2563eb !important;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04) !important;
}

[data-theme="dark"] .log-filter-pill.active {
  background: #334155 !important;
  color: #60a5fa !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25) !important;
}

.log-pill-badge {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 22px !important;
  height: 20px !important;
  padding: 0 7px !important;
  border-radius: 9999px !important;
  font-size: 0.74rem !important;
  font-weight: 800 !important;
  background: rgba(148, 163, 184, 0.22) !important;
  color: #475569 !important;
  line-height: 1 !important;
  transition: all 0.2s ease !important;
}

[data-theme="dark"] .log-pill-badge {
  background: rgba(148, 163, 184, 0.25) !important;
  color: #cbd5e1 !important;
}

.log-filter-pill.active .log-pill-badge {
  background: #2563eb !important;
  color: #ffffff !important;
}

[data-theme="dark"] .log-filter-pill.active .log-pill-badge {
  background: #3b82f6 !important;
  color: #ffffff !important;
}


/* Action Button in Table Rows */
.btn-open-detail {
  width: 38px !important;
  height: 38px !important;
  border-radius: 12px !important;
  background: linear-gradient(135deg, #f0f7ff 0%, #e0f2fe 100%) !important;
  border: 1.5px solid #bae6fd !important;
  color: #0284c7 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  font-size: 0.95rem !important;
  box-shadow: 0 2px 5px rgba(14, 165, 233, 0.08) !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.btn-open-detail:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
  color: #ffffff !important;
  border-color: #2563eb !important;
  transform: translateX(3px) scale(1.08) !important;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35) !important;
}

[data-theme="dark"] .btn-open-detail {
  background: rgba(37, 99, 235, 0.15) !important;
  border-color: rgba(37, 99, 235, 0.3) !important;
  color: #60a5fa !important;
}

[data-theme="dark"] .btn-open-detail:hover {
  background: #2563eb !important;
  color: #ffffff !important;
}

.log-data-row {
  cursor: pointer !important;
  transition: background-color 0.15s ease !important;
}

.log-data-row:hover {
  background-color: rgba(241, 245, 249, 0.7) !important;
}

[data-theme="dark"] .log-data-row:hover {
  background-color: rgba(30, 41, 59, 0.7) !important;
}

/* Table Card & Header & Row Enhancements */
.logs-table-wrapper {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 18px !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  box-shadow: 0 4px 20px -3px rgba(15, 23, 42, 0.05) !important;
}

.logs-table-wrapper::-webkit-scrollbar {
  height: 6px;
}

.logs-table-wrapper::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

[data-theme="dark"] .logs-table-wrapper {
  background: #111827 !important;
  border-color: #1f2937 !important;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3) !important;
}

.logs-modern-table {
  width: 100% !important;
  min-width: 1060px !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  font-family: var(--font-base) !important;
}

.logs-modern-table th {
  background: #f8fafc !important;
  color: #64748b !important;
  font-size: 0.78rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.03em !important;
  padding: 13px 14px !important;
  border-bottom: 1.5px solid #e2e8f0 !important;
  white-space: nowrap !important;
  font-family: var(--font-base) !important;
}

[data-theme="dark"] .logs-modern-table th {
  background: #1e293b !important;
  color: #94a3b8 !important;
  border-bottom-color: #334155 !important;
}

.logs-modern-table td {
  padding: 12px 14px !important;
  border-bottom: 1px solid #f1f5f9 !important;
  font-size: 0.85rem !important;
  vertical-align: middle !important;
  font-family: var(--font-base) !important;
}

[data-theme="dark"] .logs-modern-table td {
  border-bottom-color: #1f2937 !important;
}

/* Column Widths & Alignments */
.col-time { width: 105px !important; min-width: 105px !important; }

.col-client { width: 130px !important; min-width: 130px !important; white-space: nowrap !important; }

.col-bot { width: 165px !important; min-width: 165px !important; }

.col-recipient { width: 220px !important; min-width: 220px !important; }

.col-content { min-width: 250px !important; }

.col-status { width: 110px !important; min-width: 110px !important; text-align: center !important; }

.col-action { width: 175px !important; min-width: 175px !important; }

.col-info { width: 60px !important; min-width: 60px !important; }

/* Log Time Column */
.log-time-col {
  display: flex !important;
  flex-direction: column !important;
  gap: 2px !important;
}

.time-bold {
  font-size: 0.85rem !important;
  font-weight: 700 !important;
  color: var(--text-heading, #0f172a) !important;
  font-family: 'Inter', 'Prompt', sans-serif !important;
}

[data-theme="dark"] .time-bold {
  color: #f8fafc !important;
}

.date-muted {
  font-size: 0.72rem !important;
  color: #94a3b8 !important;
}

/* Client Badge Pills */
.client-pill {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 5px 12px !important;
  border-radius: 9999px !important;
  font-size: 0.76rem !important;
  font-weight: 700 !important;
  white-space: nowrap !important;
}

.client-test {
  background: rgba(245, 158, 11, 0.12) !important;
  color: #d97706 !important;
  border: 1px solid rgba(245, 158, 11, 0.3) !important;
}

[data-theme="dark"] .client-test {
  background: rgba(245, 158, 11, 0.2) !important;
  color: #fbbf24 !important;
  border-color: rgba(245, 158, 11, 0.4) !important;
}

.client-app {
  background: rgba(37, 99, 235, 0.1) !important;
  color: #2563eb !important;
  border: 1px solid rgba(37, 99, 235, 0.25) !important;
}

[data-theme="dark"] .client-app {
  background: rgba(37, 99, 235, 0.2) !important;
  color: #60a5fa !important;
  border-color: rgba(37, 99, 235, 0.35) !important;
}

/* Bot Badges */
.bot-badge-pill {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 4px 10px !important;
  border-radius: 8px !important;
  font-size: 0.78rem !important;
  font-weight: 700 !important;
  white-space: nowrap !important;
}

.pill-strat {
  background: rgba(99, 102, 241, 0.12) !important;
  color: #4f46e5 !important;
  border: 1px solid rgba(99, 102, 241, 0.25) !important;
}

[data-theme="dark"] .pill-strat {
  background: rgba(99, 102, 241, 0.2) !important;
  color: #818cf8 !important;
  border-color: rgba(99, 102, 241, 0.35) !important;
}

.pill-portal {
  background: rgba(16, 185, 129, 0.12) !important;
  color: #059669 !important;
  border: 1px solid rgba(16, 185, 129, 0.25) !important;
}

[data-theme="dark"] .pill-portal {
  background: rgba(16, 185, 129, 0.2) !important;
  color: #34d399 !important;
  border-color: rgba(16, 185, 129, 0.35) !important;
}

.pill-epitrack {
  background: rgba(239, 68, 68, 0.12) !important;
  color: #dc2626 !important;
  border: 1px solid rgba(239, 68, 68, 0.25) !important;
}

[data-theme="dark"] .pill-epitrack {
  background: rgba(239, 68, 68, 0.2) !important;
  color: #f87171 !important;
}

.pill-kpi {
  background: rgba(245, 158, 11, 0.12) !important;
  color: #d97706 !important;
  border: 1px solid rgba(245, 158, 11, 0.25) !important;
}

[data-theme="dark"] .pill-kpi {
  background: rgba(245, 158, 11, 0.2) !important;
  color: #fbbf24 !important;
}

/* Recipient Card (Avatar + Info) */
.log-rec-card {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
}

.log-rec-avatar {
  width: 34px !important;
  height: 34px !important;
  border-radius: 50% !important;
  background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%) !important;
  color: #ffffff !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 0.82rem !important;
  font-weight: 800 !important;
  box-shadow: 0 2px 6px rgba(99, 102, 241, 0.3) !important;
  flex-shrink: 0 !important;
}

.log-rec-info {
  display: flex !important;
  flex-direction: column !important;
  gap: 2px !important;
}

.log-rec-name {
  font-size: 0.86rem !important;
  font-weight: 700 !important;
  color: var(--text-heading, #0f172a) !important;
}

[data-theme="dark"] .log-rec-name {
  color: #f8fafc !important;
}

.log-rec-sub {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  flex-wrap: wrap !important;
}

.log-rec-discord {
  font-size: 0.72rem !important;
  font-weight: 600 !important;
  color: #5865F2 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
}

.log-rec-cid {
  font-size: 0.7rem !important;
  font-family: 'Fira Code', monospace !important;
  color: #94a3b8 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
}

/* Title & Content Cell */
.log-title-cell {
  display: flex !important;
  flex-direction: column !important;
  gap: 3px !important;
}

.log-title-text {
  font-size: 0.84rem !important;
  font-weight: 700 !important;
  color: var(--text-heading, #0f172a) !important;
  max-width: 280px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

[data-theme="dark"] .log-title-text {
  color: #f8fafc !important;
}

.log-tracking-sub {
  font-size: 0.68rem !important;
  font-family: 'Fira Code', monospace !important;
  color: #94a3b8 !important;
}

/* Delivery Status Badges */
.log-delivery-badge {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  padding: 4px 10px !important;
  border-radius: 9999px !important;
  font-size: 0.74rem !important;
  font-weight: 700 !important;
  white-space: nowrap !important;
}

.log-delivery-badge.success {
  background: rgba(16, 185, 129, 0.12) !important;
  color: #059669 !important;
  border: 1px solid rgba(16, 185, 129, 0.3) !important;
}

[data-theme="dark"] .log-delivery-badge.success {
  background: rgba(16, 185, 129, 0.2) !important;
  color: #34d399 !important;
}

.log-delivery-badge.failed {
  background: rgba(239, 68, 68, 0.12) !important;
  color: #dc2626 !important;
  border: 1px solid rgba(239, 68, 68, 0.3) !important;
}

[data-theme="dark"] .log-delivery-badge.failed {
  background: rgba(239, 68, 68, 0.2) !important;
  color: #f87171 !important;
}

/* 2-Way Interactive Action Chips */
.log-action-cell {
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
}

.log-interactive-chip {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 4px 10px !important;
  border-radius: 8px !important;
  font-size: 0.75rem !important;
  font-weight: 700 !important;
  width: fit-content !important;
  white-space: nowrap !important;
}

.chip-ack {
  background: rgba(16, 185, 129, 0.12) !important;
  color: #059669 !important;
  border: 1px solid rgba(16, 185, 129, 0.3) !important;
}

[data-theme="dark"] .chip-ack {
  background: rgba(16, 185, 129, 0.2) !important;
  color: #34d399 !important;
}

.chip-approve {
  background: rgba(99, 102, 241, 0.12) !important;
  color: #4f46e5 !important;
  border: 1px solid rgba(99, 102, 241, 0.3) !important;
}

[data-theme="dark"] .chip-approve {
  background: rgba(99, 102, 241, 0.2) !important;
  color: #818cf8 !important;
}

.chip-reject {
  background: rgba(239, 68, 68, 0.12) !important;
  color: #dc2626 !important;
  border: 1px solid rgba(239, 68, 68, 0.3) !important;
}

[data-theme="dark"] .chip-reject {
  background: rgba(239, 68, 68, 0.2) !important;
  color: #f87171 !important;
}

.chip-report {
  background: rgba(124, 58, 237, 0.12) !important;
  color: #7c3aed !important;
  border: 1px solid rgba(124, 58, 237, 0.3) !important;
}

[data-theme="dark"] .chip-report {
  background: rgba(124, 58, 237, 0.2) !important;
  color: #a78bfa !important;
}

.chip-waiting {
  background: #f1f5f9 !important;
  color: #64748b !important;
  border: 1px solid #e2e8f0 !important;
}

[data-theme="dark"] .chip-waiting {
  background: #1e293b !important;
  color: #94a3b8 !important;
  border-color: #334155 !important;
}

.log-action-timestamp {
  font-size: 0.68rem !important;
  color: #94a3b8 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
}

/* Footer Bar */
.logs-table-footer-bar {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 12px 20px !important;
  background: #f8fafc !important;
  border-top: 1px solid #e2e8f0 !important;
  font-size: 0.8rem !important;
  color: #64748b !important;
  flex-wrap: wrap !important;
  gap: 10px !important;
}

[data-theme="dark"] .logs-table-footer-bar {
  background: #1e293b !important;
  border-top-color: #334155 !important;
  color: #94a3b8 !important;
}

.logs-footer-tip {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  color: #2563eb !important;
  font-weight: 600 !important;
}

[data-theme="dark"] .logs-footer-tip {
  color: #60a5fa !important;
}

.log-stepper-ribbon {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 18px;
  padding: 16px 22px;
  margin-bottom: 20px;
}

.stepper-step {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.stepper-step-bubble {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.stepper-step.done .stepper-step-bubble {
  background: #dcfce7;
  color: #15803d;
  border: 1.5px solid #bbf7d0;
  box-shadow: 0 2px 6px rgba(22, 163, 74, 0.15);
}

.stepper-step.active .stepper-step-bubble {
  background: #eff6ff;
  color: #2563eb;
  border: 1.5px solid #bfdbfe;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.stepper-step.waiting .stepper-step-bubble {
  background: #f1f5f9;
  color: #94a3b8;
  border: 1.5px solid #e2e8f0;
}

.stepper-step.failed .stepper-step-bubble {
  background: #fee2e2;
  color: #dc2626;
  border: 1.5px solid #fca5a5;
}

.stepper-step-text {
  display: flex;
  flex-direction: column;
}

.stepper-step-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #1e293b;
}

.stepper-step-sub {
  font-size: 0.74rem;
  color: #64748b;
  margin-top: 1px;
}

.stepper-divider {
  width: 32px;
  height: 2px;
  background: #e2e8f0;
  margin: 0 10px;
  flex-shrink: 0;
}

.stepper-divider.done {
  background: #10b981;
}

.log-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.log-meta-card {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: all 0.2s ease;
}

.log-meta-card:hover {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.log-meta-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 6px;
}

.log-meta-value {
  font-size: 0.88rem;
  font-weight: 800;
  color: #0f172a;
}

.log-recipient-card {
  border: 1.5px solid #e2e8f0;
  border-radius: 16px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  background: #ffffff;
}

.recipient-card-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.recipient-avatar-box {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, #5865F2 0%, #4752C4 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: 0 4px 10px rgba(88, 101, 242, 0.25);
}

.recipient-info-name {
  font-size: 0.95rem;
  font-weight: 800;
  color: #0f172a;
}

.recipient-info-meta {
  font-size: 0.78rem;
  color: #64748b;
  margin-top: 2px;
}

.recipient-card-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.masked-id-badge {
  font-family: monospace;
  font-size: 0.82rem;
  font-weight: 700;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  padding: 6px 12px;
  border-radius: 8px;
  color: #334155;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.discord-preview-card {
  border: 1.5px solid #e2e8f0;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 20px;
  background: #ffffff;
}

.discord-preview-header {
  background: #f8fafc;
  padding: 10px 18px;
  border-bottom: 1.5px solid #e2e8f0;
  font-size: 0.8rem;
  font-weight: 700;
  color: #475569;
  display: flex;
  align-items: center;
  gap: 8px;
}

.discord-preview-body {
  padding: 18px;
}

.discord-embed-box {
  border-left: 4px solid #3b82f6;
  background: #f8fafc;
  padding: 16px 20px;
  border-radius: 0 12px 12px 0;
}

.discord-embed-title {
  margin: 0 0 8px 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
}

.discord-embed-desc {
  font-size: 0.88rem;
  color: #334155;
  line-height: 1.6;
}

.discord-embed-meta {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed #e2e8f0;
  font-size: 0.74rem;
  color: #94a3b8;
  font-family: monospace;
  display: flex;
  gap: 16px;
}

.log-action-card {
  border: 1.5px solid #c4b5fd;
  border-radius: 16px;
  padding: 18px 20px;
  background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
  margin-bottom: 20px;
}

.action-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.action-card-title {
  color: #6d28d9;
  font-size: 0.95rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}

.action-time-badge {
  font-size: 0.76rem;
  color: #7c3aed;
  background: #ede9fe;
  padding: 3px 10px;
  border-radius: 8px;
  font-weight: 700;
}

.action-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  font-size: 0.85rem;
  margin-bottom: 12px;
}

.action-fields-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.action-field-item {
  background: #ffffff;
  border: 1px solid #ddd6fe;
  border-radius: 10px;
  padding: 8px 14px;
}

.action-field-key {
  font-size: 0.76rem;
  font-weight: 700;
  color: #7c3aed;
}

.action-field-val {
  font-size: 0.88rem;
  font-weight: 600;
  color: #1e293b;
  margin-top: 2px;
}

.log-raw-accordion {
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  overflow: hidden;
  background: #f8fafc;
}

.log-raw-accordion summary {
  padding: 12px 18px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  -webkit-user-select: none;
  user-select: none;
}

.log-raw-accordion summary:hover {
  background: #f1f5f9;
}

.log-raw-code {
  margin: 0;
  padding: 14px 18px;
  background: #0f172a;
  color: #38bdf8;
  font-size: 0.76rem;
  overflow-x: auto;
  max-height: 220px;
  font-family: monospace;
}

.modal-subtitle-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: monospace;
  font-size: 0.8rem;
  color: #64748b;
  background: #f1f5f9;
  padding: 4px 10px;
  border-radius: 8px;
  margin-top: 4px;
  border: 1px solid #e2e8f0;
}

.btn-copy-chip {
  background: transparent;
  border: none;
  cursor: pointer;
  color: #64748b;
  padding: 2px;
  display: inline-flex;
  align-items: center;
  transition: all 0.15s ease;
}

.btn-copy-chip:hover {
  color: #2563eb;
  transform: scale(1.15);
}

/* ==========================================================================
   🌟 2026 DEVELOPER HUB & CODE PREVIEW MODAL SUITE (MyWellnetPTN)
   ========================================================================== */

/* 1. Modal Container */
.doc-preview-modal-container {
  max-width: 960px !important;
  width: 95% !important;
  border-radius: 24px !important;
  max-height: 92vh !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  box-shadow: 0 25px 60px -15px rgba(15, 23, 42, 0.35) !important;
}

.doc-preview-body {
  padding: 20px 28px !important;
  overflow-y: auto !important;
  max-height: calc(92vh - 180px) !important;
}

/* 2. Language Switcher Tabs */
.doc-preview-nav-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  overflow-x: auto;
}

.doc-preview-nav-bar::-webkit-scrollbar {
  display: none;
}

[data-theme="dark"] .doc-preview-nav-bar {
  background: #0b1329;
  border-bottom-color: #1e293b;
}

.doc-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 12px;
  font-size: 0.86rem;
  font-weight: 600;
  color: #64748b;
  background: transparent;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.doc-tab-btn:hover {
  color: #0f172a;
  background: rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .doc-tab-btn:hover {
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.05);
}

.doc-tab-btn.active {
  color: #2563eb;
  background: #ffffff;
  border-color: rgba(37, 99, 235, 0.25);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08);
  font-weight: 700;
}

[data-theme="dark"] .doc-tab-btn.active {
  background: #1e293b;
  color: #60a5fa;
  border-color: rgba(96, 165, 250, 0.3);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* 3. Code Editor Toolbar */
.doc-preview-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 18px;
  background: #090d16;
  border-radius: 14px 14px 0 0;
  border: 1px solid #1e293b;
  border-bottom: none;
  gap: 12px;
  flex-wrap: wrap;
}

.doc-toolbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.doc-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.editor-window-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.dot-red { background: #ef4444; }

.dot-amber { background: #f59e0b; }

.dot-green { background: #22c55e; }

.doc-toolbar-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.74rem;
  font-family: 'Fira Code', Consolas, monospace;
  background: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
}

.doc-toolbar-chip.chip-filename {
  color: #38bdf8;
  font-weight: 600;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.25);
}

/* 4. Code Editor Frame */
.doc-editor-frame {
  position: relative;
  background: #090d16;
  border: 1px solid #1e293b;
  border-radius: 0 0 14px 14px;
  overflow: hidden;
}

.doc-code-pre {
  margin: 0;
  padding: 20px 22px;
  max-height: 440px;
  overflow-y: auto;
  overflow-x: auto;
  font-family: 'Fira Code', 'Cascadia Code', Consolas, monospace;
  font-size: 0.85rem;
  line-height: 1.65;
  color: #e2e8f0;
  tab-size: 2;
  transition: opacity 0.2s ease;
}

.doc-code-pre::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.doc-code-pre::-webkit-scrollbar-track {
  background: #090d16;
}

.doc-code-pre::-webkit-scrollbar-thumb {
  background: #1e293b;
  border-radius: 4px;
}

.doc-code-pre::-webkit-scrollbar-thumb:hover {
  background: #334155;
}

.doc-preview-loading {
  position: absolute;
  inset: 0;
  background: rgba(9, 13, 22, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #38bdf8;
  font-size: 0.95rem;
  z-index: 10;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.doc-preview-loading.is-hidden {
  display: none;
}

/* 5. Integration Note Card */
.doc-preview-note {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 18px;
  margin-top: 16px;
  background: rgba(59, 130, 246, 0.06);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 14px;
  font-size: 0.86rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

[data-theme="dark"] .doc-preview-note {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.25);
}

.doc-note-icon {
  color: #3b82f6;
  font-size: 1.15rem;
  flex-shrink: 0;
  margin-top: 2px;
}

/* 6. SDK Showcase Cards in Tab 4 */
.sdk-showcase-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.sdk-showcase-card {
  background: var(--bg-surface-glass);
  border: 1.5px solid var(--border-color);
  border-radius: 18px;
  padding: 20px 22px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.sdk-showcase-card:hover {
  transform: translateY(-3px);
  border-color: rgba(37, 99, 235, 0.4);
  box-shadow: 0 12px 28px -6px rgba(37, 99, 235, 0.12);
}

.sdk-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.sdk-icon-circle {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
}

.sdk-icon-circle.icon-php {
  background: rgba(79, 91, 147, 0.12);
  color: #4F5B93;
  border: 1px solid rgba(79, 91, 147, 0.25);
}

.sdk-icon-circle.icon-node {
  background: rgba(34, 197, 94, 0.12);
  color: #16a34a;
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.sdk-icon-circle.icon-python {
  background: rgba(59, 130, 246, 0.12);
  color: #2563eb;
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.sdk-tag-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-muted);
}

[data-theme="dark"] .sdk-tag-pill {
  background: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
}

.sdk-card-title {
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 6px 0;
}

.sdk-card-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0 0 16px 0;
  flex-grow: 1;
}

.sdk-card-desc code {
  font-family: 'Fira Code', monospace;
  font-size: 0.8rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-primary);
}

[data-theme="dark"] .sdk-card-desc code {
  background: rgba(255, 255, 255, 0.08);
}

.sdk-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
  gap: 10px;
}

.btn-preview-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.84rem;
  font-weight: 600;
  color: #2563eb;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.btn-preview-link:hover {
  background: rgba(37, 99, 235, 0.08);
}

.btn-download-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid var(--border-color);
  font-size: 0.85rem;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-download-icon:hover {
  color: #2563eb;
  background: rgba(37, 99, 235, 0.1);
  border-color: rgba(37, 99, 235, 0.25);
  transform: translateY(-1px);
}

/* ==========================================================================
   🌟 2026 EXECUTIVE AUDIT: REDESIGNED LOG DETAIL MODAL SUITE
   ========================================================================== */

/* 1. Modal Container & Body */
.log-detail-modal-container {
  max-width: 960px !important;
  width: 95% !important;
  border-radius: 24px !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  max-height: 90vh !important;
  box-shadow: 0 25px 65px -12px rgba(15, 23, 42, 0.35) !important;
}

.log-detail-modal-body {
  padding: 24px 32px 30px !important;
  max-height: calc(90vh - 145px) !important;
  overflow-y: auto !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 18px !important;
}

.log-detail-modal-body::-webkit-scrollbar {
  width: 6px;
}

.log-detail-modal-body::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}

.log-modal-content-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 100%;
}

/* 2. Horizontal Delivery Pipeline Stepper */
.log-pipeline-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1.5px solid #e2e8f0;
  border-radius: 18px;
  padding: 16px 24px;
  gap: 10px;
}

[data-theme="dark"] .log-pipeline-card {
  background: #0f172a;
  border-color: #1e293b;
}

.pipeline-step {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex-shrink: 0;
}

.pipeline-icon-box {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  flex-shrink: 0;
}

.pipeline-icon-box.bg-emerald {
  background: #dcfce7;
  color: #15803d;
  border: 1.5px solid #bbf7d0;
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.15);
}

.pipeline-icon-box.bg-rose {
  background: #ffe4e6;
  color: #e11d48;
  border: 1.5px solid #fecdd3;
  box-shadow: 0 2px 8px rgba(225, 29, 72, 0.15);
}

.pipeline-icon-box.bg-blue {
  background: #dbeafe;
  color: #2563eb;
  border: 1.5px solid #bfdbfe;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15);
}

.pipeline-icon-box.bg-purple {
  background: #f3e8ff;
  color: #7c3aed;
  border: 1.5px solid #e9d5ff;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.18);
}

.pipeline-icon-box.bg-slate {
  background: #f1f5f9;
  color: #94a3b8;
  border: 1.5px solid #e2e8f0;
}

.pipeline-text {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.pipeline-label {
  font-size: 0.74rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.pipeline-val {
  font-size: 0.92rem;
  font-weight: 700;
  color: #0f172a;
}

[data-theme="dark"] .pipeline-val {
  color: #f8fafc;
}

.pipeline-val.text-emerald { color: #15803d; }

.pipeline-val.text-rose { color: #e11d48; }

.pipeline-val.text-purple { color: #7c3aed; }

.pipeline-val.text-slate { color: #94a3b8; }

.pipeline-connector {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  padding: 0 8px;
  color: #cbd5e1;
}

.pipeline-connector.done {
  color: #10b981;
}

.pipeline-line {
  flex: 1;
  height: 2.5px;
  background: currentColor;
  border-radius: 2px;
  opacity: 0.65;
}

/* 3. Four Metric Badges Grid */
.log-stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

@media (max-width: 768px) {
  .log-stat-strip {
    grid-template-columns: repeat(2, 1fr);
  }
}

.log-stat-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
}

[data-theme="dark"] .log-stat-card {
  background: #1e293b;
  border-color: #334155;
}

.stat-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

[data-theme="dark"] .stat-icon-wrap {
  background: #0f172a;
}

.stat-content {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.stat-label {
  font-size: 0.72rem;
  color: #64748b;
  font-weight: 600;
}

.stat-val {
  font-size: 0.88rem;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

[data-theme="dark"] .stat-val {
  color: #f8fafc;
}

/* 4. Recipient Profile Banner */
.log-recipient-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 16px;
  gap: 16px;
  flex-wrap: wrap;
}

[data-theme="dark"] .log-recipient-banner {
  background: #1e293b;
  border-color: #334155;
}

.recipient-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.recipient-discord-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #5865F2;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(88, 101, 242, 0.25);
}

.recipient-meta-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.recipient-name-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.recipient-full-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
}

[data-theme="dark"] .recipient-full-name {
  color: #ffffff;
}

.recipient-tag-badge {
  font-size: 0.78rem;
  font-weight: 700;
  color: #5865F2;
  background: rgba(88, 101, 242, 0.1);
  padding: 2px 8px;
  border-radius: 6px;
}

.recipient-id-row {
  font-size: 0.8rem;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 6px;
}

.recipient-id-row code {
  font-family: 'Fira Code', monospace;
  font-size: 0.78rem;
  background: #f1f5f9;
  padding: 1px 5px;
  border-radius: 4px;
  color: #334155;
}

[data-theme="dark"] .recipient-id-row code {
  background: #0f172a;
  color: #94a3b8;
}

.recipient-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pdpa-id-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(16, 185, 129, 0.08);
  border: 1.5px solid rgba(16, 185, 129, 0.25);
  border-radius: 10px;
  font-family: 'Fira Code', monospace;
  font-weight: 700;
  color: #065f46;
  font-size: 0.88rem;
}

[data-theme="dark"] .pdpa-id-chip {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

.pdpa-verified-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-weight: 700;
  color: #475569;
  font-size: 0.78rem;
}

[data-theme="dark"] .pdpa-verified-chip {
  background: #0f172a;
  border-color: #334155;
  color: #94a3b8;
}

/* 5. Authentic Discord DM Embed Preview */
.discord-message-frame {
  background: #313338;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid #1f2023;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.discord-frame-header {
  background: #2b2d31;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #232428;
  color: #949ba4;
  font-size: 0.8rem;
  font-weight: 600;
}

.frame-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #5865F2;
}

.frame-header-left span {
  color: #dbdee1;
  font-weight: 700;
}

.discord-tag-pill {
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(88, 101, 242, 0.2);
  color: #858cf7;
  padding: 2px 8px;
  border-radius: 6px;
}

.discord-frame-body {
  padding: 20px 24px;
  color: #dbdee1;
}

.discord-author-bar {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 12px;
}

.discord-bot-avatar-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #5865F2;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.discord-author-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.discord-bot-title-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.discord-bot-name-text {
  font-size: 0.98rem;
  font-weight: 700;
  color: #f2f3f5;
}

.discord-bot-official-badge {
  background: #5865F2;
  color: #ffffff;
  font-size: 0.62rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.discord-timestamp-text {
  font-size: 0.75rem;
  color: #949ba4;
}

.discord-dm-target-hint {
  font-size: 0.78rem;
  color: #949ba4;
}

.discord-embed-card {
  background: #2b2d31;
  border-left: 4px solid #3b82f6;
  border-radius: 4px 14px 14px 4px;
  padding: 16px 20px;
  margin-left: 54px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.discord-embed-headline {
  font-size: 1.08rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.35;
}

.discord-embed-message {
  font-size: 0.9rem;
  line-height: 1.6;
  color: #dbdee1;
  white-space: pre-line;
}

.discord-embed-fields-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.discord-field-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.discord-field-name {
  font-size: 0.76rem;
  font-weight: 700;
  color: #949ba4;
  text-transform: uppercase;
}

.discord-field-value {
  font-size: 0.88rem;
  font-weight: 600;
  color: #ffffff;
}

.discord-embed-footer-line {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  color: #949ba4;
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Simulated Discord Action Buttons */
.discord-actions-strip {
  margin-left: 54px;
  margin-top: 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.discord-action-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  background: #4e5058;
  color: #ffffff;
  border: none;
  cursor: default;
  transition: opacity 0.2s;
}

.discord-action-pill-btn.style-primary { background: #5865F2; }

.discord-action-pill-btn.style-success { background: #248046; }

.discord-action-pill-btn.style-danger { background: #da373c; }

.discord-action-pill-btn.style-link { background: #4e5058; }

/* 6. 2-Way Interactive Action Response */
.log-action-card-v2 {
  background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
  border: 1.5px solid #d8b4fe;
  border-radius: 18px;
  padding: 18px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

[data-theme="dark"] .log-action-card-v2 {
  background: rgba(124, 58, 237, 0.12);
  border-color: rgba(168, 85, 247, 0.35);
}

.action-v2-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.action-v2-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.98rem;
  font-weight: 800;
  color: #7c3aed;
}

[data-theme="dark"] .action-v2-title {
  color: #c084fc;
}

.action-v2-time-badge {
  font-size: 0.78rem;
  font-weight: 700;
  background: #ede9fe;
  color: #6d28d9;
  padding: 3px 12px;
  border-radius: 999px;
}

.action-v2-summary-row {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 0.88rem;
  color: #4b5563;
  flex-wrap: wrap;
}

[data-theme="dark"] .action-v2-summary-row {
  color: #d1d5db;
}

.action-v2-code-pill {
  background: #ede9fe;
  color: #6d28d9;
  padding: 3px 10px;
  border-radius: 6px;
  font-family: 'Fira Code', monospace;
  font-weight: 700;
  font-size: 0.82rem;
}

.action-v2-fields-box {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 4px;
}

.action-v2-field-item {
  background: #ffffff;
  border: 1px solid #e9d5ff;
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

[data-theme="dark"] .action-v2-field-item {
  background: #1e293b;
  border-color: rgba(168, 85, 247, 0.25);
}

.action-v2-field-label {
  font-size: 0.74rem;
  font-weight: 700;
  color: #7c3aed;
}

.action-v2-field-text {
  font-size: 0.88rem;
  font-weight: 600;
  color: #1f2937;
}

[data-theme="dark"] .action-v2-field-text {
  color: #f3f4f6;
}

/* 7. Collapsible Technical JSON Accordion */
.log-tech-accordion {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  overflow: hidden;
  transition: all 0.2s ease;
}

[data-theme="dark"] .log-tech-accordion {
  background: #0f172a;
  border-color: #1e293b;
}

.log-tech-accordion summary {
  padding: 14px 20px;
  font-size: 0.86rem;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  -webkit-user-select: none;
  user-select: none;
}

[data-theme="dark"] .log-tech-accordion summary {
  color: #94a3b8;
}

.tech-summary-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tech-summary-toggle {
  font-size: 0.78rem;
  color: #2563eb;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tech-body {
  padding: 16px 20px;
  border-top: 1px solid #e2e8f0;
  background: #ffffff;
}

[data-theme="dark"] .tech-body {
  border-top-color: #1e293b;
  background: #0b1329;
}

.tech-meta-row {
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
  font-size: 0.8rem;
  color: #64748b;
  flex-wrap: wrap;
}

.tech-meta-row code {
  font-family: 'Fira Code', monospace;
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  color: #0f172a;
}

[data-theme="dark"] .tech-meta-row code {
  background: #1e293b;
  color: #f8fafc;
}

.tech-json-pre {
  margin: 0;
  padding: 14px 18px;
  background: #090d16;
  border: 1px solid #1e293b;
  border-radius: 10px;
  color: #e2e8f0;
  font-family: 'Fira Code', monospace;
  font-size: 0.8rem;
  line-height: 1.6;
  max-height: 260px;
  overflow: auto;
}


/* ==========================================================================
   Clean Component & Layout Enhancements (All Missing Utility & Action Styles)
   ========================================================================== */
.section-sub-header {
  margin-bottom: 16px;
}
.logs-header-clean {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 20px;
}
.logs-header-actions-wrap {
  display: flex;
  gap: 10px;
  align-items: center;
}
.logs-filters-right {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  flex-wrap: wrap !important;
}

.logs-bot-select-wrap {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  min-width: 240px !important;
  max-width: 320px !important;
}

.logs-bot-select-wrap .premium-custom-menu {
  min-width: 290px !important;
  width: max-content !important;
  max-width: 380px !important;
  right: auto !important;
  left: 0 !important;
}

.logs-bot-select-wrap .custom-trigger-texts {
  min-width: 0 !important;
  flex: 1 !important;
}

.logs-bot-select-wrap .custom-trigger-label {
  display: inline-block !important;
  max-width: 140px !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.logs-bot-select-wrap .logs-bot-icon,
.logs-bot-select-wrap .logs-bot-chevron {
  display: none !important;
}

.logs-bot-select-wrap .select-wrapper {
  width: 100% !important;
  margin: 0 !important;
}

.logs-bot-select-wrap .premium-custom-dropdown {
  width: 100% !important;
}

.logs-bot-select-wrap .premium-custom-trigger,
.premium-custom-dropdown.is-compact .premium-custom-trigger {
  min-height: 38px !important;
  height: 38px !important;
  padding: 4px 12px !important;
  border-radius: 12px !important;
  background: #f8fafc !important;
  border: 1.5px solid #cbd5e1 !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04) !important;
}

[data-theme="dark"] .logs-bot-select-wrap .premium-custom-trigger,
[data-theme="dark"] .premium-custom-dropdown.is-compact .premium-custom-trigger {
  background: #1e293b !important;
  border-color: #334155 !important;
}

.logs-bot-select-wrap .custom-trigger-content,
.premium-custom-dropdown.is-compact .custom-trigger-content {
  gap: 8px !important;
}

.logs-bot-select-wrap .custom-trigger-icon,
.premium-custom-dropdown.is-compact .custom-trigger-icon {
  width: 24px !important;
  height: 24px !important;
  font-size: 0.82rem !important;
  border-radius: 6px !important;
}

.logs-bot-select-wrap .custom-trigger-label,
.premium-custom-dropdown.is-compact .custom-trigger-label {
  font-size: 0.82rem !important;
  font-weight: 700 !important;
  white-space: nowrap !important;
}

.logs-bot-select-wrap .custom-trigger-sub,
.premium-custom-dropdown.is-compact .custom-trigger-sub {
  display: none !important;
}

.logs-bot-select {
  display: none !important;
}
.mb-4 { margin-bottom: 1.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-3 { margin-top: 1rem !important; }
.btn-sm {
  padding: 6px 12px !important;
  font-size: 0.8rem !important;
  border-radius: 8px !important;
}
.admin-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.text-secondary {
  color: var(--text-secondary);
}
.modal-form-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.tile-backdrop {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.tile-action-label {
  font-size: 0.85rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.doc-code-body {
  font-family: 'Fira Code', Consolas, monospace;
  font-size: 0.85rem;
  line-height: 1.6;
}
.doc-note-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.bot-token-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.custom-trigger-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.custom-option-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.app-info-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.app-title-line {
  display: flex;
  align-items: center;
  gap: 8px;
}
.app-name-text {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-heading);
}
.btn-action-edit:hover {
  background: rgba(37, 99, 235, 0.12) !important;
  color: #2563eb !important;
  border-color: rgba(37, 99, 235, 0.3) !important;
}
.btn-action-del:hover {
  background: rgba(239, 68, 68, 0.12) !important;
  color: #ef4444 !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
}
.text-blue { color: #2563eb !important; }
.text-indigo { color: #4f46e5 !important; }
.text-blurple { color: #5865F2 !important; }
.frame-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ==========================================================================
   Discord Interactive Feature Studio & Simulator
   ========================================================================== */
.modal-w-850 {
  max-width: 860px !important;
  width: 95% !important;
  max-height: min(92vh, 880px) !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

#testPingModal .admin-modal-container {
  max-height: min(92vh, 880px) !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

#testPingForm {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

#testPingForm .modal-form-scrollable {
  flex: 1 1 auto !important;
  overflow-y: auto !important;
  min-height: 0 !important;
  padding: 18px 24px !important;
}

#testPingForm .modal-form-scrollable::-webkit-scrollbar {
  width: 6px;
}

#testPingForm .modal-form-scrollable::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.4);
  border-radius: 4px;
}

#testPingForm .modal-footer {
  flex-shrink: 0 !important;
  margin-top: 0 !important;
  padding: 14px 24px !important;
  background: var(--bg-surface, #ffffff) !important;
  border-top: 1px solid var(--border-color, #e2e8f0) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 12px !important;
  z-index: 10 !important;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.03) !important;
}

[data-theme="dark"] #testPingForm .modal-footer {
  background: #0f172a !important;
  border-top-color: rgba(51, 65, 85, 0.6) !important;
}

.test-scenario-container {
  margin-bottom: 14px;
}

.scenario-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.scenario-counter-tag {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted, #64748b);
  background: rgba(100, 116, 139, 0.08);
  padding: 2px 8px;
  border-radius: 12px;
}

.test-scenario-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.scenario-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  background: var(--bg-surface, #ffffff);
  border: 1.5px solid var(--border-color, #e2e8f0);
  border-radius: 10px;
  cursor: pointer;
  position: relative;
  text-align: left;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: var(--font-base) !important;
  -webkit-user-select: none;
  user-select: none;
}

.scenario-btn:hover {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.04);
  transform: translateY(-1px);
}

.scenario-btn.active {
  border-color: #2563eb;
  background: rgba(37, 99, 235, 0.08);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

[data-theme="dark"] .scenario-btn {
  background: #1e293b;
  border-color: #334155;
}

[data-theme="dark"] .scenario-btn:hover {
  background: rgba(59, 130, 246, 0.1);
  border-color: #60a5fa;
}

[data-theme="dark"] .scenario-btn.active {
  background: rgba(37, 99, 235, 0.2);
  border-color: #3b82f6;
}

.scenario-btn-icon {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.scenario-btn-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary, #0f172a);
}

.scenario-btn.active .scenario-btn-title {
  color: #1d4ed8;
  font-weight: 700;
}

[data-theme="dark"] .scenario-btn.active .scenario-btn-title {
  color: #60a5fa;
}

.scenario-mini-badge {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 12px;
  background: #7c3aed;
  color: #fff;
  box-shadow: 0 2px 5px rgba(124, 58, 237, 0.3);
  margin-left: 2px;
}

.scenario-badge {
  position: absolute;
  top: -6px;
  right: 10px;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  background: #7c3aed;
  color: #fff;
  box-shadow: 0 2px 6px rgba(124, 58, 237, 0.35);
}

.test-preview-box {
  background: #1e1f22;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 14px 18px;
  color: #dbdee1;
  font-size: 0.88rem;
  margin-bottom: 16px;
}

.test-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.78rem;
  color: #949ba4;
}

.test-preview-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.72rem;
  background: rgba(88, 101, 242, 0.2);
  color: #5865f2;
}

.test-preview-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.test-preview-components {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.preview-discord-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.82rem;
  color: #fff;
  background: #5865f2;
  border: none;
  cursor: default;
}

.preview-discord-btn.btn-green { background: #23a55a; }
.preview-discord-btn.btn-red { background: #da373c; }
.preview-discord-btn.btn-grey { background: #4e5058; }

.preview-discord-select {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: #2b2d31;
  border: 1px solid #1e1f22;
  border-radius: 6px;
  color: #949ba4;
  font-size: 0.84rem;
}

.test-preview-tip {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
  font-size: 0.75rem;
  color: #23a55a;
}

/* 2-Way Form Submission Cards in Log Details */
.action-v2-fields-box {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 12px;
  background: rgba(124, 58, 237, 0.04);
  border: 1px solid rgba(124, 58, 237, 0.15);
  border-radius: 10px;
  padding: 12px 14px;
}

@media (max-width: 600px) {
  .action-v2-fields-box {
    grid-template-columns: 1fr;
  }
}

.action-v2-field-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--bg-surface, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 8px;
  padding: 8px 12px;
}

.action-v2-field-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #7c3aed;
  display: flex;
  align-items: center;
  gap: 5px;
}

.action-v2-field-text {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-primary, #0f172a);
  word-break: break-word;
  white-space: pre-wrap;
}

.action-v2-selected-box {
  margin-top: 10px;
  padding: 10px 14px;
  background: rgba(37, 99, 235, 0.05);
  border: 1px solid rgba(37, 99, 235, 0.15);
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
}

.badge-modal-submit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  background: rgba(124, 58, 237, 0.12);
  color: #7c3aed;
  border-radius: 20px;
  font-size: 0.74rem;
  font-weight: 700;
}

/* =========================================================================
   Discord Broadcast Studio Styling
   ========================================================================= */
.broadcast-layout-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 1024px) {
  .broadcast-layout-grid {
    grid-template-columns: 1fr;
  }
}

.broadcast-form-card,
.broadcast-preview-card {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.04);
}

.broadcast-preview-card {
  position: sticky;
  top: 24px;
}

/* =========================================================================
   Ultra-Premium Studio Inputs, Dropdowns, and Textareas
   ========================================================================= */

.form-control,
.form-input,
.form-textarea {
  width: 100% !important;
  padding: 11px 16px !important;
  background: var(--bg-surface, #f8fafc) !important;
  border: 1.5px solid var(--border-color, #cbd5e1) !important;
  border-radius: 12px !important;
  font-size: 0.92rem !important;
  color: var(--text-primary, #0f172a) !important;
  font-family: inherit !important;
  outline: none !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
  box-sizing: border-box !important;
}

[data-theme="dark"] .form-control,
[data-theme="dark"] .form-input,
[data-theme="dark"] .form-textarea {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #f1f5f9 !important;
}

.form-control:hover,
.form-input:hover,
.form-textarea:hover {
  border-color: #94a3b8 !important;
  background: var(--bg-card, #ffffff) !important;
}

[data-theme="dark"] .form-control:hover,
[data-theme="dark"] .form-input:hover,
[data-theme="dark"] .form-textarea:hover {
  border-color: #475569 !important;
  background: #1e293b !important;
}

.form-control:focus,
.form-input:focus,
.form-textarea:focus {
  border-color: var(--primary, #2563eb) !important;
  background: var(--bg-card, #ffffff) !important;
  box-shadow: 0 0 0 3.5px rgba(37, 99, 235, 0.16) !important;
  transform: translateY(-1px) !important;
}

[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-input:focus,
[data-theme="dark"] .form-textarea:focus {
  background: #0f172a !important;
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 3.5px rgba(59, 130, 246, 0.22) !important;
}

/* Premium Select Dropdown Styling (Removes Ancient Native Browser Select) */
select.form-control,
select.form-select,
.form-select {
  width: 100% !important;
  padding: 11px 40px 11px 16px !important;
  background-color: var(--bg-surface, #f8fafc) !important;
  border: 1.5px solid var(--border-color, #cbd5e1) !important;
  border-radius: 12px !important;
  font-size: 0.92rem !important;
  font-weight: 600 !important;
  color: var(--text-primary, #0f172a) !important;
  font-family: inherit !important;
  outline: none !important;
  cursor: pointer !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%232563eb'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2.5' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 14px center !important;
  background-size: 16px !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  box-sizing: border-box !important;
}

[data-theme="dark"] select.form-control,
[data-theme="dark"] select.form-select,
[data-theme="dark"] .form-select {
  background-color: #1e293b !important;
  border-color: #334155 !important;
  color: #f1f5f9 !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2360a5fa'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2.5' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E") !important;
}

select.form-control:hover,
select.form-select:hover,
.form-select:hover {
  border-color: #94a3b8 !important;
  background-color: var(--bg-card, #ffffff) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06) !important;
}

[data-theme="dark"] select.form-control:hover,
[data-theme="dark"] select.form-select:hover,
[data-theme="dark"] .form-select:hover {
  background-color: #1e293b !important;
  border-color: #475569 !important;
}

select.form-control:focus,
select.form-select:focus,
.form-select:focus {
  border-color: var(--primary, #2563eb) !important;
  background-color: var(--bg-card, #ffffff) !important;
  box-shadow: 0 0 0 3.5px rgba(37, 99, 235, 0.18) !important;
  transform: translateY(-1px) !important;
}

[data-theme="dark"] select.form-control:focus,
[data-theme="dark"] select.form-select:focus,
[data-theme="dark"] .form-select:focus {
  background-color: #0f172a !important;
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 3.5px rgba(59, 130, 246, 0.22) !important;
}

/* Premium Textarea Styling */
textarea.form-control,
textarea.form-textarea {
  min-height: 110px !important;
  line-height: 1.6 !important;
  border-radius: 14px !important;
  resize: vertical !important;
}

.broadcast-target-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: var(--bg-surface, #f8fafc);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--border-color, #e2e8f0);
}

.target-toggle-btn {
  padding: 10px 14px;
  border: none;
  background: transparent;
  color: var(--text-secondary, #64748b);
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.target-toggle-btn:hover {
  color: var(--text-primary, #0f172a);
}

.target-toggle-btn.active {
  background: var(--bg-card, #ffffff);
  color: var(--primary, #2563eb);
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .target-toggle-btn.active {
  background: #1e293b;
  color: #60a5fa;
}

.quick-channel-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.quick-pill-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted, #94a3b8);
  margin-right: 4px;
}

.quick-pill-btn {
  padding: 4px 10px;
  font-size: 0.76rem;
  font-weight: 600;
  border-radius: 20px;
  background: rgba(37, 99, 235, 0.08);
  color: var(--primary, #2563eb);
  border: 1px solid rgba(37, 99, 235, 0.2);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}

.quick-pill-btn:hover {
  background: var(--primary, #2563eb);
  color: #ffffff;
  transform: translateY(-1px);
}

.color-preset-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.color-pill {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--bg-surface, #f8fafc);
  border: 2px solid transparent;
  color: var(--text-secondary, #475569);
  cursor: pointer;
  position: relative;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.color-pill::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--c);
}

.color-pill:hover {
  border-color: var(--c);
}

.color-pill.active {
  background: var(--c);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.color-pill.active::before {
  background: #ffffff;
}

.color-pill.color-blue { --c: #2563EB; }
.color-pill.color-emerald { --c: #059669; }
.color-pill.color-purple { --c: #7C3AED; }
.color-pill.color-amber { --c: #D97706; }
.color-pill.color-red { --c: #DC2626; }
.test-preview-title { font-weight: 600; color: #f2f3f5; }
.test-preview-desc { font-size: 0.84rem; color: #dbdee1; line-height: 1.4; }

/* Studio Quick Formatting & Emoji Toolbar */
.studio-toolbar-card {
  background: var(--bg-surface, #f8fafc);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.2s ease;
}

[data-theme="dark"] .studio-toolbar-card {
  background: rgba(30, 41, 59, 0.6);
  border-color: rgba(255, 255, 255, 0.08);
}

.studio-toolbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.studio-toolbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
}

.toolbar-pill-title {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted, #64748b);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.emoji-palette-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.btn-emoji-chip {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-color, #cbd5e1);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease, border-color 0.12s ease;
  -webkit-user-select: none;
  user-select: none;
}

[data-theme="dark"] .btn-emoji-chip {
  background: #1e293b;
  border-color: #334155;
}

.btn-emoji-chip:hover {
  transform: translateY(-2px) scale(1.15);
  background: rgba(37, 99, 235, 0.1);
  border-color: var(--primary, #2563eb);
}

.btn-emoji-chip:active {
  transform: scale(0.95);
}

.studio-toolbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-toolbar-tool {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-color, #cbd5e1);
  color: var(--text-primary, #1e293b);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}

[data-theme="dark"] .btn-toolbar-tool {
  background: #1e293b;
  border-color: #334155;
  color: #e2e8f0;
}

.btn-toolbar-tool:hover {
  border-color: var(--primary, #2563eb);
  color: var(--primary, #2563eb);
  background: rgba(37, 99, 235, 0.06);
}

.btn-tool-danger {
  color: #ef4444 !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
}

.btn-tool-danger:hover {
  background: rgba(239, 68, 68, 0.1) !important;
  border-color: #ef4444 !important;
}

.studio-markdown-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding-top: 6px;
  border-top: 1px dashed var(--border-color, #e2e8f0);
}

[data-theme="dark"] .studio-markdown-row {
  border-top-color: rgba(255, 255, 255, 0.08);
}

.btn-md-chip {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-secondary, #475569);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.12s ease;
}

[data-theme="dark"] .btn-md-chip {
  background: #1e293b;
  border-color: #334155;
  color: #94a3b8;
}

.btn-md-chip:hover {
  color: var(--primary, #2563eb);
  border-color: var(--primary, #2563eb);
  background: rgba(37, 99, 235, 0.06);
}

.form-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.btn-text-action {
  background: none;
  border: none;
  color: var(--text-muted, #94a3b8);
  cursor: pointer;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.btn-text-action:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
}

.label-hint-active {
  font-size: 0.72rem;
  font-weight: 700;
  color: #10b981;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-subtle {
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary, #2563eb);
  padding: 3px 8px;
  border-radius: 20px;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Discord Mock Live Preview Card */
.preview-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
}

.preview-tag {
  font-size: 0.82rem;
  font-weight: 700;
  color: #5865f2;
  display: flex;
  align-items: center;
  gap: 8px;
}

.preview-bot-tag {
  background: #5865f2;
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
}

.discord-message-mock {
  display: flex;
  gap: 12px;
  background: #313338;
  color: #dbdee1;
  padding: 16px;
  border-radius: 12px;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  line-height: 1.4;
}

.mock-avatar-wrap {
  flex-shrink: 0;
}

.mock-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.mock-avatar.bg-blue-light {
  background: #5865f2;
  color: #ffffff;
}

.mock-body {
  flex: 1;
  min-width: 0;
}

.mock-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.mock-name {
  font-weight: 600;
  font-size: 0.92rem;
  color: #f2f3f5;
}

.mock-bot-badge {
  background: #5865f2;
  color: #ffffff;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
  line-height: 1.2;
}

.mock-time {
  font-size: 0.72rem;
  color: #949ba4;
  margin-left: 2px;
}

.mock-mention-text {
  color: #c9cdfb;
  background: rgba(88, 101, 242, 0.3);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85rem;
  display: inline-block;
  margin-bottom: 8px;
}

.mock-embed {
  background: #2b2d31;
  border-left: 4px solid #2563eb;
  border-radius: 4px;
  padding: 12px 16px;
  margin-top: 4px;
  max-width: 520px;
}

.mock-embed-header {
  margin-bottom: 4px;
}

.mock-embed-author {
  font-size: 0.76rem;
  font-weight: 600;
  color: #b5bac1;
}

.mock-embed-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #f2f3f5;
  margin: 4px 0 8px 0;
}

.mock-embed-desc {
  font-size: 0.86rem;
  color: #dbdee1;
  line-height: 1.45;
  margin: 0 0 10px 0;
  white-space: pre-wrap;
}

.mock-embed-footer {
  font-size: 0.72rem;
  color: #949ba4;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.mock-actions {
  margin-top: 10px;
}

.mock-btn-discord {
  background: #4e5058;
  color: #ffffff;
  border: none;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: default;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* =========================================================================
   Bot Health Sentinel & Webhook Modal
   ========================================================================= */
.health-hero-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(37, 99, 235, 0.08) 100%);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 14px;
}

.health-hero-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(16, 185, 129, 0.15);
  color: #059669;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.health-hero-text strong {
  display: block;
  font-size: 0.94rem;
  color: var(--text-primary, #0f172a);
  margin-bottom: 2px;
}

.health-hero-text p {
  font-size: 0.82rem;
  color: var(--text-secondary, #475569);
  margin: 0;
  line-height: 1.4;
}

/* Switch UI */
.switch-ui {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
  flex-shrink: 0;
}

.switch-ui input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider-ui {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: .3s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 26px;
}

.slider-ui:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.switch-ui input:checked + .slider-ui {
  background-color: #10b981;
}

.switch-ui input:checked + .slider-ui:before {
  transform: translateX(20px);
}

.health-events-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.event-checkbox-pill {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 12px;
  background: var(--bg-surface, #f8fafc);
  cursor: pointer;
  transition: all 0.15s ease;
}

.event-checkbox-pill:hover {
  background: var(--bg-card, #ffffff);
  border-color: #3b82f6;
}

.event-checkbox-pill input[type="checkbox"] {
  margin-top: 3px;
  width: 18px;
  height: 18px;
  accent-color: #2563eb;
  cursor: pointer;
}

.event-pill-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.event-pill-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
}

.event-pill-desc {
  font-size: 0.78rem;
  color: var(--text-secondary, #64748b);
  line-height: 1.35;
}

/* =========================================================================
   Webhook Queue & Dead-Letter Queue (DLQ) Modal Styles
   ========================================================================= */
.modal-w-850 {
  max-width: 850px !important;
  width: 95% !important;
}

.modal-body-custom {
  padding: 20px 24px;
  max-height: calc(85vh - 140px);
  overflow-y: auto;
}

.queue-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.queue-kpi-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-surface, #f8fafc);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 12px;
  transition: all 0.2s ease;
}

[data-theme="dark"] .queue-kpi-card {
  background: rgba(30, 41, 59, 0.5);
  border-color: rgba(51, 65, 85, 0.6);
}

.queue-kpi-icon {
  font-size: 1.4rem;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--bg-card, #ffffff);
}

[data-theme="dark"] .queue-kpi-icon {
  background: rgba(15, 23, 42, 0.6);
}

.queue-kpi-info {
  display: flex;
  flex-direction: column;
}

.queue-kpi-label {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-secondary, #64748b);
}

.queue-kpi-val {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.2;
}

.queue-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.queue-filter-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-surface, #f1f5f9);
  padding: 4px;
  border-radius: 10px;
}

[data-theme="dark"] .queue-filter-pills {
  background: rgba(15, 23, 42, 0.6);
}

.queue-filter-btn {
  border: none;
  background: transparent;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary, #64748b);
  cursor: pointer;
  transition: all 0.15s ease;
}

.queue-filter-btn:hover {
  color: var(--text-primary, #0f172a);
}

.queue-filter-btn.active {
  background: var(--bg-card, #ffffff);
  color: #2563eb;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .queue-filter-btn.active {
  background: #1e293b;
  color: #60a5fa;
}

.queue-actions-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.queue-table-wrap {
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 12px;
  overflow: hidden;
}

.queue-table th {
  font-size: 0.78rem;
  font-weight: 700;
  background: var(--bg-surface, #f8fafc);
  padding: 10px 14px;
}

[data-theme="dark"] .queue-table th {
  background: #1e293b;
}

.queue-table td {
  font-size: 0.82rem;
  padding: 10px 14px;
  vertical-align: middle;
}

.max-w-200 {
  max-width: 200px;
}

/* ==========================================================================
   Audit Trail & Activity Log Modal Styles
   ========================================================================== */
.modal-w-950 {
  max-width: 950px !important;
  width: 95vw !important;
}

.audit-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

@media (max-width: 768px) {
  .audit-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.audit-kpi-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-surface, #f8fafc);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 12px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

[data-theme="dark"] .audit-kpi-card {
  background: #0f172a;
  border-color: #334155;
}

.audit-kpi-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  background: rgba(99, 102, 241, 0.1);
  color: #6366f1;
}

.audit-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.audit-kpi-info {
  display: flex;
  flex-direction: column;
}

.audit-kpi-label {
  font-size: 0.72rem;
  color: var(--text-muted, #64748b);
  font-weight: 600;
}

.audit-kpi-val {
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.2;
}

.audit-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.audit-search-wrap {
  position: relative;
  flex: 1;
  min-width: 220px;
}

.audit-search-wrap i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted, #94a3b8);
  font-size: 0.85rem;
}

.audit-search-input {
  width: 100%;
  padding: 8px 12px 8px 34px;
  font-size: 0.84rem;
  border-radius: 10px;
  border: 1px solid var(--border-color, #cbd5e1);
  background: var(--bg-surface, #f8fafc);
  color: var(--text-primary, #0f172a);
  font-family: inherit;
  transition: all 0.2s ease;
}

[data-theme="dark"] .audit-search-input {
  background: #1e293b;
  border-color: #334155;
  color: #f1f5f9;
}

.audit-search-input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.audit-filter-select {
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 10px;
  border: 1px solid var(--border-color, #cbd5e1);
  background: var(--bg-surface, #f8fafc);
  color: var(--text-primary, #0f172a);
  font-family: inherit;
  cursor: pointer;
}

[data-theme="dark"] .audit-filter-select {
  background: #1e293b;
  border-color: #334155;
  color: #f1f5f9;
}

.audit-table-wrap {
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 12px;
  overflow: hidden;
  max-height: 440px;
  overflow-y: auto;
}

[data-theme="dark"] .audit-table-wrap {
  border-color: #334155;
}

.audit-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  font-size: 0.76rem;
  font-weight: 700;
  background: var(--bg-surface, #f8fafc);
  padding: 10px 12px;
  border-bottom: 2px solid var(--border-color, #e2e8f0);
}

[data-theme="dark"] .audit-table th {
  background: #1e293b;
  border-color: #334155;
}

.audit-table td {
  font-size: 0.8rem;
  padding: 10px 12px;
  vertical-align: middle;
  border-bottom: 1px solid var(--border-color, #f1f5f9);
}

[data-theme="dark"] .audit-table td {
  border-color: #1e293b;
}

.audit-pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0 0;
  font-size: 0.8rem;
  color: var(--text-muted, #64748b);
}

/* =========================================================================
   Broadcast Studio: Luxury Target Mode & Anti-Collision Suite
   ========================================================================= */

.user-sub-target-card {
  background: var(--bg-surface, #f8fafc);
  border: 1.5px solid var(--border-color, #e2e8f0);
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
  transition: all 0.2s ease;
}

[data-theme="dark"] .user-sub-target-card {
  background: #1e293b;
  border-color: #334155;
}

.user-sub-target-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.sub-target-title {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
  display: flex;
  align-items: center;
  gap: 7px;
}

.target-selected-badge {
  font-size: 0.74rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 99px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.user-sub-target-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.sub-target-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 12px;
  background: var(--bg-card, #ffffff);
  border: 1.5px solid var(--border-color, #cbd5e1);
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary, #475569);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

[data-theme="dark"] .sub-target-btn {
  background: #0f172a;
  border-color: #334155;
  color: #94a3b8;
}

.sub-target-btn:hover {
  border-color: var(--primary, #2563eb);
  color: var(--primary, #2563eb);
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(37, 99, 235, 0.1);
}

.sub-target-btn.active {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  border-color: #2563eb;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.28);
}

[data-theme="dark"] .sub-target-btn.active {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  border-color: #3b82f6;
  color: #ffffff;
}

/* All Users Info Banner */
.all-users-info-box {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(16, 185, 129, 0.08);
  border: 1.5px solid rgba(16, 185, 129, 0.25);
  border-radius: 12px;
  color: #065f46;
  animation: fadeIn 0.25s ease-out;
}

[data-theme="dark"] .all-users-info-box {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.35);
  color: #a7f3d0;
}

.all-users-icon {
  font-size: 1.25rem;
  color: #10b981;
  flex-shrink: 0;
  margin-top: 2px;
}

.all-users-text strong {
  display: block;
  font-size: 0.86rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.all-users-text p {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.45;
  opacity: 0.9;
}

/* User Select Header with Quick Search Button */
.user-select-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.btn-search-personnel-quick {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.22);
  border-radius: 8px;
  color: #2563eb;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
}

.btn-search-personnel-quick:hover {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
  transform: translateY(-1px);
}

[data-theme="dark"] .btn-search-personnel-quick {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.3);
  color: #60a5fa;
}

[data-theme="dark"] .btn-search-personnel-quick:hover {
  background: #3b82f6;
  color: #ffffff;
}

/* Anti-Collision & Stacking Elevation for Dropdowns */
.select-wrapper {
  position: relative !important;
}

.premium-custom-dropdown.is-open {
  z-index: 10010 !important;
}

.select-wrapper:has(.premium-custom-dropdown.is-open),
.form-group:has(.premium-custom-dropdown.is-open),
.form-row-2col:has(.premium-custom-dropdown.is-open) {
  z-index: 10005 !important;
  position: relative !important;
}

.premium-custom-menu.open {
  z-index: 10020 !important;
}

/* =========================================================================
   SSO Verification Prompt & Broadcast Engine Cards
   ========================================================================= */

.sso-prompt-hero-card {
  background: linear-gradient(135deg, rgba(15, 58, 46, 0.05) 0%, rgba(37, 99, 235, 0.05) 100%);
  border: 1.5px solid rgba(15, 58, 46, 0.2);
  border-radius: 16px;
  padding: 20px 24px;
  margin-bottom: 24px;
  box-shadow: 0 4px 20px -4px rgba(15, 58, 46, 0.08);
  transition: all 0.25s ease;
}

[data-theme="dark"] .sso-prompt-hero-card {
  background: linear-gradient(135deg, rgba(15, 58, 46, 0.2) 0%, rgba(30, 41, 59, 0.8) 100%);
  border-color: rgba(52, 211, 153, 0.25);
  box-shadow: 0 4px 20px -4px rgba(0, 0, 0, 0.3);
}

.sso-prompt-hero-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.sso-prompt-hero-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.sso-prompt-hero-title h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary, #0f172a);
  display: flex;
  align-items: center;
  gap: 8px;
}

.sso-prompt-badge {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 6px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.btn-refresh-sso-summary {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-color, #cbd5e1);
  color: var(--text-secondary, #475569);
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all 0.2s ease;
}

.btn-refresh-sso-summary:hover {
  background: var(--primary-subtle, #e0f2fe);
  color: var(--primary-brand, #0284c7);
  border-color: var(--primary-brand, #0284c7);
}

.sso-prompt-desc {
  font-size: 0.88rem;
  color: var(--text-secondary, #475569);
  margin-bottom: 16px;
  line-height: 1.5;
}

.sso-stats-metrics-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.sso-stat-chip {
  background: var(--bg-card, #ffffff);
  border: 1.5px solid var(--border-color, #e2e8f0);
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  transition: all 0.2s ease;
}

[data-theme="dark"] .sso-stat-chip {
  background: #1e293b;
  border-color: #334155;
}

.sso-stat-chip.highlight-amber {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.04);
}

[data-theme="dark"] .sso-stat-chip.highlight-amber {
  background: rgba(245, 158, 11, 0.1);
  border-color: #d97706;
}

.stat-chip-icon {
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.04);
}

[data-theme="dark"] .stat-chip-icon {
  background: rgba(255, 255, 255, 0.06);
}

.stat-chip-content {
  display: flex;
  flex-direction: column;
}

.stat-chip-label {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted, #64748b);
  letter-spacing: 0.4px;
}

.stat-chip-val {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary, #0f172a);
}

.sso-prompt-actions-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-sso-action {
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  border: none;
}

.btn-sso-primary {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.3);
}

.btn-sso-primary:hover {
  background: linear-gradient(135deg, #b45309 0%, #92400e 100%);
  transform: translateY(-1px);
}

.btn-sso-secondary {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.3);
}

.btn-sso-secondary:hover {
  background: linear-gradient(135deg, #047857 0%, #065f46 100%);
  transform: translateY(-1px);
}

.btn-sso-outline {
  background: var(--bg-card, #ffffff);
  border: 1.5px solid var(--border-color, #cbd5e1);
  color: var(--text-primary, #0f172a);
}

.btn-sso-outline:hover {
  border-color: #0284c7;
  color: #0284c7;
  background: #f0f9ff;
}

.sso-action-badge {
  background: rgba(255, 255, 255, 0.3);
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 0.74rem;
}

.sso-broadcast-progress-wrap {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-color, #cbd5e1);
  border-radius: 10px;
  padding: 12px 16px;
}

[data-theme="dark"] .sso-broadcast-progress-wrap {
  background: #1e293b;
  border-color: #334155;
}

.progress-info-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  margin-bottom: 8px;
}

.progress-bar-track {
  height: 8px;
  background: #e2e8f0;
  border-radius: 99px;
  overflow: hidden;
}

[data-theme="dark"] .progress-bar-track {
  background: #334155;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #d97706, #10b981);
  border-radius: 99px;
  transition: width 0.3s ease;
}

.badge-amber-pill {
  background: rgba(245, 158, 11, 0.15);
  color: #b45309;
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 700;
}

[data-theme="dark"] .badge-amber-pill {
  background: rgba(245, 158, 11, 0.25);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.4);
}

.user-sub-target-buttons {
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)) !important;
}

/* =========================================================================
   Ultra-Modern Modal Overrides (Fix 2-column grid crush & Beautify Modals)
   ========================================================================= */
#ssoPromptModal .modal-body,
#unverifiedListModal .modal-body,
.modal-body-stack:not(.is-hidden):not(.hidden) {
  display: flex !important;
  flex-direction: column !important;
  grid-template-columns: none !important;
  gap: 20px !important;
  padding: 24px 28px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

#ssoPromptModal .admin-modal-container {
  max-width: 680px !important;
  width: 95vw !important;
  border-radius: 20px !important;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.25) !important;
  overflow: hidden !important;
}

#unverifiedListModal .admin-modal-container {
  max-width: 920px !important;
  width: 95vw !important;
  border-radius: 20px !important;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.25) !important;
  overflow: hidden !important;
}

/* Modern Segmented Target Picker for SSO Broadcast Modal */
.sso-target-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
}
@media (max-width: 600px) {
  .sso-target-cards-grid {
    grid-template-columns: 1fr;
  }
}
.sso-target-card-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 12px;
  border-radius: 14px;
  border: 1.5px solid var(--border-color, #e2e8f0);
  background: var(--bg-surface, #ffffff);
  color: var(--text-color, #1e293b);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 0.86rem;
  font-weight: 600;
  text-align: center;
  position: relative;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.sso-target-card-btn:hover {
  border-color: #d97706;
  background: rgba(245, 158, 11, 0.05);
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(217, 119, 6, 0.12);
}
.sso-target-card-btn.active {
  border-color: #d97706;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.14) 0%, rgba(217, 119, 6, 0.06) 100%);
  color: #b45309;
  box-shadow: 0 4px 16px rgba(217, 119, 6, 0.18);
}
[data-theme="dark"] .sso-target-card-btn {
  background: #1e293b;
  border-color: #334155;
  color: #f1f5f9;
}
[data-theme="dark"] .sso-target-card-btn.active {
  background: rgba(245, 158, 11, 0.2);
  color: #fde68a;
  border-color: #f59e0b;
}

.sso-target-count-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  background: rgba(15, 23, 42, 0.06);
  color: inherit;
}
.sso-target-card-btn.active .sso-target-count-badge {
  background: #d97706;
  color: #ffffff;
}

/* Modern Textarea Styling */
.sso-custom-message-box {
  width: 100% !important;
  box-sizing: border-box !important;
  border-radius: 14px !important;
  border: 1.5px solid var(--border-color, #e2e8f0) !important;
  padding: 14px 16px !important;
  font-size: 0.92rem !important;
  line-height: 1.6 !important;
  color: var(--text-color, #1e293b) !important;
  background: var(--bg-surface, #ffffff) !important;
  resize: vertical !important;
  min-height: 120px !important;
  transition: all 0.2s ease !important;
  font-family: inherit !important;
}
.sso-custom-message-box:focus {
  outline: none !important;
  border-color: #d97706 !important;
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.18) !important;
}
[data-theme="dark"] .sso-custom-message-box {
  background: #0f172a !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}

/* Quick Message Template Chips */
.sso-template-chips-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
  align-items: center;
}
.sso-template-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.76rem;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-color, #e2e8f0);
  background: var(--bg-hover, #f8fafc);
  color: var(--text-muted, #64748b);
  cursor: pointer;
  transition: all 0.15s ease;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}
.sso-template-chip:hover {
  background: rgba(245, 158, 11, 0.12);
  border-color: #d97706;
  color: #b45309;
  transform: translateY(-1px);
}
[data-theme="dark"] .sso-template-chip {
  background: #1e293b;
  border-color: #334155;
  color: #94a3b8;
}

/* Unverified Members Table */
.unverified-table-wrapper {
  width: 100% !important;
  max-height: 440px !important;
  overflow-y: auto !important;
  border: 1px solid var(--border-color, #e2e8f0) !important;
  border-radius: 14px !important;
  background: var(--bg-surface, #ffffff) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02) !important;
}
.unverified-table {
  width: 100% !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
}
.unverified-table th {
  position: sticky !important;
  top: 0 !important;
  z-index: 5 !important;
  background: #f8fafc !important;
  padding: 12px 18px !important;
  font-size: 0.8rem !important;
  font-weight: 700 !important;
  color: #475569 !important;
  border-bottom: 1px solid var(--border-color, #e2e8f0) !important;
  text-transform: uppercase !important;
  letter-spacing: 0.03em !important;
}
[data-theme="dark"] .unverified-table th {
  background: #1e293b !important;
  color: #cbd5e1 !important;
  border-color: #334155 !important;
}
.unverified-table td {
  padding: 12px 18px !important;
  border-bottom: 1px solid var(--border-color, #f1f5f9) !important;
  font-size: 0.88rem !important;
  vertical-align: middle !important;
}
[data-theme="dark"] .unverified-table td {
  border-color: #334155 !important;
}
.unverified-table tr:last-child td {
  border-bottom: none !important;
}
.unverified-table tr:hover td {
  background: rgba(245, 158, 11, 0.04) !important;
}

.discord-user-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}
.discord-user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  background: #e2e8f0;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}
.discord-user-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.discord-user-name {
  font-weight: 600;
  color: var(--text-color, #1e293b);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.discord-user-tag {
  font-size: 0.76rem;
  color: var(--text-muted, #64748b);
}

.discord-id-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.78rem;
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.05);
  color: var(--text-muted, #64748b);
  border: 1px solid rgba(15, 23, 42, 0.08);
  cursor: pointer;
  transition: all 0.15s ease;
}
.discord-id-pill:hover {
  background: rgba(245, 158, 11, 0.1);
  border-color: #d97706;
  color: #b45309;
}
[data-theme="dark"] .discord-id-pill {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
  color: #94a3b8;
}


/* ==========================================================================
   Admin UI Utility & Component Classes (Moved from inline styles)
   ========================================================================== */
.unverified-info-box {
  border-left-color: #f59e0b !important;
  background: rgba(245, 158, 11, 0.06) !important;
}
.unverified-info-icon {
  background: rgba(245, 158, 11, 0.15) !important;
  color: #d97706 !important;
}
.unverified-info-strong {
  color: #b45309 !important;
}

/* Diagnostic Host Card */
.health-host-box {
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 12px;
  padding: 14px 16px;
}
.health-host-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.health-host-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.health-host-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(99, 102, 241, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  color: #818cf8;
}
.health-host-title {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-primary, #f8fafc);
}
.health-host-sub {
  font-size: 0.8rem;
  color: var(--text-muted, #94a3b8);
}
.health-host-badge {
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 20px;
}
.health-host-details {
  font-size: 0.78rem;
  color: var(--text-secondary, #cbd5e1);
  margin-top: 10px;
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
  padding-top: 8px;
  font-family: monospace;
  word-break: break-all;
}

/* Bot Admins Modal Styles */
.bot-admin-modal-body {
  padding: 24px;
  max-height: 75vh;
  overflow-y: auto;
}
.bot-admin-security-alert {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.bot-admin-security-icon {
  font-size: 1.25rem;
  margin-top: 2px;
}
.bot-admin-security-text {
  font-size: 0.88rem;
  color: var(--text-secondary, #334155);
  line-height: 1.5;
}
.bot-admin-card {
  background: var(--bg-surface, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.bot-admin-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.bot-admin-card-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
.bot-admin-card-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted, #64748b);
}
.bot-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.bot-admin-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-secondary, #475569);
}
.bot-admin-input-wrap {
  position: relative;
}
.bot-admin-input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #5865F2;
}
.bot-admin-input {
  width: 100%;
  box-sizing: border-box;
  height: 40px;
  border-radius: 10px;
}
.bot-admin-input-padded {
  padding-left: 38px;
}
.bot-admin-checkbox-group-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-secondary, #475569);
}
.bot-admin-checkbox-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  background: var(--bg-main, #f8fafc);
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid var(--border-color, #e2e8f0);
}
.bot-admin-check-item-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  color: #4338ca;
}
.bot-admin-check-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 0.85rem;
}
.bot-admin-badge-all {
  background: rgba(99, 102, 241, 0.15);
  color: #4f46e5;
  padding: 4px 10px;
  border-radius: 6px;
}
.bot-admin-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.bot-admin-submit-btn {
  padding: 9px 22px;
}
.bot-admin-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.bot-admin-list-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
.bot-admin-table-wrap {
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-surface, #ffffff);
}
.bot-admin-table {
  width: 100%;
  border-collapse: collapse;
}
.bot-admin-th-row {
  background: var(--bg-main, #f8fafc);
  border-bottom: 1px solid var(--border-color, #e2e8f0);
  text-align: left;
  font-size: 0.82rem;
  color: var(--text-muted, #64748b);
}
.bot-admin-th {
  padding: 12px 16px;
}
.bot-admin-th-actions {
  padding: 12px 16px;
  text-align: right;
}
.bot-admin-modal-footer {
  display: flex;
  justify-content: flex-end;
  padding: 16px 24px;
}

/* Bot Control Modal Styles */
.bot-ctrl-modal-body {
  padding: 24px;
  max-height: 75vh;
  overflow-y: auto;
}
.bot-ctrl-hero-banner {
  border-radius: 14px;
  padding: 20px 24px;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(5, 150, 105, 0.05) 100%);
  border: 1px solid rgba(16, 185, 129, 0.25);
}
.bot-ctrl-hero-left {
  display: flex;
  align-items: center;
  gap: 18px;
}
.bot-ctrl-aura-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #10b981;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.4);
}
.bot-ctrl-state-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}
.bot-ctrl-state-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: #065f46;
}
.bot-ctrl-state-desc {
  margin: 4px 0 0 0;
  font-size: 0.88rem;
  color: #047857;
}
.bot-ctrl-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.bot-ctrl-metric-card {
  background: var(--bg-surface, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}
.bot-ctrl-metric-label {
  font-size: 0.78rem;
  color: var(--text-muted, #64748b);
  font-weight: 600;
  margin-bottom: 4px;
}
.bot-ctrl-metric-val-dark {
  font-size: 1.2rem;
  color: var(--text-primary, #0f172a);
}
.bot-ctrl-metric-val-blue {
  font-size: 1.2rem;
  color: #0284c7;
}
.bot-ctrl-metric-val-green {
  font-size: 1.05rem;
  color: #059669;
}
.bot-ctrl-metric-val-gray {
  font-size: 1.05rem;
  color: #475569;
}
.bot-ctrl-deck-card {
  background: var(--bg-surface, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 14px;
  padding: 22px;
  margin-bottom: 20px;
}
.bot-ctrl-deck-title {
  margin: 0 0 14px 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-secondary, #334155);
  display: flex;
  align-items: center;
  gap: 8px;
}
.bot-ctrl-btn-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}
.bot-ctrl-start-btn {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  padding: 12px 24px !important;
  font-weight: 600 !important;
}
.bot-ctrl-restart-btn {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%) !important;
  color: white !important;
  padding: 12px 24px !important;
  font-weight: 600 !important;
  border: none !important;
}
.bot-ctrl-stop-btn {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
  color: white !important;
  padding: 12px 24px !important;
  font-weight: 600 !important;
  border: none !important;
}
.bot-ctrl-tips-box {
  margin-top: 16px;
  padding: 12px 16px;
  background: var(--bg-main, #f8fafc);
  border-radius: 8px;
  font-size: 0.82rem;
  color: var(--text-muted, #64748b);
  line-height: 1.5;
}
.bot-ctrl-tips-list {
  margin: 6px 0 0 0;
  padding-left: 20px;
}
.bot-ctrl-modal-footer {
  display: flex;
  justify-content: flex-end;
  padding: 16px 24px;
}

/* SSO Prompt Modal Styles */
.sso-prompt-header-icon {
  background: rgba(245, 158, 11, 0.15) !important;
  color: #d97706 !important;
}
.sso-prompt-label-spaced {
  margin-bottom: 8px;
}
.sso-prompt-target-btn-inner {
  display: flex;
  align-items: center;
  gap: 6px;
}
.sso-prompt-custom-msg-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.sso-prompt-msg-label {
  margin: 0;
}
.sso-prompt-template-hint {
  font-size: 0.75rem;
  color: var(--text-muted, #64748b);
}
.sso-prompt-help-text {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 0.78rem;
}
.sso-prompt-delay-label {
  margin-bottom: 6px;
}
.sso-prompt-delay-select {
  width: 100%;
  border-radius: 12px;
  padding: 12px 16px;
}
.sso-prompt-delay-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 0.78rem;
  color: #059669;
}
.sso-prompt-modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 28px;
}
.sso-prompt-confirm-btn {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%) !important;
  padding: 10px 24px !important;
  font-weight: 600 !important;
}


.unverified-modal-search-wrap {
  position: relative;
  width: 100%;
}
.unverified-modal-search-input {
  width: 100%;
  box-sizing: border-box;
  padding-left: 42px;
  border-radius: 12px;
  height: 44px;
}
.unverified-modal-search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted, #94a3b8);
  font-size: 0.95rem;
}
.unverified-th-member { width: 38%; }
.unverified-th-id { width: 24%; }
.unverified-th-joined { width: 18%; }
.unverified-th-actions { width: 20%; text-align: right; }
.unverified-modal-footer-hint {
  font-size: 0.8rem;
  color: var(--text-muted, #64748b);
  display: flex;
  align-items: center;
  gap: 6px;
}

.bot-admin-table-loading {
  text-align: center;
  padding: 30px;
  color: var(--text-muted, #94a3b8);
}

/* Discord Link Management Modal Styles */
.btn-sso-indigo {
  background: linear-gradient(135deg, #6366F1 0%, #4F46E5 100%) !important;
  color: #FFFFFF !important;
}
.btn-sso-indigo:hover {
  background: linear-gradient(135deg, #4F46E5 0%, #4338CA 100%) !important;
  transform: translateY(-1px);
}
.btn-sso-force-link {
  background: rgba(99, 102, 241, 0.12) !important;
  color: #4F46E5 !important;
  border: 1px solid rgba(99, 102, 241, 0.25) !important;
  padding: 6px 12px !important;
  font-size: 0.8rem !important;
  border-radius: 8px !important;
  font-weight: 600 !important;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}
.btn-sso-force-link:hover {
  background: #4F46E5 !important;
  color: #FFFFFF !important;
}
.discord-link-modal-container {
  max-width: 1100px !important;
  width: 96vw !important;
  border-radius: 24px !important;
  box-shadow: 0 30px 70px -15px rgba(0, 0, 0, 0.35) !important;
  overflow: hidden !important;
}
.discord-link-modal-tabs {
  display: flex;
  gap: 10px;
  padding: 10px 24px;
  background: var(--bg-surface-secondary, #F8FAFC);
  border-bottom: 1px solid var(--border-color, #E2E8F0);
}
.discord-link-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted, #64748B);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.discord-link-tab-btn:hover {
  color: var(--text-primary, #0F172A);
  background: rgba(0, 0, 0, 0.04);
}
.discord-link-tab-btn.active {
  background: #FFFFFF;
  color: #4F46E5;
  border-color: rgba(99, 102, 241, 0.25);
  box-shadow: 0 3px 10px rgba(99, 102, 241, 0.12);
}
[data-theme="dark"] .discord-link-modal-tabs {
  background: #0f172a;
  border-color: #1e293b;
}
[data-theme="dark"] .discord-link-tab-btn.active {
  background: #1e293b;
  color: #818CF8;
  border-color: rgba(99, 102, 241, 0.4);
}

.force-link-info-box {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(79, 70, 229, 0.03) 100%);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 14px;
  padding: 14px 18px;
  margin-bottom: 18px;
  font-size: 0.86rem;
  color: var(--text-color, #334155);
}
.force-link-info-box p {
  margin: 4px 0 0 0;
  font-size: 0.82rem;
  color: var(--text-muted, #64748B);
}
.force-link-actions-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color, #E2E8F0);
}

/* Table Column Widths & Layout */
.link-th-person { width: 22%; min-width: 180px; }
.link-th-dept { width: 20%; min-width: 160px; }
.link-th-discord { width: 36%; min-width: 320px; }
.link-th-quota { width: 11%; min-width: 110px; text-align: center; }
.link-th-actions { width: 11%; min-width: 130px; text-align: right; }

.verified-table-row {
  border-bottom: 1px solid var(--border-color, #e2e8f0);
  transition: background 0.15s ease;
}
.verified-table-row:hover {
  background: rgba(99, 102, 241, 0.02);
}
.verified-cell-person,
.verified-cell-dept,
.verified-cell-discord,
.verified-cell-date,
.verified-cell-actions {
  padding: 14px 14px;
  vertical-align: middle;
}
.verified-cell-actions {
  text-align: right;
}
.verified-cell-name {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 0.88rem;
}
.verified-cell-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}
.verified-cell-dept-name {
  font-size: 0.84rem;
  color: var(--text-color);
  font-weight: 600;
}
.verified-cell-dept-pos {
  font-size: 0.76rem;
  color: var(--text-muted);
}

/* Multi-Discord Accounts UI in Admin Portal */
.accounts-grid-cell {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}
.account-card-mini {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 8px 12px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}
.account-card-mini:hover {
  border-color: #6366F1;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.12);
  transform: translateY(-1px);
}
.account-card-primary {
  border-left: 3.5px solid #10B981;
}
.account-card-secondary {
  border-left: 3.5px solid #6366F1;
  background: rgba(99, 102, 241, 0.03);
}
.account-card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.account-card-user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  min-width: 0;
}
.account-discord-ico {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: rgba(88, 101, 242, 0.12);
  color: #5865F2;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  flex-shrink: 0;
}
.account-card-tag-text {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-primary, #0F172A);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.account-tag-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}
.account-tag-badge.primary {
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
  border: 1px solid rgba(16, 185, 129, 0.2);
}
.account-tag-badge.secondary {
  background: rgba(99, 102, 241, 0.14);
  color: #4338CA;
  border: 1px solid rgba(99, 102, 241, 0.25);
}
.btn-unlink-mini {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #DC2626;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.btn-unlink-mini:hover {
  background: #DC2626;
  color: #FFFFFF;
  border-color: #DC2626;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
}
.account-card-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
  padding-top: 5px;
  border-top: 1px dashed rgba(226, 232, 240, 0.8);
}
.discord-id-chip-modern {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'JetBrains Mono', Consolas, monospace;
  font-size: 0.73rem;
  color: var(--text-muted, #64748B);
  background: rgba(15, 23, 42, 0.04);
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.discord-id-chip-modern:hover {
  background: rgba(99, 102, 241, 0.1);
  color: #4F46E5;
  border-color: rgba(99, 102, 241, 0.2);
}
.account-date-chip-modern {
  font-size: 0.72rem;
  color: var(--text-muted, #94A3B8);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.badge-account-quota {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap !important;
}
.badge-account-quota.single {
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
  border: 1px solid rgba(16, 185, 129, 0.25);
}
.badge-account-quota.dual {
  background: rgba(99, 102, 241, 0.12);
  color: #4338CA;
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.btn-add-secondary-action {
  background: linear-gradient(135deg, #4F46E5 0%, #3730A3 100%);
  color: #FFFFFF;
  border: none;
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 3px 8px rgba(79, 70, 229, 0.25);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}
.btn-add-secondary-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.4);
}
.badge-quota-completed {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted, #64748B);
  background: rgba(100, 116, 139, 0.08);
  padding: 5px 10px;
  border-radius: 8px;
  white-space: nowrap;
}
.force-link-secondary-notice {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(79, 70, 229, 0.05) 100%);
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: 12px;
  padding: 12px 16px;
  color: #312E81;
  font-size: 0.86rem;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* =========================================================================
   Bot Health Sentinel Modal Redesign
   ========================================================================= */
#botHealthModal .admin-modal-container {
  max-width: 780px !important;
  width: 95vw !important;
  border-radius: 22px !important;
  box-shadow: 0 25px 65px -15px rgba(0, 0, 0, 0.3) !important;
}
.health-hero-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(5, 150, 105, 0.04) 100%);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 16px;
  padding: 16px 20px;
}
.health-hero-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #10B981;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}
.health-hero-text strong {
  font-size: 0.96rem;
  color: #065F46;
  display: block;
  margin-bottom: 3px;
}
.health-hero-text p {
  margin: 0;
  font-size: 0.84rem;
  color: #047857;
  line-height: 1.45;
}
.health-host-box {
  background: #FFFFFF;
  border: 1px solid var(--border-color, #E2E8F0);
  border-radius: 16px;
  padding: 16px 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.health-host-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.health-host-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.health-host-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(99, 102, 241, 0.12);
  color: #4F46E5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}
.health-host-title {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-primary, #0F172A);
}
.health-host-sub {
  font-size: 0.8rem;
  color: var(--text-muted, #64748B);
  margin-top: 2px;
}
.health-host-badge {
  font-size: 0.74rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
}
.health-host-details {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-color, #E2E8F0);
  font-size: 0.78rem;
  color: var(--text-muted, #64748B);
}
.health-switch-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: #FFFFFF;
  border: 1.5px solid rgba(16, 185, 129, 0.3);
  border-radius: 16px;
  padding: 14px 20px;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.08);
}
.health-switch-info {
  flex: 1;
  min-width: 0;
}
.health-switch-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary, #0F172A);
  display: flex;
  align-items: center;
  gap: 8px;
}
.health-switch-desc {
  margin: 3px 0 0 0;
  font-size: 0.8rem;
  color: var(--text-muted, #64748B);
}
.health-events-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
@media (max-width: 680px) {
  .health-events-grid {
    grid-template-columns: 1fr;
  }
}
.event-checkbox-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #FFFFFF;
  border: 1px solid var(--border-color, #E2E8F0);
  border-radius: 14px;
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.event-checkbox-card:hover {
  border-color: #6366F1;
  background: rgba(99, 102, 241, 0.02);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}
.event-card-content {
  flex: 1;
  min-width: 0;
}
.event-card-title {
  font-weight: 700;
  font-size: 0.84rem;
  color: var(--text-primary, #0F172A);
  display: block;
  margin-bottom: 2px;
}
.event-card-desc {
  font-size: 0.74rem;
  color: var(--text-muted, #64748B);
  line-height: 1.4;
  display: block;
}

/* =========================================================================
   Audit Trail & Activity Log Modal Redesign
   ========================================================================= */
#auditLogModal .admin-modal-container {
  max-width: 1100px !important;
  width: 96vw !important;
  border-radius: 24px !important;
  box-shadow: 0 30px 75px -15px rgba(0, 0, 0, 0.35) !important;
}
.audit-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
@media (max-width: 768px) {
  .audit-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
.audit-kpi-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #FFFFFF;
  border: 1px solid var(--border-color, #E2E8F0);
  border-radius: 16px;
  padding: 14px 18px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}
.audit-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}
.audit-kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}
.audit-kpi-info {
  display: flex;
  flex-direction: column;
}
.audit-kpi-label {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted, #64748B);
}
.audit-kpi-val {
  font-size: 1.55rem;
  font-weight: 800;
  line-height: 1.2;
}
.audit-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.audit-search-wrap {
  position: relative;
  flex: 1;
  min-width: 260px;
}
.audit-search-input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  border-radius: 12px;
  border: 1px solid var(--border-color, #E2E8F0);
  font-size: 0.86rem;
  background: #FFFFFF;
  transition: all 0.2s ease;
}
.audit-search-input:focus {
  border-color: #6366F1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
  outline: none;
}
.audit-search-wrap i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted, #94A3B8);
}
.audit-filter-select {
  padding: 9px 32px 9px 12px;
  border-radius: 12px;
  border: 1px solid var(--border-color, #E2E8F0);
  font-size: 0.84rem;
  font-weight: 600;
  background: #FFFFFF;
  color: var(--text-primary, #0F172A);
  cursor: pointer;
  transition: all 0.2s ease;
}
.audit-filter-select:focus {
  border-color: #6366F1;
  outline: none;
}
.audit-table-wrap {
  border: 1px solid var(--border-color, #E2E8F0);
  border-radius: 16px;
  overflow-x: auto;
  background: #FFFFFF;
  max-height: 480px;
  overflow-y: auto;
}
.audit-table-wrap::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.audit-table-wrap::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 4px;
}
.audit-table th {
  position: sticky;
  top: 0;
  background: #F8FAFC;
  z-index: 2;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted, #475569);
  padding: 12px 14px;
  border-bottom: 1.5px solid var(--border-color, #E2E8F0);
  white-space: nowrap;
}
.audit-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.7);
  font-size: 0.84rem;
  vertical-align: middle;
}
.audit-date-cell {
  display: flex;
  flex-direction: column;
  white-space: nowrap;
}
.audit-date-main {
  font-weight: 700;
  color: var(--text-primary, #0F172A);
  font-size: 0.82rem;
}
.audit-date-sub {
  font-size: 0.72rem;
  color: var(--text-muted, #64748B);
  font-family: 'JetBrains Mono', monospace;
}
.audit-status-badge {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px !important;
  padding: 4px 10px !important;
  border-radius: 20px !important;
  font-size: 0.75rem !important;
  font-weight: 700 !important;
  white-space: nowrap !important;
  letter-spacing: normal !important;
}
.audit-status-badge.sent {
  background: rgba(16, 185, 129, 0.12) !important;
  color: #047857 !important;
  border: 1px solid rgba(16, 185, 129, 0.25) !important;
}
.audit-status-badge.actioned {
  background: rgba(59, 130, 246, 0.12) !important;
  color: #1D4ED8 !important;
  border: 1px solid rgba(59, 130, 246, 0.25) !important;
}
.audit-status-badge.failed {
  background: rgba(239, 68, 68, 0.12) !important;
  color: #B91C1C !important;
  border: 1px solid rgba(239, 68, 68, 0.25) !important;
}
.audit-action-btn-modern {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(99, 102, 241, 0.08);
  color: #4F46E5;
  border: 1px solid rgba(99, 102, 241, 0.2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.audit-action-btn-modern:hover {
  background: #4F46E5;
  color: #FFFFFF;
  transform: scale(1.05);
  box-shadow: 0 3px 8px rgba(79, 70, 229, 0.3);
}

/* =========================================================================
   Unconditional Display & Visibility Guarantee
   ========================================================================= */
.is-hidden,
.hidden,
[hidden],
#tabContentVerifiedList.is-hidden,
#tabContentForceLink.is-hidden,
.modal-body-stack.is-hidden {
  display: none !important;
}

/* =========================================================================
   Utility Classes replacing Inline Styles
   ========================================================================= */
.health-switch-label {
  flex-shrink: 0;
  margin: 0;
}

.event-checkbox-input {
  margin-top: 3px;
}

.health-events-grid-full {
  grid-column: 1 / -1;
}

.discord-settings-banner {
  background: linear-gradient(135deg, rgba(88, 101, 242, 0.08) 0%, rgba(99, 102, 241, 0.04) 100%);
  border-color: rgba(88, 101, 242, 0.2);
}

.discord-settings-icon {
  background: rgba(88, 101, 242, 0.15);
  color: #5865F2;
}

.discord-settings-title {
  color: #4752C4;
}

.discord-invite-input-row {
  display: flex;
  gap: 8px;
}

.discord-invite-input {
  flex: 1;
}

.discord-invite-test-btn {
  white-space: nowrap;
  padding: 0 14px;
}

.discord-shortcut-box {
  background: rgba(248, 250, 252, 0.9);
  border: 1px dashed rgba(203, 213, 225, 0.8);
}

.discord-shortcut-header {
  border: none;
  padding-bottom: 0;
}

.discord-shortcut-icon {
  background: rgba(99, 102, 241, 0.1);
  color: #6366F1;
}

.discord-shortcut-title {
  font-size: 13.5px;
}

.discord-shortcut-badge {
  text-decoration: none;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-th-quota-col {
  text-align: center;
  width: 120px;
}

.link-th-actions-col {
  text-align: right;
  width: 160px;
}

/* =========================================================================
   Broadcast Studio 2.0: Rich Embeds, Fields Grid, Media, & Action Buttons
   ========================================================================= */

/* Template Presets Bar */
.template-presets-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: var(--bg-surface, #f8fafc);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 12px;
  margin-bottom: 18px;
}
[data-theme="dark"] .template-presets-bar {
  background: rgba(30, 41, 59, 0.5);
  border-color: rgba(255, 255, 255, 0.08);
}
.template-presets-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted, #64748b);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.template-preset-btn {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-color, #cbd5e1);
  border-radius: 8px;
  padding: 6px 13px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary, #1e293b);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
[data-theme="dark"] .template-preset-btn {
  background: #1e293b;
  border-color: #334155;
  color: #e2e8f0;
}
.template-preset-btn:hover {
  background: var(--primary, #2563eb);
  color: #ffffff;
  border-color: var(--primary, #2563eb);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

/* Studio Accordion Sections */
.studio-accordion-card {
  background: var(--bg-surface, #f8fafc);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 14px;
  margin-bottom: 16px;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
[data-theme="dark"] .studio-accordion-card {
  background: rgba(30, 41, 59, 0.45);
  border-color: rgba(255, 255, 255, 0.08);
}
.studio-accordion-card:hover {
  border-color: #cbd5e1;
}
[data-theme="dark"] .studio-accordion-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
}
.studio-accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 18px;
  background: var(--bg-card, #ffffff);
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  transition: background 0.15s ease;
}
[data-theme="dark"] .studio-accordion-header {
  background: #1e293b;
}
.studio-accordion-header:hover {
  background: rgba(37, 99, 235, 0.03);
}
[data-theme="dark"] .studio-accordion-header:hover {
  background: #243248;
}
.accordion-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}
.accordion-icon-box {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
}
.accordion-icon-blue {
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary, #2563eb);
}
.accordion-icon-emerald {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}
.accordion-icon-purple {
  background: rgba(124, 58, 237, 0.1);
  color: #7c3aed;
}
.accordion-title-text {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
}
[data-theme="dark"] .accordion-title-text {
  color: #f1f5f9;
}
.accordion-count-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary, #2563eb);
}
[data-theme="dark"] .accordion-count-badge {
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
}
.accordion-chevron {
  color: var(--text-muted, #94a3b8);
  transition: transform 0.25s ease;
  font-size: 0.85rem;
}
.studio-accordion-card.is-open .accordion-chevron {
  transform: rotate(180deg);
}
.studio-accordion-body {
  padding: 16px 18px;
  border-top: 1px solid var(--border-color, #e2e8f0);
  display: none;
}
[data-theme="dark"] .studio-accordion-body {
  border-top-color: rgba(255, 255, 255, 0.08);
}
.studio-accordion-card.is-open .studio-accordion-body {
  display: block;
}

/* Fields & Buttons Builder Items */
.builder-actions-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}
.builder-empty-state {
  text-align: center;
  padding: 22px 14px;
  background: var(--bg-card, #ffffff);
  border: 1.5px dashed var(--border-color, #cbd5e1);
  border-radius: 12px;
  color: var(--text-muted, #94a3b8);
  font-size: 0.85rem;
}
.builder-empty-state i {
  font-size: 1.4rem;
}
[data-theme="dark"] .builder-empty-state {
  background: #1e293b;
  border-color: #334155;
}
.field-item-card,
.button-item-card {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 10px;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}
[data-theme="dark"] .field-item-card,
[data-theme="dark"] .button-item-card {
  background: #1e293b;
  border-color: #334155;
}
.field-item-card:hover,
.button-item-card:hover {
  border-color: var(--primary, #2563eb);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}
.item-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.item-badge-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary, #2563eb);
}
.item-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (max-width: 640px) {
  .item-card-grid {
    grid-template-columns: 1fr;
  }
}
.item-layout-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-surface, #f8fafc);
  padding: 3px;
  border-radius: 8px;
  border: 1px solid var(--border-color, #cbd5e1);
}
[data-theme="dark"] .item-layout-toggle {
  background: #0f172a;
  border-color: #334155;
}
.toggle-chip-btn {
  background: transparent;
  border: none;
  border-radius: 6px;
  padding: 3px 9px;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-secondary, #64748b);
  cursor: pointer;
  transition: all 0.15s ease;
}
.toggle-chip-btn.active {
  background: var(--primary, #2563eb);
  color: #ffffff;
  box-shadow: 0 1px 4px rgba(37, 99, 235, 0.3);
}
.btn-delete-item {
  background: transparent;
  border: 1px solid transparent;
  color: #ef4444;
  border-radius: 6px;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-delete-item:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.2);
}

/* Quick Emoji Picker Strip */
.button-emoji-picker-strip {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.btn-mini-emoji {
  background: var(--bg-surface, #f8fafc);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: transform 0.1s ease;
}
[data-theme="dark"] .btn-mini-emoji {
  background: #0f172a;
  border-color: #334155;
}
.btn-mini-emoji:hover {
  transform: scale(1.2);
}

/* Discord Mockup Rich Embed Expansion */
.mock-embed-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.mock-embed-left-content {
  flex: 1;
  min-width: 0;
}
.mock-author-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 4px;
}
.mock-author-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
}
.mock-thumbnail-wrap {
  flex-shrink: 0;
  margin-left: 10px;
}
.mock-thumbnail {
  width: 80px;
  height: 80px;
  border-radius: 6px;
  object-fit: cover;
  background: #1e1f22;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Mock Fields Grid */
.mock-embed-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 12px;
  margin: 12px 0 10px;
}
@media (max-width: 480px) {
  .mock-embed-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.mock-field-col {
  grid-column: span 1;
}
.mock-field-full {
  grid-column: 1 / -1;
}
.mock-field-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: #b5bac1;
  margin-bottom: 2px;
  word-break: break-word;
}
.mock-field-val {
  font-size: 0.85rem;
  color: #dbdee1;
  line-height: 1.4;
  word-break: break-word;
  white-space: pre-wrap;
}

/* Mock Banner Image */
.mock-image-wrap {
  margin: 12px 0 8px;
}
.mock-embed-image {
  max-width: 100%;
  max-height: 260px;
  width: 100%;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: block;
}

/* Mock Action Buttons */
.mock-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.mock-btn-link {
  background: #4e5058;
  color: #ffffff;
  padding: 7px 14px;
  border-radius: 4px;
  font-size: 0.82rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
  border: none;
}
.mock-btn-link:hover {
  background: #6d6f78;
  color: #ffffff;
}
.mock-btn-link .link-arrow-icon {
  font-size: 0.7rem;
  opacity: 0.75;
}

/* ==========================================================================
   OFFICIAL THAI GOVERNMENT EXECUTIVE UI/UX REVAMP (MyWellnetPTN Backoffice)
   ตามระเบียบงานสารสนเทศภาครัฐ • Modern, Friendly, State-of-the-Art Enterprise Design
   ========================================================================== */

:root {
  --gov-navy-950: #061126;
  --gov-navy-900: #0a1b3d;
  --gov-navy-800: #0f2b5c;
  --gov-blue-700: #1d4ed8;
  --gov-blue-600: #2563eb;
  --gov-blue-500: #3b82f6;
  --gov-azure-400: #60a5fa;
  --gov-azure-50: #eff6ff;

  --gov-gold-600: #d97706;
  --gov-gold-500: #f59e0b;
  --gov-gold-100: #fef3c7;

  --gov-emerald-700: #047857;
  --gov-emerald-600: #059669;
  --gov-emerald-500: #10b981;
  --gov-emerald-50: #ecfdf5;

  --gov-slate-900: #0f172a;
  --gov-slate-800: #1e293b;
  --gov-slate-700: #334155;
  --gov-slate-600: #475569;
  --gov-slate-500: #64748b;
  --gov-slate-400: #94a3b8;
  --gov-slate-200: #e2e8f0;
  --gov-slate-100: #f1f5f9;
  --gov-slate-50: #f8fafc;

  --gov-card-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.06), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
  --gov-card-hover-shadow: 0 16px 32px -4px rgba(15, 23, 42, 0.12), 0 6px 12px -2px rgba(15, 23, 42, 0.06);
  --gov-popover-shadow: 0 24px 50px -10px rgba(15, 23, 42, 0.22), 0 0 0 1px rgba(37, 99, 235, 0.12);
}

[data-theme="dark"] {
  --gov-slate-50: #0a0f1d;
  --gov-slate-100: #0f172a;
  --gov-slate-200: #1e293b;
  --gov-slate-700: #cbd5e1;
  --gov-slate-800: #e2e8f0;
  --gov-slate-900: #f8fafc;
  --gov-card-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.06);
  --gov-card-hover-shadow: 0 16px 36px -4px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(59, 130, 246, 0.3);
  --gov-popover-shadow: 0 24px 50px -8px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(96, 165, 250, 0.25);
}

/* --- 1. Top Executive Navigation Bar (Official Government Portal Look) --- */
.admin-nav {
  background: var(--bg-surface-glass, rgba(255, 255, 255, 0.92)) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  backdrop-filter: blur(20px) !important;
  border-bottom: 1.5px solid var(--border-color, #e2e8f0) !important;
  box-shadow: 0 4px 20px -4px rgba(15, 23, 42, 0.05) !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 1000 !important;
  height: 64px !important;
  padding: 0 28px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
}

[data-theme="dark"] .admin-nav {
  background: rgba(10, 15, 29, 0.94) !important;
  border-bottom-color: rgba(255, 255, 255, 0.08) !important;
}

.admin-nav .brand {
  gap: 12px !important;
  text-decoration: none !important;
}

.admin-nav .brand-logo-frame {
  width: 40px !important;
  height: 40px !important;
  border-radius: 12px !important;
  background: linear-gradient(135deg, #1e3a8a, #2563eb) !important;
  padding: 3px !important;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.admin-nav .brand-logo-img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  border-radius: 9px !important;
}

.admin-nav .brand-title {
  font-size: 1.15rem !important;
  font-weight: 800 !important;
  letter-spacing: -0.01em !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

.brand-tag-gov {
  font-size: 0.62rem !important;
  font-weight: 800 !important;
  padding: 2px 7px !important;
  background: linear-gradient(135deg, #1e3a8a, #2563eb) !important;
  color: #ffffff !important;
  border-radius: 6px !important;
  letter-spacing: 0.05em !important;
  text-transform: uppercase !important;
}

.admin-nav .brand-sub {
  font-size: 0.72rem !important;
  color: var(--gov-slate-500, #64748b) !important;
  font-weight: 600 !important;
  line-height: 1.2 !important;
}

/* Center Status Indicator */
.admin-nav-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.gov-system-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
  color: #059669;
}

[data-theme="dark"] .gov-system-status-chip {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.3);
}

.pulse-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #10b981;
  position: relative;
}

.pulse-indicator::after {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border-radius: 50%;
  background-color: inherit;
  opacity: 0.7;
  animation: gov-pulse 2s cubic-bezier(0.24, 0, 0.38, 1) infinite;
}

@keyframes gov-pulse {
  0% { transform: scale(1); opacity: 0.8; }
  70% { transform: scale(2.4); opacity: 0; }
  100% { transform: scale(2.4); opacity: 0; }
}

.admin-badge-sso {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 4px 12px !important;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(79, 70, 229, 0.1)) !important;
  border: 1px solid rgba(59, 130, 246, 0.3) !important;
  border-radius: 999px !important;
  font-size: 0.74rem !important;
  font-weight: 700 !important;
  color: #1d4ed8 !important;
}

[data-theme="dark"] .admin-badge-sso {
  color: #60a5fa !important;
  border-color: rgba(96, 165, 250, 0.35) !important;
}

/* User Capsule */
.user-pill {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 4px 12px 4px 5px !important;
  background: var(--bg-card, #ffffff) !important;
  border: 1px solid var(--border-color, #e2e8f0) !important;
  border-radius: 999px !important;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05) !important;
  transition: all 0.2s ease !important;
}

.user-pill:hover {
  border-color: #cbd5e1 !important;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08) !important;
}

.user-avatar-circle {
  width: 32px !important;
  height: 32px !important;
  border-radius: 50% !important;
  background: linear-gradient(135deg, #1e3a8a, #2563eb) !important;
  color: #ffffff !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-weight: 800 !important;
  font-size: 0.85rem !important;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3) !important;
}

.user-pill-name {
  font-size: 0.82rem !important;
  font-weight: 700 !important;
}

.user-pill-role {
  font-size: 0.68rem !important;
  color: #059669 !important;
  font-weight: 700 !important;
}

/* --- 2. Executive Tab Navigation Bar (Polished Segmented Control) --- */
.admin-tab-bar-container {
  max-width: 1400px;
  margin: 20px auto 28px;
  padding: 0 24px;
}

.admin-tab-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface-glass, rgba(255, 255, 255, 0.9));
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1.5px solid var(--border-color, #e2e8f0);
  border-radius: 18px;
  padding: 6px;
  box-shadow: var(--gov-card-shadow);
  overflow-x: auto;
}

.admin-tab-bar::-webkit-scrollbar {
  display: none;
}

.admin-tab-btn {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 10px 18px !important;
  font-size: 0.88rem !important;
  font-weight: 700 !important;
  color: var(--gov-slate-600, #475569) !important;
  background: transparent !important;
  border: 1.5px solid transparent !important;
  border-radius: 12px !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.admin-tab-btn i {
  font-size: 1rem !important;
  transition: transform 0.2s ease !important;
}

.admin-tab-btn:hover {
  color: #2563eb !important;
  background: rgba(37, 99, 235, 0.05) !important;
}

.admin-tab-btn:hover i {
  transform: scale(1.15) !important;
}

.admin-tab-btn.active {
  color: #ffffff !important;
  background: linear-gradient(135deg, #1e3a8a, #2563eb) !important;
  border-color: rgba(37, 99, 235, 0.4) !important;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35) !important;
}

.admin-tab-btn.active i {
  color: #ffffff !important;
}

.tab-badge {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 20px !important;
  height: 20px !important;
  padding: 0 6px !important;
  font-size: 0.7rem !important;
  font-weight: 800 !important;
  border-radius: 999px !important;
  background: rgba(15, 23, 42, 0.08) !important;
  color: inherit !important;
  transition: all 0.2s ease !important;
}

.admin-tab-btn.active .tab-badge {
  background: rgba(255, 255, 255, 0.25) !important;
  color: #ffffff !important;
}

/* --- 3. Section Eyebrow & Page Headers --- */
.gov-section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #2563eb;
  margin-bottom: 6px;
}

[data-theme="dark"] .gov-section-eyebrow {
  color: #60a5fa;
}

.admin-title-group h1 {
  font-size: 1.85rem !important;
  font-weight: 800 !important;
  color: var(--gov-slate-900, #0f172a) !important;
  letter-spacing: -0.02em !important;
  line-height: 1.2 !important;
  margin-bottom: 6px !important;
}

.admin-title-group p {
  font-size: 0.92rem !important;
  color: var(--gov-slate-500, #64748b) !important;
  line-height: 1.5 !important;
}

/* --- 4. Bento Stat Cards & KPI Boxes --- */
.admin-stats-grid,
.bot-kpi-summary-grid,
.logs-kpi-grid {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 16px !important;
  margin-bottom: 24px !important;
}

@media (max-width: 1024px) {
  .admin-stats-grid,
  .bot-kpi-summary-grid,
  .logs-kpi-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 640px) {
  .admin-stats-grid,
  .bot-kpi-summary-grid,
  .logs-kpi-grid {
    grid-template-columns: 1fr !important;
  }
}

.stat-card,
.bot-kpi-card,
.log-kpi-box {
  background: var(--bg-card, #ffffff) !important;
  border: 1.5px solid var(--border-color, #e2e8f0) !important;
  border-radius: 18px !important;
  padding: 18px 20px !important;
  box-shadow: var(--gov-card-shadow) !important;
  position: relative !important;
  overflow: hidden !important;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.stat-card:hover,
.bot-kpi-card:hover,
.log-kpi-box:hover {
  transform: translateY(-3px) !important;
  box-shadow: var(--gov-card-hover-shadow) !important;
  border-color: #cbd5e1 !important;
}

.stat-card::before,
.bot-kpi-card::before,
.log-kpi-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3.5px;
  background: linear-gradient(90deg, #1e3a8a, #2563eb);
  opacity: 0.8;
}

.stat-card:nth-child(2)::before { background: linear-gradient(90deg, #059669, #10b981); }
.stat-card:nth-child(3)::before { background: linear-gradient(90deg, #d97706, #f59e0b); }
.stat-card:nth-child(4)::before { background: linear-gradient(90deg, #7c3aed, #a855f7); }

.stat-card-title,
.bot-kpi-label,
.log-kpi-label {
  font-size: 0.80rem !important;
  font-weight: 700 !important;
  color: var(--gov-slate-500, #64748b) !important;
}

.stat-card-value,
.bot-kpi-value,
.log-kpi-val {
  font-size: 1.95rem !important;
  font-weight: 900 !important;
  color: var(--gov-slate-900, #0f172a) !important;
  line-height: 1.15 !important;
  margin: 4px 0 !important;
  font-family: 'Plus Jakarta Sans', 'Prompt', sans-serif !important;
}

.stat-card-sub,
.bot-kpi-sub,
.log-kpi-desc {
  font-size: 0.74rem !important;
  color: var(--gov-slate-400, #94a3b8) !important;
  font-weight: 600 !important;
  display: flex !important;
  align-items: center !important;
  gap: 5px !important;
}

.stat-card-icon-box,
.bot-kpi-icon,
.log-kpi-icon {
  width: 44px !important;
  height: 44px !important;
  border-radius: 12px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 1.25rem !important;
}

/* --- 5. ULTRA-PREMIUM DROPDOWN SYSTEM (FontAwesome Icons + Government Dignity) --- */
.premium-custom-dropdown {
  position: relative !important;
  width: 100% !important;
}

.premium-custom-trigger {
  width: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  min-height: 48px !important;
  padding: 8px 14px !important;
  background: var(--bg-card, #ffffff) !important;
  border: 1.5px solid var(--border-color, #cbd5e1) !important;
  border-radius: 14px !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04) !important;
  cursor: pointer !important;
  font-family: inherit !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  text-align: left !important;
}

.premium-custom-trigger:hover {
  border-color: #2563eb !important;
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.08) !important;
}

.premium-custom-trigger.open,
.premium-custom-trigger:focus-visible {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.16), 0 4px 12px rgba(15, 23, 42, 0.08) !important;
  outline: none !important;
}

.custom-trigger-content {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  min-width: 0 !important;
  flex: 1 !important;
}

.custom-trigger-icon {
  width: 36px !important;
  height: 36px !important;
  border-radius: 10px !important;
  background: rgba(37, 99, 235, 0.08) !important;
  color: #2563eb !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 1.05rem !important;
  flex-shrink: 0 !important;
  transition: all 0.2s ease !important;
}

.custom-trigger-texts {
  display: flex !important;
  flex-direction: column !important;
  min-width: 0 !important;
  line-height: 1.25 !important;
}

.custom-trigger-label {
  font-size: 0.90rem !important;
  font-weight: 700 !important;
  color: var(--gov-slate-900, #0f172a) !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.custom-trigger-sub {
  font-size: 0.74rem !important;
  color: var(--gov-slate-500, #64748b) !important;
  font-weight: 500 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.custom-trigger-actions {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-shrink: 0 !important;
  margin-left: 10px !important;
}

.custom-trigger-chevron {
  font-size: 0.82rem !important;
  color: var(--gov-slate-400, #94a3b8) !important;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.2s ease !important;
}

.premium-custom-trigger.open .custom-trigger-chevron {
  transform: rotate(180deg) !important;
  color: #2563eb !important;
}

/* Floating Menu */
.premium-custom-menu {
  position: absolute !important;
  top: calc(100% + 8px) !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 1100 !important;
  background: var(--bg-card, #ffffff) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  backdrop-filter: blur(20px) !important;
  border: 1.5px solid var(--border-color, #cbd5e1) !important;
  border-radius: 18px !important;
  box-shadow: var(--gov-popover-shadow) !important;
  padding: 8px !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transform: translateY(-8px) scale(0.98) !important;
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.2s !important;
}

.premium-custom-menu.open {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  transform: translateY(0) scale(1) !important;
}

.custom-menu-search {
  position: relative !important;
  padding: 6px 8px 10px !important;
  border-bottom: 1px solid var(--border-color, #f1f5f9) !important;
  margin-bottom: 6px !important;
}

.custom-menu-search .search-icon {
  position: absolute !important;
  left: 20px !important;
  top: 18px !important;
  font-size: 0.85rem !important;
  color: var(--gov-slate-400, #94a3b8) !important;
}

.custom-menu-search-input {
  width: 100% !important;
  padding: 9px 12px 9px 36px !important;
  font-size: 0.86rem !important;
  font-family: inherit !important;
  border: 1.5px solid var(--border-color, #e2e8f0) !important;
  border-radius: 11px !important;
  background: var(--gov-slate-50, #f8fafc) !important;
  color: var(--gov-slate-900, #0f172a) !important;
  transition: all 0.15s ease !important;
}

.custom-menu-search-input:focus {
  background: #ffffff !important;
  border-color: #2563eb !important;
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14) !important;
}

.custom-menu-options-list {
  max-height: 280px !important;
  overflow-y: auto !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
  padding-right: 4px !important;
}

.custom-menu-options-list::-webkit-scrollbar {
  width: 6px !important;
}

.custom-menu-options-list::-webkit-scrollbar-thumb {
  background: #cbd5e1 !important;
  border-radius: 99px !important;
}

.premium-custom-option {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 9px 12px !important;
  border-radius: 12px !important;
  cursor: pointer !important;
  border: 1.5px solid transparent !important;
  transition: all 0.15s ease !important;
}

.premium-custom-option:hover {
  background: rgba(37, 99, 235, 0.06) !important;
  border-color: rgba(37, 99, 235, 0.15) !important;
}

.premium-custom-option.active {
  background: rgba(37, 99, 235, 0.1) !important;
  border-color: rgba(37, 99, 235, 0.3) !important;
}

.custom-option-main {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  min-width: 0 !important;
  flex: 1 !important;
}

.custom-option-icon-box {
  width: 34px !important;
  height: 34px !important;
  border-radius: 9px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 1rem !important;
  flex-shrink: 0 !important;
}

.custom-option-texts {
  display: flex !important;
  flex-direction: column !important;
  min-width: 0 !important;
}

.custom-option-title {
  font-size: 0.88rem !important;
  font-weight: 700 !important;
  color: var(--gov-slate-900, #0f172a) !important;
}

.custom-option-subtext {
  font-size: 0.74rem !important;
  color: var(--gov-slate-500, #64748b) !important;
  font-weight: 500 !important;
}

.custom-option-check {
  font-size: 0.85rem !important;
  color: #059669 !important;
  opacity: 0 !important;
  transform: scale(0.6) !important;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

.premium-custom-option.active .custom-option-check {
  opacity: 1 !important;
  transform: scale(1) !important;
}

/* Native Select Enhancement (When Native Select is rendered or fallback) */
.form-select,
select.form-control {
  -webkit-appearance: none !important;
  appearance: none !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232563eb' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 14px center !important;
  background-size: 16px 16px !important;
  padding: 10px 40px 10px 16px !important;
  border: 1.5px solid var(--border-color, #cbd5e1) !important;
  border-radius: 13px !important;
  font-family: inherit !important;
  font-size: 0.90rem !important;
  font-weight: 600 !important;
  color: var(--gov-slate-900, #0f172a) !important;
  background-color: var(--bg-card, #ffffff) !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04) !important;
  transition: all 0.2s ease !important;
  cursor: pointer !important;
}

.form-select:focus,
select.form-control:focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 3.5px rgba(37, 99, 235, 0.16) !important;
  outline: none !important;
}

/* --- 6. Modern Government Tables & Containers --- */
.admin-table-card {
  background: var(--bg-card, #ffffff) !important;
  border: 1.5px solid var(--border-color, #e2e8f0) !important;
  border-radius: 20px !important;
  box-shadow: var(--gov-card-shadow) !important;
  overflow: hidden !important;
  margin-bottom: 24px !important;
}

.admin-table {
  width: 100% !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
}

.admin-table th {
  background: var(--gov-slate-50, #f8fafc) !important;
  padding: 14px 18px !important;
  font-size: 0.80rem !important;
  font-weight: 800 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
  color: var(--gov-slate-600, #475569) !important;
  border-bottom: 1.5px solid var(--border-color, #e2e8f0) !important;
}

.admin-table td {
  padding: 16px 18px !important;
  font-size: 0.88rem !important;
  color: var(--gov-slate-800, #1e293b) !important;
  border-bottom: 1px solid var(--border-color, #f1f5f9) !important;
  vertical-align: middle !important;
  transition: background 0.15s ease !important;
}

.admin-table tbody tr:hover td {
  background: rgba(37, 99, 235, 0.03) !important;
}

/* --- 7. Modern Button Variants --- */
.btn-modern-primary {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  padding: 10px 20px !important;
  font-size: 0.88rem !important;
  font-weight: 700 !important;
  border-radius: 12px !important;
  background: linear-gradient(135deg, #1e3a8a, #2563eb) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3) !important;
  cursor: pointer !important;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.btn-modern-primary:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.4) !important;
  background: linear-gradient(135deg, #172554, #1d4ed8) !important;
}

.btn-modern-secondary {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  padding: 10px 18px !important;
  font-size: 0.88rem !important;
  font-weight: 700 !important;
  border-radius: 12px !important;
  background: var(--bg-card, #ffffff) !important;
  color: var(--gov-slate-700, #334155) !important;
  border: 1.5px solid var(--border-color, #cbd5e1) !important;
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.04) !important;
  cursor: pointer !important;
  transition: all 0.22s ease !important;
}

.btn-modern-secondary:hover {
  border-color: #94a3b8 !important;
  color: #0f172a !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.08) !important;
}

/* Control Toolbar & Filter Pills */
.admin-control-bar {
  background: var(--bg-card, #ffffff) !important;
  border: 1.5px solid var(--border-color, #e2e8f0) !important;
  border-radius: 18px !important;
  padding: 12px 18px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 16px !important;
  margin-bottom: 20px !important;
  box-shadow: var(--gov-card-shadow) !important;
  flex-wrap: wrap !important;
}

.search-box {
  position: relative !important;
  flex: 1 !important;
  min-width: 280px !important;
  display: flex !important;
  align-items: center !important;
}

.search-box i {
  position: absolute !important;
  left: 14px !important;
  color: var(--gov-slate-400, #94a3b8) !important;
  font-size: 0.95rem !important;
}

.search-input {
  width: 100% !important;
  padding: 10px 16px 10px 42px !important;
  font-size: 0.90rem !important;
  border: 1.5px solid var(--border-color, #cbd5e1) !important;
  border-radius: 12px !important;
  background: var(--gov-slate-50, #f8fafc) !important;
  color: var(--gov-slate-900, #0f172a) !important;
  transition: all 0.2s ease !important;
}

.search-input:focus {
  background: #ffffff !important;
  border-color: #2563eb !important;
  outline: none !important;
  box-shadow: 0 0 0 3.5px rgba(37, 99, 235, 0.14) !important;
}

.status-filter-pills {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  flex-wrap: wrap !important;
}

.filter-btn {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 7px 14px !important;
  font-size: 0.82rem !important;
  font-weight: 700 !important;
  border-radius: 10px !important;
  background: var(--gov-slate-50, #f8fafc) !important;
  color: var(--gov-slate-600, #475569) !important;
  border: 1.5px solid var(--border-color, #e2e8f0) !important;
  cursor: pointer !important;
  transition: all 0.18s ease !important;
}

.filter-btn:hover {
  background: rgba(37, 99, 235, 0.05) !important;
  color: #2563eb !important;
  border-color: rgba(37, 99, 235, 0.3) !important;
}

.filter-btn.active {
  background: linear-gradient(135deg, #1e3a8a, #2563eb) !important;
  color: #ffffff !important;
  border-color: transparent !important;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3) !important;
}

/* --- 8. Modals & Form Dialog Polish (Safe & Preserved) --- */
.admin-modal-overlay {
  -webkit-backdrop-filter: blur(12px) !important;
  backdrop-filter: blur(12px) !important;
  background: rgba(15, 23, 42, 0.65) !important;
}

.admin-modal-container {
  background: var(--bg-card, #ffffff) !important;
  border: 1.5px solid var(--border-color, #e2e8f0) !important;
  border-radius: 24px !important;
  box-shadow: 0 25px 60px -10px rgba(0, 0, 0, 0.35) !important;
}

.modal-header {
  padding: 20px 24px !important;
  border-bottom: 1.5px solid var(--border-color, #f1f5f9) !important;
}

.modal-header-icon-box {
  width: 44px !important;
  height: 44px !important;
  border-radius: 12px !important;
  background: linear-gradient(135deg, #1e3a8a, #2563eb) !important;
  color: #ffffff !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 1.25rem !important;
}

.modal-section-card {
  background: var(--gov-slate-50, #f8fafc) !important;
  border: 1.5px solid var(--border-color, #e2e8f0) !important;
  border-radius: 16px !important;
  padding: 18px !important;
  margin-bottom: 16px !important;
}

.modal-section-title {
  font-size: 0.88rem !important;
  font-weight: 800 !important;
  color: var(--gov-slate-900, #0f172a) !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  margin-bottom: 14px !important;
}

.form-label {
  font-size: 0.82rem !important;
  font-weight: 700 !important;
  color: var(--gov-slate-700, #334155) !important;
  margin-bottom: 6px !important;
}

.form-input,
.form-textarea {
  width: 100% !important;
  padding: 10px 14px !important;
  font-size: 0.88rem !important;
  border: 1.5px solid var(--border-color, #cbd5e1) !important;
  border-radius: 12px !important;
  background: #ffffff !important;
  color: var(--gov-slate-900, #0f172a) !important;
  transition: all 0.2s ease !important;
}

.form-input:focus,
.form-textarea:focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 3.5px rgba(37, 99, 235, 0.14) !important;
  outline: none !important;
}

.input-with-icon {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
}

.input-with-icon .input-adornment {
  position: absolute !important;
  right: 14px !important;
  color: var(--gov-slate-400, #94a3b8) !important;
  font-size: 0.90rem !important;
  pointer-events: none !important;
}

/* ==========================================================================
   🏛️ 2026 OFFICIAL EXECUTIVE GOVERNMENT DESIGN SYSTEM (อบจ.ปัตตานี)
   According to Master Guideline guildeline_by_dntvkl.md
   ========================================================================== */

/* 1. Global Reset & Elimination of Boxed Gaps for 100% Flush Gov Shell */
body.admin-logged-in {
  overflow: hidden !important;
  background-color: var(--gov-slate-50, #f8fafc) !important;
  color: var(--gov-slate-800, #1e293b) !important;
  margin: 0 !important;
  padding: 0 !important;
  width: 100vw !important;
  max-width: 100vw !important;
  height: 100vh !important;
  max-height: 100vh !important;
}

body.admin-logged-in .ambient-light {
  display: none !important;
}

body.admin-logged-in .login-nav-only {
  display: none !important;
}

body.admin-logged-in .admin-layout,
body.admin-logged-in .admin-main {
  padding: 0 !important;
  margin: 0 !important;
  max-width: 100vw !important;
  width: 100% !important;
  height: 100vh !important;
  max-height: 100vh !important;
  display: flex !important;
  flex-direction: column !important;
}

/* 2. Executive Shell (Sidebar + Content Shell) - 100% Flush to Viewport Edges */
body.admin-logged-in .admin-app-shell,
body.admin-logged-in #dashboardView.admin-app-shell:not(.is-hidden) {
  display: flex !important;
  height: 100vh !important;
  max-height: 100vh !important;
  width: 100vw !important;
  max-width: 100vw !important;
  margin: 0 !important;
  padding: 0 !important;
  position: relative !important;
  background: var(--gov-slate-50, #f8fafc) !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

/* 3. Official Left Sidebar - ติดขอบจอ 100% ชิดซ้าย บน และล่าง */
.admin-sidebar {
  width: 270px !important;
  min-width: 270px !important;
  max-width: 270px !important;
  background: #ffffff !important;
  border-right: 1px solid var(--border-color, #e2e8f0) !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  height: 100vh !important;
  max-height: 100vh !important;
  position: relative !important;
  top: 0 !important;
  left: 0 !important;
  bottom: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  flex-shrink: 0 !important;
  z-index: 1050 !important;
  transition: width 0.28s cubic-bezier(0.16, 1, 0.3, 1), transform 0.28s cubic-bezier(0.16, 1, 0.3, 1) !important;
  box-shadow: 1px 0 3px rgba(0, 0, 0, 0.02) !important;
  box-sizing: border-box !important;
}

[data-theme="dark"] .admin-sidebar {
  background: #0f172a !important;
  border-color: #1e293b !important;
}

/* Brand Header */
.sidebar-brand-wrapper {
  padding: 18px 20px !important;
  border-bottom: 1px solid var(--border-color, #e2e8f0) !important;
  display: flex !important;
  align-items: center !important;
  flex-shrink: 0 !important;
}

[data-theme="dark"] .sidebar-brand-wrapper {
  border-color: #1e293b !important;
}

.sidebar-brand-link {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  text-decoration: none !important;
  color: inherit !important;
  width: 100% !important;
}

.sidebar-brand-wrapper .brand-logo-frame {
  width: 42px !important;
  height: 42px !important;
  min-width: 42px !important;
  border-radius: 10px !important;
  background: #ffffff !important;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.12) !important;
  border: 1px solid rgba(226, 232, 240, 0.8) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden !important;
}

.sidebar-brand-wrapper .brand-logo-img {
  width: 32px !important;
  height: 32px !important;
  object-fit: contain !important;
}

.sidebar-brand-info {
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  white-space: nowrap !important;
}

.sidebar-brand-title {
  font-size: 1.05rem !important;
  font-weight: 800 !important;
  color: #0f172a !important;
  letter-spacing: -0.02em !important;
  line-height: 1.2 !important;
}

[data-theme="dark"] .sidebar-brand-title {
  color: #f8fafc !important;
}

.sidebar-brand-title .brand-accent {
  color: #2563eb !important;
}

.sidebar-brand-sub {
  font-size: 0.72rem !important;
  color: #64748b !important;
  font-weight: 500 !important;
  margin-top: 2px !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

[data-theme="dark"] .sidebar-brand-sub {
  color: #94a3b8 !important;
}

/* Nav Scrollable Area */
.sidebar-nav-scrollable {
  flex: 1 1 auto !important;
  overflow-y: auto !important;
  padding: 16px 12px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 20px !important;
}

.sidebar-nav-section {
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
}

.sidebar-nav-heading {
  font-size: 0.70rem !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.06em !important;
  color: #94a3b8 !important;
  padding: 4px 10px 8px 10px !important;
}

[data-theme="dark"] .sidebar-nav-heading {
  color: #64748b !important;
}

.sidebar-nav-list {
  display: flex !important;
  flex-direction: column !important;
  gap: 3px !important;
}

/* Sidebar Nav Items */
.sidebar-nav-item.admin-tab-btn {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  width: 100% !important;
  padding: 10px 14px !important;
  border-radius: 10px !important;
  font-size: 0.88rem !important;
  font-weight: 600 !important;
  color: #475569 !important;
  background: transparent !important;
  border: 1px solid transparent !important;
  cursor: pointer !important;
  text-align: left !important;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1) !important;
  box-shadow: none !important;
  position: relative !important;
}

.sidebar-nav-item .nav-icon {
  font-size: 1rem !important;
  width: 20px !important;
  text-align: center !important;
  color: #64748b !important;
  transition: color 0.18s ease !important;
  flex-shrink: 0 !important;
}

.sidebar-nav-item .nav-text {
  flex: 1 1 auto !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.sidebar-nav-item .tab-badge {
  font-size: 0.72rem !important;
  font-weight: 700 !important;
  padding: 2px 7px !important;
  border-radius: 999px !important;
  background: #e2e8f0 !important;
  color: #475569 !important;
  margin-left: auto !important;
}

.sidebar-nav-item:hover {
  background: #f1f5f9 !important;
  color: #0f172a !important;
}

.sidebar-nav-item:hover .nav-icon {
  color: #2563eb !important;
}

[data-theme="dark"] .sidebar-nav-item {
  color: #94a3b8 !important;
}

[data-theme="dark"] .sidebar-nav-item:hover {
  background: #1e293b !important;
  color: #f8fafc !important;
}

.sidebar-nav-item.active {
  background: #eff6ff !important;
  color: #1d4ed8 !important;
  font-weight: 700 !important;
  border-color: rgba(37, 99, 235, 0.15) !important;
}

.sidebar-nav-item.active .nav-icon {
  color: #2563eb !important;
}

.sidebar-nav-item.active .tab-badge {
  background: #2563eb !important;
  color: #ffffff !important;
}

[data-theme="dark"] .sidebar-nav-item.active {
  background: rgba(37, 99, 235, 0.18) !important;
  color: #60a5fa !important;
  border-color: rgba(96, 165, 250, 0.25) !important;
}

/* Sidebar Footer & Collapse */
.sidebar-footer {
  padding: 14px 16px !important;
  border-top: 1px solid var(--border-color, #e2e8f0) !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  flex-shrink: 0 !important;
  background: #ffffff !important;
}

[data-theme="dark"] .sidebar-footer {
  background: #0f172a !important;
  border-color: #1e293b !important;
}

.sidebar-status-box {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 8px 12px !important;
  background: #f0fdf4 !important;
  border: 1px solid #bbf7d0 !important;
  border-radius: 8px !important;
  font-size: 0.76rem !important;
  color: #166534 !important;
  font-weight: 600 !important;
}

[data-theme="dark"] .sidebar-status-box {
  background: rgba(22, 101, 52, 0.2) !important;
  border-color: rgba(34, 197, 94, 0.3) !important;
  color: #86efac !important;
}

.btn-sidebar-collapse {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  padding: 8px 12px !important;
  width: 100% !important;
  border: 1px solid var(--border-color, #e2e8f0) !important;
  background: transparent !important;
  border-radius: 8px !important;
  color: #64748b !important;
  font-size: 0.80rem !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: all 0.18s ease !important;
}

.btn-sidebar-collapse:hover {
  background: #f8fafc !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}

[data-theme="dark"] .btn-sidebar-collapse {
  border-color: #1e293b !important;
  color: #94a3b8 !important;
}

[data-theme="dark"] .btn-sidebar-collapse:hover {
  background: #1e293b !important;
  color: #f8fafc !important;
}

/* Collapsed Sidebar on Desktop */
.admin-sidebar.collapsed {
  width: 76px !important;
  min-width: 76px !important;
  max-width: 76px !important;
}

.admin-sidebar.collapsed .sidebar-brand-info,
.admin-sidebar.collapsed .sidebar-nav-heading,
.admin-sidebar.collapsed .nav-text,
.admin-sidebar.collapsed .tab-badge,
.admin-sidebar.collapsed .sidebar-status-text,
.admin-sidebar.collapsed .collapse-text {
  display: none !important;
}

.admin-sidebar.collapsed .sidebar-brand-wrapper {
  justify-content: center !important;
  padding: 16px 10px !important;
}

.admin-sidebar.collapsed .sidebar-nav-item {
  justify-content: center !important;
  padding: 12px 10px !important;
}

.admin-sidebar.collapsed .collapse-icon {
  transform: rotate(180deg) !important;
}

/* 4. Content Shell & Topbar */
.admin-content-shell {
  flex: 1 1 auto !important;
  display: flex !important;
  flex-direction: column !important;
  min-width: 0 !important;
  height: 100vh !important;
  max-height: 100vh !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  background: var(--gov-slate-50, #f8fafc) !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}

[data-theme="dark"] .admin-content-shell {
  background: #0b1120 !important;
}

.admin-content-topbar {
  height: 64px !important;
  min-height: 64px !important;
  background: #ffffff !important;
  border-bottom: 1px solid var(--border-color, #e2e8f0) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 0 32px !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 1040 !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03) !important;
  flex-shrink: 0 !important;
  box-sizing: border-box !important;
}

[data-theme="dark"] .admin-content-topbar {
  background: #0f172a !important;
  border-color: #1e293b !important;
}

.topbar-left {
  display: flex !important;
  align-items: center !important;
  gap: 16px !important;
}

.btn-hamburger {
  display: none !important;
  background: transparent !important;
  border: 1px solid var(--border-color, #e2e8f0) !important;
  border-radius: 8px !important;
  width: 38px !important;
  height: 38px !important;
  color: #334155 !important;
  font-size: 1.1rem !important;
  cursor: pointer !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.18s ease !important;
}

.btn-hamburger:hover {
  background: #f1f5f9 !important;
  color: #0f172a !important;
}

[data-theme="dark"] .btn-hamburger {
  border-color: #334155 !important;
  color: #cbd5e1 !important;
}

.topbar-breadcrumb {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  font-size: 0.88rem !important;
  font-weight: 600 !important;
}

.breadcrumb-item-root {
  color: #64748b !important;
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
}

.breadcrumb-chevron {
  font-size: 0.68rem !important;
  color: #94a3b8 !important;
}

.breadcrumb-item-active {
  color: #0f172a !important;
  font-weight: 700 !important;
}

[data-theme="dark"] .breadcrumb-item-active {
  color: #f8fafc !important;
}

.topbar-right {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
}

.btn-topbar-link {
  padding: 8px 14px !important;
  font-size: 0.84rem !important;
  border-radius: 8px !important;
}

/* Panes Viewport */
.admin-panes-viewport {
  flex: 1 1 auto !important;
  padding: 24px 32px 48px !important;
  max-width: 100% !important;
  width: 100% !important;
  margin: 0 !important;
  box-sizing: border-box !important;
}

.admin-tab-pane {
  display: none;
}

.admin-tab-pane.active {
  display: block !important;
  animation: fadeInPane 0.22s ease !important;
}

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

/* 5. Mobile & Tablet Responsiveness */
@media (max-width: 1024px) {
  .btn-hamburger {
    display: inline-flex !important;
  }

  .admin-sidebar {
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    transform: translateX(-100%) !important;
    z-index: 2100 !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25) !important;
  }

  .admin-sidebar.mobile-open {
    transform: translateX(0) !important;
  }

  .sidebar-backdrop {
    display: none;
    position: fixed !important;
    inset: 0 !important;
    background: rgba(15, 23, 42, 0.5) !important;
    -webkit-backdrop-filter: blur(4px) !important;
    backdrop-filter: blur(4px) !important;
    z-index: 2050 !important;
  }

  .sidebar-backdrop.active {
    display: block !important;
  }

  .admin-content-topbar {
    padding: 0 16px !important;
  }

  .admin-panes-viewport {
    padding: 16px !important;
  }

  .btn-sidebar-collapse {
    display: none !important;
  }
}

@media (max-width: 640px) {
  .btn-text-preview {
    display: none !important;
  }

  .user-pill-role {
    display: none !important;
  }

  .breadcrumb-item-root {
    display: none !important;
  }

  .breadcrumb-chevron {
    display: none !important;
  }
}

/* 6. Sticky Header & Sticky Footer Modals (Fixed Header & Footer, Scrollable Body) */
.admin-modal-overlay {
  position: fixed !important;
  inset: 0 !important;
  background: rgba(15, 23, 42, 0.65) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  backdrop-filter: blur(8px) !important;
  z-index: 2500 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 16px !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transition: opacity 0.22s ease, visibility 0.22s ease !important;
}

.admin-modal-overlay.active,
.admin-modal-overlay.is-active {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

.admin-modal-container {
  background: var(--bg-card, #ffffff) !important;
  border: 1px solid var(--border-color, #e2e8f0) !important;
  border-radius: 18px !important;
  box-shadow: 0 25px 60px -15px rgba(15, 23, 42, 0.3) !important;
  display: flex !important;
  flex-direction: column !important;
  max-height: calc(100vh - 40px) !important;
  max-width: 95vw !important;
  width: 100% !important;
  overflow: hidden !important;
  transform: scale(0.97) translateY(8px) !important;
  transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease !important;
  opacity: 0 !important;
}

.admin-modal-overlay.active .admin-modal-container,
.admin-modal-overlay.is-active .admin-modal-container {
  transform: scale(1) translateY(0) !important;
  opacity: 1 !important;
}

[data-theme="dark"] .admin-modal-container {
  background: #0f172a !important;
  border-color: #334155 !important;
}

.modal-header {
  flex-shrink: 0 !important;
  padding: 18px 24px !important;
  border-bottom: 1px solid var(--border-color, #e2e8f0) !important;
  background: var(--bg-card, #ffffff) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
}

[data-theme="dark"] .modal-header {
  background: #0f172a !important;
  border-color: #1e293b !important;
}

.modal-body-form,
.modal-form-scrollable,
.admin-modal-container > form {
  flex: 1 1 auto !important;
  overflow-y: auto !important;
  min-height: 0 !important;
  padding: 22px 24px !important;
}

.modal-footer,
.modal-footer-actions {
  flex-shrink: 0 !important;
  padding: 14px 24px !important;
  border-top: 1px solid var(--border-color, #e2e8f0) !important;
  background: var(--bg-surface, #f8fafc) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
}

[data-theme="dark"] .modal-footer,
[data-theme="dark"] .modal-footer-actions {
  background: #0b1120 !important;
  border-color: #1e293b !important;
}

/* 7. Dropdown Premium Only (Standard styling according to Guideline Section 4.3) */
.form-select,
.logs-bot-select,
select.form-control,
.audit-filter-select {
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  background-color: #ffffff !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23475569'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 14px center !important;
  background-size: 16px 16px !important;
  padding: 10px 40px 10px 14px !important;
  border: 1.5px solid var(--border-color, #cbd5e1) !important;
  border-radius: 10px !important;
  font-size: 0.88rem !important;
  font-weight: 500 !important;
  color: var(--gov-slate-900, #0f172a) !important;
  cursor: pointer !important;
  transition: border-color 0.18s ease, box-shadow 0.18s ease !important;
  outline: none !important;
  width: 100% !important;
  line-height: 1.5 !important;
}

[data-theme="dark"] .form-select,
[data-theme="dark"] .logs-bot-select,
[data-theme="dark"] select.form-control,
[data-theme="dark"] .audit-filter-select {
  background-color: #1e293b !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E") !important;
}

.form-select:focus,
.logs-bot-select:focus,
select.form-control:focus,
.audit-filter-select:focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
}

/* 8. CRUD Tables & Cards Standards (Modern Clean Government Look) */
.admin-table-card {
  background: #ffffff !important;
  border: 1px solid var(--border-color, #e2e8f0) !important;
  border-radius: 14px !important;
  overflow-x: auto !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

[data-theme="dark"] .admin-table-card {
  background: #0f172a !important;
  border-color: #1e293b !important;
}

.admin-table {
  width: 100% !important;
  min-width: 960px !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
}

.admin-table th {
  background: #f8fafc !important;
  color: #475569 !important;
  font-size: 0.82rem !important;
  font-weight: 700 !important;
  padding: 13px 18px !important;
  border-bottom: 1px solid var(--border-color, #e2e8f0) !important;
  letter-spacing: 0.01em !important;
  white-space: nowrap !important;
}

.col-order { width: 70px !important; min-width: 70px !important; text-align: center !important; }
.col-status { width: 300px !important; min-width: 300px !important; white-space: nowrap !important; }
.col-vis { width: 110px !important; min-width: 110px !important; text-align: center !important; }
.col-action { width: 120px !important; min-width: 120px !important; text-align: right !important; white-space: nowrap !important; }

.app-url-link {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  font-size: 0.82rem !important;
  font-weight: 600 !important;
  color: var(--primary) !important;
  text-decoration: none !important;
  max-width: 280px !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  vertical-align: middle !important;
}

.app-url-link:hover {
  color: #1d4ed8 !important;
  text-decoration: underline !important;
}

[data-theme="dark"] .admin-table th {
  background: #1e293b !important;
  color: #94a3b8 !important;
  border-color: #334155 !important;
}

.admin-table td {
  padding: 14px 18px !important;
  border-bottom: 1px solid rgba(226, 232, 240, 0.6) !important;
  font-size: 0.86rem !important;
  color: #1e293b !important;
}

[data-theme="dark"] .admin-table td {
  border-color: rgba(51, 65, 85, 0.6) !important;
  color: #cbd5e1 !important;
}

.admin-table tr:hover td {
  background: rgba(241, 245, 249, 0.6) !important;
}

[data-theme="dark"] .admin-table tr:hover td {
  background: rgba(30, 41, 59, 0.5) !important;
}

/* ==========================================================================
   📱 9. RESPONSIVE ADAPTATIONS FOR CRUD, GRIDS, STATS & MODALS
   According to Guideline Section 10 (มาตรฐานการรองรับอุปกรณ์)
   ========================================================================== */

/* Table Scrollable Wrapper */
.admin-table-card,
.logs-table-wrapper {
  width: 100% !important;
  overflow-x: auto !important;
}

.admin-table {
  min-width: 780px !important;
  width: 100% !important;
}

.logs-modern-table {
  min-width: 920px !important;
}

/* Tablet & Mobile Grid Adaptation (<= 1024px) */
@media (max-width: 1024px) {
  .admin-stats-grid,
  .bot-kpi-summary-grid,
  .logs-summary-grid,
  .sso-stats-row {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 14px !important;
  }

  .bot-cluster-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
    gap: 16px !important;
  }

  .gateway-toolbar-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }

  .gateway-actions-right {
    width: 100% !important;
    justify-content: flex-start !important;
  }

  .gateway-btn-group {
    overflow-x: auto !important;
    max-width: 100% !important;
    padding-bottom: 2px !important;
  }

  .admin-header-row {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 14px !important;
  }

  .admin-header-actions {
    width: 100% !important;
    justify-content: flex-start !important;
    flex-wrap: wrap !important;
  }
}

/* Small Screens & Mobile (<= 640px) */
@media (max-width: 640px) {
  .admin-stats-grid,
  .bot-kpi-summary-grid,
  .logs-summary-grid,
  .sso-stats-row {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .bot-cluster-grid {
    grid-template-columns: 1fr !important;
  }

  .admin-control-bar,
  .logs-filter-toolbar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }

  .status-filter-pills,
  .logs-pills-bar {
    overflow-x: auto !important;
    width: 100% !important;
    padding-bottom: 4px !important;
    display: flex !important;
    flex-wrap: nowrap !important;
  }

  .status-filter-pills .filter-btn,
  .logs-pills-bar .log-filter-pill {
    white-space: nowrap !important;
    flex-shrink: 0 !important;
  }

  .template-presets-bar {
    overflow-x: auto !important;
    white-space: nowrap !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    padding-bottom: 4px !important;
  }

  .template-preset-btn {
    flex-shrink: 0 !important;
  }

  .sso-prompt-actions-bar {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
  }

  .sso-prompt-actions-bar .btn-sso-action {
    width: 100% !important;
    text-align: center !important;
    justify-content: center !important;
  }
}

/* ==========================================================================
   ENTERPRISE GOVERNMENT MODAL & 2-COLUMN FORM SYSTEM (PAO PATTANI STANDARD)
   Adhering to guildeline_by_dntvkl.md:
   - Modern, executive, clean, no cluttered decorations
   - Unified 2-column form grid for desktop; collapses smoothly to 1-col on mobile
   - Font Awesome icons only (no emojis as system icons)
   - Premium dropdown and input interactions with focus ring
   - Responsive multi-device support down to 375px
   ========================================================================== */

/* 1. Modal Overlay & Container */
.admin-modal-overlay {
  position: fixed !important;
  inset: 0 !important;
  z-index: 10000 !important;
  background: rgba(15, 23, 42, 0.65) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  backdrop-filter: blur(8px) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 16px !important;
  opacity: 0 !important;
  visibility: hidden !important;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.25s ease !important;
}

.admin-modal-overlay.active,
.admin-modal-overlay.is-active,
.admin-modal-overlay.open {
  opacity: 1 !important;
  visibility: visible !important;
}

.admin-modal-container {
  background: #ffffff !important;
  border-radius: 18px !important;
  border: 1px solid rgba(226, 232, 240, 0.8) !important;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.6) inset !important;
  width: 100% !important;
  max-width: 820px !important;
  max-height: 90vh !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  transform: scale(0.97) translateY(8px) !important;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease !important;
}

.admin-modal-overlay.active .admin-modal-container,
.admin-modal-overlay.is-active .admin-modal-container,
.admin-modal-overlay.open .admin-modal-container {
  transform: scale(1) translateY(0) !important;
}

/* Sizing Modifiers */
.modal-w-700 { max-width: 720px !important; }
.modal-w-800 { max-width: 820px !important; }
.modal-w-850 { max-width: 880px !important; }
.modal-w-950 { max-width: 980px !important; }
.modal-app-editor { max-width: 960px !important; }

/* 2. Modal Header */
.modal-header {
  padding: 20px 24px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  border-bottom: 1px solid #e2e8f0 !important;
  background: #ffffff !important;
  flex-shrink: 0 !important;
}

.modal-title-wrap {
  display: flex !important;
  align-items: center !important;
  gap: 14px !important;
}

.modal-header-icon-box {
  width: 44px !important;
  height: 44px !important;
  border-radius: 12px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 1.25rem !important;
  flex-shrink: 0 !important;
}

.modal-title {
  font-size: 1.15rem !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  margin: 0 !important;
  line-height: 1.3 !important;
  letter-spacing: -0.01em !important;
}

.modal-subtitle-text {
  font-size: 0.82rem !important;
  color: #64748b !important;
  margin-top: 3px !important;
  display: block !important;
  line-height: 1.4 !important;
}

.modal-close-btn {
  width: 36px !important;
  height: 36px !important;
  border-radius: 10px !important;
  border: 1px solid transparent !important;
  background: transparent !important;
  color: #64748b !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 1rem !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
}

.modal-close-btn:hover {
  background: #f1f5f9 !important;
  color: #0f172a !important;
  border-color: #e2e8f0 !important;
}

/* 3. Modal Body & Scrollable Content */
.modal-body-form,
.modal-body,
.modal-body-custom {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 !important;
  min-height: 0 !important;
  overflow: hidden !important;
  background: #ffffff !important;
}

.modal-form-scrollable,
.modal-body-custom {
  padding: 24px 26px !important;
  overflow-y: auto !important;
  flex: 1 !important;
  min-height: 0 !important;
}

/* 4. Unified 2-Column Form Layout System */
.form-grid {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 18px 22px !important;
  padding: 0 !important;
  align-items: start !important;
}

.form-row-2col,
.form-row-2 {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 18px 22px !important;
  margin-bottom: 16px !important;
  align-items: start !important;
}

.form-col-12 {
  grid-column: span 2 !important;
}

.form-col-6 {
  grid-column: span 1 !important;
}

.form-col-4 {
  grid-column: span 1 !important;
}

.form-col-8 {
  grid-column: span 2 !important;
}

.form-group {
  display: flex !important;
  flex-direction: column !important;
  margin-bottom: 0 !important;
  position: relative !important;
}

/* Form Labels & Required Markers */
.form-label,
.bot-admin-label {
  font-size: 0.88rem !important;
  font-weight: 600 !important;
  color: #334155 !important;
  margin-bottom: 6px !important;
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
}

.form-label .req,
.text-danger {
  color: #ef4444 !important;
  font-weight: 700 !important;
}

/* Form Inputs, Selects, and Textareas */
.form-input,
.form-control,
.form-select,
.bot-admin-input {
  width: 100% !important;
  height: 44px !important;
  box-sizing: border-box !important;
  padding: 0 14px !important;
  font-size: 0.92rem !important;
  color: #0f172a !important;
  background: #ffffff !important;
  border: 1.5px solid #cbd5e1 !important;
  border-radius: 10px !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  outline: none !important;
  font-family: inherit !important;
}

.form-input:hover,
.form-control:hover,
.form-select:hover,
.bot-admin-input:hover {
  border-color: #94a3b8 !important;
}

.form-input:focus,
.form-control:focus,
.form-select:focus,
.bot-admin-input:focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
  background: #ffffff !important;
}

.form-textarea,
textarea.form-input,
textarea.form-control {
  min-height: 84px !important;
  height: auto !important;
  padding: 12px 14px !important;
  resize: vertical !important;
  line-height: 1.5 !important;
}

.form-hint {
  font-size: 0.78rem !important;
  color: #64748b !important;
  margin-top: 5px !important;
  display: flex !important;
  align-items: center !important;
  gap: 5px !important;
  line-height: 1.35 !important;
}

/* 5. Custom Select Wrapper */
.select-wrapper {
  position: relative !important;
  width: 100% !important;
}

.select-wrapper .select-chevron {
  position: absolute !important;
  right: 14px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  color: #64748b !important;
  pointer-events: none !important;
  font-size: 0.8rem !important;
}

/* 6. Action Inputs (e.g., Random Key Generator) */
.field-with-action {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
}

.field-with-action .form-input {
  padding-right: 70px !important;
}

.btn-rand-key {
  position: absolute !important;
  right: 6px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  height: 32px !important;
  padding: 0 10px !important;
  border-radius: 8px !important;
  border: 1px solid #e2e8f0 !important;
  background: #f8fafc !important;
  color: #334155 !important;
  font-size: 0.8rem !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
  transition: all 0.15s ease !important;
}

.btn-rand-key:hover {
  background: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
}

/* 7. Modal Footer */
.modal-footer,
.modal-footer-actions {
  padding: 16px 24px !important;
  background: #f8fafc !important;
  border-top: 1px solid #e2e8f0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 12px !important;
  flex-shrink: 0 !important;
  border-bottom-left-radius: 18px !important;
  border-bottom-right-radius: 18px !important;
}

.modal-footer-spaced {
  justify-content: space-between !important;
}

.btn-modern-primary {
  height: 42px !important;
  padding: 0 20px !important;
  border-radius: 10px !important;
  background: #2563eb !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  font-size: 0.92rem !important;
  border: 1px solid #1d4ed8 !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2) !important;
  transition: all 0.15s ease !important;
}

.btn-modern-primary:hover {
  background: #1d4ed8 !important;
  box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.3) !important;
  transform: translateY(-1px) !important;
}

.btn-modern-secondary {
  height: 42px !important;
  padding: 0 18px !important;
  border-radius: 10px !important;
  background: #ffffff !important;
  color: #334155 !important;
  font-weight: 600 !important;
  font-size: 0.92rem !important;
  border: 1.5px solid #cbd5e1 !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  transition: all 0.15s ease !important;
}

.btn-modern-secondary:hover {
  background: #f8fafc !important;
  border-color: #94a3b8 !important;
  color: #0f172a !important;
}

/* 8. Specific Modal Refinements */

/* A. testPingModal: Interactive Feature Studio */
.test-scenario-container {
  margin-bottom: 18px !important;
}

.scenario-section-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  margin-bottom: 10px !important;
}

.scenario-counter-tag {
  font-size: 0.78rem !important;
  padding: 2px 8px !important;
  border-radius: 9999px !important;
  background: #f1f5f9 !important;
  color: #475569 !important;
  font-weight: 600 !important;
}

.test-scenario-pills {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important;
  gap: 8px !important;
}

.scenario-btn {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 9px 12px !important;
  border-radius: 12px !important;
  border: 1.5px solid #e2e8f0 !important;
  background: #ffffff !important;
  cursor: pointer !important;
  text-align: left !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  position: relative !important;
}

.scenario-btn:hover {
  border-color: #94a3b8 !important;
  background: #f8fafc !important;
  transform: translateY(-1px) !important;
}

.scenario-btn.active {
  border-color: #2563eb !important;
  background: rgba(37, 99, 235, 0.04) !important;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.18) !important;
}

.scenario-btn-icon {
  width: 32px !important;
  height: 32px !important;
  border-radius: 8px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 0.95rem !important;
  flex-shrink: 0 !important;
}

.scenario-btn-title {
  font-size: 0.82rem !important;
  font-weight: 600 !important;
  color: #1e293b !important;
  line-height: 1.3 !important;
  flex: 1 !important;
}

.scenario-mini-badge {
  font-size: 0.68rem !important;
  padding: 1px 6px !important;
  border-radius: 9999px !important;
  background: #dbeafe !important;
  color: #1e40af !important;
  font-weight: 700 !important;
}

/* Discord Live Simulator Box */
.test-preview-box {
  background: #2b2d31 !important;
  border: 1px solid #383a40 !important;
  border-radius: 14px !important;
  padding: 16px 18px !important;
  margin: 16px 0 22px 0 !important;
  color: #dbdee1 !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
}

.test-preview-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  margin-bottom: 12px !important;
  padding-bottom: 10px !important;
  border-bottom: 1px solid #383a40 !important;
  font-size: 0.82rem !important;
  color: #949ba4 !important;
  font-weight: 600 !important;
}

.test-preview-badge {
  background: #5865F2 !important;
  color: #ffffff !important;
  font-size: 0.72rem !important;
  padding: 3px 8px !important;
  border-radius: 6px !important;
  font-weight: 600 !important;
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
}

.test-preview-title {
  color: #f2f3f5 !important;
  font-size: 0.98rem !important;
  font-weight: 700 !important;
  margin-bottom: 6px !important;
}

.test-preview-desc {
  color: #dbdee1 !important;
  font-size: 0.88rem !important;
  line-height: 1.5 !important;
  margin-bottom: 12px !important;
}

.test-preview-components {
  display: flex !important;
  gap: 8px !important;
  flex-wrap: wrap !important;
  margin-bottom: 12px !important;
}

.preview-discord-btn {
  background: #5865F2 !important;
  color: #ffffff !important;
  border-radius: 6px !important;
  padding: 8px 14px !important;
  border: none !important;
  font-size: 0.85rem !important;
  font-weight: 500 !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  transition: background 0.15s ease !important;
}

.preview-discord-btn:hover { background: #4752C4 !important; }
.preview-discord-btn.btn-grey { background: #4e5058 !important; }
.preview-discord-btn.btn-grey:hover { background: #6d6f78 !important; }
.preview-discord-btn.btn-green { background: #248046 !important; }
.preview-discord-btn.btn-green:hover { background: #1a6334 !important; }
.preview-discord-btn.btn-red { background: #da373c !important; }
.preview-discord-btn.btn-red:hover { background: #a1282c !important; }

.preview-discord-select {
  background: #1e1f22 !important;
  border: 1px solid #383a40 !important;
  border-radius: 6px !important;
  padding: 10px 14px !important;
  color: #dbdee1 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  font-size: 0.88rem !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.test-preview-tip {
  background: rgba(88, 101, 242, 0.12) !important;
  border-left: 3px solid #5865F2 !important;
  padding: 8px 12px !important;
  border-radius: 4px !important;
  font-size: 0.8rem !important;
  color: #c4c9ce !important;
  display: flex !important;
  align-items: flex-start !important;
  gap: 8px !important;
  line-height: 1.4 !important;
}

/* B. botHealthModal: Bot Health Sentinel */
.health-hero-banner {
  display: flex !important;
  align-items: center !important;
  gap: 14px !important;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(6, 182, 212, 0.05) 100%) !important;
  border: 1px solid rgba(16, 185, 129, 0.25) !important;
  border-radius: 12px !important;
  padding: 12px 16px !important;
  margin-bottom: 16px !important;
}

.health-hero-icon {
  width: 40px !important;
  height: 40px !important;
  border-radius: 10px !important;
  background: rgba(16, 185, 129, 0.15) !important;
  color: #059669 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 1.2rem !important;
  flex-shrink: 0 !important;
}

.health-hero-text strong {
  display: block !important;
  font-size: 0.92rem !important;
  color: #065f46 !important;
  margin-bottom: 2px !important;
}

.health-hero-text p {
  margin: 0 !important;
  font-size: 0.82rem !important;
  color: #047857 !important;
  line-height: 1.4 !important;
}

/* Health 2-Column Overview (Host box + Switch card side-by-side) */
.health-overview-2col {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 14px !important;
  margin-bottom: 16px !important;
  align-items: stretch !important;
}

.health-host-box,
.health-switch-card {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 12px !important;
  padding: 12px 14px !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
}

.health-host-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
}

.health-host-left {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
}

.health-host-icon {
  width: 34px !important;
  height: 34px !important;
  border-radius: 8px !important;
  background: #e2e8f0 !important;
  color: #475569 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 0.95rem !important;
  flex-shrink: 0 !important;
}

.health-host-title {
  font-size: 0.86rem !important;
  font-weight: 600 !important;
  color: #1e293b !important;
}

.health-host-sub {
  font-size: 0.74rem !important;
  color: #64748b !important;
}

.health-switch-card {
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
}

.health-switch-info {
  flex: 1 !important;
  padding-right: 12px !important;
}

.health-switch-title {
  font-size: 0.86rem !important;
  font-weight: 600 !important;
  color: #1e293b !important;
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
}

.health-switch-desc {
  margin: 2px 0 0 0 !important;
  font-size: 0.74rem !important;
  color: #64748b !important;
  line-height: 1.35 !important;
}

/* Event Checkboxes Grid (2-Column) */
.health-events-grid {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 10px !important;
  margin-top: 8px !important;
}

.event-checkbox-card {
  display: flex !important;
  align-items: flex-start !important;
  gap: 12px !important;
  padding: 12px 14px !important;
  border-radius: 12px !important;
  border: 1.5px solid #e2e8f0 !important;
  background: #ffffff !important;
  cursor: pointer !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.event-checkbox-card:hover {
  border-color: #cbd5e1 !important;
  background: #f8fafc !important;
}

.event-checkbox-card:has(.event-checkbox-input:checked) {
  border-color: #2563eb !important;
  background: rgba(37, 99, 235, 0.03) !important;
}

.event-checkbox-input {
  width: 18px !important;
  height: 18px !important;
  border-radius: 5px !important;
  accent-color: #2563eb !important;
  margin-top: 2px !important;
  cursor: pointer !important;
}

.event-card-content strong {
  display: block !important;
  font-size: 0.86rem !important;
  font-weight: 600 !important;
  color: #1e293b !important;
  margin-bottom: 2px !important;
}

.event-card-content p {
  margin: 0 !important;
  font-size: 0.76rem !important;
  color: #64748b !important;
  line-height: 1.35 !important;
}

/* C. botAdminsModal: Bot Permissions Management */
.bot-admin-security-alert {
  display: flex !important;
  align-items: flex-start !important;
  gap: 12px !important;
  padding: 12px 16px !important;
  border-radius: 12px !important;
  background: rgba(16, 185, 129, 0.06) !important;
  border: 1px solid rgba(16, 185, 129, 0.25) !important;
  margin-bottom: 16px !important;
}

.bot-admin-security-alert i {
  font-size: 1.15rem !important;
  color: #059669 !important;
  margin-top: 2px !important;
  flex-shrink: 0 !important;
}

.bot-admin-security-text {
  font-size: 0.82rem !important;
  color: #065f46 !important;
  line-height: 1.45 !important;
}

.bot-admin-card {
  background: #ffffff !important;
  border: 1.5px solid #e2e8f0 !important;
  border-radius: 14px !important;
  padding: 18px 20px !important;
  margin-bottom: 20px !important;
}

.bot-admin-card-header {
  margin-bottom: 14px !important;
}

.bot-admin-card-title {
  font-size: 0.98rem !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

.bot-admin-card-subtitle {
  font-size: 0.78rem !important;
  color: #64748b !important;
  margin-top: 2px !important;
}

.bot-admin-grid {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 16px 20px !important;
  margin-bottom: 16px !important;
}

.bot-admin-input-wrap {
  position: relative !important;
}

.bot-admin-input-wrap .bot-admin-input-padded {
  padding-left: 38px !important;
}

.bot-admin-input-wrap .bot-admin-input-icon {
  position: absolute !important;
  left: 12px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  color: #5865F2 !important;
  pointer-events: none !important;
}

.bot-admin-checkbox-group-label {
  font-size: 0.82rem !important;
  font-weight: 600 !important;
  color: #334155 !important;
  margin-bottom: 8px !important;
  display: block !important;
}

.bot-admin-checkbox-wrap {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 12px !important;
  align-items: center !important;
  padding: 10px 14px !important;
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 10px !important;
  margin-bottom: 16px !important;
}

.bot-admin-checkbox-wrap label {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  font-size: 0.84rem !important;
  color: #334155 !important;
  cursor: pointer !important;
  margin: 0 !important;
}

.bot-admin-table-wrap {
  border: 1px solid #e2e8f0 !important;
  border-radius: 12px !important;
  overflow: hidden !important;
  background: #ffffff !important;
}

/* 9. Dark Theme Compatibility */
[data-theme="dark"] .admin-modal-container,
.dark-theme .admin-modal-container,
.dark-mode .admin-modal-container {
  background: #1e293b !important;
  border-color: #334155 !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6) !important;
}

[data-theme="dark"] .modal-header,
.dark-theme .modal-header,
.dark-mode .modal-header {
  background: #1e293b !important;
  border-bottom-color: #334155 !important;
}

[data-theme="dark"] .modal-title,
.dark-theme .modal-title,
.dark-mode .modal-title {
  color: #f1f5f9 !important;
}

[data-theme="dark"] .modal-subtitle-text,
.dark-theme .modal-subtitle-text,
.dark-mode .modal-subtitle-text {
  color: #94a3b8 !important;
}

[data-theme="dark"] .modal-body-form,
[data-theme="dark"] .modal-body,
[data-theme="dark"] .modal-body-custom,
.dark-theme .modal-body-form,
.dark-theme .modal-body,
.dark-theme .modal-body-custom,
.dark-mode .modal-body-form,
.dark-mode .modal-body,
.dark-mode .modal-body-custom {
  background: #1e293b !important;
}

[data-theme="dark"] .modal-footer,
[data-theme="dark"] .modal-footer-actions,
.dark-theme .modal-footer,
.dark-theme .modal-footer-actions,
.dark-mode .modal-footer,
.dark-mode .modal-footer-actions {
  background: #0f172a !important;
  border-top-color: #334155 !important;
}

[data-theme="dark"] .form-label,
[data-theme="dark"] .bot-admin-label,
.dark-theme .form-label,
.dark-theme .bot-admin-label,
.dark-mode .form-label,
.dark-mode .bot-admin-label {
  color: #e2e8f0 !important;
}

[data-theme="dark"] .form-input,
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select,
[data-theme="dark"] .bot-admin-input,
.dark-theme .form-input,
.dark-theme .form-control,
.dark-theme .form-select,
.dark-theme .bot-admin-input,
.dark-mode .form-input,
.dark-mode .form-control,
.dark-mode .form-select,
.dark-mode .bot-admin-input {
  background: #0f172a !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}

[data-theme="dark"] .form-input:focus,
[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus,
[data-theme="dark"] .bot-admin-input:focus,
.dark-theme .form-input:focus,
.dark-theme .form-control:focus,
.dark-theme .form-select:focus,
.dark-theme .bot-admin-input:focus,
.dark-mode .form-input:focus,
.dark-mode .form-control:focus,
.dark-mode .form-select:focus,
.dark-mode .bot-admin-input:focus {
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25) !important;
}

[data-theme="dark"] .scenario-btn,
.dark-theme .scenario-btn,
.dark-mode .scenario-btn {
  background: #0f172a !important;
  border-color: #334155 !important;
}

[data-theme="dark"] .scenario-btn-title,
.dark-theme .scenario-btn-title,
.dark-mode .scenario-btn-title {
  color: #f1f5f9 !important;
}

[data-theme="dark"] .scenario-btn.active,
.dark-theme .scenario-btn.active,
.dark-mode .scenario-btn.active {
  border-color: #3b82f6 !important;
  background: rgba(59, 130, 246, 0.12) !important;
}

[data-theme="dark"] .health-host-box,
[data-theme="dark"] .health-switch-card,
.dark-theme .health-host-box,
.dark-theme .health-switch-card,
.dark-mode .health-host-box,
.dark-mode .health-switch-card {
  background: #0f172a !important;
  border-color: #334155 !important;
}

[data-theme="dark"] .health-host-title,
[data-theme="dark"] .health-switch-title,
.dark-theme .health-host-title,
.dark-theme .health-switch-title,
.dark-mode .health-host-title,
.dark-mode .health-switch-title {
  color: #f1f5f9 !important;
}

[data-theme="dark"] .event-checkbox-card,
.dark-theme .event-checkbox-card,
.dark-mode .event-checkbox-card {
  background: #0f172a !important;
  border-color: #334155 !important;
}

[data-theme="dark"] .event-card-content strong,
.dark-theme .event-card-content strong,
.dark-mode .event-card-content strong {
  color: #f1f5f9 !important;
}

[data-theme="dark"] .bot-admin-card,
.dark-theme .bot-admin-card,
.dark-mode .bot-admin-card {
  background: #0f172a !important;
  border-color: #334155 !important;
}

[data-theme="dark"] .bot-admin-card-title,
.dark-theme .bot-admin-card-title,
.dark-mode .bot-admin-card-title {
  color: #f1f5f9 !important;
}

[data-theme="dark"] .bot-admin-checkbox-wrap,
.dark-theme .bot-admin-checkbox-wrap,
.dark-mode .bot-admin-checkbox-wrap {
  background: #1e293b !important;
  border-color: #334155 !important;
}

[data-theme="dark"] .bot-admin-checkbox-wrap label,
.dark-theme .bot-admin-checkbox-wrap label,
.dark-mode .bot-admin-checkbox-wrap label {
  color: #e2e8f0 !important;
}

/* 10. Multi-Device Responsive Adaptation (<= 640px) */
@media (max-width: 640px) {
  .admin-modal-overlay {
    padding: 8px !important;
  }

  .admin-modal-container {
    width: 98vw !important;
    max-height: 94vh !important;
    border-radius: 14px !important;
    margin: 4px !important;
  }

  .modal-header {
    padding: 14px 16px !important;
  }

  .modal-title {
    font-size: 1rem !important;
  }

  .modal-body-form,
  .modal-form-scrollable,
  .modal-body-custom {
    padding: 16px 14px !important;
  }

  .form-grid,
  .form-row-2col,
  .form-row-2,
  .bot-admin-grid,
  .health-overview-2col,
  .health-events-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .form-col-12,
  .form-col-6,
  .form-col-8,
  .form-col-4 {
    grid-column: span 1 !important;
  }

  .modal-footer,
  .modal-footer-actions {
    flex-direction: column-reverse !important;
    gap: 8px !important;
    padding: 12px 16px !important;
  }

  .modal-footer button,
  .modal-footer-actions button,
  .modal-footer-actions .flex-row-gap-2,
  .modal-footer-actions .flex-row-gap-2 button {
    width: 100% !important;
    justify-content: center !important;
  }
}

/* ==========================================================================
/* ==========================================================================
   🚫 DEFINITIVE ELIMINATION OF PRELOGIN NAVBAR AND VIEW DISPLAY MANAGEMENT
   ========================================================================== */
#adminPreloginNav,
header.admin-nav,
.login-nav-only,
.admin-nav {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  min-height: 0 !important;
  max-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
  overflow: hidden !important;
}

/* Strictly hide any view with .is-hidden or when unauthenticated */
.is-hidden,
.state-screen-container.is-hidden,
#loginView.is-hidden,
#unauthorizedView.is-hidden,
#dashboardView.is-hidden,
.admin-app-shell.is-hidden,
body:not(.admin-logged-in) #dashboardView,
body:not(.admin-logged-in) .admin-app-shell {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  max-height: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
}

/* Ensure clean full-screen centering ONLY for the currently active state screen */
body:not(.admin-logged-in) {
  overflow: hidden !important;
  height: 100vh !important;
}

body:not(.admin-logged-in) .admin-layout {
  height: 100vh !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

body:not(.admin-logged-in) .state-screen-container:not(.is-hidden) {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  margin: 0 !important;
  padding: 24px !important;
  box-sizing: border-box !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 100 !important;
  overflow-y: auto !important;
}

body:not(.admin-logged-in) .state-card,
body:not(.admin-logged-in) .admin-gateway-card {
  margin: auto !important;
}

.justify-content-end {
  justify-content: flex-end !important;
}

/* Enhancing stat card icons contrast and clarity */
.stat-card-icon-box i {
  display: inline-block !important;
  font-size: 1.25rem !important;
  line-height: 1 !important;
}
.stat-icon-total i { color: #2563eb !important; }
.stat-icon-open i { color: #059669 !important; }
.stat-icon-maint i { color: #d97706 !important; }
.stat-icon-soon i { color: #7c3aed !important; }

/* ==========================================================================
   ✨ 2026 EXECUTIVE BROADCAST STUDIO (REFINED, INTUITIVE 3-STEP WORKFLOW)
   ========================================================================== */

/* Sub-navigation Switcher (Composer vs SSO Monitor) */
.broadcast-subnav-bar {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 6px !important;
  background: var(--bg-card, #ffffff) !important;
  border: 1px solid var(--border-color, #e2e8f0) !important;
  border-radius: 14px !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03) !important;
}

[data-theme="dark"] .broadcast-subnav-bar {
  background: #0f172a !important;
  border-color: #1e293b !important;
}

.broadcast-subnav-pill {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 9px 18px !important;
  font-size: 0.88rem !important;
  font-weight: 600 !important;
  color: #64748b !important;
  background: transparent !important;
  border: none !important;
  border-radius: 10px !important;
  cursor: pointer !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.broadcast-subnav-pill:hover {
  background: #f1f5f9 !important;
  color: #0f172a !important;
}

[data-theme="dark"] .broadcast-subnav-pill {
  color: #94a3b8 !important;
}

[data-theme="dark"] .broadcast-subnav-pill:hover {
  background: #1e293b !important;
  color: #f8fafc !important;
}

.broadcast-subnav-pill.active {
  background: #2563eb !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.25) !important;
}

.broadcast-subnav-pill.active .subnav-count-tag {
  background: rgba(255, 255, 255, 0.2) !important;
  color: #ffffff !important;
}

.subnav-count-tag {
  font-size: 0.72rem !important;
  padding: 3px 8px !important;
  border-radius: 999px !important;
  background: #fef3c7 !important;
  color: #92400e !important;
  font-weight: 700 !important;
  margin-left: 4px !important;
}

[data-theme="dark"] .subnav-count-tag {
  background: rgba(245, 158, 11, 0.2) !important;
  color: #fde68a !important;
}

/* Non-intrusive Mini SSO Alert Ribbon */
.sso-mini-alert-ribbon {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  padding: 10px 18px !important;
  background: linear-gradient(135deg, rgba(254, 243, 199, 0.6), rgba(255, 251, 235, 0.8)) !important;
  border: 1px solid rgba(245, 158, 11, 0.3) !important;
  border-radius: 12px !important;
  font-size: 0.84rem !important;
  color: #92400e !important;
}

[data-theme="dark"] .sso-mini-alert-ribbon {
  background: rgba(245, 158, 11, 0.1) !important;
  border-color: rgba(245, 158, 11, 0.25) !important;
  color: #fcd34d !important;
}

.sso-mini-left {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  font-weight: 500 !important;
}

.pulse-dot-amber {
  width: 8px !important;
  height: 8px !important;
  border-radius: 50% !important;
  background: #f59e0b !important;
  box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7) !important;
  animation: pulseAmber 2s infinite !important;
}

@keyframes pulseAmber {
  0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7); }
  70% { box-shadow: 0 0 0 6px rgba(245, 158, 11, 0); }
  100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

.btn-mini-sso-jump {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 5px 12px !important;
  background: #ffffff !important;
  border: 1px solid rgba(245, 158, 11, 0.4) !important;
  border-radius: 8px !important;
  font-size: 0.78rem !important;
  font-weight: 700 !important;
  color: #b45309 !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
}

.btn-mini-sso-jump:hover {
  background: #fef3c7 !important;
  border-color: #d97706 !important;
}

[data-theme="dark"] .btn-mini-sso-jump {
  background: #1e293b !important;
  border-color: rgba(245, 158, 11, 0.4) !important;
  color: #fde68a !important;
}

/* 3-Step Guided Composer Cards */
.composer-step-card {
  background: #ffffff !important;
  border: 1px solid var(--border-color, #e2e8f0) !important;
  border-radius: 16px !important;
  padding: 22px 24px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03) !important;
  transition: all 0.2s ease !important;
}

[data-theme="dark"] .composer-step-card {
  background: #0f172a !important;
  border-color: #1e293b !important;
}

.step-card-header {
  display: flex !important;
  align-items: center !important;
  gap: 14px !important;
  margin-bottom: 18px !important;
  padding-bottom: 12px !important;
  border-bottom: 1px solid var(--border-color, #f1f5f9) !important;
}

[data-theme="dark"] .step-card-header {
  border-bottom-color: #1e293b !important;
}

.step-badge {
  width: 32px !important;
  height: 32px !important;
  border-radius: 50% !important;
  background: linear-gradient(135deg, #1d4ed8, #2563eb) !important;
  color: #ffffff !important;
  font-size: 0.88rem !important;
  font-weight: 800 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3) !important;
}

.step-badge-muted {
  background: #94a3b8 !important;
  box-shadow: none !important;
}

[data-theme="dark"] .step-badge-muted {
  background: #475569 !important;
}

.step-title-box {
  display: flex !important;
  flex-direction: column !important;
  gap: 2px !important;
}

.step-title-text {
  font-size: 1.02rem !important;
  font-weight: 800 !important;
  color: #0f172a !important;
}

[data-theme="dark"] .step-title-text {
  color: #f8fafc !important;
}

.step-desc-text {
  font-size: 0.78rem !important;
  color: #64748b !important;
  font-weight: 500 !important;
}

[data-theme="dark"] .step-desc-text {
  color: #94a3b8 !important;
}

/* Quick Prefix Tag Pills next to title label */
.title-quick-tags {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
}

.btn-tag-pill {
  font-size: 0.72rem !important;
  font-weight: 600 !important;
  padding: 3px 8px !important;
  border-radius: 6px !important;
  border: 1px solid #cbd5e1 !important;
  background: #f8fafc !important;
  color: #334155 !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
}

.btn-tag-pill:hover {
  background: #eff6ff !important;
  border-color: #3b82f6 !important;
  color: #1d4ed8 !important;
}

.tag-pill-rose:hover {
  background: #fff1f2 !important;
  border-color: #f43f5e !important;
  color: #be123c !important;
}

.tag-pill-amber:hover {
  background: #fffbeb !important;
  border-color: #f59e0b !important;
  color: #b45309 !important;
}

[data-theme="dark"] .btn-tag-pill {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #cbd5e1 !important;
}

/* Integrated Rich Text Editor Wrapper */
.studio-rich-editor-wrap {
  border: 1.5px solid var(--border-color, #cbd5e1) !important;
  border-radius: 12px !important;
  overflow: hidden !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}

.studio-rich-editor-wrap:focus-within {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 3.5px rgba(37, 99, 235, 0.16) !important;
}

[data-theme="dark"] .studio-rich-editor-wrap {
  border-color: #334155 !important;
}

[data-theme="dark"] .studio-rich-editor-wrap:focus-within {
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 3.5px rgba(59, 130, 246, 0.22) !important;
}

.rich-editor-toolbar {
  display: flex !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
  padding: 8px 12px !important;
  background: #f8fafc !important;
  border-bottom: 1px solid var(--border-color, #e2e8f0) !important;
}

[data-theme="dark"] .rich-editor-toolbar {
  background: #162032 !important;
  border-bottom-color: #1e293b !important;
}

.rich-toolbar-group {
  display: flex !important;
  align-items: center !important;
  gap: 3px !important;
}

.rich-tool-btn {
  width: 28px !important;
  height: 28px !important;
  border-radius: 6px !important;
  border: 1px solid transparent !important;
  background: transparent !important;
  color: #475569 !important;
  font-size: 0.82rem !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.15s ease !important;
}

.rich-tool-btn:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
}

[data-theme="dark"] .rich-tool-btn {
  color: #94a3b8 !important;
}

[data-theme="dark"] .rich-tool-btn:hover {
  background: #1e293b !important;
  color: #f8fafc !important;
}

.rich-toolbar-divider {
  width: 1px !important;
  height: 20px !important;
  background: #cbd5e1 !important;
  margin: 0 4px !important;
}

[data-theme="dark"] .rich-toolbar-divider {
  background: #334155 !important;
}

.rich-toolbar-emojis {
  display: flex !important;
  align-items: center !important;
  gap: 2px !important;
  flex-wrap: wrap !important;
}

.rich-emoji-chip {
  width: 26px !important;
  height: 26px !important;
  border-radius: 6px !important;
  border: none !important;
  background: transparent !important;
  font-size: 0.90rem !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: transform 0.12s ease, background 0.12s ease !important;
}

.rich-emoji-chip:hover {
  background: rgba(37, 99, 235, 0.12) !important;
  transform: scale(1.18) !important;
}

.btn-strip-emojis {
  color: #94a3b8 !important;
  font-size: 0.72rem !important;
}

.btn-strip-emojis:hover {
  background: #fee2e2 !important;
  color: #dc2626 !important;
}

.rich-char-counter {
  margin-left: auto !important;
  font-size: 0.72rem !important;
  color: #94a3b8 !important;
  font-weight: 600 !important;
}

.rich-textarea {
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  resize: vertical !important;
  padding: 12px 14px !important;
}

.rich-textarea:focus {
  box-shadow: none !important;
  transform: none !important;
}

/* Action Strip under Live Discord Preview */
.preview-actions-strip {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
}

.btn-preview-send {
  flex: 1 1 auto !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  padding: 12px 20px !important;
  background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
  color: #ffffff !important;
  font-size: 0.92rem !important;
  font-weight: 700 !important;
  border: none !important;
  border-radius: 12px !important;
  cursor: pointer !important;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35) !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.btn-preview-send:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.45) !important;
}

.btn-preview-send:active {
  transform: translateY(0) !important;
}

.btn-preview-reset {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  padding: 12px 16px !important;
  background: #f1f5f9 !important;
  color: #475569 !important;
  font-size: 0.88rem !important;
  font-weight: 600 !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 12px !important;
  cursor: pointer !important;
  transition: all 0.18s ease !important;
}

.btn-preview-reset:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
}

[data-theme="dark"] .btn-preview-reset {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #cbd5e1 !important;
}

[data-theme="dark"] .btn-preview-reset:hover {
  background: #334155 !important;
  color: #f8fafc !important;
}

