/* Katalog projektu - Dark Theme */

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #0f0f1a;
  color: #e0e0e0;
  min-height: 100vh;
}

a { color: #7c8cf8; text-decoration: none; }
a:hover { text-decoration: underline; }

/* Header */
.header {
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  padding: 12px 32px;
  border-bottom: 1px solid #2a2a4a;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.header-left {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.header h1 { font-size: 20px; color: #7c8cf8; }
.header h1 a { color: inherit; text-decoration: none; }
.header-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.header-user {
  font-size: 13px;
  color: #888;
  margin-right: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Navigation */
.nav-links {
  display: flex;
  gap: 4px;
  align-items: center;
}
.nav-link {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #a0a0b8;
  transition: all 0.2s;
  text-decoration: none;
}
.nav-link:hover {
  background: rgba(124, 140, 248, 0.1);
  color: #c0c0f0;
  text-decoration: none;
}
.nav-link.active {
  background: rgba(124, 140, 248, 0.2);
  color: #7c8cf8;
}

/* Buttons */
.btn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: inherit;
}
.btn-primary { background: #7c8cf8; color: #fff; }
.btn-primary:hover { background: #6b7bf7; text-decoration: none; }
.btn-secondary { background: #2a2a4a; color: #c0c0d0; }
.btn-secondary:hover { background: #3a3a5a; text-decoration: none; }
.btn-danger { background: #e74c3c; color: #fff; }
.btn-danger:hover { background: #c0392b; text-decoration: none; }
.btn-success { background: #27ae60; color: #fff; }
.btn-success:hover { background: #219a52; text-decoration: none; }
.btn-small { padding: 4px 10px; font-size: 12px; }

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

/* Search */
.search-bar { margin-bottom: 24px; }
.search-bar input {
  width: 100%;
  padding: 12px 16px;
  background: #1a1a2e;
  border: 1px solid #2a2a4a;
  border-radius: 8px;
  color: #e0e0e0;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
}
.search-bar input:focus { border-color: #7c8cf8; }
.search-bar input::placeholder { color: #555; }

/* Stats */
.stats {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.stat-card {
  background: #1a1a2e;
  border: 1px solid #2a2a4a;
  border-radius: 8px;
  padding: 16px 24px;
  flex: 1;
  min-width: 150px;
}
.stat-card .label {
  font-size: 12px;
  color: #888;
  text-transform: uppercase;
}
.stat-card .value {
  font-size: 28px;
  font-weight: 700;
  color: #7c8cf8;
  margin-top: 4px;
}
.stat-card .value.small { font-size: 14px; margin-top: 10px; }

/* Project list */
.project-list { display: flex; flex-direction: column; gap: 12px; }
.project-card {
  background: #1a1a2e;
  border: 1px solid #2a2a4a;
  border-radius: 10px;
  padding: 20px 24px;
  cursor: pointer;
  transition: all 0.2s;
  display: block;
  text-decoration: none;
  color: inherit;
}
.project-card:hover {
  border-color: #7c8cf8;
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(124, 140, 248, 0.1);
  text-decoration: none;
}
.project-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.project-card h3 { font-size: 18px; color: #e8e8f0; }
.project-card .date { font-size: 12px; color: #666; white-space: nowrap; }
.project-card .desc {
  margin-top: 8px;
  font-size: 14px;
  color: #999;
  line-height: 1.5;
}
.project-card .tags { margin-top: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.tag {
  background: #2a2a4a;
  color: #7c8cf8;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
}
.tag-link { cursor: pointer; }
.tag-link:hover { background: #3a3a5a; }

/* Detail */
.detail-section {
  background: #1a1a2e;
  border: 1px solid #2a2a4a;
  border-radius: 10px;
  padding: 24px;
  margin-bottom: 20px;
}
.detail-section h2 {
  font-size: 22px;
  color: #7c8cf8;
  margin-bottom: 8px;
}
.detail-section h3 {
  font-size: 16px;
  color: #a0a8f8;
  margin-bottom: 12px;
  margin-top: 20px;
}
.detail-meta {
  font-size: 13px;
  color: #666;
  margin-bottom: 16px;
}
.detail-description {
  background: #0f0f1a;
  border-radius: 8px;
  padding: 16px;
  line-height: 1.6;
  font-size: 14px;
  color: #ccc;
  white-space: pre-wrap;
}
.detail-actions {
  margin-top: 16px;
  display: flex;
  gap: 8px;
}

/* Functionality map */
.func-map { display: flex; flex-direction: column; gap: 8px; }
.func-item {
  background: #0f0f1a;
  border-left: 3px solid #7c8cf8;
  border-radius: 0 8px 8px 0;
  padding: 12px 16px;
}
.func-item .func-name {
  font-weight: 600;
  color: #e0e0f0;
  font-size: 14px;
}
.func-item .func-desc {
  color: #888;
  font-size: 13px;
  margin-top: 4px;
}

/* Forms */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 13px;
  color: #aaa;
  margin-bottom: 6px;
  font-weight: 500;
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px 14px;
  background: #0f0f1a;
  border: 1px solid #2a2a4a;
  border-radius: 6px;
  color: #e0e0e0;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus { border-color: #7c8cf8; }
.form-group textarea { resize: vertical; min-height: 80px; }
.form-group select option { background: #0f0f1a; }

/* Dynamic form entries */
.func-entries { display: flex; flex-direction: column; gap: 8px; }
.func-entry {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.func-entry input { flex: 1; }
.func-entry .remove-func {
  background: #e74c3c;
  color: #fff;
  border: none;
  border-radius: 4px;
  width: 32px;
  height: 38px;
  cursor: pointer;
  font-size: 18px;
  flex-shrink: 0;
}
.func-entry .remove-func:hover { background: #c0392b; }

/* Login */
.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}
.login-box {
  background: #1a1a2e;
  border: 1px solid #2a2a4a;
  border-radius: 12px;
  padding: 40px;
  width: 100%;
  max-width: 400px;
}
.login-box h1 {
  color: #7c8cf8;
  font-size: 24px;
  text-align: center;
  margin-bottom: 8px;
}
.login-box .subtitle {
  color: #666;
  text-align: center;
  margin-bottom: 24px;
  font-size: 14px;
}

/* Alerts */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
}
.alert-error {
  background: rgba(231, 76, 60, 0.15);
  border: 1px solid #e74c3c;
  color: #e74c3c;
}
.alert-success {
  background: rgba(39, 174, 96, 0.15);
  border: 1px solid #27ae60;
  color: #27ae60;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-top: 24px;
  flex-wrap: wrap;
}
.pagination a,
.pagination span {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 14px;
  text-decoration: none;
}
.pagination a {
  background: #2a2a4a;
  color: #c0c0d0;
}
.pagination a:hover {
  background: #3a3a5a;
  text-decoration: none;
}
.pagination .active {
  background: #7c8cf8;
  color: #fff;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #555;
}
.empty-state p { font-size: 16px; }

/* Breadcrumb */
.breadcrumb {
  margin-bottom: 20px;
  font-size: 14px;
  color: #666;
}
.breadcrumb a { color: #7c8cf8; }

/* ============================================================
   Badges
   ============================================================ */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  background: #2a2a4a;
  color: #c0c0d0;
}
.badge-success { background: rgba(39, 174, 96, 0.2); color: #27ae60; }
.badge-danger { background: rgba(231, 76, 60, 0.2); color: #e74c3c; }
.badge-info { background: rgba(124, 140, 248, 0.2); color: #7c8cf8; }
.badge-role {
  background: rgba(124, 140, 248, 0.15);
  color: #7c8cf8;
  font-size: 10px;
  padding: 1px 6px;
}

/* ============================================================
   Data Tables
   ============================================================ */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table th {
  text-align: left;
  padding: 10px 12px;
  background: #1a1a2e;
  border-bottom: 2px solid #2a2a4a;
  color: #888;
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 600;
  white-space: nowrap;
}
.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #1e1e35;
  vertical-align: middle;
}
.data-table tbody tr:hover {
  background: rgba(124, 140, 248, 0.04);
}
.data-table code {
  background: #0f0f1a;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'SF Mono', 'Fira Code', monospace;
}

/* ============================================================
   Tabs
   ============================================================ */
.tab-nav {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  border-bottom: 1px solid #2a2a4a;
  padding-bottom: 0;
  flex-wrap: wrap;
}
.tab-link {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  color: #888;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.2s;
  text-decoration: none;
}
.tab-link:hover {
  color: #c0c0f0;
  text-decoration: none;
}
.tab-link.active {
  color: #7c8cf8;
  border-bottom-color: #7c8cf8;
}
.tab-content {
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   Service Cards
   ============================================================ */
.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.service-card {
  background: #1a1a2e;
  border: 1px solid #2a2a4a;
  border-radius: 10px;
  padding: 20px;
}
.service-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.service-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-green { background: #27ae60; box-shadow: 0 0 8px rgba(39, 174, 96, 0.4); }
.dot-red { background: #e74c3c; box-shadow: 0 0 8px rgba(231, 76, 60, 0.4); }
.service-details {
  font-size: 12px;
  color: #888;
  line-height: 1.8;
  margin-bottom: 12px;
}
.service-action {
  display: flex;
  gap: 8px;
}

/* ============================================================
   Diff Viewer
   ============================================================ */
.diff-viewer {
  background: #0a0a15;
  border: 1px solid #2a2a4a;
  border-radius: 8px;
  overflow: hidden;
  margin-top: 16px;
}
.diff-header {
  display: flex;
  justify-content: space-between;
  padding: 10px 16px;
  background: #1a1a2e;
  border-bottom: 1px solid #2a2a4a;
  font-size: 12px;
  color: #888;
  flex-wrap: wrap;
  gap: 8px;
}
.diff-old { color: #e74c3c; }
.diff-new { color: #27ae60; }
.diff-content {
  padding: 0;
  overflow-x: auto;
  font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace;
  font-size: 12px;
  line-height: 1.6;
}
.diff-line {
  padding: 1px 16px;
  white-space: pre;
  min-height: 1.6em;
}
.diff-context { color: #888; }
.diff-added { background: rgba(39, 174, 96, 0.12); color: #6fcf97; }
.diff-removed { background: rgba(231, 76, 60, 0.12); color: #f0a0a0; }
.diff-header-line { color: #7c8cf8; background: rgba(124, 140, 248, 0.08); }
.diff-skip {
  color: #555;
  text-align: center;
  padding: 4px 16px;
  background: rgba(255,255,255,0.02);
}

/* ============================================================
   Progress Bars
   ============================================================ */
.progress-bar {
  height: 6px;
  background: #0f0f1a;
  border-radius: 3px;
  margin-top: 8px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #27ae60, #7c8cf8);
  border-radius: 3px;
  transition: width 0.3s;
}

/* ============================================================
   Toggle Switch
   ============================================================ */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  vertical-align: middle;
  cursor: pointer;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: #2a2a4a;
  border-radius: 20px;
  transition: background 0.2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  left: 3px;
  bottom: 3px;
  background: #888;
  border-radius: 50%;
  transition: all 0.2s;
}
.toggle-switch input:checked + .toggle-slider { background: rgba(39, 174, 96, 0.3); }
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(16px);
  background: #27ae60;
}

/* Project link icon */
.project-link-icon {
  font-size: 14px;
  margin-left: 6px;
  color: #7c8cf8;
  text-decoration: none;
}
.project-link-icon:hover { color: #a0b0ff; text-decoration: none; }

/* ============================================================
   Versions Sidebar Layout
   ============================================================ */
.versions-layout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}
.versions-sidebar {
  width: 240px;
  flex-shrink: 0;
  position: sticky;
  top: 24px;
  background: #1a1a2e;
  border: 1px solid #2a2a4a;
  border-radius: 8px;
  overflow: hidden;
}
.sidebar-title {
  padding: 12px 16px;
  font-size: 11px;
  text-transform: uppercase;
  color: #888;
  font-weight: 600;
  border-bottom: 1px solid #2a2a4a;
}
.sidebar-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  font-size: 13px;
  color: #a0a0b8;
  text-decoration: none;
  transition: all 0.15s;
  border-left: 3px solid transparent;
}
.sidebar-item:hover {
  background: rgba(124, 140, 248, 0.06);
  color: #c0c0f0;
  text-decoration: none;
}
.sidebar-item.active {
  background: rgba(124, 140, 248, 0.1);
  color: #7c8cf8;
  border-left-color: #7c8cf8;
}
.sidebar-badge {
  background: #2a2a4a;
  color: #888;
  font-size: 11px;
  padding: 1px 8px;
  border-radius: 10px;
  font-weight: 600;
}
.sidebar-item.active .sidebar-badge {
  background: rgba(124, 140, 248, 0.2);
  color: #7c8cf8;
}
.versions-content {
  flex: 1;
  min-width: 0;
}

/* ============================================================
   Side-by-side Diff
   ============================================================ */
.diff-toggle {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
}
.diff-toggle-btn {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 500;
  background: #2a2a4a;
  color: #a0a0b8;
  border: 1px solid #3a3a5a;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}
.diff-toggle-btn:hover {
  background: #3a3a5a;
}
.diff-toggle-btn.active {
  background: rgba(124, 140, 248, 0.2);
  color: #7c8cf8;
  border-color: #7c8cf8;
}
.diff-sbs-container {
  display: flex;
  border: 1px solid #2a2a4a;
  border-radius: 8px;
  overflow: hidden;
  background: #0a0a15;
  margin-top: 16px;
}
.diff-sbs-pane {
  flex: 1;
  overflow: auto;
  max-height: 70vh;
  font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace;
  font-size: 12px;
  line-height: 1.6;
}
.diff-sbs-pane + .diff-sbs-pane {
  border-left: 2px solid #2a2a4a;
}
.diff-sbs-header {
  padding: 8px 16px;
  background: #1a1a2e;
  border-bottom: 1px solid #2a2a4a;
  font-size: 12px;
  color: #888;
  position: sticky;
  top: 0;
  z-index: 1;
}
.diff-sbs-row {
  display: flex;
  min-height: 1.6em;
}
.diff-sbs-num {
  width: 45px;
  flex-shrink: 0;
  text-align: right;
  padding: 0 8px 0 4px;
  color: #555;
  border-right: 1px solid #1e1e35;
  user-select: none;
}
.diff-sbs-text {
  flex: 1;
  padding: 0 8px;
  white-space: pre;
  overflow: hidden;
}
.diff-sbs-equal .diff-sbs-text { color: #888; }
.diff-sbs-removed { background: rgba(231, 76, 60, 0.1); }
.diff-sbs-removed .diff-sbs-text { color: #f0a0a0; }
.diff-sbs-added { background: rgba(39, 174, 96, 0.1); }
.diff-sbs-added .diff-sbs-text { color: #6fcf97; }
.diff-sbs-changed { background: rgba(230, 160, 50, 0.1); }
.diff-sbs-changed .diff-sbs-text { color: #e8c87a; }
.diff-sbs-empty {
  background: rgba(255, 255, 255, 0.02);
}

/* ============================================================
   Syntax Highlighting Tokens (One Dark)
   ============================================================ */
.sh-keyword { color: #c678dd; }
.sh-string { color: #98c379; }
.sh-comment { color: #5c6370; font-style: italic; }
.sh-variable { color: #e06c75; }
.sh-number { color: #d19a66; }
.sh-tag { color: #e06c75; }
.sh-attr { color: #d19a66; }
.sh-prop { color: #61afef; }
.sh-func { color: #61afef; }

/* ============================================================
   Toast Notifications
   ============================================================ */
.toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  border: 1px solid;
  pointer-events: auto;
  animation: toastSlideIn 0.3s ease;
  max-width: 400px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}
.toast-success {
  background: #1a2e1a;
  border-color: #27ae60;
  color: #6fcf97;
}
.toast-error {
  background: #2e1a1a;
  border-color: #e74c3c;
  color: #f0a0a0;
}
.toast-fade-out {
  animation: toastFadeOut 0.3s ease forwards;
}
@keyframes toastSlideIn {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes toastFadeOut {
  from { opacity: 1; }
  to { opacity: 0; transform: translateY(-10px); }
}

/* ============================================================
   Activity Feed
   ============================================================ */
.activity-feed {
  display: flex;
  flex-direction: column;
  background: #1a1a2e;
  border: 1px solid #2a2a4a;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 24px;
}
.activity-feed-title {
  padding: 14px 20px;
  font-size: 14px;
  font-weight: 600;
  color: #a0a8f8;
  border-bottom: 1px solid #2a2a4a;
}
.activity-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  border-bottom: 1px solid rgba(42, 42, 74, 0.5);
  font-size: 13px;
  transition: background 0.15s;
}
.activity-item:last-child { border-bottom: none; }
.activity-item:hover { background: rgba(124, 140, 248, 0.04); }
.activity-item .activity-file {
  flex: 1;
  min-width: 0;
}
.activity-item .activity-file a {
  color: #c0c0f0;
  font-weight: 500;
}
.activity-item .activity-path {
  color: #555;
  font-size: 11px;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.activity-item .activity-time {
  color: #666;
  font-size: 12px;
  white-space: nowrap;
}

/* ============================================================
   Code Viewer
   ============================================================ */
.code-viewer {
  background: #0a0a15;
  border: 1px solid #2a2a4a;
  border-radius: 8px;
  overflow: auto;
  margin-top: 16px;
}
.code-viewer pre {
  padding: 16px;
  margin: 0;
  font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.6;
  color: #c0c0d0;
  overflow-x: auto;
}

/* ============================================================
   File Manager
   ============================================================ */
.fm-project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.fm-project-card {
  background: #1a1a2e;
  border: 1px solid #2a2a4a;
  border-radius: 10px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s;
}
.fm-project-card:hover {
  border-color: #7c8cf8;
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(124, 140, 248, 0.1);
}
.fm-project-card h3 {
  font-size: 16px;
  color: #e8e8f0;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.fm-project-card .fm-card-stats {
  font-size: 12px;
  color: #888;
  display: flex;
  gap: 12px;
  margin-bottom: 10px;
}
.fm-health-bar {
  height: 4px;
  background: #2a2a4a;
  border-radius: 2px;
  overflow: hidden;
}
.fm-health-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s;
}
.fm-health-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.fm-health-dot.green { background: #27ae60; box-shadow: 0 0 6px rgba(39, 174, 96, 0.4); }
.fm-health-dot.yellow { background: #e67e22; box-shadow: 0 0 6px rgba(230, 126, 34, 0.4); }
.fm-health-dot.red { background: #e74c3c; box-shadow: 0 0 6px rgba(231, 76, 60, 0.4); }

/* Breadcrumb */
.fm-breadcrumb {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  flex-wrap: wrap;
}
.fm-breadcrumb a {
  color: #7c8cf8;
  cursor: pointer;
  text-decoration: none;
}
.fm-breadcrumb a:hover { text-decoration: underline; }
.fm-breadcrumb .fm-bc-sep { color: #555; margin: 0 2px; }
.fm-breadcrumb .fm-bc-current { color: #e0e0e0; font-weight: 500; }

/* Context Menu */
.fm-context-menu {
  position: fixed;
  background: #1e1e35;
  border: 1px solid #3a3a5a;
  border-radius: 8px;
  padding: 6px 0;
  min-width: 180px;
  z-index: 10000;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}
.fm-context-menu .fm-ctx-item {
  padding: 8px 16px;
  font-size: 13px;
  color: #c0c0d0;
  cursor: pointer;
  transition: background 0.1s;
}
.fm-context-menu .fm-ctx-item:hover {
  background: rgba(124, 140, 248, 0.15);
  color: #e0e0f0;
}
.fm-context-menu .fm-ctx-sep {
  height: 1px;
  background: #2a2a4a;
  margin: 4px 0;
}

/* Preview Overlay */
.fm-preview-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 9000;
  display: flex;
  justify-content: flex-end;
  animation: fadeIn 0.15s ease;
}
.fm-preview-panel {
  width: 60%;
  max-width: 900px;
  background: #12121f;
  border-left: 1px solid #2a2a4a;
  display: flex;
  flex-direction: column;
  animation: fmSlideIn 0.2s ease;
}
@keyframes fmSlideIn {
  from { transform: translateX(40px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
.fm-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid #2a2a4a;
  background: #1a1a2e;
  flex-shrink: 0;
}
.fm-preview-header strong { color: #e0e0f0; font-size: 14px; }
.fm-preview-body {
  flex: 1;
  overflow: auto;
  padding: 0;
}
.fm-preview-body pre {
  padding: 16px;
  margin: 0;
  font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.6;
  color: #c0c0d0;
  overflow-x: auto;
  white-space: pre;
}
.fm-preview-body img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 20px auto;
}
.fm-preview-info {
  padding: 30px 20px;
  text-align: center;
  color: #888;
  font-size: 14px;
}

/* Info Modal */
.fm-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 9500;
  display: flex;
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.15s ease;
}
.fm-modal-card {
  background: #12121f;
  border: 1px solid #2a2a4a;
  border-radius: 10px;
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  overflow: auto;
}
.fm-info-row {
  display: flex;
  padding: 8px 0;
  border-bottom: 1px solid #1e1e35;
  font-size: 13px;
}
.fm-info-row:last-child { border-bottom: none; }
.fm-info-label {
  width: 110px;
  flex-shrink: 0;
  color: #888;
  font-weight: 500;
}
.fm-info-value {
  color: #e0e0e0;
  word-break: break-all;
}

/* Editor Panel */
.fm-editor-panel {
  width: 70%;
  max-width: 1100px;
  background: #12121f;
  border-left: 1px solid #2a2a4a;
  display: flex;
  flex-direction: column;
  animation: fmSlideIn 0.2s ease;
}
.fm-editor-title-bar {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
}
.fm-editor-title-bar strong {
  color: #e0e0f0;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fm-editor-body {
  flex: 1;
  display: flex;
  overflow: hidden;
}
.fm-editor-wrap {
  position: relative;
  flex: 1;
  overflow: hidden;
}
.fm-editor-highlight {
  position: absolute;
  inset: 0;
  padding: 16px;
  margin: 0;
  font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.6;
  tab-size: 4;
  white-space: pre;
  overflow: hidden;
  color: #c0c0d0;
  background: #0a0a15;
  pointer-events: none;
  z-index: 1;
  border: none;
}
.fm-editor-highlight code {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  tab-size: inherit;
}
.fm-editor-textarea {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 16px;
  margin: 0;
  border: none;
  outline: none;
  resize: none;
  background: transparent;
  color: transparent;
  caret-color: #e0e0e0;
  font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.6;
  tab-size: 4;
  white-space: pre;
  overflow: auto;
  z-index: 2;
}
.fm-editor-textarea::selection {
  background: rgba(124, 140, 248, 0.3);
  color: transparent;
}
.fm-editor-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 16px;
  background: #1a1a2e;
  border-top: 1px solid #2a2a4a;
  font-size: 11px;
  color: #666;
  flex-shrink: 0;
}
.fm-editor-readonly {
  opacity: 0.7;
}
.fm-editor-dirty {
  color: #e67e22;
}

/* File table health icons */
.fm-file-icon { font-size: 16px; text-align: center; }
.fm-row-clickable { cursor: pointer; }
.fm-row-clickable:hover { background: rgba(124, 140, 248, 0.08) !important; }
.fm-perm-bad { color: #e74c3c; font-weight: 600; }
.fm-perm-ok { color: #888; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 768px) {
  .header { padding: 12px 16px; }
  .header-left { gap: 12px; }
  .nav-links { gap: 2px; }
  .nav-link { padding: 4px 8px; font-size: 12px; }
  .container { padding: 16px; }
  .stats { flex-direction: column; }
  .func-entry { flex-direction: column; }
  .func-entry .remove-func { width: 100%; height: auto; padding: 6px; }
  .service-grid { grid-template-columns: 1fr; }
  .data-table { font-size: 12px; }
  .data-table th, .data-table td { padding: 8px 6px; }
  .tab-nav { gap: 0; }
  .tab-link { padding: 8px 12px; font-size: 13px; }
  .versions-layout { flex-direction: column; }
  .versions-sidebar { width: 100%; position: static; }
  .diff-sbs-container { flex-direction: column; }
  .diff-sbs-pane + .diff-sbs-pane { border-left: none; border-top: 2px solid #2a2a4a; }
  .diff-sbs-pane { max-height: 50vh; }
  .toast-container { left: 16px; right: 16px; }
  .toast { max-width: 100%; }
  .fm-project-grid { grid-template-columns: 1fr; }
  .fm-preview-panel { width: 100%; max-width: 100%; }
  .fm-editor-panel { width: 100%; max-width: 100%; }
  .fm-modal-card { width: 95%; }
}
