/* ============================================
   LCSCO Protocols - Honeycomb Compact Theme
   ============================================ */

* {
  box-sizing: border-box;
}

:root {
  --primary: #059669;
  --primary-dark: #047857;
  --primary-light: #d1fae5;
  --secondary: #0d9488;
  --accent: #f59e0b;
  --danger: #dc2626;
  --danger-dark: #b91c1c;
  --success: #10b981;
  --text: #1f2937;
  --text-light: #6b7280;
  --bg: #f0fdf4;
  --card-bg: rgba(255, 255, 255, 0.92);
  --shadow: 0 2px 4px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 16px rgba(0,0,0,0.12);
  --radius: 10px;
  --radius-sm: 6px;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --font-xs: 0.68rem;
  --font-sm: 0.75rem;
  --font-base: 0.82rem;
  --font-lg: 0.95rem;
  --font-xl: 1.1rem;
}

/* Hexagonal Header Background Element */
.header-hexagon-bg {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 70px;
  background: 
    linear-gradient(135deg, rgba(5, 150, 105, 0.95) 0%, rgba(13, 148, 136, 0.95) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='98' viewBox='0 0 28 49'%3E%3Cg fill-rule='evenodd'%3E%3Cg id='hexagons' fill='%23ffffff' fill-opacity='0.1' fill-rule='nonzero'%3E%3Cpath d='M13.99 9.25l13 7.5v15l-13 7.5L1 31.75v-15l12.99-7.5zM3 17.9v12.7l10.99 6.34 11-6.35V17.9l-11-6.34L3 17.9zM0 15l12.98-7.5V0h-2v6.35L0 12.69v2.3zm0 18.5L12.98 41v8h-2v-6.85L0 35.81v-2.3zM15 0v7.5L27.99 15H28v-2.31h-.01L17 6.35V0h-2zm0 49v-8l12.99-7.5H28v2.31h-.01L17 42.15V49h-2z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  background-size: 56px 98px;
  z-index: -1;
  pointer-events: none;
}

.role-pi .header-hexagon-bg,
.role-admin .header-hexagon-bg {
  background: 
    linear-gradient(135deg, rgba(30, 100, 120, 0.95) 0%, rgba(20, 75, 95, 0.95) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='98' viewBox='0 0 28 49'%3E%3Cg fill-rule='evenodd'%3E%3Cg id='hexagons' fill='%23ffffff' fill-opacity='0.1' fill-rule='nonzero'%3E%3Cpath d='M13.99 9.25l13 7.5v15l-13 7.5L1 31.75v-15l12.99-7.5zM3 17.9v12.7l10.99 6.34 11-6.35V17.9l-11-6.34L3 17.9zM0 15l12.98-7.5V0h-2v6.35L0 12.69v2.3zm0 18.5L12.98 41v8h-2v-6.85L0 35.81v-2.3zM15 0v7.5L27.99 15H28v-2.31h-.01L17 6.35V0h-2zm0 49v-8l12.99-7.5H28v2.31h-.01L17 42.15V49h-2z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  background-size: 56px 98px;
}

/* Honeycomb Background Pattern */
body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: var(--font-base);
  background-color: #ecfdf5;
  background-image: 
    radial-gradient(circle at 100% 50%, transparent 20%, rgba(5, 150, 105, 0.03) 21%, rgba(5, 150, 105, 0.03) 34%, transparent 35%, transparent),
    radial-gradient(circle at 0% 50%, transparent 20%, rgba(5, 150, 105, 0.03) 21%, rgba(5, 150, 105, 0.03) 34%, transparent 35%, transparent) 0 50px;
  background-size: 75px 100px;
  color: var(--text);
  line-height: 1.45;
  min-height: 100vh;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-12px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

@keyframes hexPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.2); }
  50% { box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.1); }
}

/* Header Actions (Right Side) */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  position: relative;
  z-index: 1002;
}

/* Notification Bell */
.notification-wrapper {
  position: relative;
}

.notification-btn {
  background: rgba(255,255,255,0.15);
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px;
  cursor: pointer;
  color: #fff;
  transition: var(--transition);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1003;
  pointer-events: auto;
}

.notification-btn:hover {
  background: rgba(255,255,255,0.25);
}

.notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #f59e0b;
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  animation: pulse 2s infinite;
}

.notification-badge.hidden {
  display: none;
}

.notification-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  width: 320px;
  max-height: 400px;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 1001;
  display: none;
  overflow: hidden;
}

@media (max-width: 400px) {
  .notification-dropdown,
  .settings-dropdown {
    width: calc(100vw - 40px);
    right: -10px;
  }
}

.notification-dropdown.show {
  display: block;
  animation: fadeIn 0.2s ease;
}

/* Click-open without JS (details/summary) */
.notification-wrapper[open] .notification-dropdown {
  display: block;
  animation: fadeIn 0.2s ease;
}

.notification-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #e5e7eb;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  font-weight: 600;
  font-size: var(--font-sm);
}

.role-pi .notification-header,
.role-admin .notification-header {
  background: linear-gradient(135deg, #1e6478 0%, #144b5f 100%);
}

.notification-header button {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.9);
  font-size: var(--font-xs);
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.notification-list {
  max-height: 320px;
  overflow-y: auto;
}

.notification-item {
  padding: 12px 16px;
  border-bottom: 1px solid #f3f4f6;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.notification-item:hover {
  background: #f9fafb;
}

.notification-item.unread {
  background: #eff6ff;
  border-left: 3px solid var(--primary);
}

.role-pi .notification-item.unread,
.role-admin .notification-item.unread {
  background: #e6f4f6;
  border-left-color: #1e6478;
}

.notification-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.notification-icon.submit { background: #dbeafe; color: #1e40af; }
.notification-icon.review { background: #dcfce7; color: #166534; }
.notification-icon.execute { background: #fce7f3; color: #9d174d; }
.notification-icon.alert { background: #fef3c7; color: #92400e; }

.notification-content {
  flex: 1;
}

.notification-title {
  font-weight: 600;
  font-size: var(--font-sm);
  color: var(--text);
  margin-bottom: 2px;
}

.notification-message {
  font-size: var(--font-xs);
  color: var(--text-light);
  line-height: 1.4;
}

.notification-time {
  font-size: 0.6rem;
  color: #9ca3af;
  margin-top: 4px;
}

.notification-empty {
  padding: 24px;
  text-align: center;
  color: var(--text-light);
  font-size: var(--font-sm);
}

/* Settings Dropdown */
.settings-wrapper {
  position: relative;
}

.settings-btn {
  background: rgba(255,255,255,0.15);
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px;
  cursor: pointer;
  color: #fff;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1003;
  pointer-events: auto;
}

.settings-btn:hover {
  background: rgba(255,255,255,0.25);
}

.settings-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  width: 280px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 1001;
  display: none;
}

.settings-dropdown.show {
  display: block;
  animation: fadeIn 0.2s ease;
}

/* Click-open without JS (details/summary) */
.settings-wrapper[open] .settings-dropdown {
  display: block;
  animation: fadeIn 0.2s ease;
}

/* Remove default <summary> marker */
.notification-wrapper > summary::-webkit-details-marker,
.settings-wrapper > summary::-webkit-details-marker {
  display: none;
}
.notification-wrapper > summary,
.settings-wrapper > summary {
  list-style: none;
}

.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #e5e7eb;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  font-weight: 600;
  font-size: var(--font-sm);
}

.role-pi .settings-header,
.role-admin .settings-header {
  background: linear-gradient(135deg, #1e6478 0%, #144b5f 100%);
}

.settings-list {
  max-height: none;
  overflow: visible;
}

.settings-item {
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.15s ease;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #f3f4f6;
  text-decoration: none;
  color: inherit;
}

.settings-item:hover {
  background: #e5e7eb;
}

.settings-item:active {
  background: #d1d5db;
}

.settings-item.clickable {
  cursor: pointer;
}

.settings-item.clickable:hover {
  background: #e5e7eb;
}

.settings-item.clickable:active {
  background: #d1d5db;
}

.settings-item:focus-visible {
  outline: 2px solid rgba(5, 150, 105, 0.35);
  outline-offset: -2px;
}

.settings-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.role-pi .settings-icon,
.role-admin .settings-icon {
  background: #e6f4f6;
}

.settings-content {
  flex: 1;
}

.settings-title {
  font-weight: 600;
  font-size: var(--font-sm);
  color: var(--text);
}

.settings-desc {
  font-size: var(--font-xs);
  color: var(--text-light);
  margin-top: 2px;
}

.settings-divider {
  height: 1px;
  background: #e5e7eb;
  margin: 8px 0;
}

.user-info-mini {
  padding: 12px 16px;
  background: linear-gradient(135deg, var(--primary-light) 0%, #f0fdf4 100%);
  border-bottom: 1px solid #e5e7eb;
}

.role-pi .user-info-mini,
.role-admin .user-info-mini {
  background: linear-gradient(135deg, #e6f4f6 0%, #f0f9fa 100%);
}

.user-name {
  display: block;
  font-weight: 600;
  font-size: var(--font-sm);
  color: var(--text);
}

.user-role {
  display: block;
  font-size: var(--font-xs);
  color: var(--text-light);
  text-transform: uppercase;
  margin-top: 2px;
}

.settings-logout {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  text-decoration: none;
  color: var(--text);
  transition: var(--transition);
  border-radius: 0 0 var(--radius) var(--radius);
}

.settings-logout:hover {
  background: #fef2f2;
}

.settings-logout:hover .settings-title {
  color: #dc2626;
}

.settings-toggle {
  width: 40px;
  height: 22px;
  background: #9ca3af;
  border-radius: 11px;
  position: relative;
  cursor: pointer;
  transition: background 0.2s ease;
  flex-shrink: 0;
}

.settings-toggle:hover {
  background: #6b7280;
}

.settings-toggle.active {
  background: var(--primary);
}

.role-pi .settings-toggle.active,
.role-admin .settings-toggle.active {
  background: #1e6478;
}

.role-pi .settings-toggle:hover,
.role-admin .settings-toggle:hover {
  background: #144b5f;
}

.toggle-switch {
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.settings-toggle.active .toggle-switch {
  transform: translateX(18px);
}

/* Settings Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
}

.modal-overlay.show {
  display: flex;
  animation: fadeIn 0.2s ease;
}

.modal-content {
  background: var(--card-bg);
  border-radius: var(--radius);
  width: 90%;
  max-width: 450px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  border-radius: var(--radius) var(--radius) 0 0;
}

.role-pi .modal-header,
.role-admin .modal-header {
  background: linear-gradient(135deg, #1e6478 0%, #144b5f 100%);
}

.modal-header h3 {
  margin: 0;
  color: #fff;
  font-size: var(--font-base);
}

.modal-close {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
}

.modal-close:hover {
  background: rgba(255,255,255,0.2);
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: var(--font-xs);
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
  margin: 0;
}

.checkbox-group {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.checkbox-group input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--primary);
}

.role-pi .checkbox-group input[type="checkbox"],
.role-admin .checkbox-group input[type="checkbox"] {
  accent-color: #1e6478;
}

.checkbox-group label {
  margin: 0;
  font-size: var(--font-sm);
  font-weight: 400;
  text-transform: none;
}

/* Quote in center with typing effect */
.quote-center {
  flex: 1;
  max-width: 450px;
  margin: 0 20px;
  font-size: 0.65rem;
  font-style: italic;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.35;
  text-align: center;
  min-height: 30px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.quote-text-type {
  display: block;
}

.quote-author-type {
  display: block;
  margin-top: 2px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.95);
  font-style: normal;
  font-size: 0.6rem;
}

/* Typing cursor */
.typing-cursor::after {
  content: '|';
  animation: blink 1s infinite;
  margin-left: 2px;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* Top Navigation with Scientific Hexagonal Pattern */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 20px;
  height: 70px;
  gap: 20px;
  background: 
    linear-gradient(135deg, rgba(5, 150, 105, 0.97) 0%, rgba(13, 148, 136, 0.97) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='49' viewBox='0 0 28 49'%3E%3Cg fill-rule='evenodd'%3E%3Cg id='hexagons' fill='%23ffffff' fill-opacity='0.08' fill-rule='nonzero'%3E%3Cpath d='M13.99 9.25l13 7.5v15l-13 7.5L1 31.75v-15l12.99-7.5zM3 17.9v12.7l10.99 6.34 11-6.35V17.9l-11-6.34L3 17.9zM0 15l12.98-7.5V0h-2v6.35L0 12.69v2.3zm0 18.5L12.98 41v8h-2v-6.85L0 35.81v-2.3zM15 0v7.5L27.99 15H28v-2.31h-.01L17 6.35V0h-2zm0 49v-8l12.99-7.5H28v2.31h-.01L17 42.15V49h-2z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  color: #fff;
  box-shadow: 0 3px 12px rgba(5, 150, 105, 0.25);
  position: relative;
  z-index: 1000;
}

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

.brand h1 {
  margin: 0;
  font-size: var(--font-xl);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand p {
  margin: 1px 0 0;
  font-size: var(--font-xs);
  opacity: 0.85;
}

.lab-subtitle {
  display: none;
}

.logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
  background: #fff;
  border-radius: var(--radius-sm);
  padding: 3px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  display: block;
}

.logo-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  border-radius: var(--radius-sm);
  outline-offset: 2px;
}

/* Navigation Menu */
.nav {
  background: linear-gradient(135deg, var(--primary-dark) 0%, #065f46 100%);
  padding: 8px 20px;
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.nav a {
  color: #fff;
  text-decoration: none;
  font-size: var(--font-sm);
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  position: relative;
}

.nav a:hover {
  background: rgba(255,255,255,0.1);
}

/* Main Container */
.container {
  max-width: 1400px;
  margin: 16px auto;
  padding: 0 16px;
}

/* Card Component - Honeycomb Style */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
  animation: fadeIn 0.3s ease;
  transition: var(--transition);
  border: 1px solid rgba(5, 150, 105, 0.08);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  opacity: 0.6;
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

body.role-chemist .card:hover {
  box-shadow: var(--shadow);
  transform: none;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(5, 150, 105, 0.15);
}

.section-head h2, .section-head h3 {
  margin: 0;
  color: var(--primary-dark);
  font-weight: 600;
}

.section-head h2 { font-size: var(--font-lg); }
.section-head h3 { font-size: var(--font-base); }

/* Typography */
h2 {
  font-size: var(--font-lg);
  font-weight: 600;
  color: var(--primary-dark);
  margin: 0 0 10px;
}

h3 {
  font-size: var(--font-base);
  font-weight: 600;
  color: var(--text);
  margin: 0 0 8px;
}

/* Buttons */
.btn, button, input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: var(--font-sm);
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 2px 4px rgba(5, 150, 105, 0.2);
}

.btn:hover, button:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(5, 150, 105, 0.25);
}

/* Danger Button */
.danger-btn {
  background: var(--danger);
  box-shadow: 0 2px 4px rgba(220, 38, 38, 0.2);
}

.danger-btn:hover {
  background: var(--danger-dark);
  box-shadow: 0 4px 8px rgba(220, 38, 38, 0.25);
}

/* Small Button */
.small-btn {
  padding: 4px 8px;
  font-size: var(--font-xs);
}

/* Form Elements */
input, textarea, select {
  width: 100%;
  padding: 6px 10px;
  margin: 4px 0 10px;
  border: 1px solid #d1d5db;
  border-radius: var(--radius-sm);
  font-size: var(--font-sm);
  font-family: inherit;
  background: #fff;
  transition: var(--transition);
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.1);
}

textarea {
  min-height: 80px;
  resize: vertical;
}

label {
  display: block;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 2px;
  font-size: var(--font-xs);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* Tables */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 10px;
  background: #fff;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow);
  font-size: var(--font-sm);
}

th {
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  font-weight: 600;
  text-transform: uppercase;
  font-size: var(--font-xs);
  letter-spacing: 0.04em;
  padding: 8px 10px;
  text-align: left;
}

td {
  padding: 8px 10px;
  border-bottom: 1px solid #f3f4f6;
  transition: var(--transition);
}

tr:hover td {
  background: #f9fafb;
}

tr:last-child td {
  border-bottom: none;
}

/* Grid Layouts */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  align-items: end;
}

/* Protocol Form Details */
.protocol-form details {
  border: 1px solid #e5e7eb;
  border-radius: var(--radius-sm);
  margin: 10px 0;
  padding: 12px;
  background: #fff;
  box-shadow: var(--shadow);
  font-size: var(--font-sm);
}

.protocol-form summary {
  cursor: pointer;
  font-weight: 600;
  font-size: var(--font-base);
  color: var(--primary-dark);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

.protocol-form summary::before {
  content: '▸';
  font-size: var(--font-sm);
  transition: var(--transition);
}

.protocol-form details[open] summary::before {
  transform: rotate(90deg);
}

/* Checkboxes */
.check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 14px;
  cursor: pointer;
  font-size: var(--font-sm);
}

.check input[type="checkbox"], .check input[type="radio"] {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--primary);
}

.char-data-section {
  margin: 10px 0 16px 20px;
  padding: 12px;
  background: #f9fafb;
  border-radius: 8px;
  border-left: 3px solid var(--primary);
}

.char-data-section label {
  display: block;
  margin-bottom: 8px;
}

.char-data-section .grid-2,
.char-data-section .grid-3 {
  gap: 12px;
  margin-bottom: 8px;
}

.char-single {
  width: 100%;
  max-width: 300px;
  margin-bottom: 12px;
  padding: 8px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
}

/* Flash Messages */
.flash {
  padding: 10px 14px;
  margin-bottom: 12px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  animation: slideIn 0.25s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--font-sm);
}

.flash.success {
  background: #d1fae5;
  color: #065f46;
  border-left: 3px solid var(--success);
}

.flash.error {
  background: #fee2e2;
  color: #991b1b;
  border-left: 3px solid var(--danger);
}

/* Hints */
.hint {
  font-size: var(--font-xs);
  color: var(--text-light);
  font-style: italic;
}

/* Interactive Table */
.interactive-table input, .interactive-table select {
  margin: 0;
  padding: 4px 8px;
  font-size: var(--font-xs);
}

/* Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: var(--font-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.status-draft { background: #fef3c7; color: #92400e; }
.status-submitted { background: #e0e7ff; color: #3730a3; }
.status-approved { background: #d1fae5; color: #065f46; }
.status-executed { background: #e0e7ff; color: #4338ca; }
.status-reviewed { background: #ccfbf1; color: #0f766e; }
.status-rejected { background: #fee2e2; color: #991b1b; }

/* Drop Zone */
.drop-zone {
  border: 2px dashed var(--primary);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  color: var(--primary-dark);
  background: var(--primary-light);
  cursor: pointer;
  margin: 12px 0;
  transition: var(--transition);
  font-weight: 500;
  font-size: var(--font-sm);
}

.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--primary-dark);
  background: #a7f3d0;
}

/* Table Container */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius-sm);
}

/* Hidden Field */
.hidden-field { display: none; }

/* Inline Form */
.inline-form { display: inline; }

/* Link Button */
.link-button {
  background: transparent;
  color: var(--primary);
  padding: 0;
  border: none;
  font-size: var(--font-sm);
  text-decoration: underline;
  cursor: pointer;
  font-weight: 500;
}

.link-button:hover { color: var(--primary-dark); }

/* ============================================
   PI THEME - RED
   ============================================ */
body.role-pi,
body.role-admin {
  background-color: #f0f9fa;
  background-image: 
    radial-gradient(circle at 100% 50%, transparent 20%, rgba(30, 100, 120, 0.03) 21%, rgba(30, 100, 120, 0.03) 34%, transparent 35%, transparent),
    radial-gradient(circle at 0% 50%, transparent 20%, rgba(30, 100, 120, 0.03) 21%, rgba(30, 100, 120, 0.03) 34%, transparent 35%, transparent) 0 50px;
}

.role-pi .topbar,
.role-admin .topbar {
  background: 
    linear-gradient(135deg, rgba(30, 100, 120, 0.97) 0%, rgba(20, 75, 95, 0.97) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='49' viewBox='0 0 28 49'%3E%3Cg fill-rule='evenodd'%3E%3Cg id='hexagons' fill='%23ffffff' fill-opacity='0.08' fill-rule='nonzero'%3E%3Cpath d='M13.99 9.25l13 7.5v15l-13 7.5L1 31.75v-15l12.99-7.5zM3 17.9v12.7l10.99 6.34 11-6.35V17.9l-11-6.34L3 17.9zM0 15l12.98-7.5V0h-2v6.35L0 12.69v2.3zm0 18.5L12.98 41v8h-2v-6.85L0 35.81v-2.3zM15 0v7.5L27.99 15H28v-2.31h-.01L17 6.35V0h-2zm0 49v-8l12.99-7.5H28v2.31h-.01L17 42.15V49h-2z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  box-shadow: 0 3px 12px rgba(30, 100, 120, 0.3);
}

.role-pi .nav,
.role-admin .nav {
  background: linear-gradient(135deg, #1e6478 0%, #144b5f 100%);
}

.role-pi .card::before,
.role-admin .card::before {
  background: linear-gradient(90deg, #1e6478, #3a8fa8);
}

.role-pi .card,
.role-admin .card {
  border-color: rgba(30, 100, 120, 0.1);
}

.role-pi .section-head h2,
.role-pi .section-head h3,
.role-pi h2,
.role-admin .section-head h2,
.role-admin .section-head h3,
.role-admin h2 {
  color: #144b5f;
}

.role-pi th,
.role-admin th {
  background: linear-gradient(180deg, #1e6478 0%, #144b5f 100%);
}

.role-pi .btn,
.role-admin .btn {
  background: #1e6478;
  box-shadow: 0 2px 4px rgba(30, 100, 120, 0.2);
}

.role-pi .btn:hover,
.role-admin .btn:hover {
  background: #144b5f;
  box-shadow: 0 4px 8px rgba(30, 100, 120, 0.25);
}

.role-pi input:focus,
.role-pi textarea:focus,
.role-pi select:focus,
.role-admin input:focus,
.role-admin textarea:focus,
.role-admin select:focus {
  border-color: #1e6478;
  box-shadow: 0 0 0 2px rgba(30, 100, 120, 0.1);
}

.role-pi .protocol-form summary,
.role-admin .protocol-form summary {
  color: #1e6478;
}

.role-pi .link-button,
.role-admin .link-button {
  color: #1e6478;
}

.role-pi .link-button:hover,
.role-admin .link-button:hover {
  color: #144b5f;
}

.role-pi .drop-zone,
.role-admin .drop-zone {
  border-color: #1e6478;
  background: #e6f4f6;
  color: #144b5f;
}

.role-pi .drop-zone:hover,
.role-admin .drop-zone:hover {
  border-color: #144b5f;
  background: #d0ebf0;
}

.role-pi .nav a:hover,
.role-admin .nav a:hover {
  background: rgba(255,255,255,0.12);
}

/* PI Dashboard Specific */
.pi-dashboard {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.pi-dashboard .card-full {
  grid-column: 1 / -1;
}

/* Search & Filter Compact */
.filter-bar {
  display: flex;
  gap: 10px;
  align-items: end;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.filter-bar input,
.filter-bar select {
  margin: 0;
  min-width: 140px;
}

/* Action Buttons Group */
.action-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* Compact Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 10px;
}

.stat-item {
  background: rgba(255,255,255,0.6);
  border-radius: var(--radius-sm);
  padding: 10px;
  text-align: center;
  border: 1px solid rgba(5, 150, 105, 0.1);
}

.stat-value {
  font-size: var(--font-lg);
  font-weight: 700;
  color: var(--primary-dark);
}

.stat-label {
  font-size: var(--font-xs);
  color: var(--text-light);
  text-transform: uppercase;
}

.role-pi .stat-item,
.role-admin .stat-item {
  border-color: rgba(30, 100, 120, 0.1);
}

.role-pi .stat-value,
.role-admin .stat-value {
  color: #144b5f;
}

/* Responsive */
@media (max-width: 1000px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .pi-dashboard { grid-template-columns: 1fr; }
  .nav { flex-direction: column; gap: 2px; }
  .section-head { flex-direction: column; gap: 8px; align-items: flex-start; }
}

/* Mobile Styles */
@media (max-width: 600px) {
  /* Header */
  .topbar {
    flex-wrap: wrap;
    height: auto;
    padding: 10px 12px;
    gap: 8px;
  }
  
  .brand {
    flex-shrink: 0;
  }
  
  .brand h1 {
    font-size: 1rem;
  }
  
  .brand p {
    display: none;
  }
  
  .lab-subtitle {
    display: none;
  }
  
  .logo {
    width: 32px;
    height: 32px;
    padding: 2px;
  }
  
  .quote-center {
    display: flex !important;
    max-width: 180px;
    margin: 0 8px;
    font-size: 0.55rem;
  }
  
  .quote-text-type,
  .quote-author-type {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .header-actions {
    gap: 4px;
  }
  
  .notification-btn,
  .settings-btn {
    padding: 6px;
  }
  
  .notification-btn svg,
  .settings-btn svg {
    width: 18px;
    height: 18px;
  }
  
  /* Navigation */
  .nav {
    padding: 8px 12px;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .nav a {
    font-size: 0.7rem;
    padding: 6px 8px;
  }
  
  /* Container */
  .container {
    padding: 0 12px;
    margin: 12px auto;
  }
  
  /* Cards */
  .card {
    padding: 12px;
    margin-bottom: 10px;
  }
  
  /* Typography */
  h2 {
    font-size: 1rem;
  }
  
  h3 {
    font-size: 0.9rem;
  }
  
  /* Buttons */
  .btn {
    padding: 8px 12px;
    font-size: 0.8rem;
  }
  
  /* Forms */
  input, textarea, select {
    padding: 8px 10px;
    font-size: 0.85rem;
  }
  
  /* Tables */
  table {
    font-size: 0.75rem;
  }
  
  th, td {
    padding: 6px 8px;
  }
  
  /* Dropdowns */
  .notification-dropdown,
  .settings-dropdown {
    width: 280px;
    right: -10px;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
  }
  
  /* Theme cards */
  .theme-options {
    flex-direction: column;
  }
  
  .theme-card {
    min-width: 100%;
  }
  
  /* Stats */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  /* Filter bar */
  .filter-bar {
    flex-direction: column;
    gap: 8px;
  }
  
  .filter-bar input,
  .filter-bar select {
    width: 100%;
    min-width: 100%;
  }
}

@media (max-width: 400px) {
  .topbar {
    padding: 8px;
  }
  
  .brand h1 {
    font-size: 0.9rem;
  }
  
  .nav a {
    font-size: 0.65rem;
    padding: 5px 6px;
  }
  
  .quote-center {
    display: none !important;
  }
  
  .notification-dropdown,
  .settings-dropdown {
    width: calc(100vw - 30px);
    right: 0;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
  }
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 4px; }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary-dark); }
.role-pi ::-webkit-scrollbar-thumb,
.role-admin ::-webkit-scrollbar-thumb { background: #1e6478; }
.role-pi ::-webkit-scrollbar-thumb:hover,
.role-admin ::-webkit-scrollbar-thumb:hover { background: #144b5f; }

/* ============================================
   THEMES - Blue, Green, Red
   ============================================ */

/* Blue Theme */
body.theme-blue {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #dbeafe;
  --secondary: #3b82f6;
  --bg: #eff6ff;
}
body.theme-blue .header-hexagon-bg {
  background: linear-gradient(135deg, rgba(30, 58, 138, 0.95) 0%, rgba(59, 130, 246, 0.95) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='98' viewBox='0 0 28 49'%3E%3Cg fill-rule='evenodd'%3E%3Cg id='hexagons' fill='%23ffffff' fill-opacity='0.1' fill-rule='nonzero'%3E%3Cpath d='M13.99 9.25l13 7.5v15l-13 7.5L1 31.75v-15l12.99-7.5zM3 17.9v12.7l10.99 6.34 11-6.35V17.9l-11-6.34L3 17.9zM0 15l12.98-7.5V0h-2v6.35L0 12.69v2.3zm0 18.5L12.98 41v8h-2v-6.85L0 35.81v-2.3zM15 0v7.5L27.99 15H28v-2.31h-.01L17 6.35V0h-2zm0 49v-8l12.99-7.5H28v2.31h-.01L17 42.15V49h-2z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  background-size: 56px 98px;
}
body.theme-blue .topbar {
  background:
    linear-gradient(135deg, rgba(30, 58, 138, 0.97) 0%, rgba(59, 130, 246, 0.97) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='49' viewBox='0 0 28 49'%3E%3Cg fill-rule='evenodd'%3E%3Cg id='hexagons' fill='%23ffffff' fill-opacity='0.08' fill-rule='nonzero'%3E%3Cpath d='M13.99 9.25l13 7.5v15l-13 7.5L1 31.75v-15l12.99-7.5zM3 17.9v12.7l10.99 6.34 11-6.35V17.9l-11-6.34L3 17.9zM0 15l12.98-7.5V0h-2v6.35L0 12.69v2.3zm0 18.5L12.98 41v8h-2v-6.85L0 35.81v-2.3zM15 0v7.5L27.99 15H28v-2.31h-.01L17 6.35V0h-2zm0 49v-8l12.99-7.5H28v2.31h-.01L17 42.15V49h-2z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  box-shadow: 0 3px 12px rgba(30, 58, 138, 0.3);
}
body.theme-blue .nav {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e3a8a 100%);
}
body.theme-blue .notification-header,
body.theme-blue .settings-header,
body.theme-blue .modal-header {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e3a8a 100%);
}
body.theme-blue .settings-icon { background: #dbeafe; }
body.theme-blue .user-info-mini { background: linear-gradient(135deg, #dbeafe 0%, #eff6ff 100%); }
body.theme-blue .settings-toggle.active { background: #2563eb; }
body.theme-blue .notification-item.unread { background: #eff6ff; border-left-color: #2563eb; }
body.theme-blue .section-head h2,
body.theme-blue .section-head h3,
body.theme-blue h2 { color: #1d4ed8; }
body.theme-blue .btn {
  background: #2563eb;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}
body.theme-blue .btn:hover {
  background: #1d4ed8;
  box-shadow: 0 4px 8px rgba(37, 99, 235, 0.25);
}
body.theme-blue th { background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%); }
body.theme-blue input:focus,
body.theme-blue textarea:focus,
body.theme-blue select:focus { border-color: #2563eb; box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1); }
body.theme-blue .card::before { background: linear-gradient(90deg, #2563eb, #3b82f6); }
body.theme-blue .card { border-color: rgba(37, 99, 235, 0.08); }
body.theme-blue .drop-zone { border-color: #2563eb; background: #dbeafe; color: #1d4ed8; }
body.theme-blue ::-webkit-scrollbar-thumb { background: #2563eb; }
body.theme-blue ::-webkit-scrollbar-thumb:hover { background: #1d4ed8; }
body.theme-blue .checkbox-group input[type="checkbox"] { accent-color: #2563eb; }
body.theme-blue .link-button { color: #2563eb; }
body.theme-blue .link-button:hover { color: #1d4ed8; }
body.theme-blue .protocol-form summary { color: #1d4ed8; }

/* Green Theme (Default) */
body.theme-green {
  --primary: #059669;
  --primary-dark: #047857;
  --primary-light: #d1fae5;
  --secondary: #0d9488;
  --bg: #f0fdf4;
}
body.theme-green .header-hexagon-bg {
  background: linear-gradient(135deg, rgba(6, 78, 59, 0.95) 0%, rgba(5, 150, 105, 0.95) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='98' viewBox='0 0 28 49'%3E%3Cg fill-rule='evenodd'%3E%3Cg id='hexagons' fill='%23ffffff' fill-opacity='0.1' fill-rule='nonzero'%3E%3Cpath d='M13.99 9.25l13 7.5v15l-13 7.5L1 31.75v-15l12.99-7.5zM3 17.9v12.7l10.99 6.34 11-6.35V17.9l-11-6.34L3 17.9zM0 15l12.98-7.5V0h-2v6.35L0 12.69v2.3zm0 18.5L12.98 41v8h-2v-6.85L0 35.81v-2.3zM15 0v7.5L27.99 15H28v-2.31h-.01L17 6.35V0h-2zm0 49v-8l12.99-7.5H28v2.31h-.01L17 42.15V49h-2z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  background-size: 56px 98px;
}

/* Red Theme */
body.theme-red {
  --primary: #dc2626;
  --primary-dark: #b91c1c;
  --primary-light: #fee2e2;
  --secondary: #ef4444;
  --bg: #fef2f2;
}
body.theme-red .header-hexagon-bg {
  background: linear-gradient(135deg, rgba(127, 29, 29, 0.95) 0%, rgba(220, 38, 38, 0.95) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='98' viewBox='0 0 28 49'%3E%3Cg fill-rule='evenodd'%3E%3Cg id='hexagons' fill='%23ffffff' fill-opacity='0.1' fill-rule='nonzero'%3E%3Cpath d='M13.99 9.25l13 7.5v15l-13 7.5L1 31.75v-15l12.99-7.5zM3 17.9v12.7l10.99 6.34 11-6.35V17.9l-11-6.34L3 17.9zM0 15l12.98-7.5V0h-2v6.35L0 12.69v2.3zm0 18.5L12.98 41v8h-2v-6.85L0 35.81v-2.3zM15 0v7.5L27.99 15H28v-2.31h-.01L17 6.35V0h-2zm0 49v-8l12.99-7.5H28v2.31h-.01L17 42.15V49h-2z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  background-size: 56px 98px;
}
body.theme-red .topbar {
  background:
    linear-gradient(135deg, rgba(127, 29, 29, 0.97) 0%, rgba(220, 38, 38, 0.97) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='49' viewBox='0 0 28 49'%3E%3Cg fill-rule='evenodd'%3E%3Cg id='hexagons' fill='%23ffffff' fill-opacity='0.08' fill-rule='nonzero'%3E%3Cpath d='M13.99 9.25l13 7.5v15l-13 7.5L1 31.75v-15l12.99-7.5zM3 17.9v12.7l10.99 6.34 11-6.35V17.9l-11-6.34L3 17.9zM0 15l12.98-7.5V0h-2v6.35L0 12.69v2.3zm0 18.5L12.98 41v8h-2v-6.85L0 35.81v-2.3zM15 0v7.5L27.99 15H28v-2.31h-.01L17 6.35V0h-2zm0 49v-8l12.99-7.5H28v2.31h-.01L17 42.15V49h-2z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  box-shadow: 0 3px 12px rgba(127, 29, 29, 0.3);
}
body.theme-red .nav {
  background: linear-gradient(135deg, #b91c1c 0%, #7f1d1d 100%);
}
body.theme-red .notification-header,
body.theme-red .settings-header,
body.theme-red .modal-header {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}
body.theme-red .settings-icon { background: #fee2e2; }
body.theme-red .user-info-mini { background: linear-gradient(135deg, #fee2e2 0%, #fef2f2 100%); }
body.theme-red .settings-toggle.active { background: #dc2626; }
body.theme-red .notification-item.unread { background: #fef2f2; border-left-color: #dc2626; }
body.theme-red .section-head h2,
body.theme-red .section-head h3,
body.theme-red h2 { color: #b91c1c; }
body.theme-red .btn {
  background: #dc2626;
  box-shadow: 0 2px 4px rgba(220, 38, 38, 0.2);
}
body.theme-red .btn:hover {
  background: #b91c1c;
  box-shadow: 0 4px 8px rgba(220, 38, 38, 0.25);
}
body.theme-red th { background: linear-gradient(180deg, #dc2626 0%, #b91c1c 100%); }
body.theme-red input:focus,
body.theme-red textarea:focus,
body.theme-red select:focus { border-color: #dc2626; box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.1); }
body.theme-red .card::before { background: linear-gradient(90deg, #dc2626, #ef4444); }
body.theme-red .card { border-color: rgba(220, 38, 38, 0.08); }
body.theme-red .drop-zone { border-color: #dc2626; background: #fee2e2; color: #b91c1c; }
body.theme-red ::-webkit-scrollbar-thumb { background: #dc2626; }
body.theme-red ::-webkit-scrollbar-thumb:hover { background: #b91c1c; }
body.theme-red .checkbox-group input[type="checkbox"] { accent-color: #dc2626; }
body.theme-red .link-button { color: #dc2626; }
body.theme-red .link-button:hover { color: #b91c1c; }
body.theme-red .protocol-form summary { color: #b91c1c; }

/* ============================================
   COMPACT MODE
   ============================================ */
body.compact-mode {
  --font-xs: 0.58rem;
  --font-sm: 0.68rem;
  --font-base: 0.74rem;
  --font-lg: 0.84rem;
  --font-xl: 0.96rem;
  --radius: 8px;
  --radius-sm: 4px;
}

body.compact-mode .topbar {
  height: 56px;
  padding: 6px 16px;
}

body.compact-mode .brand h1 {
  font-size: 0.95rem;
}

body.compact-mode .brand p,
body.compact-mode .lab-subtitle {
  display: none;
}

body.compact-mode .logo {
  width: 32px;
  height: 32px;
  padding: 2px;
}

body.compact-mode .header-hexagon-bg {
  height: 56px;
}

body.compact-mode .quote-center {
  display: none !important;
}

body.compact-mode .nav {
  padding: 6px 16px;
  gap: 3px;
}

body.compact-mode .nav a {
  font-size: 0.7rem;
  padding: 5px 10px;
}

body.compact-mode .container {
  margin: 10px auto;
  padding: 0 10px;
}

body.compact-mode .card {
  padding: 10px 12px;
  margin-bottom: 10px;
  border-radius: 8px;
}

body.compact-mode .section-head {
  margin-bottom: 8px;
  padding-bottom: 6px;
}

body.compact-mode .section-head h2 {
  font-size: 0.85rem;
}

body.compact-mode h2 {
  font-size: 0.85rem;
  margin-bottom: 8px;
}

body.compact-mode h3 {
  font-size: 0.78rem;
  margin-bottom: 6px;
}

body.compact-mode .form-group {
  margin-bottom: 8px;
}

body.compact-mode label {
  font-size: 0.65rem;
  margin-bottom: 1px;
}

body.compact-mode input,
body.compact-mode select,
body.compact-mode textarea {
  padding: 5px 8px;
  font-size: 0.74rem;
  margin: 2px 0 6px;
  border-radius: 4px;
}

body.compact-mode textarea {
  min-height: 60px;
}

body.compact-mode .btn {
  padding: 5px 10px;
  font-size: 0.72rem;
  border-radius: 4px;
}

body.compact-mode .small-btn {
  padding: 3px 6px;
  font-size: 0.65rem;
}

body.compact-mode table {
  font-size: 0.7rem;
  border-radius: 6px;
}

body.compact-mode th {
  padding: 6px 8px;
  font-size: 0.62rem;
}

body.compact-mode td {
  padding: 5px 8px;
}

body.compact-mode .stats-grid {
  gap: 8px;
}

body.compact-mode .stat-item {
  padding: 8px;
}

body.compact-mode .stat-value {
  font-size: 0.85rem;
}

body.compact-mode .stat-label {
  font-size: 0.55rem;
}

body.compact-mode .filter-bar {
  gap: 6px;
  margin-bottom: 8px;
}

body.compact-mode .action-group {
  gap: 4px;
}

body.compact-mode .grid-2,
body.compact-mode .grid-3,
body.compact-mode .grid-4 {
  gap: 8px;
}

body.compact-mode .status-badge {
  font-size: 0.58rem;
  padding: 2px 6px;
}

body.compact-mode .flash {
  padding: 8px 10px;
  margin-bottom: 8px;
  font-size: 0.7rem;
}

body.compact-mode .drop-zone {
  padding: 16px;
  font-size: 0.75rem;
}

/* Compact mode on mobile */
@media (max-width: 600px) {
  body.compact-mode .topbar {
    height: 50px;
    padding: 6px 10px;
  }
  
  body.compact-mode .header-hexagon-bg {
    height: 50px;
  }
  
  body.compact-mode .brand h1 {
    font-size: 0.85rem;
  }
  
  body.compact-mode .logo {
    width: 28px;
    height: 28px;
  }
  
  body.compact-mode .container {
    margin: 8px auto;
    padding: 0 8px;
  }
  
  body.compact-mode .nav {
    padding: 6px 10px;
    gap: 2px;
  }
  
  body.compact-mode .nav a {
    font-size: 0.6rem;
    padding: 4px 6px;
  }
  
  body.compact-mode .card {
    padding: 8px 10px;
    margin-bottom: 8px;
  }
  
  body.compact-mode .btn {
    padding: 6px 10px;
    font-size: 0.7rem;
  }
  
  body.compact-mode .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }
}

/* ============================================
   HIDE QUOTES
   ============================================ */
body.hide-quotes .quote-center {
  display: none !important;
}

