/* === GL Sitzungsverwaltung — Light Business Theme === */

:root {
  --bg-primary: #f0f2f5;
  --bg-secondary: #ffffff;
  --bg-tertiary: #e8ecf1;
  --bg-hover: #dfe3e8;
  --text-primary: #1a202c;
  --text-secondary: #4a5568;
  --text-tertiary: #a0aec0;
  --accent: #2b6cb0;
  --accent-hover: #2c5282;
  --accent-light: #ebf4ff;
  --danger: #e53e3e;
  --danger-light: #fff5f5;
  --success: #38a169;
  --success-light: #f0fff4;
  --warning: #d69e2e;
  --warning-light: #fffff0;
  --border: #e2e8f0;
  --border-strong: #cbd5e0;
  --header-height: 56px;
  --sidebar-width: 280px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.12);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.15);
  --transition: 200ms ease;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
}

.hidden { display: none !important; }

/* === AUTH SCREEN === */
.auth-screen {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #2b6cb0 0%, #1a365d 100%);
  z-index: 1000;
}

.auth-card {
  background: var(--bg-secondary);
  padding: 40px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 380px;
  text-align: center;
}

.auth-logo {
  font-size: 48px; font-weight: 800;
  color: var(--accent);
  margin-bottom: 4px;
  letter-spacing: 2px;
}

.auth-subtitle {
  color: var(--text-secondary);
  margin-bottom: 28px;
  font-size: 14px;
}

.auth-card .form-group { margin-bottom: 16px; text-align: left; }

.auth-card input[type="text"],
.auth-card input[type="password"] {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 15px;
  transition: border-color var(--transition);
}

.auth-card input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(43,108,176,0.15);
}

.auth-error {
  color: var(--danger);
  font-size: 13px;
  padding: 8px 12px;
  background: var(--danger-light);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}

.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 20px auto;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* === BUTTONS === */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 20px;
  border: none; border-radius: var(--radius-md);
  font-size: 14px; font-weight: 500;
  cursor: pointer; transition: all var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: var(--accent); color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-secondary {
  background: var(--bg-tertiary); color: var(--text-primary);
}
.btn-secondary:hover { background: var(--bg-hover); }

.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 13px; }

.icon-btn {
  background: none; border: none; cursor: pointer;
  font-size: 16px; padding: 6px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: all var(--transition);
  line-height: 1;
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.delete-btn:hover { color: var(--danger); background: var(--danger-light); }

/* === HEADER === */
.header {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--header-height);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 20px;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

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

.logo {
  font-size: 22px; font-weight: 800;
  color: var(--accent); background: none; border: none;
  cursor: pointer; letter-spacing: 1px;
}

.header-nav {
  display: flex; gap: 4px;
  margin-left: 32px;
}

.nav-tab {
  padding: 8px 16px;
  background: none; border: none; border-radius: var(--radius-md);
  font-size: 14px; font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer; transition: all var(--transition);
}
.nav-tab:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.nav-tab.active { background: var(--accent-light); color: var(--accent); font-weight: 600; }

.header-right {
  margin-left: auto;
  display: flex; align-items: center; gap: 12px;
}

.user-info {
  font-size: 13px; color: var(--text-secondary);
}

/* === MAIN CONTENT === */
.main-content {
  margin-top: var(--header-height);
  padding: 24px;
  max-width: 1200px;
  margin-left: auto; margin-right: auto;
}

.view { display: none; }
.view.active { display: block; }

.view-header {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 20px;
}

.view-header h2 {
  font-size: 22px; font-weight: 700;
  color: var(--text-primary);
}

.view-header .btn { margin-left: auto; }

.back-btn { font-size: 20px; }

/* === EMPTY STATE === */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-tertiary);
}
.empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-hint { font-size: 13px; margin-top: 4px; }

/* === POOL ITEMS === */
.pool-list, .template-list, .user-list { display: flex; flex-direction: column; gap: 8px; }

.pool-item, .template-item, .user-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-secondary);
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  transition: all var(--transition);
}
.pool-item:hover, .template-item:hover, .user-item:hover {
  box-shadow: var(--shadow-sm);
  border-color: var(--border-strong);
}

.drag-handle {
  cursor: grab; font-size: 16px;
  color: var(--text-tertiary);
  user-select: none;
  padding: 4px;
  flex-shrink: 0;
}
.drag-handle:active { cursor: grabbing; }

.item-content { flex: 1; min-width: 0; }

.item-subject {
  font-weight: 600; font-size: 15px;
  margin-bottom: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.item-meta { display: flex; flex-wrap: wrap; gap: 6px; }

.meta-tag {
  display: inline-flex; align-items: center;
  font-size: 12px; padding: 2px 8px;
  border-radius: 10px;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

.duration-tag { background: var(--accent-light); color: var(--accent); }
.guest-tag { background: #faf5ff; color: #6b46c1; }
.doc-tag { background: var(--success-light); color: var(--success); }
.default-tag { background: var(--warning-light); color: var(--warning); }
.role-admin { background: var(--accent-light); color: var(--accent); font-weight: 600; }
.status-tag-inline.status-blocked { background: var(--danger-light); color: var(--danger); }

.item-actions { display: flex; gap: 4px; flex-shrink: 0; }

/* === MEETING CARDS === */
.meeting-list { display: flex; flex-direction: column; gap: 12px; }

.meeting-card {
  background: var(--bg-secondary);
  padding: 18px 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  cursor: default;
  transition: all var(--transition);
}
.meeting-card:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); }

.meeting-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.meeting-card-actions { display: flex; gap: 4px; }

.meeting-card-title {
  font-size: 17px; font-weight: 600;
  cursor: pointer; color: var(--accent);
  margin-bottom: 8px;
}
.meeting-card-title:hover { text-decoration: underline; }

.meeting-card-meta {
  display: flex; flex-wrap: wrap; gap: 12px;
  font-size: 13px; color: var(--text-secondary);
}

/* === STATUS BADGES === */
.status-badge {
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 600;
  padding: 3px 10px; border-radius: 10px;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.status-draft { background: var(--bg-tertiary); color: var(--text-secondary); }
.status-planned { background: var(--accent-light); color: var(--accent); }
.status-completed { background: var(--success-light); color: var(--success); }

/* === AGENDA VIEW === */
.agenda-container {
  display: flex; gap: 24px;
}

.agenda-timeline { flex: 1; min-width: 0; }

.agenda-meta {
  display: flex; flex-wrap: wrap; gap: 12px;
  font-size: 13px; color: var(--text-secondary);
  margin-left: 12px;
}

.agenda-item {
  display: flex; gap: 0;
  margin-bottom: 2px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all var(--transition);
}
.agenda-item:hover { box-shadow: var(--shadow-sm); border-color: var(--border-strong); }

.agenda-time {
  display: flex; flex-direction: column; align-items: center;
  padding: 12px 8px;
  min-width: 64px;
  background: var(--bg-tertiary);
  gap: 0;
}

.time-start {
  font-size: 13px; font-weight: 700;
  color: var(--accent);
}

.time-bar {
  width: 3px;
  background: linear-gradient(to bottom, var(--accent), rgba(43,108,176,0.2));
  border-radius: 2px;
  margin: 4px 0;
  flex-shrink: 0;
}

.time-end {
  font-size: 11px;
  color: var(--text-tertiary);
}

.agenda-item-body {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
}

.agenda-item-details { flex: 1; min-width: 0; }

.agenda-item-subject {
  font-weight: 600; font-size: 15px;
  margin-bottom: 4px;
}

.agenda-item-meta { display: flex; flex-wrap: wrap; gap: 6px; }

.doc-link {
  text-decoration: none;
  background: var(--success-light); color: var(--success);
}
.doc-link:hover { text-decoration: underline; }

.unassign-btn { font-size: 18px; }

.agenda-footer {
  display: flex; justify-content: space-between;
  padding: 16px 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-top: 8px;
  font-size: 14px; color: var(--text-secondary);
}

/* === AGENDA SIDEBAR === */
.agenda-sidebar {
  width: var(--sidebar-width); flex-shrink: 0;
  display: flex; flex-direction: column; gap: 20px;
}

.sidebar-section h3 {
  font-size: 13px; font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.sidebar-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
  cursor: grab;
  transition: all var(--transition);
  font-size: 13px;
}
.sidebar-item:hover { border-color: var(--accent); background: var(--accent-light); }
.sidebar-item:active { cursor: grabbing; }

.sidebar-item-subject { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-item-duration { color: var(--text-tertiary); font-size: 12px; margin-left: 8px; flex-shrink: 0; }

.sidebar-template { border-left: 3px solid var(--warning); }

.empty-hint { font-size: 12px; color: var(--text-tertiary); padding: 8px; }

#sidebarPool.drag-over {
  background: var(--accent-light);
  border: 2px dashed var(--accent);
  border-radius: var(--radius-md);
  min-height: 60px;
}

/* === DRAG & DROP FEEDBACK === */
.dragging { opacity: 0.4; }

.drop-indicator {
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
  margin: 2px 0;
  animation: pulse-indicator 1s ease infinite;
}

@keyframes pulse-indicator {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

.drag-over { background: rgba(43,108,176,0.03); }

.agenda-empty.drag-over {
  border: 2px dashed var(--accent);
  background: var(--accent-light);
}

/* === URL DROP ZONE === */
.url-drop-zone {
  position: relative;
}

.url-drop-zone input {
  width: 100%;
  padding: 10px 14px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
  transition: border-color var(--transition);
}
.url-drop-zone input:focus {
  outline: none;
  border-color: var(--accent);
  border-style: solid;
}

.drop-hint {
  position: absolute; bottom: -18px; left: 0;
  font-size: 11px; color: var(--text-tertiary);
}

.url-drag-over {
  border-color: var(--accent) !important;
  background: var(--accent-light);
}
.url-drag-over input { border-color: var(--accent) !important; }

/* === MODAL === */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
  z-index: 200;
  padding: 20px;
}

.modal {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 480px;
  max-height: 90vh; overflow-y: auto;
  padding: 24px;
}

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.modal-header h3 { font-size: 18px; font-weight: 700; }

/* === FORMS === */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px; font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
  transition: border-color var(--transition);
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(43,108,176,0.1);
}

.form-row {
  display: flex; gap: 16px;
}
.form-row .form-group { flex: 1; }

.form-actions {
  display: flex; gap: 8px; justify-content: flex-end;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* === GUEST CHIPS === */
.guest-input-row {
  display: flex; gap: 8px;
}
.guest-input-row input { flex: 1; }

.guest-list {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 8px;
}

.guest-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px;
  background: #faf5ff; color: #6b46c1;
  border-radius: 12px;
  font-size: 13px;
}

.guest-remove {
  background: none; border: none;
  cursor: pointer; color: #6b46c1;
  font-size: 14px; line-height: 1;
  padding: 0 2px; margin-left: 2px;
}
.guest-remove:hover { color: var(--danger); }

/* === TOAST === */
.toast {
  position: fixed; bottom: 24px;
  left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--text-primary);
  color: #fff;
  padding: 10px 24px;
  border-radius: var(--radius-md);
  font-size: 14px;
  opacity: 0;
  transition: all 300ms ease;
  z-index: 500;
  white-space: nowrap;
  box-shadow: var(--shadow-md);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* === HELP PAGE === */
.help-content {
  display: flex;
  gap: 32px;
  align-items: flex-start;
}

.help-toc {
  position: sticky;
  top: calc(var(--header-height) + 24px);
  min-width: 180px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
}

.help-toc h3 {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-tertiary);
  margin-bottom: 10px;
}

.help-toc ul { list-style: none; }

.help-toc li { margin-bottom: 6px; }

.help-toc a {
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition);
}
.help-toc a:hover { color: var(--accent); }

.help-article {
  flex: 1;
  min-width: 0;
  max-width: 720px;
}

.help-article section {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px 28px;
  margin-bottom: 16px;
}

.help-article h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent-light);
}

.help-article h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 18px;
  margin-bottom: 8px;
}

.help-article p {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.help-article ul, .help-article ol {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 10px;
  padding-left: 20px;
}

.help-article li { margin-bottom: 4px; }
.help-article li ul { margin-top: 4px; margin-bottom: 4px; }

.help-info {
  background: var(--accent-light);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin: 12px 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.help-info ul { margin-bottom: 0; }

.help-tip {
  background: var(--success-light);
  border-left: 3px solid var(--success);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin: 12px 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  font-size: 14px;
  vertical-align: middle;
}

.help-badge {
  display: inline-flex;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  vertical-align: middle;
}

.help-badge-draft { background: var(--bg-tertiary); color: var(--text-secondary); }
.help-badge-planned { background: var(--accent-light); color: var(--accent); }
.help-badge-completed { background: var(--success-light); color: var(--success); }

kbd {
  display: inline-block;
  padding: 2px 6px;
  font-size: 12px;
  font-family: inherit;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  box-shadow: 0 1px 0 var(--border-strong);
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .header-nav { display: none; }
  .header { padding: 0 12px; }
  .main-content { padding: 16px; }
  .meeting-list { grid-template-columns: 1fr; }
  .agenda-container { flex-direction: column; }
  .agenda-sidebar { width: 100%; }
  .form-row { flex-direction: column; gap: 0; }
  .help-content { flex-direction: column; }
  .help-toc { position: static; min-width: 0; }
  .help-article section { padding: 18px 16px; }

  /* Mobile navigation drawer */
  .header-left { position: relative; }
  .logo::after { content: ' \25BE'; font-size: 14px; }
}

@media (max-width: 480px) {
  .auth-card { padding: 28px 20px; margin: 0 12px; }
  .modal { padding: 18px; }
  .agenda-time { min-width: 52px; padding: 8px 6px; }
}
