@font-face {
  font-family: 'Raleway';
  src: url('/fonts/Raleway-Variable.ttf') format('truetype');
  font-weight: 100 900;
  font-display: swap;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary-color: #2E9B3E;
  --primary-dark: #247D31;
  --primary-light: #8CC63F;
  --primary-bg: #e6f4ea;
  --warning-color: #f59e0b;
  --warning-bg: #fef3c7;
  --error-color: #ea4335;
  --error-bg: #fce8e6;
  --info-color: #3b82f6;
  --info-bg: #dbeafe;
  --text-color: #202124;
  --text-secondary: #5f6368;
  --background: #f0f5f1;
  --surface: #ffffff;
  --border-color: #e2e8e3;
  --success-color: var(--success-color);
  --bewerking-bg: #f3e8ff;
  --bewerking-color: var(--bewerking-color);
  --cache-note-color: var(--cache-note-color);
  --cache-note-border: #fbbf24;
  --sidebar-width: 250px;
}

body {
  font-family: 'Raleway', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background-color: var(--background);
  color: var(--text-color);
  line-height: 1.5;
  min-height: 100vh;
}

button, input, select, textarea {
  font-family: inherit;
}

/* ========================
   Sidebar
   ======================== */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background-color: var(--primary-light);
  display: flex;
  flex-direction: column;
  z-index: 100;
}

.sidebar-header {
  padding: 1.5rem 1.25rem;
  display: flex;
  justify-content: center;
}

.sidebar-logo-link {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: white;
  border-radius: 12px;
  padding: 0.75rem 1.25rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.sidebar-logo {
  height: 60px;
  width: auto;
}

.sidebar-nav {
  flex: 1;
  padding: 0.25rem 0.75rem;
  overflow-y: auto;
}

.sidebar-nav-item,
.sidebar-logout {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.7rem 1rem;
  border: none;
  background: none;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  border-radius: 10px;
  transition: all 0.2s;
}

.sidebar-nav-item {
  font-size: 0.95rem;
  text-align: left;
  margin-bottom: 0.15rem;
}

.sidebar-nav-item:hover,
.sidebar-logout:hover {
  color: white;
  background-color: rgba(255, 255, 255, 0.2);
}

.sidebar-nav-item.active {
  color: white;
  background-color: var(--primary-color);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.sidebar-nav-item.active .nav-icon {
  stroke: white;
}

.nav-icon {
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 0.75rem;
  border-top: 1px solid rgba(46, 155, 62, 0.15);
}

.sidebar-logout {
  font-size: 0.9rem;
}

/* ========================
   Status icon
   ======================== */
.status-icon {
  display: flex;
  align-items: center;
}

.status-icon .offline-circle,
.status-icon .offline-line {
  display: none;
}

.status-icon.offline .offline-circle,
.status-icon.offline .offline-line {
  display: initial;
}

/* ========================
   Mobile header
   ======================== */
.mobile-header {
  display: none;
}

/* ========================
   Content wrapper + toolbar
   ======================== */
.content-wrapper {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
}

.toolbar {
  display: flex;
  justify-content: flex-end;
  padding: 0.75rem 2rem 0;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toolbar-icon {
  color: var(--text-secondary);
  cursor: default;
}

/* ========================
   Main content
   ======================== */
#content {
  padding: 1.5rem 2rem;
}

.loading {
  text-align: center;
  padding: 2rem;
  color: var(--text-secondary);
}

/* ========================
   Page header
   ======================== */
.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--text-color);
}

/* ========================
   Stat cards (dashboard)
   ======================== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--surface);
  border-radius: 12px;
  padding: 1.25rem;
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon.green {
  background-color: var(--primary-bg);
  color: var(--primary-color);
}

.stat-icon.orange {
  background-color: var(--warning-bg);
  color: var(--warning-color);
}

.stat-icon.blue {
  background-color: var(--info-bg);
  color: var(--info-color);
}

.stat-icon.red {
  background-color: var(--error-bg);
  color: var(--error-color);
}

.stat-info {
  min-width: 0;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
}

/* ========================
   Login
   ======================== */
.login-container {
  max-width: 400px;
  margin: 3rem auto;
}

.login-logo {
  display: block;
  max-width: 180px;
  margin: 0 auto 2rem auto;
}

/* ========================
   Cards
   ======================== */
.card {
  background: var(--surface);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border-color);
}

.card-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

/* ========================
   Empty state
   ======================== */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-secondary);
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--primary-bg);
  color: var(--primary-color);
}

.empty-state p {
  font-size: 0.95rem;
}

/* ========================
   Task list (dashboard)
   ======================== */
.task-list {
  list-style: none;
}

.task-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border-color);
}

.task-item:last-child {
  border-bottom: none;
}

.task-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.task-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.task-title {
  font-weight: 600;
  font-size: 0.9rem;
}

.task-subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.task-action {
  font-size: 0.85rem;
  color: var(--primary-color);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  background: none;
  border: none;
}

.task-action:hover {
  text-decoration: underline;
}

/* ========================
   Buttons
   ======================== */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: all 0.2s;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
  box-shadow: 0 2px 8px rgba(46, 155, 62, 0.25);
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  box-shadow: 0 4px 12px rgba(46, 155, 62, 0.35);
}

.btn-block {
  display: block;
  width: 100%;
}

/* ========================
   Forms
   ======================== */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  font-size: 0.9rem;
}

.form-group input:not([type="checkbox"]):not([type="radio"]),
.form-group select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:not([type="checkbox"]):not([type="radio"]):focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(46, 155, 62, 0.15);
}

.form-group input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.form-group input[type="number"]::-webkit-inner-spin-button,
.form-group input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.form-group label:has(input[type="checkbox"]) {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.form-group input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary-color);
  cursor: pointer;
  flex-shrink: 0;
}

.error-message {
  color: var(--error-color);
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

/* ========================
   Status badges
   ======================== */
.status-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.status-nieuw {
  background-color: var(--primary-bg);
  color: var(--primary-color);
}

.status-in_behandeling {
  background-color: var(--warning-bg);
  color: var(--warning-color);
}

.status-afgerond {
  background-color: var(--primary-bg);
  color: var(--success-color);
}

.status-geannuleerd {
  background-color: var(--error-bg);
  color: var(--error-color);
}

.status-onbevestigd {
  background-color: var(--warning-bg);
  color: var(--warning-color);
}

.status-bevestigd {
  background-color: var(--primary-bg);
  color: var(--success-color);
}

.status-niet_gelukt {
  background-color: var(--error-bg);
  color: var(--error-color);
}

.type-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
}

.type-gewasbescherming {
  background-color: var(--info-bg);
  color: var(--info-color);
}

.type-bewerking {
  background-color: var(--bewerking-bg);
  color: var(--bewerking-color);
}

/* ========================
   Date filter
   ======================== */
.date-filter {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.date-filter-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-color);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s;
}

.date-filter-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.date-filter-btn.active {
  background-color: var(--primary-bg);
  border-color: var(--primary-color);
  color: var(--primary-color);
  font-weight: 600;
}

.date-filter-arrow {
  padding: 0.5rem;
}

.date-filter-print {
  margin-left: auto;
  text-decoration: none;
  gap: 0.4rem;
}

.date-filter-picker {
  position: relative;
  display: inline-flex;
}

.date-filter-picker-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-color);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.date-filter-picker:hover .date-filter-picker-label {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.date-filter-picker-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
  -webkit-appearance: none;
  appearance: none;
  font-size: 1rem;
}

/* ========================
   Opdracht list & detail
   ======================== */
.opdracht-list {
  list-style: none;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1rem 0;
}

.pagination-btn {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-color);
  cursor: pointer;
  font-size: 0.875rem;
}

.pagination-btn:hover:not(:disabled) {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination-info {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.day-header {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.75rem 0 0.35rem;
  margin-top: 0.5rem;
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 1;
  list-style: none;
}

.day-header:first-child {
  margin-top: 0;
}

.opdracht-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: background-color 0.15s;
}

.opdracht-item:last-child {
  border-bottom: none;
}

.opdracht-item:hover {
  background-color: var(--primary-bg);
  margin: 0 -1.5rem;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.opdracht-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.opdracht-icon.gewasbescherming {
  background-color: var(--info-bg);
  color: var(--info-color);
}

.opdracht-icon.bewerking {
  background-color: var(--bewerking-bg);
  color: var(--bewerking-color);
}

.opdracht-info {
  flex: 1;
  min-width: 0;
}

.opdracht-title {
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.opdracht-subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.opdracht-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
  flex-shrink: 0;
}

.opdracht-date {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.opdracht-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

@media (max-width: 768px) {
  .opdracht-detail-grid {
    grid-template-columns: 1fr;
  }

  .detail-columns {
    flex-direction: column;
    gap: 1rem;
  }

  .opdracht-item:hover {
    margin: 0;
    padding-left: 0;
    padding-right: 0;
  }

  .detail-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .detail-header-title {
    font-size: 1rem;
  }

  .middelen-table {
    font-size: 0.8rem;
  }

  .middelen-table th,
  .middelen-table td {
    padding: 0.4rem 0.5rem;
  }
}

.detail-columns {
  display: flex;
  gap: 2rem;
  margin-bottom: 1rem;
}

.detail-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.detail-field {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.detail-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.detail-value {
  font-size: 0.95rem;
}

.middelen-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.middelen-table th,
.middelen-table td {
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.middelen-table th {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.middelen-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.middelen-edit-section {
  margin: 0.75rem 0;
}

.middelen-edit-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.5rem;
}

.middel-edit-row {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-color);
}

.middel-edit-row:last-child {
  border-bottom: none;
}

.middel-edit-name {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.middel-edit-fields {
  display: flex;
  gap: 0.75rem;
}

.middel-edit-field {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.middel-edit-field label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  min-width: 3rem;
}

.middel-edit-field input {
  width: 5rem;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 0.9rem;
  text-align: right;
}

.middel-edit-field input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(46, 155, 62, 0.15);
}

.middel-unit {
  font-size: 0.8rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.detail-header-title {
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  word-break: break-word;
}

.detail-header-badges {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-shrink: 0;
}

/* ========================
   Misc
   ======================== */
.back-link {
  color: var(--primary-color);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  font-weight: 500;
}

.back-link:hover {
  text-decoration: underline;
}

.cache-note {
  background-color: var(--warning-bg);
  color: var(--cache-note-color);
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-size: 0.875rem;
  margin-bottom: 1rem;
  border: 1px solid var(--cache-note-border);
}

/* ========================
   Loading spinner
   ======================== */
@keyframes btn-spin {
  to { transform: rotate(360deg); }
}

.btn-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.8;
}

.btn-loading .btn-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: btn-spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 0.5rem;
}

/* ========================
   Modal
   ======================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1rem;
}

.modal {
  background: var(--surface);
  border-radius: 16px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
}

.modal-close:hover {
  color: var(--text-color);
  background: var(--background);
}

.modal-body {
  padding: 1.25rem;
  overflow-y: auto;
  flex: 1;
}

.modal-body textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  font-size: 1rem;
  font-family: inherit;
  resize: vertical;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.modal-body textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(46, 155, 62, 0.15);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border-color);
}

.radio-group {
  display: flex;
  gap: 0.5rem;
}

.radio-label {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.65rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  transition: all 0.2s;
}

.radio-label:hover {
  border-color: var(--primary-color);
}

.radio-label:has(input:checked) {
  background-color: var(--primary-bg);
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.radio-label input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.btn-secondary {
  background-color: transparent;
  color: var(--text-color);
  border: 1px solid var(--border-color);
  box-shadow: none;
}

.btn-secondary:hover {
  background-color: var(--background);
}

.btn-confirm {
  margin-top: 1.5rem;
  font-size: 1.1rem;
  padding: 0.9rem 1.5rem;
}

/* ========================
   Dark mode
   ======================== */
@media (prefers-color-scheme: dark) {
  :root {
    --background: #1a1a1a;
    --surface: #2d2d2d;
    --text-color: #e0e0e0;
    --text-secondary: #a0a0a0;
    --border-color: #404040;
    --primary-bg: #1a3a1a;
    --warning-bg: #3a3418;
    --error-bg: #3a1a1a;
    --info-bg: #1a2a3a;
    --success-color: #4ade80;
    --bewerking-bg: #2a1a3a;
    --bewerking-color: #c084fc;
    --cache-note-color: #f0c040;
    --cache-note-border: #5a4a20;
  }

  .form-group input,
  .form-group select {
    background-color: #353535;
    color: var(--text-color);
  }

  .cache-note {
    background-color: #3a3418;
  }

  .modal-body textarea {
    background-color: #353535;
    color: var(--text-color);
  }

  .date-filter-picker-input {
    color-scheme: dark;
  }

  .modal-overlay {
    background: rgba(0, 0, 0, 0.7);
  }
}

/* ========================
   Bottom navigation (mobile)
   ======================== */
.bottom-nav {
  display: none;
}

/* ========================
   Mobile layout
   ======================== */
@media (max-width: 768px) {
  .mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--primary-color);
    color: white;
    padding: 0.6rem 1rem;
    position: sticky;
    top: 0;
    z-index: 99;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  }

  .mobile-header-logo {
    height: 28px;
    width: auto;
    filter: brightness(0) invert(1);
  }

  .sidebar {
    display: none !important;
  }

  .content-wrapper {
    margin-left: 0 !important;
  }

  .toolbar {
    display: none !important;
  }

  #content {
    padding: 1rem;
    padding-bottom: 4.5rem;
  }

  .stat-grid {
    grid-template-columns: 1fr;
  }

  .login-container {
    margin: 1.5rem auto;
  }

  /* Modal full-screen on mobile */
  .modal-overlay {
    padding: 0;
    align-items: stretch;
  }

  .modal {
    max-width: none;
    max-height: none;
    border-radius: 0;
    height: 100%;
  }

  /* Bottom nav */
  .bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: var(--surface);
    border-top: 1px solid var(--border-color);
    padding: 0.5rem 0;
    z-index: 100;
    box-shadow: 0 -1px 8px rgba(0, 0, 0, 0.06);
  }

  .bottom-nav-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: none;
    background: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.2s;
  }

  .bottom-nav-item.active {
    color: var(--primary-color);
    background-color: var(--primary-bg);
  }

  .bottom-nav-item:hover {
    color: var(--primary-color);
  }
}

/* ========================
   Log panel
   ======================== */
#log-toggle {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  padding: 0.5rem 1rem;
  background-color: #333;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.875rem;
  z-index: 1000;
  opacity: 0.7;
  transition: opacity 0.2s;
}

#log-toggle:hover,
#log-toggle.active {
  opacity: 1;
}

#log-toggle.active {
  background-color: var(--primary-color);
}

#log-panel {
  position: fixed;
  bottom: 3.5rem;
  right: 1rem;
  width: 450px;
  max-width: calc(100vw - 2rem);
  height: 350px;
  background-color: #1e1e1e;
  color: #d4d4d4;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  z-index: 999;
  display: none;
  flex-direction: column;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.75rem;
}

#log-panel.visible {
  display: flex;
}

.log-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  background-color: #333;
  border-radius: 8px 8px 0 0;
  font-weight: 500;
}

.log-btn {
  background: none;
  border: none;
  color: #d4d4d4;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
}

.log-btn:hover {
  color: white;
}

#log-content {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
}

.log-entry {
  padding: 0.25rem 0.5rem;
  border-bottom: 1px solid #333;
  line-height: 1.4;
}

.log-entry:last-child {
  border-bottom: none;
}

.log-time {
  color: #808080;
  margin-right: 0.5rem;
}

.log-type {
  font-weight: bold;
  margin-right: 0.5rem;
}

.log-req .log-type { color: #569cd6; }
.log-res .log-type { color: #4ec9b0; }
.log-err .log-type { color: #f14c4c; }
.log-info .log-type { color: #dcdcaa; }
.log-net .log-type { color: #c586c0; }

.log-entry pre {
  margin: 0.25rem 0 0 0;
  padding: 0.25rem;
  background-color: #2d2d2d;
  border-radius: 2px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  font-size: 0.7rem;
}
