/* =========================================================
   CHATBOT CLOUD RUN - MODERN GLASSMORPHISM DESIGN SYSTEM
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg-primary: #0a0e17;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.7);
  --bg-card-hover: rgba(30, 41, 59, 0.8);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(99, 102, 241, 0.5);
  
  --accent-primary: #6366f1;
  --accent-secondary: #8b5cf6;
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
  --accent-glow: rgba(99, 102, 241, 0.25);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #38bdf8;
  
  --sidebar-width: 280px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.2);
}

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

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  overflow: hidden;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(168, 85, 247, 0.06) 0%, transparent 40%);
}

/* Scrollbar kustom */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* =========================================================
   LAYOUT UTAMA: SIDEBAR & MAIN VIEW
   ========================================================= */

#app-container {
  display: flex;
  width: 100vw;
  height: 100vh;
  position: relative;
}

/* Sidebar */
#sidebar {
  width: var(--sidebar-width);
  height: 100%;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  z-index: 20;
  transition: transform 0.3s ease;
}

.sidebar-header {
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.brand-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: var(--shadow-glow);
  overflow: hidden;
  padding: 3px;
}

.brand-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  border-radius: inherit;
}

.brand-info h1 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-info span {
  font-size: 11px;
  color: var(--accent-primary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sidebar-nav {
  padding: 16px 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.nav-item:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
}

.nav-item.active {
  background: rgba(99, 102, 241, 0.15);
  color: #fff;
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.1);
}

.nav-item svg {
  width: 20px;
  height: 20px;
  stroke-width: 2;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: #334155;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: var(--accent-primary);
  border: 2px solid var(--border-subtle);
}

.user-meta {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
}

.user-role-badge {
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
}

/* =========================================================
   MAIN CONTENT AREA
   ========================================================= */

#main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  overflow: hidden;
}

/* Top Navigation Bar */
.top-navbar {
  height: 70px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  z-index: 10;
}

.view-title-group h2 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.view-title-group p {
  font-size: 12px;
  color: var(--text-muted);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Mode Switcher Pills */
.mode-toggle-group {
  display: flex;
  background: rgba(2, 6, 23, 0.6);
  padding: 4px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
}

.mode-btn {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.mode-btn.active {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.3);
}

.mode-btn svg {
  width: 14px;
  height: 14px;
}

/* Tombol Aksi */
.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-primary {
  background: var(--accent-gradient);
  border: none;
  color: #fff;
  padding: 8px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-glow);
  transition: all 0.2s ease;
}

.btn-primary:hover {
  opacity: 0.95;
  transform: translateY(-1px);
}

/* =========================================================
   PAGES / VIEWS
   ========================================================= */

.view-panel {
  display: none !important;
  flex: 1;
  height: calc(100% - 70px);
  overflow-y: auto;
  position: relative;
}

.view-panel.active {
  display: flex !important;
  flex-direction: column;
}

.view-panel > * {
  flex-shrink: 0 !important;
}

/* ----------------- CHAT VIEW ----------------- */
#chat-view {
  padding: 0;
}

.chat-messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.message-item {
  display: flex;
  gap: 16px;
  max-width: 820px;
  animation: fadeInUp 0.3s ease;
}

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

.message-item.user-message {
  margin-left: auto;
  flex-direction: row-reverse;
}

.message-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  overflow: hidden;
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  display: block;
}

.message-item.ai-message .message-avatar {
  background: rgba(99, 102, 241, 0.2);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
  border: 1px solid rgba(99, 102, 241, 0.35);
  padding: 1px;
}

.message-item.user-message .message-avatar {
  background: #334155;
  color: #cbd5e1;
}

.message-bubble {
  padding: 14px 20px;
  border-radius: var(--radius-lg);
  font-size: 14px;
  line-height: 1.6;
  position: relative;
}

.message-item.ai-message .message-bubble {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  backdrop-filter: blur(10px);
}

.message-item.user-message .message-bubble {
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
  color: #fff;
  border-top-right-radius: 4px;
}

.message-item.ai-message .message-bubble {
  border-top-left-radius: 4px;
}

/* Sumber RAG badge */
.source-tag-group {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.source-tag {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Chat Input Bar */
.chat-input-wrapper {
  padding: 16px 32px 24px;
  background: linear-gradient(to top, var(--bg-primary) 80%, transparent);
}

.chat-input-card {
  background: rgba(17, 24, 39, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 8px 12px 8px 14px;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(16px);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.chat-input-card:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 25px rgba(99, 102, 241, 0.25);
}

#chat-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 14px;
  font-family: inherit;
  resize: none;
  min-height: 38px;
  max-height: 200px;
  line-height: 1.5;
  padding: 8px 6px;
  overflow-y: auto;
  word-break: break-word;
}

#chat-input::placeholder {
  color: var(--text-dim);
}

#attach-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  margin-bottom: 2px;
}

#attach-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
}

#send-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--accent-gradient);
  border: none;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
  flex-shrink: 0;
  margin-bottom: 1px;
}

#send-btn:hover {
  transform: scale(1.05);
}

#send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

/* Bubble Action Bar & Message Wrapper */
.message-content-wrapper {
  max-width: 82%;
  display: flex;
  flex-direction: column;
}

.message-item.user-message .message-content-wrapper {
  align-items: flex-end;
}

.message-item.ai-message .message-content-wrapper {
  align-items: flex-start;
}

.bubble-action-bar {
  display: flex;
  gap: 6px;
  margin-top: 4px;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.message-item:hover .bubble-action-bar {
  opacity: 1;
}

.bubble-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  padding: 2px 8px;
  font-size: 11px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.bubble-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.chat-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ----------------- KNOWLEDGE BASE VIEW ----------------- */
#knowledge-view {
  padding: 28px 32px;
  gap: 28px;
}

.upload-dropzone {
  border: 2px dashed rgba(99, 102, 241, 0.4);
  border-radius: var(--radius-lg);
  background: rgba(17, 24, 39, 0.4);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.upload-dropzone:hover, .upload-dropzone.dragover {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.08);
}

.dropzone-icon {
  font-size: 40px;
  margin-bottom: 12px;
}

.dropzone-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
}

.dropzone-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

.table-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  flex-shrink: 0 !important;
  width: 100%;
}

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

.table-header h3 {
  font-size: 15px;
  font-weight: 700;
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}

.custom-table th {
  padding: 14px 20px;
  background: rgba(15, 23, 42, 0.6);
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border-subtle);
}

.custom-table td {
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
}

.badge-success { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.badge-info { background: rgba(56, 189, 248, 0.15); color: #38bdf8; }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }

/* ----------------- SETTINGS & ADMIN VIEW ----------------- */
#settings-view, #admin-view {
  padding: 28px 32px;
  gap: 24px;
}

.card-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
}

.card-panel h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
}

.card-panel p {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-main);
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s ease;
}

.form-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.2);
}

/* =========================================================
   MODAL DIALOG (LOGIN / PROFILE)
   ========================================================= */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: fadeIn 0.2s ease;
}

.modal-backdrop.active {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-card {
  width: 100%;
  max-width: 420px;
  background: #111827;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  animation: modalScale 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScale {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  margin-bottom: 24px;
  text-align: center;
}

.modal-header h2 {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.modal-header p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 999;
}

.toast {
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.toast-success { background: #059669; }
.toast-error { background: #dc2626; }
.toast-info { background: #0284c7; }

/* Responsive */
@media (max-width: 768px) {
  #sidebar {
    position: absolute;
    transform: translateX(-100%);
  }
  #sidebar.open {
    transform: translateX(0);
  }
}

/* Provider & Model Selectors in Top Navbar */
.provider-model-group {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(2, 6, 23, 0.6);
  padding: 4px 8px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
}

.custom-select {
  background: transparent;
  color: #fff;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.custom-select option {
  background: #111827;
  color: #fff;
}

/* Action Buttons for Tables */
.btn-danger-sm {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-danger-sm:hover {
  background: rgba(239, 68, 68, 0.3);
  color: #fff;
  border-color: #ef4444;
}

.btn-secondary-sm {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary-sm:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
}

/* Provider Specific Badges */
.badge-gemini { background: rgba(99, 102, 241, 0.2); color: #818cf8; border: 1px solid rgba(99, 102, 241, 0.4); }
.badge-openai { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.4); }
.badge-groq { background: rgba(249, 115, 22, 0.2); color: #fb923c; border: 1px solid rgba(249, 115, 22, 0.4); }
.badge-deepseek { background: rgba(6, 182, 212, 0.2); color: #22d3ee; border: 1px solid rgba(6, 182, 212, 0.4); }
.badge-openrouter { background: rgba(168, 85, 247, 0.2); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.4); }
.badge-custom { background: rgba(148, 163, 184, 0.2); color: #cbd5e1; border: 1px solid rgba(148, 163, 184, 0.4); }

/* Model Monitoring Chips in API Key Modal */
.model-chips-box {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  background: rgba(0, 0, 0, 0.25);
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  min-height: 44px;
  align-items: center;
}

.model-chip {
  padding: 5px 11px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-family: 'JetBrains Mono', Consolas, monospace;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}

.model-chip:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.4);
  color: #fff;
  transform: translateY(-1px);
}

.model-chip.active {
  background: rgba(99, 102, 241, 0.35);
  border-color: var(--accent-primary);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.35);
}

.model-chip .chip-tag {
  font-size: 9px;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  text-transform: uppercase;
  font-weight: 700;
}

/* Anthropic & BYOK Badges */
.badge-anthropic { background: rgba(217, 119, 6, 0.2); color: #fbbf24; border: 1px solid rgba(217, 119, 6, 0.4); }
.badge-byok { background: rgba(168, 85, 247, 0.2); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.4); }

/* Admin User Monitoring Filter Bar */
.admin-filter-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.filter-tab {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-tab:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.filter-tab.active {
  background: rgba(99, 102, 241, 0.25);
  border-color: var(--accent-primary);
  color: #fff;
}

.btn-toggle-sm {
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.3);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-toggle-sm:hover {
  background: rgba(99, 102, 241, 0.3);
  color: #fff;
}

/* Provider Cards Deck (Enterprise Multi-Provider Layout) */
.provider-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 18px;
  margin-top: 16px;
}

.provider-card {
  background: rgba(17, 24, 39, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  backdrop-filter: blur(12px);
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.provider-card:hover {
  border-color: rgba(99, 102, 241, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.provider-card.configured {
  border-left: 4px solid var(--success);
}

.provider-card.unconfigured {
  border-left: 4px solid rgba(255, 255, 255, 0.15);
  opacity: 0.85;
}

.provider-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.provider-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.provider-icon-badge {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
}

.provider-title-group h4 {
  font-size: 15px;
  font-weight: 700;
}

.provider-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
  font-size: 13px;
}

.provider-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.provider-info-label {
  color: var(--text-dim);
  font-size: 12px;
}

.provider-models-section {
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-sm);
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.provider-models-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 11px;
  color: var(--text-muted);
}

.provider-models-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.model-pill-item {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.model-pill-item.is-default {
  border-color: var(--accent-primary);
  color: #fff;
  background: rgba(99, 102, 241, 0.15);
}

.model-pill-delete {
  cursor: pointer;
  color: #f87171;
  font-size: 11px;
  padding: 0 2px;
  transition: transform 0.15s ease;
}

.model-pill-delete:hover {
  transform: scale(1.3);
}

.provider-card-actions {
  display: flex;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

/* Connection Test Box in Modal */
.test-result-box {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 12px;
  line-height: 1.5;
  display: none;
  animation: fadeIn 0.2s ease;
}

.test-result-box.success {
  display: block;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
}

.test-result-box.error {
  display: block;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #f87171;
}

.test-result-box.testing {
  display: block;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: #818cf8;
}

/* =========================================================
   DEDICATED FULL-SCREEN LOGIN SCREEN
   ========================================================= */
.login-fullscreen-wrapper {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at 50% 30%, #1e1b4b 0%, #0f172a 60%, #030712 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.login-card-box {
  width: 100%;
  max-width: 440px;
  background: rgba(17, 24, 39, 0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-xl);
  padding: 36px 32px;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.7), 0 0 40px rgba(99, 102, 241, 0.15);
  animation: fadeInScale 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.96) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.login-brand-header {
  text-align: center;
  margin-bottom: 20px;
}

.login-logo-glow {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-lg);
  background: var(--accent-gradient);
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  box-shadow: 0 0 25px rgba(99, 102, 241, 0.5);
  overflow: hidden;
  padding: 4px;
}

.login-brand-header h2 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 4px;
}

.login-tagline {
  font-size: 12px;
  color: var(--accent-primary);
  font-weight: 500;
}

.login-notice-banner {
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: #a5b4fc;
  border-radius: var(--radius-md);
  padding: 8px 12px;
  font-size: 11px;
  text-align: center;
  margin-bottom: 22px;
}

.login-error-alert {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #f87171;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 12px;
  margin-bottom: 12px;
  animation: fadeIn 0.2s ease;
}

.login-footer-info {
  margin-top: 24px;
  text-align: center;
  font-size: 11px;
  color: var(--text-dim);
}

/* =========================================================
   SIDEBAR CONVERSATION SESSIONS (MULTI-SESSION CHAT)
   ========================================================= */
.sidebar-conversations-section {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  border-top: 1px solid var(--border-subtle);
  padding: 14px 12px;
  overflow: hidden;
}

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

.sidebar-section-header span {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-dim);
  letter-spacing: 0.05em;
}

.btn-new-chat {
  background: rgba(99, 102, 241, 0.18);
  border: 1px solid rgba(99, 102, 241, 0.4);
  color: #a5b4fc;
  border-radius: var(--radius-sm);
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.btn-new-chat:hover {
  background: var(--accent-primary);
  color: #fff;
  border-color: var(--accent-primary);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
}

.conversations-scroll-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  flex: 1;
  padding-right: 2px;
}

.conversations-scroll-list::-webkit-scrollbar {
  width: 4px;
}
.conversations-scroll-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.conversation-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.18s ease;
  user-select: none;
}

.conversation-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

.conversation-item.active {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.35);
  color: #fff;
  font-weight: 600;
}

.conversation-item-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  margin-right: 6px;
}

.conversation-item-actions {
  display: none;
  align-items: center;
  gap: 4px;
}

.conversation-item:hover .conversation-item-actions,
.conversation-item.active .conversation-item-actions {
  display: flex;
}

.conv-action-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 2px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease;
}

.conv-action-btn:hover {
  color: #fff;
}
.conv-action-btn.delete:hover {
  color: #f87171;
}

/* =========================================================
   CITATIONS ACCORDION & BADGES
   ========================================================= */
.citation-accordion {
  margin-top: 10px;
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
  padding-top: 8px;
}

.citation-header-btn {
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: #a5b4fc;
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.citation-header-btn:hover {
  background: rgba(99, 102, 241, 0.2);
  color: #fff;
}

.citation-sources-box {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  background: rgba(0, 0, 0, 0.25);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.citation-source-chip {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: 'JetBrains Mono', Consolas, monospace;
}

/* =========================================================
   EXPORT DROPDOWN MENU
   ========================================================= */
.dropdown-wrapper {
  position: relative;
  display: inline-block;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: #1e293b;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
  min-width: 170px;
  z-index: 100;
  padding: 6px 0;
  animation: fadeIn 0.15s ease;
}

.dropdown-item {
  padding: 8px 14px;
  font-size: 12px;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.15s ease;
}

.dropdown-item:hover {
  background: rgba(99, 102, 241, 0.15);
  color: #fff;
}

/* Print styling for PDF */
@media print {
  body {
    background: #fff !important;
    color: #000 !important;
  }
  #sidebar, .top-navbar, .chat-input-container, .bubble-action-bar, #toast-container, .modal-backdrop, #login-screen {
    display: none !important;
  }
  #app-container {
    display: block !important;
    height: auto !important;
  }
  #main-content {
    overflow: visible !important;
  }
  .chat-messages-container {
    padding: 0 !important;
  }
  .message-item {
    page-break-inside: avoid;
    margin-bottom: 20px;
  }
  .message-bubble {
    color: #111 !important;
    background: #f1f5f9 !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: none !important;
  }
  .message-item.user-message .message-bubble {
    background: #e2e8f0 !important;
  }
}

/* =========================================================
   LAPISAN RESPONSIF PONSEL & TABLET
   ---------------------------------------------------------
   Ditambahkan 12 Okt 2026. Seluruh aturan di bawah hanya aktif
   pada layar kecil; tampilan desktop sengaja tidak disentuh.

   Masalah nyata yang diperbaiki (terukur di viewport 390px):
   - sidebar off-canvas tanpa tombol pembuka -> navigasi mustahil
   - .top-actions melebar 1165px (meluber 876px)
   - tabel 547-797px; grid 2 kolom menyusut jadi 125px per kolom
   - kotak ketik chat tinggal 196px
   - input berfont 12-14px -> Safari iOS memaksa zoom
   - 7 sasaran sentuh di bawah 40px
   ========================================================= */

/* Tinggi viewport dinamis: 100vh di ponsel ikut menghitung area di balik
   bilah alamat, sehingga kotak input chat terdorong keluar layar. */
@supports (height: 100dvh) {
  #app-container {
    height: 100dvh;
  }
}

/* 100vw tidak memperhitungkan lebar scrollbar vertikal. */
#app-container {
  width: 100%;
  max-width: 100%;
}

/* Kartu provider tidak boleh memaksa lebar minimum melebihi layar. */
.provider-cards-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr));
}

/* Lapisan gelap di belakang drawer (hanya tampil saat drawer terbuka). */
#sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.6);
  backdrop-filter: blur(2px);
  z-index: 19;
  opacity: 0;
  transition: opacity 0.25s ease;
}

#sidebar-overlay.show {
  display: block;
  opacity: 1;
}

/* Tombol hamburger: hanya muncul di layar kecil (lihat blok 768px). */
#btn-mobile-menu {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  cursor: pointer;
  transition: background 0.2s ease;
}

#btn-mobile-menu:hover,
#btn-mobile-menu:focus-visible {
  background: rgba(255, 255, 255, 0.14);
}

/* Grid dua kolom yang sebelumnya ditulis sebagai inline style;
   dipindahkan ke kelas agar dapat dilipat menjadi satu kolom. */
.label-compact {
  display: none;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ---------------------------------------------------------
   TABLET & PONSEL (<= 768px)
   --------------------------------------------------------- */
@media (max-width: 768px) {
  /* --- Drawer navigasi --- */
  #sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: min(86vw, 320px);
    max-width: 320px;
    transform: translateX(-100%);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.6);
    will-change: transform;
  }

  #sidebar.open {
    transform: translateX(0);
  }

  #btn-mobile-menu {
    display: inline-flex;
  }

  .nav-item {
    min-height: 46px;
  }

  /* --- Bilah atas: dua baris, tinggi mengikuti isi --- */
  .top-navbar {
    height: auto;
    min-height: 56px;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
  }

  .view-title-group {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1 1 auto;
  }

  .view-title-group h2 {
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Subjudul disembunyikan di ponsel: isinya penjelasan, bukan kendali. */
  .view-title-group p {
    display: none;
  }

  /* Dua baris rapi, bukan strip panjang yang harus digeser:
     baris 1 = pemilih provider & model, baris 2 = mode + aksi cepat. */
  .top-actions {
    flex: 1 1 100%;
    order: 3;
    flex-wrap: wrap;
    gap: 8px;
    overflow-x: auto;          /* jaring pengaman bila layar sangat sempit */
    overflow-y: hidden;
    padding-bottom: 2px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  /* Hanya mode yang sedang aktif yang menampilkan labelnya;
     dua lainnya cukup ikon (judulnya tetap ada sebagai tooltip). */
  .mode-btn .label-compact {
    display: none;
  }

  .mode-btn.active .label-compact {
    display: inline;
  }

  .top-actions::-webkit-scrollbar {
    display: none;
  }

  .top-actions > * {
    flex-shrink: 0;
  }

  /* Pemilih provider & model tetap terlihat, dipadatkan menjadi chip. */
  .provider-model-group {
    gap: 2px;
    padding: 2px 4px;
    max-width: 100%;
  }

  .custom-select {
    font-size: 16px; /* >= 16px mencegah Safari iOS memperbesar halaman */
    padding: 4px 4px;
    min-height: 38px;
    text-overflow: ellipsis;
  }

  .chat-header-actions {
    gap: 6px;
  }

  .mode-btn {
    padding: 7px 10px;
    min-height: 38px;
    font-size: 12px;
  }

  .chat-header-actions .btn-secondary {
    min-height: 38px;
  }

  /* Tombol aksi cepat jadi ikon saja; label panjang disembunyikan.
     Fungsi, urutan, dan tooltip tombol tetap sama. */
  .chat-header-actions .label-full {
    display: none;
  }

  .chat-header-actions .btn-secondary {
    padding: 8px 9px !important;
    min-width: 38px;
    justify-content: center;
  }

  /* Label panjang tombol mode disembunyikan; lihat aturan .mode-btn.active di atas. */
  .mode-btn .label-full {
    display: none;
  }

  /* Pintasan dokumentasi API disembunyikan di ponsel:
     di production /docs memang dimatikan, dan ini bukan kendali harian. */
  #btn-swagger-docs {
    display: none !important;
  }

  /* --- Area obrolan --- */
  .chat-messages-container {
    padding: 16px 12px;
    gap: 16px;
  }

  .message-item {
    gap: 10px;
    max-width: 100%;
  }

  .message-bubble {
    padding: 12px 14px;
    font-size: 15px;
  }

  .chat-input-wrapper {
    padding: 10px 12px 14px;
  }

  .chat-input-card {
    padding: 6px 8px 6px 10px;
    gap: 6px;
  }

  #chat-input {
    font-size: 16px; /* mencegah zoom otomatis iOS */
    min-width: 0;
    padding: 8px 4px;
  }

  #attach-btn,
  #send-btn {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
  }

  /* --- Panel & formulir --- */
  #knowledge-view,
  #settings-view,
  #admin-view {
    padding: 16px 12px;
    gap: 16px;
  }

  .card-panel {
    padding: 16px 14px;
  }

  /* Semua grid dua kolom dilipat menjadi satu kolom. */
  .grid-2 {
    grid-template-columns: 1fr;
  }

  /* Input formulir: 16px agar tidak memicu zoom, dan cukup tinggi untuk disentuh. */
  .form-input,
  input[type="text"],
  input[type="password"],
  input[type="email"],
  input[type="number"],
  select,
  textarea {
    font-size: 16px;
    min-height: 44px;
  }

  .btn-primary,
  .btn-secondary {
    min-height: 44px;
  }

  /* Tombol kecil (obrolan baru, chip filter, aksi tabel, pengalih sandi)
     dinaikkan ke ambang sentuh yang nyaman. */
  .btn-new-chat,
  [id^="filter-"],
  .btn-toggle-sm,
  .btn-secondary-sm,
  .btn-danger-sm {
    min-height: 38px;
  }

  button[onclick*="Visibility"] {
    min-width: 40px;
    min-height: 40px;
  }

  /* Tombol salin di bawah tiap gelembung pesan. */
  .bubble-btn {
    min-height: 34px;
    padding: 6px 12px;
  }

  .card-panel .btn-primary {
    width: 100%;
    justify-content: center;
  }

  /* --- Modal: tampil sebagai panel bawah --- */
  .modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  .modal-card {
    max-width: 100%;
    width: 100%;
    max-height: 92dvh;
    overflow-y: auto;
    padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }
}

/* ---------------------------------------------------------
   LAYAR SEMPIT (<= 740px): pemilih provider & model pindah baris
   ---------------------------------------------------------
   Di tablet lebar (741-768px) ketiga kelompok kendali masih muat dalam
   satu baris, jadi aturan ini sengaja tidak berlaku di sana.
   --------------------------------------------------------- */
@media (max-width: 740px) {
  #chat-provider-model-group {
    flex: 1 1 100%;
    justify-content: space-between;
  }

  #chat-provider-select,
  #chat-model-select {
    flex: 1 1 0;
    min-width: 0;
  }
}

/* ---------------------------------------------------------
   PONSEL (<= 480px): tabel berubah menjadi kartu bertumpuk
   ---------------------------------------------------------
   Lebar asli tabel pada layar 390px: Pengguna 797px, Pengingat 675px,
   Kunci API 600px, Dokumen 547px. Alih-alih digeser kiri-kanan,
   setiap baris ditampilkan sebagai kartu dengan label kolomnya,
   diambil dari atribut data-label pada tiap <td>.
   --------------------------------------------------------- */
@media (max-width: 480px) {
  .custom-table thead {
    display: none;
  }

  .custom-table,
  .custom-table tbody,
  .custom-table tr,
  .custom-table td {
    display: block;
    width: 100%;
  }

  .custom-table tr {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    margin: 0 0 10px;
    padding: 4px 0;
  }

  .custom-table tr:last-child {
    margin-bottom: 0;
  }

  .custom-table td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    text-align: right;
    padding: 9px 14px;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 13px;
    min-height: 40px;
    word-break: break-word;
  }

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

  /* Label kolom di sisi kiri tiap baris kartu. */
  .custom-table td[data-label]::before {
    content: attr(data-label);
    flex: 0 0 auto;
    margin-right: auto;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
  }

  /* Baris pesan status (colspan): tampil polos, tanpa label. */
  .custom-table td[colspan] {
    justify-content: center;
    text-align: center;
  }

  .custom-table td[colspan]::before {
    content: none;
  }

  /* Kolom aksi: tombol dibariskan agar mudah ditekan. */
  .custom-table td[data-label="Aksi"] {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
  }

  .custom-table td[data-label="Aksi"] button {
    min-height: 38px;
    padding: 8px 14px;
    font-size: 12px;
  }

  /* Kode panjang (URI, kunci tersamar) dipaksa patah. */
  .custom-table td code {
    word-break: break-all;
    text-align: right;
  }

  /* Header tabel beserta tombolnya ditumpuk. */
  .table-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .table-header > div {
    min-width: 0;
  }

  .table-card {
    min-width: 0;
  }

  .view-title-group h2 {
    font-size: 14px;
  }

  .custom-select {
    max-width: 40vw;
  }
}
