/* ==========================================================================
   CTC-Indonesia HSE AI Platform Design System (Light Theme)
   Countermeasure Training & Consulting
   ========================================================================== */

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

:root {
  /* Brand Colors - Official CTC Logo Colors (Vibrant Green, Metallic Gold, and CTC Red) */
  --primary: #009e49;
  --primary-hover: #00823c;
  --primary-light: #ebfaef;
  --primary-border: #8fe0b0;
  
  --secondary: #c59218;
  --secondary-hover: #a7790e;
  --secondary-light: #fdf7e6;
  --secondary-border: #ecd598;
  
  --gold: #c59218;
  --accent: #c59218;
  --danger: #e11d27;
  --danger-light: #fee2e2;
  --success: #009e49;
  --success-light: #ebfaef;
  
  /* Solid Light Mode Base */
  --bg-dark: #f8fafc;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --border-color: #e2e8f0;
  --border-focus: #009e49;
  --border-light: #cbd5e1;
  
  /* Text */
  --text-main: #0f172a;
  --text-muted: #334155;
  --text-dim: #64748b;
  
  /* Layout */
  --sidebar-width: 280px;
  --header-height: 70px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  
  /* Transitions & Shadows */
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 14px -1px rgba(0, 0, 0, 0.08), 0 2px 6px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 12px 30px -4px rgba(0, 0, 0, 0.1), 0 4px 12px -2px rgba(0, 0, 0, 0.05);
  --shadow-glow: 0 0 25px rgba(5, 150, 105, 0.18);
}

[data-theme="dark"] {
  /* Brand Colors in Dark Theme */
  --primary: #00c058;
  --primary-hover: #10d868;
  --primary-light: rgba(0, 192, 88, 0.14);
  --primary-border: rgba(0, 192, 88, 0.35);
  
  --secondary: #f1b82d;
  --secondary-hover: #fbc02d;
  --secondary-light: rgba(241, 184, 45, 0.14);
  --secondary-border: rgba(241, 184, 45, 0.35);
  
  --gold: #f1b82d;
  --accent: #f1b82d;
  --danger: #f87171;
  --danger-light: rgba(239, 68, 68, 0.18);
  --success: #00c058;
  --success-light: rgba(0, 192, 88, 0.14);
  
  /* Sleek High-Tech Dark Mode Base */
  --bg-dark: #0a0f18;
  --bg-surface: #101726;
  --bg-surface-elevated: #162033;
  --bg-card: #121a2c;
  --bg-card-hover: #19253d;
  --bg-glass: rgba(16, 23, 38, 0.92);
  
  --border-color: rgba(255, 255, 255, 0.09);
  --border-focus: #00c058;
  --border-light: rgba(255, 255, 255, 0.15);
  
  /* Text */
  --text-main: #f8fafc;
  --text-muted: #cbd5e1;
  --text-dim: #94a3b8;
  
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.45);
  --shadow-md: 0 4px 14px -1px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 12px 30px -4px rgba(0, 0, 0, 0.75);
  --shadow-glow: 0 0 25px rgba(0, 192, 88, 0.35);
}

html {
  font-size: 95%;
  scroll-behavior: smooth;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
}

/* App Shell Container */
.app-container {
  display: flex;
  min-height: 100vh;
}

body.copilot-mode .app-container,
body:has(#copilot-view.active) .app-container {
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-surface);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  transition: var(--transition);
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.02);
}

.brand-section {
  padding: 22px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-surface);
}

.brand-logo-badge {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.25);
  flex-shrink: 0;
}

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

.brand-info h2 {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

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

.nav-menu {
  flex: 1;
  padding: 18px 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.nav-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  padding: 14px 14px 6px;
}

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

.nav-item:hover {
  background: var(--bg-surface-elevated);
  color: var(--text-main);
  transform: translateX(3px);
}

.nav-item.active {
  background: var(--primary-light);
  color: var(--primary);
  border-color: rgba(5, 150, 105, 0.2);
  font-weight: 700;
}

.nav-item i {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-surface-elevated);
}

.status-card {
  background: var(--primary-light);
  border: 1px solid var(--primary-border);
  padding: 12px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 6px var(--primary);
  animation: pulse-dot 2s infinite;
}

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

/* Main Content Wrapper */
.main-wrapper {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

body.copilot-mode .main-wrapper,
body:has(#copilot-view.active) .main-wrapper {
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  overflow: hidden;
}

/* Top Header */
.top-header {
  height: var(--header-height);
  flex-shrink: 0;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 90;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.02);
}

.header-title-group h1 {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

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

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

/* Theme Lighting Switcher (Toggle Button) */
.theme-toggle-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0;
  flex-shrink: 0;
}

.theme-toggle-btn:hover {
  color: var(--primary);
  border-color: var(--primary-border);
  transform: scale(1.08);
  box-shadow: 0 0 14px rgba(0, 192, 88, 0.25);
}

.theme-toggle-btn i {
  position: absolute;
  font-size: 14px;
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.theme-toggle-btn .theme-icon-moon {
  transform: rotate(0deg) scale(1);
  opacity: 1;
  color: var(--text-dim);
}

.theme-toggle-btn .theme-icon-sun {
  transform: rotate(90deg) scale(0);
  opacity: 0;
  color: #f59e0b;
}

[data-theme="dark"] .theme-toggle-btn .theme-icon-moon {
  transform: rotate(-90deg) scale(0);
  opacity: 0;
}

[data-theme="dark"] .theme-toggle-btn .theme-icon-sun {
  transform: rotate(0deg) scale(1);
  opacity: 1;
  color: #fbbf24;
  filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.65));
}

[data-theme="dark"] .theme-toggle-btn:hover {
  border-color: rgba(251, 191, 36, 0.45);
  box-shadow: 0 0 16px rgba(251, 191, 36, 0.3);
}

/* Language Switcher */
.lang-switcher {
  display: inline-flex;
  align-items: center;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 2px 3px;
  gap: 2px;
}

.lang-btn {
  background: transparent;
  border: none;
  font-size: 11px;
  font-weight: 800;
  color: var(--text-dim);
  padding: 4px 8px;
  border-radius: 14px;
  cursor: pointer;
  transition: var(--transition);
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.lang-btn:hover {
  color: var(--primary);
}

.lang-btn.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(4, 120, 87, 0.25);
}

/* Custom Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #047857 0%, #065f46 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(5, 150, 105, 0.35);
}

.btn-secondary {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-light);
  color: var(--text-main);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

/* Page Views */
.content-body {
  padding: 32px;
  flex: 1;
}

.content-body.copilot-active,
.content-body:has(#copilot-view.active) {
  padding: 0;
  display: flex;
  flex-direction: column;
  flex: 1 1 0%;
  min-height: 0;
  height: calc(100vh - var(--header-height));
  height: calc(100dvh - var(--header-height));
  max-height: calc(100vh - var(--header-height));
  max-height: calc(100dvh - var(--header-height));
  overflow: hidden;
}

body.copilot-mode,
body:has(#copilot-view.active) {
  overflow: hidden;
  height: 100vh;
  height: 100dvh;
}

.page-view {
  display: none;
  animation: fadeIn 0.3s ease-in-out;
}

.page-view.active {
  display: block;
}

#copilot-view.active {
  display: flex;
  flex-direction: column;
  flex: 1 1 0%;
  min-height: 0;
  width: 100%;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
}

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

/* Card System */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

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

.card-title {
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-main);
}

.card-title i {
  color: var(--primary);
}

/* Grid Layouts */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

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

.form-label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.form-control, .form-select {
  width: 100%;
  padding: 11px 16px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 13.5px;
  transition: var(--transition);
  outline: none;
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
  background: var(--bg-surface);
}

textarea.form-control {
  min-height: 110px;
  resize: vertical;
}

/* Chat Copilot Interface */
.chat-container {
  display: flex;
  flex-direction: column;
  flex: 1 1 0%;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  width: 100%;
  background: var(--bg-card);
  border: none;
  border-radius: 0;
  overflow: hidden;
  box-shadow: none;
}

.chat-role-bar {
  padding: 12px 28px;
  background: var(--bg-surface-elevated);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 12px;
  overflow-x: auto;
  flex-shrink: 0;
  z-index: 5;
}

.role-chip {
  padding: 7px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  background: var(--bg-card);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}

.role-chip:hover {
  background: var(--bg-surface-elevated);
  color: var(--text-main);
}

.role-chip.active {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary-border);
}

.chat-messages {
  flex: 1 1 0%;
  min-height: 0;
  padding: 24px 28px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: var(--bg-card);
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.chat-messages::-webkit-scrollbar {
  width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
  background: var(--bg-surface);
}

.chat-messages::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

.chat-msg {
  display: flex;
  gap: 14px;
  max-width: 85%;
  animation: fadeIn 0.25s ease;
}

.chat-msg.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chat-msg.assistant {
  align-self: flex-start;
}

.chat-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.chat-msg.assistant .chat-avatar {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.3);
}

.chat-msg.user .chat-avatar {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: white;
}

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

.chat-msg.assistant .chat-bubble {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  border-top-left-radius: 4px;
}

.chat-msg.user .chat-bubble {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  color: #ffffff;
  border-top-right-radius: 4px;
}

.chat-input-area {
  padding: 14px 28px 18px 28px;
  background: var(--bg-surface-elevated);
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
  z-index: 5;
}

.quick-prompts-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.quick-btn {
  padding: 6px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: var(--transition);
}

.quick-btn:hover {
  background: var(--bg-surface);
  color: var(--primary);
  border-color: var(--primary-border);
}

.input-box-wrapper {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.chat-textarea {
  flex: 1;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  color: var(--text-main);
  font-size: 14px;
  line-height: 1.5;
  height: 48px;
  min-height: 48px;
  max-height: 160px;
  outline: none;
  resize: none;
  overflow-y: auto;
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.chat-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}

/* Markdown Formatted Content Inside Chat & Reports */
.markdown-body {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-muted);
}

.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4 {
  color: var(--text-main);
  margin-top: 16px;
  margin-bottom: 10px;
  font-weight: 800;
}

.markdown-body h3 {
  font-size: 15px;
  color: var(--primary);
}

.markdown-body p {
  margin-bottom: 10px;
}

.markdown-body ul, .markdown-body ol {
  padding-left: 20px;
  margin-bottom: 12px;
}

.markdown-body li {
  margin-bottom: 4px;
}

.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
  font-size: 13px;
  background: var(--bg-card);
}

.markdown-body table th {
  background: var(--bg-surface-elevated);
  color: var(--text-main);
  text-align: left;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  font-weight: 700;
}

.markdown-body table td {
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
}

.markdown-body blockquote {
  border-left: 4px solid var(--primary);
  padding: 8px 16px;
  background: var(--primary-light);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 12px 0;
  color: var(--text-muted);
}

/* Report Viewer Container */
.report-paper {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 36px;
  box-shadow: var(--shadow-md);
  margin-top: 10px;
  position: relative;
}

.report-header-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 3px double var(--primary);
  padding-bottom: 16px;
  margin-bottom: 24px;
}

.report-title-box h2 {
  font-size: 20px;
  color: var(--primary);
  font-weight: 800;
}

.report-title-box p {
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 600;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
}

.report-table th, .report-table td {
  border: 1px solid var(--border-color);
  padding: 8px 12px;
  font-size: 12.5px;
  text-align: left;
}

.report-table th {
  background: var(--bg-surface-elevated);
  font-weight: 700;
  color: var(--text-main);
}

.report-table td {
  color: var(--text-muted);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-high { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }
.badge-medium { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }
.badge-low { background: #dcfce7; color: #15803d; border: 1px solid #86efac; }

/* KPI Stats Card */
.stat-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 20px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
}

.stat-val {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-main);
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 540px;
  padding: 28px;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95);
  transition: var(--transition);
  color: var(--text-main);
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}

/* Print Optimization */
@media print {
  @page {
    size: A4;
    margin: 15mm;
  }

  html, body {
    background: #ffffff !important;
    color: #0f172a !important;
    min-height: auto !important;
    height: auto !important;
    overflow: visible !important;
    font-size: 11pt;
  }

  .sidebar, 
  .top-header, 
  .btn, 
  .chat-role-bar, 
  .chat-input-area, 
  .quick-prompts-row, 
  .modal-overlay,
  .no-print,
  #jsa-form,
  form {
    display: none !important;
  }

  .print-official-header {
    display: block !important;
  }

  .app-container, .main-wrapper, .content-body {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
  }

  .page-view {
    display: none !important;
  }
  
  .page-view.active {
    display: block !important;
  }

  .chat-container {
    height: auto !important;
    border: none !important;
    background: transparent !important;
  }

  .chat-messages {
    overflow: visible !important;
    padding: 0 !important;
    gap: 16px !important;
  }

  .chat-msg {
    max-width: 100% !important;
    page-break-inside: avoid;
    margin-bottom: 12px;
  }

  .chat-msg.assistant .chat-bubble {
    background: #f8fafc !important;
    color: #0f172a !important;
    border: 1px solid #cbd5e1 !important;
  }

  .chat-msg.user .chat-bubble {
    background: #f1f5f9 !important;
    color: #047857 !important;
    border: 1px solid #94a3b8 !important;
    font-weight: 600;
  }

  .chat-avatar {
    border: 1px solid #cbd5e1 !important;
    color: #047857 !important;
    background: #ffffff !important;
  }

  .markdown-body {
    color: #0f172a !important;
  }

  .markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4 {
    color: #047857 !important;
  }

  .markdown-body table {
    width: 100% !important;
    border-collapse: collapse !important;
  }

  .markdown-body table th {
    background: #e2e8f0 !important;
    color: #0f172a !important;
    border: 1px solid #94a3b8 !important;
  }

  .markdown-body table td {
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
  }

  .grid-2 {
    display: block !important;
  }

  .card {
    background: transparent !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: none !important;
    page-break-inside: avoid;
    color: #0f172a !important;
    margin-bottom: 20px;
  }

  .card-title {
    color: #047857 !important;
  }

  .stat-box {
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
  }

  .stat-label {
    color: #64748b !important;
  }

  .report-paper {
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    page-break-inside: avoid;
  }

  .report-table th {
    background: #e2e8f0 !important;
    color: #0f172a !important;
  }

  .badge-high { background: #fee2e2 !important; color: #b91c1c !important; border: 1px solid #f87171 !important; }
  .badge-medium { background: #fef3c7 !important; color: #b45309 !important; border: 1px solid #fbbf24 !important; }
  .badge-low { background: #dcfce7 !important; color: #15803d !important; border: 1px solid #86efac !important; }
}

/* Mobile Sidebar Toggle Button & Overlay */
.mobile-sidebar-toggle {
  display: none;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 18px;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.mobile-sidebar-toggle:hover {
  background: var(--bg-card-hover);
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  z-index: 99;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Responsive Table Wrapper */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 14px 0;
}

/* Responsive Media Queries */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.mobile-open {
    transform: translateX(0);
  }
  .main-wrapper {
    margin-left: 0;
  }
  .mobile-sidebar-toggle {
    display: inline-flex;
  }
  .top-header {
    padding: 0 16px;
    height: 60px;
  }
  .content-body {
    padding: 16px 14px;
  }
  .content-body.copilot-active,
  .content-body:has(#copilot-view.active) {
    padding: 0 !important;
    height: calc(100vh - 60px);
    height: calc(100dvh - 60px);
  }
  .grid-4, .grid-3, .grid-2 {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .chat-container {
    height: 100%;
  }
  .chat-role-bar {
    padding: 10px 16px;
  }
  .chat-messages {
    padding: 16px;
  }
  .chat-input-area {
    padding: 12px 16px;
  }
}

@media (max-width: 640px) {
  .top-header {
    height: 56px;
    padding: 0 12px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }

  .mobile-sidebar-toggle {
    width: 34px;
    height: 34px;
    font-size: 15px;
  }

  .header-title-group h1 {
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
  }

  .header-title-group p {
    display: none;
  }

  .header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    width: auto;
  }

  .header-actions .btn-secondary {
    display: none !important;
  }

  .theme-toggle-btn {
    width: 32px;
    height: 32px;
  }

  .theme-toggle-btn i {
    font-size: 12px;
  }

  .lang-switcher {
    padding: 2px;
    border-radius: 16px;
    gap: 1px;
  }

  .lang-btn {
    font-size: 10.5px;
    padding: 3px 6px;
    border-radius: 12px;
  }

  .header-actions .btn-primary.btn-sm {
    width: 32px;
    height: 32px;
    min-width: 32px;
    padding: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
  }

  .btn-text-responsive {
    display: none !important;
  }

  /* Content Body Spacing */
  .content-body {
    padding: 10px 8px;
  }
  .content-body.copilot-active,
  .content-body:has(#copilot-view.active) {
    padding: 0 !important;
    height: calc(100vh - 56px);
    height: calc(100dvh - 56px);
  }

  /* Chat Container Spacing & Proportions */
  .chat-container {
    height: 100% !important;
    border-radius: 0 !important;
    margin: 0 !important;
  }

  .chat-role-bar {
    padding: 8px 12px;
    gap: 6px;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .chat-messages {
    padding: 12px;
  }

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

  .chat-role-bar::-webkit-scrollbar {
    display: none;
  }

  .chat-role-bar span {
    font-size: 10px !important;
    white-space: nowrap;
  }

  .role-chip {
    padding: 5px 10px;
    font-size: 11px;
    gap: 5px;
    border-radius: 14px;
  }

  .chat-messages {
    padding: 12px 10px;
    gap: 12px;
  }

  .chat-msg {
    max-width: 95%;
    gap: 8px;
  }

  .chat-avatar {
    width: 30px;
    height: 30px;
    min-width: 30px;
    font-size: 12px;
  }

  .chat-bubble {
    padding: 10px 12px;
    font-size: 13px;
    line-height: 1.5;
    border-radius: 12px;
  }

  .chat-bubble h1, 
  .chat-bubble h2, 
  .chat-bubble h3, 
  .chat-bubble h4 {
    font-size: 13.5px;
    margin-top: 6px;
    margin-bottom: 6px;
  }

  .chat-bubble p {
    margin-bottom: 6px;
  }

  .chat-bubble p:last-child {
    margin-bottom: 0;
  }

  .chat-bubble ol,
  .chat-bubble ul {
    padding-left: 18px;
    margin-bottom: 6px;
  }

  .chat-bubble li {
    margin-bottom: 3px;
  }

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

  .quick-prompts-row {
    gap: 6px;
    padding-bottom: 4px;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .quick-prompts-row::-webkit-scrollbar {
    display: none;
  }

  .quick-btn {
    padding: 5px 9px;
    font-size: 11px;
    border-radius: 6px;
  }

  .input-box-wrapper {
    gap: 8px;
    align-items: flex-end;
  }

  .chat-textarea {
    height: 40px;
    min-height: 40px;
    max-height: 110px;
    padding: 9px 12px;
    font-size: 13px;
    line-height: 1.45;
    border-radius: 10px;
    overflow-y: auto;
    box-sizing: border-box;
  }

  .input-box-wrapper .btn-primary {
    width: 40px;
    height: 40px;
    min-width: 40px;
    padding: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
  }

  /* Form & Card Elements in Other Views */
  .grid-4, .grid-3, .grid-2 {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .card {
    padding: 16px 12px;
    margin-bottom: 14px;
    border-radius: 12px;
  }

  .card-header {
    margin-bottom: 12px;
    padding-bottom: 8px;
  }

  .card-title {
    font-size: 14px;
  }

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

  .form-label {
    font-size: 12px;
    margin-bottom: 5px;
  }

  .form-control, .form-select {
    padding: 9px 11px;
    font-size: 13px;
    border-radius: 8px;
  }

  .report-paper {
    padding: 16px 12px;
    margin-top: 14px;
    border-radius: 10px;
  }

  .report-header-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .modal-content {
    width: 94%;
    max-width: 400px;
    padding: 18px 14px;
    border-radius: 14px;
  }
}

