:root {
  --bg-dark: #080D1A;
  --bg-sidebar: #0D1424;
  --card-bg: #121C30;
  --card-hover: #17243D;
  --card-border: #1E2D48;
  --line: #223250;
  --text-primary: #F1F5F9;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  
  --teal: #00D2B4;
  --teal-glow: rgba(0, 210, 180, 0.25);
  --teal-bg: rgba(0, 210, 180, 0.08);
  --blue: #38BDF8;
  --blue-bg: rgba(56, 189, 248, 0.08);
  --indigo: #818CF8;
  --amber: #F59E0B;
  --amber-bg: rgba(245, 158, 11, 0.1);
  --rose: #F43F5E;
  --rose-bg: rgba(244, 63, 94, 0.1);
  --emerald: #10B981;
  
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Apple SD Gothic Neo', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-primary);
  font-family: var(--font-sans);
  height: 100vh;
  overflow: hidden;
  line-height: 1.6;
}

/* App Layout */
.app-layout {
  display: flex;
  height: 100vh;
  width: 100vw;
}

/* Sidebar */
.sidebar {
  width: 320px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--card-border);
  display: flex;
  flex-direction: column;
  padding: 20px 18px;
  flex-shrink: 0;
}

.brand-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo-dot {
  width: 12px;
  height: 12px;
  background: var(--teal);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--teal);
}
.brand-name {
  font-size: 17px;
  letter-spacing: -0.01em;
  color: #FFFFFF;
}
.brand-name strong {
  color: var(--teal);
}
.brand-badge {
  font-size: 11px;
  font-weight: 800;
  color: var(--blue);
  background: var(--blue-bg);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 2px 8px;
  border-radius: 6px;
  letter-spacing: 0.08em;
}

/* Remote Target Card */
.remote-target-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 24px;
  transition: all 0.2s ease;
}
.remote-target-card:hover {
  border-color: var(--line);
}
.target-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.target-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.status-indicator.online {
  background: var(--teal);
  box-shadow: 0 0 8px var(--teal);
}
.status-indicator.offline {
  background: var(--rose);
}
.target-host {
  font-size: 14px;
  font-weight: 700;
  color: #FFFFFF;
  font-family: var(--font-mono);
}
.target-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
.btn-config-target {
  width: 100%;
  margin-top: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-border);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  padding: 7px 0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-config-target:hover {
  background: var(--card-hover);
  color: #fff;
  border-color: var(--teal);
}

/* Section Title */
.section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}

/* Tool List */
.tools-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}
.tool-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(18, 28, 48, 0.5);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 10px 12px;
}
.tool-icon {
  font-size: 18px;
}
.tool-name {
  font-size: 13px;
  font-weight: 700;
  color: #FFFFFF;
}
.tool-desc {
  font-size: 11px;
  color: var(--text-muted);
}

/* Dropzone */
.file-dropzone {
  border: 1px dashed var(--card-border);
  border-radius: 10px;
  padding: 18px;
  text-align: center;
  cursor: pointer;
  background: rgba(18, 28, 48, 0.3);
  transition: all 0.2s ease;
}
.file-dropzone:hover {
  border-color: var(--teal);
  background: var(--teal-bg);
}
.drop-icon {
  font-size: 22px;
  display: block;
  margin-bottom: 4px;
}
.drop-text {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
}
.file-list {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 120px;
  overflow-y: auto;
}
.file-badge-item {
  font-size: 11.5px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 6px;
  padding: 5px 8px;
  color: var(--teal);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid var(--card-border);
  padding-top: 14px;
  font-size: 11.5px;
  color: var(--text-muted);
}
.sidebar-footer div strong {
  color: var(--text-secondary);
}

/* Main Workspace */
.chat-workspace {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: relative;
  overflow: hidden;
}

/* Topbar */
.topbar {
  height: 58px;
  border-bottom: 1px solid var(--card-border);
  background: rgba(13, 20, 36, 0.95);
  backdrop-filter: blur(10px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 14px;
  gap: 10px;
  z-index: 10;
  box-sizing: border-box;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
.topbar::-webkit-scrollbar {
  display: none;
}
.model-selector-group {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-shrink: 1;
}
.model-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}
.model-dropdown-wrap {
  min-width: 0;
  flex-shrink: 1;
}
.model-select {
  background: var(--card-bg);
  color: #FFFFFF;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  max-width: 210px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.model-select:focus {
  border-color: var(--teal);
}
.model-tier-badge {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--teal);
  background: var(--teal-bg);
  border: 1px solid var(--teal-glow);
  padding: 2px 7px;
  border-radius: 10px;
  white-space: nowrap;
  flex-shrink: 0;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin-left: auto;
  padding-right: 2px;
}
.btn-clear-chat {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--card-border);
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 7px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.2s ease;
}
.btn-clear-chat:hover {
  color: #fff;
  border-color: var(--teal);
  background: rgba(0, 210, 180, 0.1);
}

/* Language Switcher */
.language-switch {
  display: flex;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--card-border);
  border-radius: 7px;
  padding: 2px;
  gap: 2px;
  flex-shrink: 0;
}
.lang-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 38px;
}
.lang-btn.active {
  background: var(--teal);
  color: #060B14;
  font-weight: 700;
}
.lang-btn:hover:not(.active) {
  color: #FFFFFF;
}

/* Chat Timeline */
.chat-timeline {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px 120px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Messages */
.chat-message {
  display: flex;
  gap: 14px;
  max-width: 860px;
}
.chat-message.user {
  margin-left: auto;
  flex-direction: row-reverse;
}
.msg-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
}
.chat-message.assistant .msg-avatar {
  background: linear-gradient(135deg, var(--teal), #0D9488);
  color: #07131D;
}
.chat-message.user .msg-avatar {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: var(--blue);
}
.msg-content {
  flex: 1;
  min-width: 0;
}
.msg-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.chat-message.user .msg-header {
  justify-content: flex-end;
}
.msg-author {
  font-size: 13px;
  font-weight: 700;
  color: #FFFFFF;
}
.msg-time {
  font-size: 11px;
  color: var(--text-muted);
}
.msg-body {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 16px 20px;
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--text-primary);
  word-break: break-word;
}
.chat-message.user .msg-body {
  background: #1E293B;
  border-color: #334155;
}

/* Quick Chips */
.quick-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.quick-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-border);
  color: var(--blue);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.quick-chip:hover {
  background: var(--blue-bg);
  border-color: var(--blue);
}

/* Friendly & Comforting Assistant Step Pills (Designed for Office Staff) */
.friendly-step-card {
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 12px;
  margin: 10px 0;
  overflow: hidden;
  transition: all 0.25s ease;
  backdrop-filter: blur(6px);
}
.friendly-step-card.running {
  border-color: rgba(56, 189, 248, 0.35);
  background: rgba(15, 23, 42, 0.65);
}
.friendly-step-card.completed {
  border-color: rgba(16, 185, 129, 0.22);
  background: rgba(15, 23, 42, 0.45);
}
.friendly-step-header {
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
}
.friendly-step-header:hover {
  background: rgba(255, 255, 255, 0.03);
}
.friendly-step-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.friendly-step-icon {
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.friendly-step-title {
  color: #E2E8F0;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.friendly-step-pulse {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #38BDF8;
  box-shadow: 0 0 8px #38BDF8;
  animation: pulse-soft 1.5s infinite ease-in-out;
}
@keyframes pulse-soft {
  0%, 100% { opacity: 0.3; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.15); }
}
.friendly-step-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.friendly-step-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
}
.friendly-step-badge.running {
  color: #38BDF8;
  background: rgba(56, 189, 248, 0.12);
}
.friendly-step-badge.done {
  color: #10B981;
  background: rgba(16, 185, 129, 0.14);
}
.friendly-step-toggle {
  font-size: 11px;
  color: #64748B;
  transition: color 0.2s ease;
  user-select: none;
}
.friendly-step-toggle:hover {
  color: #94A3B8;
}
.friendly-step-drawer {
  display: none !important; /* Always hidden by default - non-technical staff won't see raw code */
  padding: 10px 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.5;
  color: #94A3B8;
  background: rgba(6, 9, 19, 0.9);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  max-height: 180px;
  overflow-y: auto;
  white-space: pre-wrap;
}
.friendly-step-drawer.open {
  display: block !important;
}

/* Backward compatibility for legacy tool-box */
.tool-box {
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(56, 189, 248, 0.18);
  border-radius: 10px;
  margin: 10px 0;
  overflow: hidden;
}
.tool-box-header {
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}
.tool-box-title {
  color: #E2E8F0;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
.tool-box-status {
  font-size: 12px;
  font-weight: 600;
}
.tool-box-content {
  display: none !important;
  padding: 12px 14px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.6;
  color: #94A3B8;
  background: #060913;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  max-height: 220px;
  overflow-y: auto;
  white-space: pre-wrap;
}

/* Input Container */
.input-container {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px 28px 24px;
  background: linear-gradient(180deg, rgba(8, 13, 26, 0) 0%, rgba(8, 13, 26, 0.95) 40%, rgba(8, 13, 26, 1) 100%);
}
.chat-form {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 8px 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  transition: border-color 0.2s ease;
}
.chat-form:focus-within {
  border-color: var(--teal);
}
.chat-textarea {
  flex: 1;
  background: transparent;
  border: none;
  color: #FFFFFF;
  font-family: var(--font-sans);
  font-size: 14.5px;
  resize: none;
  outline: none;
  max-height: 120px;
  line-height: 1.5;
}
.btn-send {
  background: var(--teal);
  color: #07131D;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
}
.btn-send:hover {
  filter: brightness(1.1);
  transform: scale(1.04);
}
.input-hints {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 8px;
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal-card {
  background: var(--bg-sidebar);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  width: 100%;
  max-width: 500px;
  padding: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}
.modal-warning {
  border-color: var(--rose);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: #FFFFFF;
}
.btn-close-modal {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 22px;
  cursor: pointer;
}
.modal-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}
.form-group {
  margin-bottom: 14px;
}
.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.form-group input {
  width: 100%;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13.5px;
  color: #fff;
  font-family: var(--font-mono);
  outline: none;
}
.form-group input:focus {
  border-color: var(--teal);
}
.form-row {
  display: flex;
  gap: 12px;
}
.flex-1 { flex: 1; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}
.btn-primary {
  background: var(--teal);
  color: #07131D;
  border: none;
  font-weight: 700;
  font-size: 13px;
  padding: 8px 18px;
  border-radius: 8px;
  cursor: pointer;
}
.btn-secondary {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 8px;
  cursor: pointer;
}
.btn-danger {
  background: var(--rose);
  color: #fff;
  border: none;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: 8px;
  cursor: pointer;
}
.code-preview-box {
  background: #080D18;
  border: 1px solid var(--card-border);
  padding: 12px;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--amber);
  margin: 10px 0;
  overflow-x: auto;
}

/* Interactive Chart Card */
.chart-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 16px 20px;
  margin: 14px 0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  transition: all 0.25s ease;
}
.chart-card:hover {
  border-color: rgba(56, 189, 248, 0.4);
}
.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.chart-title {
  font-size: 14.5px;
  font-weight: 700;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  gap: 8px;
}
.chart-actions {
  display: flex;
  gap: 8px;
}
.btn-chart-dl {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.btn-chart-dl:hover {
  color: var(--teal);
  border-color: var(--teal);
  background: var(--teal-bg);
}
.chart-canvas-wrap {
  position: relative;
  width: 100%;
  max-height: 340px;
  min-height: 220px;
  margin: 10px 0;
}
.chart-summary {
  margin-top: 12px;
  padding: 10px 14px;
  background: rgba(56, 189, 248, 0.06);
  border-left: 3px solid var(--blue);
  border-radius: 6px;
  font-size: 12.5px;
  color: #E2E8F0;
  line-height: 1.6;
}

/* ==========================================================================
   Dataset Explorer & SmartStore Modal Styles
   ========================================================================== */
.btn-grid-modal-trigger {
  background: linear-gradient(135deg, rgba(0, 210, 180, 0.15) 0%, rgba(56, 189, 248, 0.15) 100%);
  border: 1px solid rgba(0, 210, 180, 0.4);
  color: #00D2B4;
  font-size: 11.5px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 7px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.25s ease;
  box-shadow: 0 0 12px rgba(0, 210, 180, 0.12);
  white-space: nowrap;
  flex-shrink: 0;
}
.btn-grid-modal-trigger:hover {
  background: linear-gradient(135deg, rgba(0, 210, 180, 0.3) 0%, rgba(56, 189, 248, 0.3) 100%);
  border-color: #00D2B4;
  color: #FFFFFF;
  transform: translateY(-1px);
  box-shadow: 0 0 20px rgba(0, 210, 180, 0.3);
}

.modal-dataset-explorer {
  width: 95vw !important;
  max-width: 1440px !important;
  height: 92vh !important;
  max-height: 92vh !important;
  display: flex;
  flex-direction: column;
  background: #0B1120 !important;
  border: 1px solid rgba(56, 189, 248, 0.25) !important;
  border-radius: 16px !important;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(0, 210, 180, 0.1) !important;
  padding: 0 !important;
  overflow: hidden;
}

.modal-dataset-explorer .modal-header {
  padding: 16px 24px;
  background: #0F172A;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}
.modal-badge-live {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid #10B981;
  color: #10B981;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}
.modal-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.select-dataset-dropdown {
  background: #1E293B;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #F1F5F9;
  font-size: 12.5px;
  padding: 6px 12px;
  border-radius: 8px;
  outline: none;
  cursor: pointer;
  max-width: 280px;
}
.btn-smartstore-action {
  background: linear-gradient(135deg, #03C75A 0%, #00B048 100%);
  border: none;
  color: #FFFFFF;
  font-size: 12.5px;
  font-weight: 700;
  padding: 7px 16px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 15px rgba(3, 199, 90, 0.35);
  transition: all 0.2s ease;
}
.btn-smartstore-action:hover {
  background: linear-gradient(135deg, #05DF65 0%, #03C75A 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(3, 199, 90, 0.5);
}

/* KPI Summary Bar */
.dataset-kpi-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 14px 24px;
  background: rgba(15, 23, 42, 0.7);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.kpi-mini-card {
  background: #131E35;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 10px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.kpi-mini-card.highlight-green {
  border-color: rgba(16, 185, 129, 0.3);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(19, 30, 53, 0.8) 100%);
}
.kpi-mini-card.highlight-green .kpi-mini-val {
  color: #34D399;
}
.kpi-mini-card.highlight-blue {
  border-color: rgba(56, 189, 248, 0.3);
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.08) 0%, rgba(19, 30, 53, 0.8) 100%);
}
.kpi-mini-card.highlight-blue .kpi-mini-val {
  color: #38BDF8;
}
.kpi-mini-label {
  font-size: 11px;
  font-weight: 600;
  color: #94A3B8;
  letter-spacing: 0.2px;
}
.kpi-mini-val {
  font-size: 17px;
  font-weight: 800;
  color: #F8FAFC;
  font-family: var(--font-mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Controls Bar */
.dataset-controls-bar {
  padding: 12px 24px;
  background: #0E1628;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 240px;
}
.search-input-wrap .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  color: #64748B;
}
.grid-search-input {
  width: 100%;
  background: #18233C;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #F1F5F9;
  font-size: 12.5px;
  padding: 8px 12px 8px 34px;
  border-radius: 8px;
  outline: none;
  transition: all 0.2s ease;
}
.grid-search-input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 10px rgba(0, 210, 180, 0.25);
}
.category-filter-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.filter-label {
  font-size: 12px;
  color: #94A3B8;
  font-weight: 600;
}
.category-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.chip-btn {
  background: #18233C;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #94A3B8;
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.chip-btn:hover {
  color: #F1F5F9;
  background: #223253;
}
.chip-btn.active {
  background: rgba(0, 210, 180, 0.2);
  border-color: #00D2B4;
  color: #00D2B4;
}
.grid-status-right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}
.grid-row-counter {
  font-size: 12px;
  color: #94A3B8;
  font-weight: 600;
}
.select-grid-limit {
  background: #18233C;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #F1F5F9;
  font-size: 11.5px;
  padding: 5px 8px;
  border-radius: 6px;
  outline: none;
}

/* Data Table Container */
.dataset-table-container {
  flex: 1;
  overflow: auto;
  position: relative;
  background: #090E1A;
}
.dataset-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
  color: #CBD5E1;
}
.dataset-table th {
  position: sticky;
  top: 0;
  background: #131E35;
  color: #F1F5F9;
  font-weight: 700;
  font-size: 12px;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 2px solid rgba(56, 189, 248, 0.3);
  white-space: nowrap;
  z-index: 10;
}
.dataset-table td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  white-space: nowrap;
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dataset-table tr:hover td {
  background: rgba(56, 189, 248, 0.08);
  color: #FFFFFF;
}
.dataset-table tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.015);
}
.dataset-table tr:nth-child(even):hover td {
  background: rgba(56, 189, 248, 0.08);
}
.cell-money {
  font-weight: 700;
  color: #34D399 !important;
  text-align: right;
  font-family: var(--font-mono);
}
.cell-badge {
  background: rgba(56, 189, 248, 0.15);
  color: #38BDF8;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

/* Footer & Pagination */
.dataset-footer {
  padding: 12px 24px !important;
  background: #0F172A !important;
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
}
.dataset-pagination {
  display: flex;
  align-items: center;
  gap: 4px;
}
.page-btn {
  background: #18233C;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #CBD5E1;
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.page-btn:hover {
  background: #25365A;
  color: #FFFFFF;
}
.page-btn.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #FFFFFF;
  font-weight: 700;
}
.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ==========================================================================
   Responsive Topbar & Layout
   ========================================================================== */
@media (max-width: 1440px) {
  .model-select {
    max-width: 190px;
  }
  .model-tier-badge {
    display: none;
  }
}

@media (max-width: 1200px) {
  .sidebar {
    width: 270px;
  }
  .model-label {
    display: none;
  }
  .model-select {
    max-width: 170px;
  }
  .topbar-actions {
    gap: 5px;
  }
}

@media (max-width: 1024px) {
  .sidebar {
    width: 240px;
  }
  .grid-btn-text {
    display: none;
  }
  .model-select {
    max-width: 140px;
  }
}
