/* ==========================================================================
   Ontech Dev Portal — Main Design System
   Based on Ontech ERP Frontend Standard (Bootstrap 5.3.2)
   ========================================================================== */

/* ── CSS Variables ──────────────────────────────────────────────────────── */
:root {
  --ontech-primary: #002868;
  --ontech-secondary: #0056b3;
  --ontech-accent: #0d6efd;
  --ontech-success: #198754;
  --ontech-warning: #ffc107;
  --ontech-danger: #dc3545;
  --ontech-info: #0dcaf0;

  --bg-body: #f0f2f5;
  --bg-sidebar: #1a1d21;
  --bg-sidebar-hover: #2a2d35;
  --bg-sidebar-active: #32363e;
  --bg-white: #ffffff;
  --bg-light: #f8f9fa;
  --bg-card: #ffffff;

  --text-primary: #212529;
  --text-secondary: #6c757d;
  --text-muted: #adb5bd;
  --text-white: #ffffff;

  --border-color: #dee2e6;
  --border-light: #e9ecef;
  --border-sidebar: rgba(255, 255, 255, 0.1);

  --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  --shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);

  --sidebar-width: 260px;
  --navbar-height: 60px;
  --radius: 0.5rem;
  --radius-lg: 0.75rem;
}

/* ── Base Typography ────────────────────────────────────────────────────── */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 0.9375rem;
  color: var(--text-primary);
  background-color: var(--bg-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

.text-mono {
  font-family: 'SF Mono', 'Fira Code', 'Fira Mono', Menlo, Consolas, monospace;
}

/* ── Layout ─────────────────────────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-width);
  padding: 1.5rem 2rem;
  min-height: 100vh;
  padding-top: calc(var(--navbar-height) + 1.5rem);
  transition: margin-left 0.3s ease;
}

/* ── Sidebar ────────────────────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  z-index: 1040;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
  overflow: hidden;
}

.sidebar-header {
  padding: 1.25rem 1.25rem;
  border-bottom: 1px solid var(--border-sidebar);
  flex-shrink: 0;
}

.sidebar-menu {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 0;
}

.sidebar-menu::-webkit-scrollbar {
  width: 4px;
}

.sidebar-menu::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
}

.menu-section {
  margin-bottom: 0.5rem;
}

.menu-section-label {
  padding: 0.5rem 1.25rem 0.25rem;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
}

.menu-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1.25rem;
  margin: 0.1rem 0.5rem;
  border-radius: var(--radius);
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.15s ease;
  cursor: pointer;
  border-left: 3px solid transparent;
}

.menu-link:hover {
  background: var(--bg-sidebar-hover);
  color: rgba(255, 255, 255, 0.9);
}

.menu-link.active {
  background: var(--bg-sidebar-active);
  color: var(--text-white);
  border-left-color: var(--ontech-accent);
}

.menu-link i {
  width: 1.25rem;
  text-align: center;
  font-size: 0.9rem;
}

.sidebar-badge {
  margin-left: auto;
  background: var(--ontech-danger);
  color: var(--text-white);
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border-sidebar);
  flex-shrink: 0;
}

.sidebar-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--ontech-accent), var(--ontech-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-white);
  flex-shrink: 0;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1035;
}

/* ── Top Navbar ─────────────────────────────────────────────────────────── */
.top-navbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  height: var(--navbar-height);
  background: var(--bg-white);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  z-index: 1030;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  transition: left 0.3s ease;
}

.navbar-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--text-secondary);
  padding: 0.25rem 0.5rem;
  margin-right: 0.75rem;
  cursor: pointer;
  border-radius: var(--radius);
}

.navbar-toggle:hover {
  background: var(--bg-light);
  color: var(--text-primary);
}

.navbar-notifications .dropdown-toggle::after {
  display: none;
}

.navbar-notifications .badge {
  position: absolute;
  top: -2px;
  right: -4px;
  font-size: 0.6rem;
  padding: 0.2em 0.45em;
}

.notification-item {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-light);
  transition: background 0.15s ease;
  text-decoration: none;
  color: inherit;
  display: block;
}

.notification-item:hover {
  background: var(--bg-light);
}

.notification-item.unread {
  border-left: 3px solid var(--ontech-accent);
  background: rgba(13, 110, 253, 0.03);
}

.notification-msg {
  font-size: 0.8125rem;
  line-height: 1.5;
  margin-bottom: 0.2rem;
  color: var(--text-primary);
}

.notification-time {
  font-size: 0.7rem;
  color: var(--text-muted);
}

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

.card-header {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border-color);
  font-weight: 600;
  padding: 1rem 1.25rem;
}

.card-header h5, .card-header h6 {
  margin: 0;
}

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

.stat-card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.stat-card-icon.bg-primary-subtle { background: rgba(13, 110, 253, 0.12); color: #0d6efd; }
.stat-card-icon.bg-success-subtle { background: rgba(25, 135, 84, 0.12); color: #198754; }
.stat-card-icon.bg-warning-subtle { background: rgba(255, 193, 7, 0.12); color: #cc9a00; }
.stat-card-icon.bg-danger-subtle { background: rgba(220, 53, 69, 0.12); color: #dc3545; }
.stat-card-icon.bg-info-subtle { background: rgba(13, 202, 240, 0.12); color: #0aa2c0; }

.stat-card-value {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 0.15rem;
}

.stat-card-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.stat-card-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* ── Page Header ────────────────────────────────────────────────────────── */
.page-header {
  margin-bottom: 1.5rem;
}

.page-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.page-header .page-subtitle {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.page-header .breadcrumb {
  font-size: 0.8125rem;
  margin-bottom: 0.5rem;
}

.page-header .breadcrumb-item + .breadcrumb-item::before {
  content: "/";
  color: var(--text-muted);
}

/* ── Status Badges ──────────────────────────────────────────────────────── */
.badge-status-open { background-color: rgba(13, 202, 240, 0.12); color: #0aa2c0; }
.badge-status-in_progress { background-color: rgba(255, 193, 7, 0.15); color: #997404; }
.badge-status-review { background-color: rgba(253, 126, 20, 0.15); color: #d6630e; }
.badge-status-approved { background-color: rgba(25, 135, 84, 0.12); color: #198754; }
.badge-status-rejected { background-color: rgba(220, 53, 69, 0.12); color: #dc3545; }
.badge-status-pending { background-color: rgba(255, 193, 7, 0.15); color: #997404; }
.badge-status-completed { background-color: rgba(25, 135, 84, 0.12); color: #198754; }

.badge-priority-high { background-color: rgba(220, 53, 69, 0.12); color: #dc3545; }
.badge-priority-medium { background-color: rgba(255, 193, 7, 0.15); color: #997404; }
.badge-priority-low { background-color: rgba(108, 117, 125, 0.12); color: #6c757d; }

[class*="badge-status-"],
[class*="badge-priority-"] {
  display: inline-block;
  padding: 0.3em 0.65em;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 0.375rem;
  text-transform: capitalize;
}

/* ── Table Overrides ────────────────────────────────────────────────────── */
.table thead th {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border-color);
  padding: 0.75rem;
  white-space: nowrap;
}

.table tbody td {
  padding: 0.75rem;
  vertical-align: middle;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--border-light);
}

.table-hover tbody tr:hover td {
  background-color: rgba(0, 0, 0, 0.02);
}

.table th .sort-icon {
  margin-left: 0.25rem;
  font-size: 0.7rem;
  opacity: 0.5;
}

.table th:hover .sort-icon {
  opacity: 1;
}

.table th {
  cursor: pointer;
}

.table th:hover {
  color: var(--ontech-accent);
}

/* ── Modal Refinements ──────────────────────────────────────────────────── */
.modal-content {
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.modal-header {
  border-bottom: 1px solid var(--border-light);
  padding: 1.25rem 1.5rem;
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  border-top: 1px solid var(--border-light);
  padding: 1rem 1.5rem;
}

/* ── Form Enhancements ──────────────────────────────────────────────────── */
.form-control:focus,
.form-select:focus {
  border-color: var(--ontech-accent);
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

.form-label {
  font-weight: 500;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

/* ── Search Bar ─────────────────────────────────────────────────────────── */
.search-bar .form-control {
  border-radius: var(--radius);
}

.search-bar .input-group-text {
  background: var(--bg-white);
  border-color: var(--border-color);
}

/* ── Pagination ─────────────────────────────────────────────────────────── */
.pagination-container {
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}

.pagination-container .page-link {
  border-radius: var(--radius);
  font-size: 0.8125rem;
  padding: 0.35rem 0.75rem;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.pagination-container .page-item.active .page-link {
  background-color: var(--ontech-primary);
  border-color: var(--ontech-primary);
  color: var(--text-white);
}

.pagination-info {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-left: 0.75rem;
}

/* ── Code Preview / Diff ────────────────────────────────────────────────── */
.code-preview {
  background: #1e1e2e;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1rem;
  font-family: 'SF Mono', 'Fira Code', Consolas, monospace;
  font-size: 0.8125rem;
  line-height: 1.7;
  max-height: 350px;
  overflow-y: auto;
  white-space: pre-wrap;
  color: #c0caf5;
}

.diff-view {
  max-height: 350px;
  overflow-y: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  background: var(--bg-white);
}

.diff-line {
  padding: 0.15rem 0.75rem;
  font-family: 'SF Mono', 'Fira Code', Consolas, monospace;
  font-size: 0.75rem;
  line-height: 1.7;
  white-space: pre-wrap;
}

.diff-line-add, .diff-add {
  background: rgba(25, 135, 84, 0.08);
  color: #198754;
}

.diff-line-remove, .diff-remove {
  background: rgba(220, 53, 69, 0.08);
  color: #dc3545;
}

.diff-line-context, .diff-context {
  color: var(--text-muted);
}

/* ── Review Tabs ────────────────────────────────────────────────────────── */
.review-tabs .nav-link {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
}

.review-tabs .nav-link.active {
  background: var(--bg-light);
  color: var(--text-primary);
}

/* ── Charts ─────────────────────────────────────────────────────────────── */
.chart-card canvas {
  max-height: 280px;
}

/* ── KPI Cards (Analytics) ──────────────────────────────────────────────── */
.kpi-card {
  text-align: center;
  padding: 1.5rem;
}

.kpi-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--ontech-primary);
  margin-bottom: 0.25rem;
}

.kpi-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
  letter-spacing: 0.03em;
}

/* ── Audit Log ──────────────────────────────────────────────────────────── */
.log-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.8125rem;
}

.log-item:last-child {
  border-bottom: none;
}

.log-time {
  color: var(--text-muted);
  font-size: 0.75rem;
  flex-shrink: 0;
  font-family: 'SF Mono', Consolas, monospace;
}

.log-action {
  font-weight: 600;
  color: var(--ontech-accent);
  font-size: 0.8125rem;
}

.log-detail {
  color: var(--text-secondary);
  font-size: 0.8125rem;
}

/* ── Comments ───────────────────────────────────────────────────────────── */
.comment-item {
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  border-radius: var(--radius);
  background: var(--bg-light);
  font-size: 0.8125rem;
}

.comment-item.admin {
  border-left: 3px solid var(--ontech-accent);
}

.comment-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
  display: flex;
  justify-content: space-between;
}

.comment-text {
  line-height: 1.5;
  color: var(--text-primary);
}

/* ── Test Results ───────────────────────────────────────────────────────── */
.test-score-bar {
  height: 6px;
  background: var(--border-light);
  border-radius: 3px;
  overflow: hidden;
  margin: 0.5rem 0;
}

.test-score-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s ease;
}

.test-result-item {
  padding: 0.6rem 0.75rem;
  margin-bottom: 0.4rem;
  border-radius: var(--radius);
  background: var(--bg-light);
  font-size: 0.8125rem;
  border-left: 3px solid var(--border-color);
}

.test-result-item.passed { border-left-color: var(--ontech-success); }
.test-result-item.failed { border-left-color: var(--ontech-danger); }
.test-result-item.error { border-left-color: var(--ontech-warning); }

.test-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 0.4rem;
}

.test-dot.passed { background: var(--ontech-success); }
.test-dot.failed { background: var(--ontech-danger); }
.test-dot.error { background: var(--ontech-warning); }

/* ── Workspace Layout (Task Editor) ─────────────────────────────────────── */
.workspace-layout {
  display: grid;
  grid-template-columns: 240px 1fr 360px;
  height: calc(100vh - var(--navbar-height) - 40px);
  overflow: hidden;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  background: var(--bg-white);
}

.file-panel {
  background: var(--bg-white);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.editor-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-white);
}

.ai-panel {
  background: var(--bg-white);
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── File Panel ─────────────────────────────────────────────────────────── */
.file-panel .panel-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
}

.file-panel .panel-tab {
  flex: 1;
  padding: 0.6rem 0.5rem;
  text-align: center;
  font-size: 0.7rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-muted);
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  font-weight: 600;
  transition: all 0.15s ease;
}

.file-panel .panel-tab.active {
  color: var(--ontech-accent);
  border-bottom-color: var(--ontech-accent);
}

.file-panel .panel-tab:hover {
  color: var(--text-primary);
}

.file-panel .panel-content {
  flex: 1;
  overflow-y: auto;
  display: none;
}

.file-panel .panel-content.active {
  display: flex;
  flex-direction: column;
}

.file-item {
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  transition: all 0.15s ease;
  margin: 0.1rem 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.file-item:hover {
  background: var(--bg-light);
  color: var(--text-primary);
}

.file-item.active {
  background: rgba(13, 110, 253, 0.08);
  color: var(--ontech-accent);
  border-left: 2px solid var(--ontech-accent);
}

.file-icon { font-size: 0.9rem; }
.file-name { flex: 1; word-break: break-all; font-size: 0.75rem; }

/* ── Editor Panel ───────────────────────────────────────────────────────── */
.editor-topbar {
  padding: 0.5rem 1rem;
  background: var(--bg-light);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.current-file {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  flex: 1;
  font-family: 'SF Mono', Consolas, monospace;
}

.editor-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.editor-wrapper .CodeMirror {
  height: 100%;
  font-size: 0.8125rem;
  line-height: 1.6;
}

.no-file {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.75rem;
  color: var(--text-muted);
}

.no-file i { font-size: 2.5rem; }
.no-file p { font-size: 0.875rem; }

/* ── AI Chat Panel ──────────────────────────────────────────────────────── */
.ai-header {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.ai-dot {
  width: 8px;
  height: 8px;
  background: var(--ontech-success);
  border-radius: 50%;
  animation: ai-pulse 2s infinite;
}

@keyframes ai-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.ai-title {
  font-size: 0.875rem;
  font-weight: 600;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.msg {
  padding: 0.75rem;
  border-radius: var(--radius);
  font-size: 0.8125rem;
  line-height: 1.6;
  max-width: 100%;
}

.msg-user {
  background: rgba(13, 110, 253, 0.08);
  border: 1px solid rgba(13, 110, 253, 0.15);
  align-self: flex-end;
  font-family: 'SF Mono', Consolas, monospace;
  font-size: 0.8125rem;
}

.msg-ai {
  background: var(--bg-light);
  border: 1px solid var(--border-light);
}

.msg-ai pre {
  background: #1e1e2e;
  padding: 0.6rem;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 0.5rem 0;
  font-size: 0.75rem;
  color: #c0caf5;
}

.msg-system {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.chat-input-area {
  padding: 0.75rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.chat-input {
  width: 100%;
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.8125rem;
  resize: none;
  min-height: 60px;
  transition: border-color 0.15s;
}

.chat-input:focus {
  border-color: var(--ontech-accent);
  outline: none;
  box-shadow: 0 0 0 0.15rem rgba(13, 110, 253, 0.1);
}

.typing {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 0.5rem;
}

.typing span {
  width: 6px;
  height: 6px;
  background: var(--ontech-accent);
  border-radius: 50%;
  animation: typing-bounce 1s infinite;
}

.typing span:nth-child(2) { animation-delay: 0.15s; }
.typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-6px); }
}

/* ── Task Workspace Topbar ──────────────────────────────────────────────── */
.workspace-topbar {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

.workspace-topbar .task-title {
  font-weight: 600;
  font-size: 0.9375rem;
  flex: 1;
}

.security-bar {
  padding: 0.5rem 1rem;
  background: #fff3cd;
  border-top: 1px solid #ffc107;
  font-size: 0.75rem;
  color: #856404;
  text-align: center;
  flex-shrink: 0;
}

/* ── Session Timeout Modal ──────────────────────────────────────────────── */
#sessionTimeoutModal .modal-header {
  background: #fff3cd;
  border-bottom: 1px solid #ffc107;
}

#sessionTimeoutModal .countdown {
  font-size: 2rem;
  font-weight: 700;
  color: var(--ontech-danger);
}

/* ── Admin SPA Tabs ────────────────────────────────────────────────────── */
.admin-tab {
  display: none;
}

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

/* ── Utility ────────────────────────────────────────────────────────────── */
.fade-in {
  animation: fadeIn 0.3s ease;
}

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

.cursor-pointer { cursor: pointer; }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.show {
    transform: translateX(0);
  }

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

  .main-content {
    margin-left: 0;
  }

  .top-navbar {
    left: 0;
  }

  .navbar-toggle {
    display: block;
  }

  .workspace-layout {
    grid-template-columns: 1fr;
    height: auto;
  }

  .file-panel,
  .ai-panel {
    display: none;
  }
}

@media (max-width: 767.98px) {
  .main-content {
    padding: 1rem;
    padding-top: calc(var(--navbar-height) + 1rem);
  }

  h1 { font-size: 1.35rem; }

  .stat-card {
    padding: 1rem;
  }

  .stat-card-value {
    font-size: 1.35rem;
  }
}
