/* --- OrgaPilot.DOKU Stylesheet --- */
:root {
  --bg-primary: #050810;
  --bg-secondary: #0a0f1d;
  --bg-card: rgba(13, 22, 41, 0.75);
  --border-color: rgba(16, 133, 255, 0.2);
  --border-glow: rgba(16, 133, 255, 0.45);
  
  --text-primary: #f0f4f8;
  --text-secondary: #8a9fc4;
  --text-muted: #536b94;
  
  --color-primary: #1085ff;
  --color-primary-glow: rgba(16, 133, 255, 0.5);
  --color-secondary: #ffd000;
  --color-danger: #ff2c55;
  --color-success: #00e676;
  
  --fms-1: #00ff00;
  --fms-2: #00cc00;
  --fms-3: #ff8800;
  --fms-4: #ff4444;
  --fms-7: #ff55ff;
  --fms-8: #55ccff;
  
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-telemetry: 'Rajdhani', sans-serif;
  --font-mono: 'Share Tech Mono', monospace;
  
  --transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
  --shadow-glow: 0 0 15px rgba(16, 133, 255, 0.2);
}

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

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}

/* --- Scanlines & Grid Effects --- */
.scanlines {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%);
  background-size: 100% 4px;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.2;
}

.grid-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: 30px 30px;
  background-image: 
    linear-gradient(to right, rgba(16, 133, 255, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(16, 133, 255, 0.03) 1px, transparent 1px);
  z-index: -1;
  pointer-events: none;
}

/* --- Typography --- */
h1, h2, h3, h4 {
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #ffffff;
}

/* --- Cockpit Layout --- */
.cockpit {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.5rem;
  background-color: var(--bg-secondary);
  border-bottom: 2px solid var(--border-color);
  box-shadow: var(--shadow-glow);
}

.brand {
  font-family: var(--font-telemetry);
  font-size: 1.4rem;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-dot {
  width: 10px;
  height: 10px;
  background-color: var(--color-primary);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--color-primary);
}

.nav-buttons {
  display: flex;
  gap: 0.75rem;
}

.btn {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  background: rgba(16, 133, 255, 0.1);
  color: #ffffff;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-telemetry);
  text-transform: uppercase;
}

.btn:hover {
  background: var(--color-primary);
  box-shadow: 0 0 10px var(--color-primary-glow);
  border-color: transparent;
}

.btn-danger {
  background: rgba(255, 44, 85, 0.1);
  border-color: rgba(255, 44, 85, 0.3);
}

.btn-danger:hover {
  background: var(--color-danger);
  box-shadow: 0 0 10px rgba(255, 44, 85, 0.5);
}

/* --- Main Layout --- */
.main-content {
  flex: 1;
  display: grid;
  grid-template-columns: 320px 1fr;
  overflow: hidden;
  height: calc(100vh - 60px);
  transition: grid-template-columns 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.main-content.sidebar-collapsed {
  grid-template-columns: 0px 1fr;
}

/* --- Sidebar --- */
.sidebar {
  background-color: rgba(5, 8, 16, 0.85);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 1rem;
  gap: 1rem;
  transition: padding 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.3s ease;
}

.main-content.sidebar-collapsed .sidebar {
  padding: 0;
  opacity: 0;
  pointer-events: none;
}

.sidebar-title {
  font-family: var(--font-telemetry);
  font-size: 0.9rem;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

.sidebar-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sidebar-item {
  padding: 0.75rem;
  border-radius: 4px;
  background: var(--bg-card);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
}

.sidebar-item:hover, .sidebar-item.active {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-glow);
  background: rgba(16, 133, 255, 0.05);
}

/* --- Workspace Area --- */
.workspace {
  background-color: var(--bg-secondary);
  overflow-y: auto;
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* --- Telemetry Panel --- */
.telemetry-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 0.6rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* --- Form Fields & Grid System --- */
.form-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 0.4rem 0.65rem;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.form-field label {
  font-size: 0.72rem;
  color: var(--text-secondary);
  font-family: var(--font-telemetry);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.form-input {
  background: rgba(5, 8, 16, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 0.35rem 0.55rem;
  color: #ffffff;
  font-size: 0.85rem;
  transition: var(--transition);
}

.form-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 6px var(--color-primary-glow);
}

/* --- Signature Pad --- */
.sig-container {
  border: 1px solid var(--border-color);
  background: rgba(5, 8, 16, 0.8);
  border-radius: 4px;
  position: relative;
  height: 150px;
}

.sig-canvas {
  width: 100%;
  height: 100%;
  display: block;
  filter: brightness(0) saturate(100%) invert(95%) sepia(93%) saturate(5437%) hue-rotate(54deg) brightness(101%) contrast(105%);
}

/* --- Comments Log --- */
.comments-log {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: rgba(5, 8, 16, 0.4);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 1rem;
  max-height: 300px;
  overflow-y: auto;
}

.comment-item {
  border-bottom: 1px solid rgba(16, 133, 255, 0.1);
  padding-bottom: 0.5rem;
}

.comment-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-bottom: 0.25rem;
}

.comment-text {
  font-size: 0.9rem;
}

/* --- Expiring share warning --- */
.alert-banner {
  background: rgba(255, 44, 85, 0.1);
  border: 1px solid var(--color-danger);
  border-radius: 6px;
  padding: 1rem;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* --- Form Configurator Drag-and-Drop Editor --- */
.editor-canvas {
  border: 2px dashed var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
  min-height: 400px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: rgba(13, 22, 41, 0.3);
  margin-bottom: 2rem;
}

.editor-field-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: opacity 0.15s ease, border-color 0.15s ease;
}

.editor-field-card.dragging {
  opacity: 0.4;
  border: 1px dashed var(--color-primary);
  background: rgba(16, 133, 255, 0.05);
}

/* --- Visual A4 Drag Canvas --- */
.editor-visual-container {
  display: flex;
  gap: 1.5rem;
  margin-top: 1rem;
}

.visual-canvas-wrapper {
  flex: 1;
  overflow: auto;
  max-height: 850px;
  background: #101524;
  padding: 1rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  display: flex;
  justify-content: center;
}

.visual-canvas {
  width: 595px;
  height: 842px;
  background-color: #ffffff;
  background-size: contain;
  background-repeat: no-repeat;
  position: relative;
  border: 2px solid var(--color-primary);
  box-shadow: 0 0 20px rgba(16, 133, 255, 0.3);
}

.draggable-badge {
  position: absolute;
  background: rgba(16, 133, 255, 0.85);
  color: #ffffff;
  border: 1px solid #1085ff;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.75rem;
  cursor: move;
  user-select: none;
  font-family: var(--font-mono);
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  gap: 4px;
}

.draggable-badge:hover {
  background: var(--color-primary);
}

/* --- Login Modal/Window --- */
.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
}

.login-card {
  width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 2.5rem;
  box-shadow: 0 0 30px rgba(16, 133, 255, 0.2);
  backdrop-filter: blur(15px);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* --- Premium Wiki & Modern Dashboard Additions --- */
.wiki-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 2rem;
  align-items: start;
}

.wiki-sidebar {
  background: linear-gradient(135deg, rgba(10, 15, 29, 0.7) 0%, rgba(5, 8, 16, 0.85) 100%);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  backdrop-filter: blur(10px);
}

.wiki-sidebar-item {
  padding: 0.85rem 1rem;
  margin-bottom: 0.5rem;
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--font-telemetry);
  font-size: 0.95rem;
  color: var(--text-secondary);
  border-left: 3px solid transparent;
  background: rgba(16, 133, 255, 0.02);
  transition: var(--transition);
}

.wiki-sidebar-item:hover {
  color: #ffffff;
  background: rgba(16, 133, 255, 0.08);
  border-left-color: rgba(16, 133, 255, 0.5);
  padding-left: 1.2rem;
}

.wiki-sidebar-item.active {
  color: #ffffff;
  background: linear-gradient(90deg, rgba(16, 133, 255, 0.15) 0%, transparent 100%);
  border-left-color: var(--color-primary);
  box-shadow: inset 3px 0 0 var(--color-primary);
  font-weight: 600;
}

.wiki-content-card {
  background: linear-gradient(135deg, rgba(10, 15, 29, 0.6) 0%, rgba(13, 22, 41, 0.55) 100%);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 2.5rem;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4), var(--shadow-glow);
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.wiki-content-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--color-primary), var(--color-primary-glow), transparent);
}

.text-gradient-cyan {
  background: linear-gradient(90deg, #ffffff 0%, #1085ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.wiki-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.wiki-list li {
  position: relative;
  padding-left: 1.5rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.wiki-list li::before {
  content: '⚡';
  position: absolute;
  left: 0;
  top: 0.15rem;
  color: var(--color-primary);
  font-size: 0.8rem;
  text-shadow: 0 0 5px var(--color-primary-glow);
}

.wiki-list-ordered {
  padding-left: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.wiki-list-ordered li {
  color: var(--text-secondary);
  line-height: 1.6;
}

.wiki-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1.5rem;
}

.wiki-table th {
  padding: 1rem;
  text-align: left;
  font-family: var(--font-telemetry);
  color: #ffffff;
  border-bottom: 2px solid var(--border-color);
  text-transform: uppercase;
  font-size: 0.85rem;
}

.wiki-table td {
  padding: 1rem;
  line-height: 1.5;
  border-bottom: 1px solid rgba(16, 133, 255, 0.08);
}

.wiki-table tr:hover {
  background: rgba(16, 133, 255, 0.02);
}

/* --- Responsive Design / Mobile & Tablet Support --- */
@media (max-width: 992px) {
  .main-content {
    grid-template-columns: 280px 1fr;
  }
}

@media (max-width: 768px) {
  .main-content {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }
  
  .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    max-height: 350px;
    overflow-y: auto;
  }
  
  .workspace {
    height: auto;
    overflow: visible;
  }

  .wiki-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .editor-visual-container {
    flex-direction: column;
  }
}

@media (max-width: 600px) {
  .form-grid {
    gap: 0.5rem 0;
  }
  
  .form-grid > * {
    grid-column: span 12 !important;
  }
}

@media (max-width: 480px) {
  .header-bar {
    flex-direction: column;
    gap: 0.75rem;
    align-items: stretch;
    padding: 0.75rem 1rem;
  }
  
  .brand {
    justify-content: center;
  }

  .nav-buttons {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
  }
  
  .nav-buttons .btn {
    flex: 1;
    min-width: 100px;
    padding: 0.4rem 0.6rem;
    font-size: 0.8rem;
    text-align: center;
  }

  .login-card {
    width: calc(100% - 2rem);
    margin: 1rem;
    padding: 1.5rem;
  }
}

/* --- Custom Modals --- */
.custom-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(5, 8, 16, 0.85);
  backdrop-filter: blur(8px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 100000;
  opacity: 0;
  transition: opacity 0.2s ease-in-out;
}

.custom-modal-overlay.active {
  opacity: 1;
}

.custom-modal-card {
  background: linear-gradient(135deg, rgba(10, 15, 29, 0.95) 0%, rgba(13, 22, 41, 0.95) 100%);
  border: 1px solid var(--border-glow);
  box-shadow: 0 0 25px var(--border-glow);
  border-radius: 8px;
  width: 90%;
  max-width: 450px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  transform: scale(0.9);
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

.custom-modal-header {
  font-family: var(--font-telemetry);
  font-size: 1.15rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #ffffff;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

.custom-modal-body {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.custom-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  border-top: 1px solid var(--border-color);
  padding-top: 0.75rem;
}



