/* ==========================================================================
   Sitro Versions-Studio — Design System (Warm, Elegant & Clean)
   ========================================================================== */

/* Dark Theme (Default) */
:root, [data-theme="dark"] {
  --bg-main: #0b0f19;
  --bg-sidebar: #0f1624;
  --bg-card: #151e30;
  --bg-card-hover: #1c273e;
  --bg-card-active: #202d47;
  --bg-input: #090d16;
  --bg-modal: #131b2c;
  --bg-elevated: #1a2438;

  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-card: rgba(255, 255, 255, 0.1);
  --border-focus: #6366f1;

  --text-main: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-soft: rgba(99, 102, 241, 0.15);

  --emerald: #10b981;
  --emerald-hover: #059669;
  --emerald-soft: rgba(16, 185, 129, 0.15);

  --amber: #f59e0b;
  --amber-soft: rgba(245, 158, 11, 0.15);

  --purple: #a855f7;
  --purple-soft: rgba(168, 85, 247, 0.15);

  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 24px -4px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 40px -8px rgba(0, 0, 0, 0.5);

  --code-bg: #070a10;
}

/* Light Theme (Daylight Mode) */
[data-theme="light"] {
  --bg-main: #f8fafc;
  --bg-sidebar: #f1f5f9;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-card-active: #f1f5f9;
  --bg-input: #ffffff;
  --bg-modal: #ffffff;
  --bg-elevated: #f1f5f9;

  --border-subtle: #e2e8f0;
  --border-card: #e2e8f0;
  --border-focus: #4f46e5;

  --text-main: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;

  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-soft: rgba(79, 70, 229, 0.1);

  --emerald: #10b981;
  --emerald-hover: #059669;
  --emerald-soft: rgba(16, 185, 129, 0.12);

  --amber: #d97706;
  --amber-soft: rgba(217, 119, 6, 0.12);

  --purple: #9333ea;
  --purple-soft: rgba(147, 51, 234, 0.12);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 8px 24px -4px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 20px 48px -12px rgba(0, 0, 0, 0.12);

  --code-bg: #1e293b;
}

/* Global Tokens */
:root {
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;
  --header-h: 70px;
  --sidebar-w: 380px;
}

/* ==========================================================================
   Reset & Base
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

.font-mono { font-family: var(--font-mono); }
.font-bold { font-weight: 700; }
.text-emerald { color: var(--emerald) !important; }
.text-amber { color: var(--amber) !important; }
.text-purple { color: var(--purple) !important; }
.text-indigo { color: var(--primary) !important; }
.text-muted { color: var(--text-muted) !important; }

.bg-emerald-soft { background: var(--emerald-soft) !important; }
.bg-indigo-soft { background: var(--primary-soft) !important; }
.bg-purple-soft { background: var(--purple-soft) !important; }

/* ==========================================================================
   Layout Structure
   ========================================================================== */
.app-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
}

/* Header */
.app-header {
  height: var(--header-h);
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  flex-shrink: 0;
  z-index: 30;
}

.header-left {
  display: flex;
  align-items: center;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-badge-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}
.brand-badge-icon svg {
  width: 20px;
  height: 20px;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-name {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
  line-height: 1.2;
}

.pro-tag {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.brand-tagline {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Stats Pill */
.global-stats-pill {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 6px 18px;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
}

.stat-bubble {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.stat-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.dot-purple { background: var(--primary); box-shadow: 0 0 8px var(--primary); }
.dot-amber { background: var(--amber); box-shadow: 0 0 8px var(--amber); }
.dot-green { background: var(--emerald); }

.stat-separator {
  width: 1px;
  height: 14px;
  background: var(--border-subtle);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}
.icon-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
}
.icon-btn svg { width: 18px; height: 18px; }

/* Main Workspace */
.main-workspace {
  display: flex;
  flex: 1;
  height: calc(100vh - var(--header-h));
  overflow: hidden;
  position: relative;
}

/* ==========================================================================
   Sidebar: Explorer & Draggable Resizer
   ========================================================================== */
.site-explorer {
  width: var(--sidebar-w);
  min-width: 280px;
  max-width: 650px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: 100%;
  position: relative;
  overflow: hidden;
}

/* Draggable Split Resizer */
.resizer-handle {
  width: 8px;
  background: transparent;
  cursor: col-resize;
  position: relative;
  z-index: 25;
  flex-shrink: 0;
  margin: 0 -4px;
  transition: background-color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.resizer-handle::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 3px;
  width: 2px;
  background: var(--border-subtle);
  transition: all 0.2s ease;
}

.resizer-handle:hover::after,
.resizer-handle.is-dragging::after {
  background: var(--primary);
  width: 3px;
  box-shadow: 0 0 10px var(--primary);
}

.explorer-header-box {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 14px;
  width: 17px;
  height: 17px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input-wrapper input {
  width: 100%;
  height: 40px;
  background: var(--bg-input);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 0 36px 0 40px;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 13px;
  outline: none;
  transition: all 0.2s ease;
}

.search-input-wrapper input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}

.clear-search-btn {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
}
.clear-search-btn:hover { color: var(--text-main); }

.pill-tabs-nav {
  display: flex;
  background: var(--bg-input);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  gap: 3px;
  overflow-x: auto;
}

.pill-tab {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  background: transparent;
  border: none;
  padding: 6px 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.pill-tab:hover {
  color: var(--text-main);
}

.pill-tab.active {
  background: var(--bg-card);
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}

.tab-badge {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  background: var(--border-subtle);
  font-family: var(--font-mono);
}

.badge-amber {
  background: var(--amber-soft);
  color: var(--amber);
}

/* Site Cards List */
.site-list-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.site-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-sm);
}

.site-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-card);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.site-card.active {
  background: var(--primary-soft);
  border-color: var(--primary);
  box-shadow: 0 0 0 1.5px var(--primary), var(--shadow-md);
}

.site-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.site-card-info {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

.site-icon-box {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}

.site-card-name {
  font-weight: 700;
  font-size: 13.5px;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-secondary);
  border-top: 1px solid var(--border-subtle);
  padding-top: 8px;
}

.site-card-commit-msg {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
  color: var(--text-secondary);
}

.tag-framework {
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

/* ==========================================================================
   Right Main: Versions & Canvas
   ========================================================================== */
.timeline-workspace {
  flex: 1;
  background: var(--bg-main);
  height: 100%;
  overflow-y: auto;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Empty State */
.empty-selection-state {
  margin: auto;
  text-align: center;
  max-width: 440px;
  padding: 50px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.empty-illustration {
  position: relative;
  width: 72px;
  height: 72px;
}

.empty-glow {
  position: absolute;
  inset: -10px;
  background: var(--primary);
  border-radius: 50%;
  filter: blur(20px);
  opacity: 0.25;
}

.empty-icon-circle {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  box-shadow: var(--shadow-md);
}
.empty-icon-circle svg { width: 34px; height: 34px; }

.empty-selection-state h3 {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-main);
}

.empty-selection-state p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Active Site Banner */
.site-active-view {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.site-view-banner {
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-subtle);
  padding: 22px 36px;
  position: sticky;
  top: 0;
  z-index: 15;
  backdrop-filter: blur(12px);
}

.site-banner-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.site-title-container {
  display: flex;
  align-items: center;
  gap: 16px;
}

.site-avatar-circle {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: var(--shadow-sm);
}

.title-with-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.active-site-name {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.badge-status-dirty {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 11.5px;
  font-weight: 600;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--amber);
  animation: pulse-ring 1.5s infinite;
}
@keyframes pulse-ring {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(245, 158, 11, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

.site-meta-subtitle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.meta-path {
  font-family: var(--font-mono);
  background: var(--bg-card);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

/* Uncommitted Soft Box */
.uncommitted-soft-box {
  background: var(--amber-soft);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.uncommitted-content {
  display: flex;
  align-items: center;
  gap: 14px;
}

.uncommitted-icon-wrap {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: rgba(245, 158, 11, 0.2);
  color: var(--amber);
  display: flex;
  align-items: center;
  justify-content: center;
}
.uncommitted-icon-wrap svg { width: 18px; height: 18px; }

.uncommitted-title {
  font-weight: 700;
  font-size: 13.5px;
  color: var(--amber);
}

.uncommitted-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Timeline Layout */
.timeline-body-wrap {
  padding: 32px 36px 80px;
  max-width: 960px;
  width: 100%;
}

.feed-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

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

.hint-pill {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.hint-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.dot-live { background: var(--emerald); box-shadow: 0 0 8px var(--emerald); }

/* Changelog Cards Feed */
.timeline-cards-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.version-entry-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
  position: relative;
}

.version-entry-card:hover {
  background: var(--bg-card-hover);
  box-shadow: var(--shadow-md);
}

.version-entry-card.is-live {
  border-color: rgba(16, 185, 129, 0.4);
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.2), var(--shadow-sm);
}

.version-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.version-badge-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pill-hash {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}
.pill-hash:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}

.badge-live-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: var(--emerald-soft);
  color: var(--emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.version-card-time {
  font-size: 12.5px;
  color: var(--text-muted);
}

.version-card-message {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.4;
}

.version-card-body {
  font-size: 13px;
  color: var(--text-secondary);
  background: var(--bg-input);
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  white-space: pre-wrap;
}

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

.author-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.author-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}

.version-card-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ==========================================================================
   Buttons & Form Controls
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-icon { width: 16px; height: 16px; }

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}
.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

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

.btn-emerald {
  background: var(--emerald);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}
.btn-emerald:hover {
  background: var(--emerald-hover);
  transform: translateY(-1px);
}

.btn-amber-soft {
  background: var(--amber);
  color: #0f172a;
  font-weight: 700;
}
.btn-amber-soft:hover {
  background: #d97706;
  color: #fff;
}

.btn-restore-soft {
  background: var(--emerald-soft);
  color: var(--emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.btn-restore-soft:hover {
  background: var(--emerald);
  color: #fff;
  border-color: var(--emerald);
}

/* ==========================================================================
   Modals & Overlays
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
  animation: fadeIn 0.15s ease;
}

.modal-dialog {
  background: var(--bg-modal);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 540px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: popIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-dialog-wide {
  max-width: 880px;
  height: 82vh;
}

.modal-head {
  padding: 22px 26px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
}

.modal-badge-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.modal-heading {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-main);
}

.modal-sub {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.modal-close {
  position: absolute;
  right: 22px;
  top: 22px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
}
.modal-close:hover { color: var(--text-main); }

.modal-content {
  padding: 24px 26px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
}

.modal-foot {
  padding: 18px 26px;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.restore-details-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.detail-line {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

.detail-label { color: var(--text-muted); flex-shrink: 0; }
.detail-val { font-weight: 600; text-align: right; word-break: break-all; }

.info-callout {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--primary-soft);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-size: 13px;
  color: var(--text-main);
  line-height: 1.5;
}
.info-callout svg { color: var(--primary); flex-shrink: 0; margin-top: 2px; }

.form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}

.required { color: #ef4444; }

.field-input {
  background: var(--bg-input);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 11px 16px;
  font-family: var(--font-sans);
  font-size: 13.5px;
  color: var(--text-main);
  outline: none;
  transition: all 0.2s ease;
}
.field-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}

.custom-checkbox {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
}
.custom-checkbox input { display: none; }
.checkbox-box {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1.5px solid var(--border-card);
  background: var(--bg-input);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.custom-checkbox input:checked + .checkbox-box {
  background: var(--emerald);
  border-color: var(--emerald);
}
.custom-checkbox input:checked + .checkbox-box::after {
  content: '✓';
  color: #fff;
  font-size: 12px;
  font-weight: bold;
}

/* Diff View */
.diff-content-layout {
  flex: 1;
  padding: 0;
}

.diff-meta-strip {
  padding: 14px 26px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 12.5px;
  color: var(--text-secondary);
}

.diff-viewer-frame {
  flex: 1;
  overflow: auto;
  background: var(--code-bg);
  padding: 18px 24px;
}

.diff-formatted-code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.65;
  white-space: pre-wrap;
}

.diff-add { color: #34d399; background: rgba(52, 211, 153, 0.1); display: block; }
.diff-del { color: #f87171; background: rgba(248, 113, 113, 0.1); display: block; }
.diff-hunk { color: #818cf8; font-weight: 700; display: block; margin: 4px 0; }

/* Toast Notifications */
.toast-stack {
  position: fixed;
  bottom: 28px;
  right: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 200;
}

.toast {
  background: var(--bg-modal);
  border: 1px solid var(--border-card);
  padding: 14px 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 13.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  color: var(--text-main);
}

.toast-success { border-color: var(--emerald); }
.toast-error { border-color: #ef4444; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: scale(1); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: translateX(0); } }

/* Loader */
.pulse-loader {
  width: 28px;
  height: 28px;
  border: 3px solid var(--primary-soft);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 50px 20px;
  gap: 14px;
  color: var(--text-secondary);
  font-size: 13.5px;
}
