/* =============================================
   AuditTool - Main CSS (Mobile First)
   ============================================= */

/* TML (TUI MAGIC LIFE) als Standard-Theme */
:root {
  --color-primary: #00264f;       /* TML Midnight */
  --color-primary-light: #003166; /* TML Light Midnight */
  --color-primary-deep: #001933;  /* TML Deep Midnight */
  --color-accent: #50c7da;        /* TML Pool */
  --color-accent-light: #81d7e4;  /* TML Light Pool */
  --color-accent-2: #ff3e86;      /* TML Flamingo */
  --color-accent-2-light: #ff70a5;/* TML Light Flamingo */
  --color-highlight: #fff500;     /* TML Sun */
  --color-highlight-light: #fffb9b;/* TML Light Sun */
  --color-success: #2ecc71;
  --color-warning: #f39c12;
  --color-error: #e74c3c;
  --color-bg: #f0f6fa;
  --color-card: #ffffff;
  --color-text: #00264f;          /* TML Midnight fuer Text */
  --color-text-light: #003166;
  --color-border: #81d7e4;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.12);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --color-text-muted: #6c7a8d;
  --max-width: 1200px;
  --header-height: 56px;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  width: 100%;
}

/* ---- Header ---- */
.app-header {
  background: var(--color-primary);
  color: #fff;
  height: var(--header-height);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  letter-spacing: 0.5px;
}

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

.user-info {
  font-size: 0.875rem;
  opacity: 0.9;
}

.badge {
  display: inline-block;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  font-weight: 600;
}

.badge-admin {
  background: var(--color-accent-2);
  color: #fff;
}

/* ---- Container ---- */
.container {
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
  padding: 20px 16px;
  flex: 1;
  box-sizing: border-box;
  overflow-x: hidden;
}

/* ---- Footer ---- */
.app-footer {
  text-align: center;
  padding: 20px 16px;
  color: var(--color-text-light);
  font-size: 0.75rem;
  opacity: 0.6;
}
.app-footer .footer-legal { margin-top: 4px; font-size: 0.75rem }
.app-footer .footer-legal a { color: inherit; text-decoration: none }
.app-footer .footer-legal a:hover { text-decoration: underline }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, transform 0.1s;
  min-height: 44px;
  touch-action: manipulation;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
  font-weight: 700;
}

.btn-primary:hover {
  background: var(--color-primary-light);
}

.btn-action {
  background: var(--color-accent-2);
  color: #fff;
  font-weight: 600;
}

.btn-action:hover {
  background: var(--color-accent-2-light);
  color: #fff;
}

.btn-danger {
  background: var(--color-error);
  color: #fff;
  font-weight: 600;
}

.btn-danger:hover {
  opacity: 0.9;
}

.btn-outline {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.4);
}

.btn-outline:hover {
  background: rgba(255,255,255,0.1);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  min-height: 36px;
}

.btn-full {
  width: 100%;
}

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

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

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: var(--font);
  background: #fff;
  color: var(--color-text);
  transition: border-color 0.2s;
  min-height: 44px;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(80, 199, 218, 0.15);
}

/* ---- Alerts ---- */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 0.9rem;
}

.alert-error {
  background: #fdeaea;
  color: var(--color-error);
  border: 1px solid #f5c6cb;
}

.alert-success {
  background: #e8f8ef;
  color: #27ae60;
  border: 1px solid #a3d9b1;
}

/* ---- Login Page ---- */
.login-page {
  background: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.login-container {
  width: 100%;
  max-width: 400px;
  padding: 16px;
}

.login-card {
  background: var(--color-card);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  box-shadow: var(--shadow-lg);
}

.login-title {
  text-align: center;
  font-size: 1.5rem;
  color: var(--color-primary);
  margin-bottom: 4px;
}

.login-subtitle {
  text-align: center;
  color: var(--color-text-light);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

.login-footer {
  text-align: center;
  color: rgba(255,255,255,0.3);
  font-size: 0.7rem;
  margin-top: 24px;
}

/* ---- Dashboard ---- */
.dashboard-title {
  font-size: 1.3rem;
  margin-bottom: 4px;
}

.dashboard-subtitle {
  color: var(--color-text-light);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 32px;
}

.module-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px 16px;
  background: var(--color-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--color-text);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  min-height: 120px;
  cursor: pointer;
  position: relative;
  border: 2px solid transparent;
}

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

.module-card:active {
  transform: scale(0.97);
}

.module-card--disabled {
  opacity: 0.5;
  cursor: default;
  pointer-events: none;
}

.module-icon {
  font-size: 2rem;
  margin-bottom: 8px;
}

.module-title {
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.3;
}

.module-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--color-border);
  color: var(--color-text-light);
  font-size: 0.6rem;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  font-weight: 600;
}

.module-card--admin {
  background: var(--color-primary);
  color: #fff;
  min-height: 80px;
  border-color: var(--color-primary);
}

.module-card--admin:hover {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-primary);
}

.module-grid--small {
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
}

.admin-section h2 {
  font-size: 1rem;
  color: var(--color-text-light);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

/* ---- Error Page ---- */
.error-page {
  text-align: center;
  padding: 60px 20px;
}

.error-page h1 {
  font-size: 1.5rem;
  margin-bottom: 12px;
}

.error-page p {
  color: var(--color-text-light);
  margin-bottom: 24px;
}

/* ---- ROB (ROBINSON) Theme Override ---- */
[data-brand="ROB"] {
  --color-primary: #0047AB;       /* ROB Azur */
  --color-primary-light: #0A4169; /* ROB Kobalt */
  --color-primary-deep: #32374B;  /* ROB Grau 1 */
  --color-accent: #00AFAA;        /* ROB Aqua */
  --color-accent-light: #00AFAA;
  --color-accent-2: #E6374B;      /* ROB Korall */
  --color-accent-2-light: #E6374B;
  --color-highlight: #A0E673;     /* ROB Kiwi */
  --color-highlight-light: #A0E673;
  --color-bg: #f0f4f8;
  --color-text: #0A4169;          /* ROB Kobalt */
  --color-text-light: #5F6473;    /* ROB Grau 2 */
  --color-border: #BEC3C8;        /* ROB Grau 4 */
}

/* ---- TML (TUI MAGIC LIFE) Theme Override ---- */
[data-brand="TML"] {
  --color-primary: #fff500;        /* SUN Gelb - Header & Hauptfarbe */
  --color-primary-light: #fffb9b;  /* Light Sun */
  --color-primary-deep: #f5e400;   /* Deep Sun */
  --color-accent: #50c7da;         /* Pool Tuerkis */
  --color-accent-light: #81d7e4;   /* Light Pool */
  --color-accent-2: #ff3e86;       /* Flamingo Pink */
  --color-accent-2-light: #ff70a5; /* Light Flamingo */
  --color-highlight: #ff3e86;      /* Flamingo */
  --color-highlight-light: #ff70a5;
  --color-bg: #fffef2;             /* Warmer sonniger Hintergrund */
  --color-text: #00264f;           /* Midnight fuer Text */
  --color-text-light: #003166;     /* Light Midnight */
  --color-text-muted: #003166;
  --color-border: #81d7e4;         /* Light Pool */
}
/* TML: Dunkler Text auf gelbem Header */
[data-brand="TML"] .app-header {
  color: #00264f;
  box-shadow: 0 2px 8px rgba(255, 245, 0, 0.4);
}
[data-brand="TML"] .logo { color: #00264f; font-weight: 800; }
[data-brand="TML"] .user-info { color: #00264f; opacity: 1; }
[data-brand="TML"] .badge-admin { background: #ff3e86; color: #fff; }
[data-brand="TML"] .btn-outline {
  color: #00264f;
  border-color: rgba(0, 38, 79, 0.3);
}
[data-brand="TML"] .btn-outline:hover {
  background: rgba(0, 38, 79, 0.1);
}
/* TML: Buttons in Flamingo Pink */
[data-brand="TML"] .btn-primary {
  background: #ff3e86;
  color: #fff;
}
[data-brand="TML"] .btn-primary:hover {
  background: #d4155d;
}
/* TML: Module-Cards Hover in Flamingo */
[data-brand="TML"] .module-card:hover {
  border-color: #ff3e86;
  box-shadow: 0 4px 16px rgba(255, 62, 134, 0.2);
}
/* TML: Admin-Cards in Midnight */
[data-brand="TML"] .module-card--admin {
  background: #00264f;
  border-color: #00264f;
  color: #fff;
}
[data-brand="TML"] .module-card--admin:hover {
  background: #ff3e86;
  border-color: #ff3e86;
  color: #fff;
}
/* TML: Tabellen-Header in Midnight */
[data-brand="TML"] .data-table th {
  background: #00264f;
  color: #fff;
}
/* TML: Kategorie-Header in Flamingo */
[data-brand="TML"] .category-title,
[data-brand="TML"] .category-header {
  background: #ff3e86;
  color: #fff;
}
[data-brand="TML"] .field-type-badge {
  background: #00264f;
}
/* TML: Links und Akzente */
[data-brand="TML"] .data-table a { color: #ff3e86; }
[data-brand="TML"] .data-table a:hover { color: #d4155d; }
/* TML: Toast in Midnight */
[data-brand="TML"] .toast--info { background: #00264f; }
/* TML: Focus-Ring in Flamingo */
[data-brand="TML"] .form-group input:focus,
[data-brand="TML"] .form-group textarea:focus,
[data-brand="TML"] .form-group select:focus {
  border-color: #ff3e86;
  box-shadow: 0 0 0 3px rgba(255, 62, 134, 0.15);
}
[data-brand="TML"] .form-input:focus {
  border-color: #ff3e86;
  box-shadow: 0 0 0 3px rgba(255, 62, 134, 0.15);
}
/* TML: Audit Form overrides (af-* classes use --color-primary which is yellow) */
[data-brand="TML"] .af-title { color: #00264f; }
[data-brand="TML"] .af-card-title { background: #ff3e86; color: #fff; }
[data-brand="TML"] .af-question-label { color: #00264f; }
[data-brand="TML"] .af-tab.active { border-color: #ff3e86; color: #00264f; }
[data-brand="TML"] .af-tab.active .tab-icon { border-color: #ff3e86; color: #ff3e86; }
[data-brand="TML"] .af-tab.done.active { border-color: #ff3e86; }

/* ---- Page Header ---- */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-header h1 {
  font-size: 1.3rem;
}

.page-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---- Cards ---- */
.card {
  background: var(--color-card);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  box-sizing: border-box;
  max-width: 100%;
  overflow-x: hidden;
}
@media (min-width:768px) {
  .card { padding: 24px; }
}

.text-light { color: var(--color-text-light); font-size: 0.9rem; margin-bottom: 16px; }
.empty-state { color: var(--color-text-light); text-align: center; padding: 40px 20px; }

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.data-table th, .data-table td {
  padding: 12px 16px;
  text-align: left;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--color-border);
}
.data-table th {
  background: var(--color-primary);
  color: #fff;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.data-table a { color: var(--color-primary); text-decoration: none; font-weight: 600; }
.data-table a:hover { text-decoration: underline; color: var(--color-accent-2); }
.actions { display: flex; gap: 6px; }

/* ---- Status Badges ---- */
.status-badge {
  display: inline-block;
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  font-weight: 600;
}
.status-draft { background: #ffeaa7; color: #856404; }
.status-published { background: #d4edda; color: #155724; }
.status-archived { background: var(--color-border); color: var(--color-text-light); }
.status-finalized { background: #d4edda; color: #155724; }
.status-locked { background: #f8d7da; color: #721c24; }
.status-user { background: var(--color-accent); color: #fff; }
.status-admin { background: var(--color-accent-2); color: #fff; }

/* ---- Modals ---- */
.modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}
.modal-content {
  background: var(--color-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal-content--wide { max-width: 600px; }
.modal-actions { display: flex; gap: 8px; margin-top: 16px; }

/* ---- Buttons extra ---- */
.btn-outline-dark {
  background: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-border);
}
.btn-outline-dark:hover { background: var(--color-bg); }

/* ---- Form extras ---- */
.form-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.form-row .form-group { flex: 1; min-width: 140px; }
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 6px 0;
}

/* ---- Vertraulich Pill Toggle ---- */
.conf-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border: 2px solid var(--color-border);
  border-radius: 50px;
  background: var(--color-card);
  cursor: pointer;
  user-select: none;
  transition: all 0.25s ease;
  font-size: 0.9rem;
}
.conf-pill:hover {
  border-color: var(--color-text-muted);
}
.conf-pill input { display: none }
.conf-pill-track {
  position: relative;
  width: 44px;
  height: 24px;
  background: #ccd3dc;
  border-radius: 12px;
  transition: background 0.25s ease;
  flex-shrink: 0;
}
.conf-pill-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.25s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.conf-pill input:checked ~ .conf-pill-track {
  background: var(--color-error);
}
.conf-pill input:checked ~ .conf-pill-track .conf-pill-thumb {
  transform: translateX(20px);
}
.conf-pill-icon {
  font-size: 1rem;
  opacity: 0.4;
  transition: opacity 0.25s ease;
}
.conf-pill input:checked ~ .conf-pill-icon {
  opacity: 1;
}
.conf-pill-text {
  font-weight: 600;
  color: var(--color-text-muted);
  transition: color 0.25s ease;
  letter-spacing: 0.3px;
}
.conf-pill input:checked ~ .conf-pill-text {
  color: var(--color-error);
}
.conf-pill.active {
  border-color: var(--color-error);
  background: rgba(231, 76, 60, 0.04);
}

.form-actions { display: flex; gap: 8px; margin-top: 16px; }
.form-input {
  width: 100%;
  max-width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-family: var(--font);
  background: #fff;
  min-height: 44px;
  box-sizing: border-box;
}
.form-input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(80,199,218,0.15);
}

/* ---- Template Editor ---- */
.editor-section { margin-bottom: 24px; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.section-header h2 { font-size: 1.1rem; }
.category-block {
  background: var(--color-card);
  border-radius: var(--radius);
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--color-primary);
  color: #fff;
}
.category-header h3 { font-size: 0.95rem; }
.category-actions { display: flex; gap: 6px; }
.question-item {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid var(--color-border);
  gap: 12px;
}
.question-item:last-child { border-bottom: none; }
.question-label { flex: 1; font-size: 0.9rem; }
.question-meta { display: flex; gap: 4px; flex-wrap: wrap; }
.question-actions { display: flex; gap: 4px; }
.field-type-badge {
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 3px;
  background: var(--color-primary);
  color: #fff;
  font-weight: 600;
  text-transform: uppercase;
}

/* ---- Audit Form ---- */
.audit-category {
  background: var(--color-card);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.category-title {
  padding: 14px 20px;
  background: var(--color-primary);
  color: #fff;
  font-size: 1rem;
  margin: 0;
}
.audit-question {
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
}
.audit-question:last-child { border-bottom: none; }
.question-label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 8px;
  color: var(--color-text);
}
.additional-notes { margin-top: 8px; }
.notes-field { margin-top: 6px; }
.input-with-suffix { display: flex; align-items: center; gap: 8px; }
.input-suffix { font-weight: 600; color: var(--color-text-light); }
.answer-value { font-size: 0.95rem; padding: 8px 0; }
.answer-notes { font-size: 0.85rem; color: var(--color-text-light); padding: 4px 0; }

/* ---- Sticky Save ---- */
.sticky-save {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  max-width: 100vw;
  padding: 10px 12px;
  background: var(--color-card);
  box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
  display: flex;
  justify-content: center;
  gap: 8px;
  z-index: 90;
  box-sizing: border-box;
}

/* ---- Asset Grid ---- */
.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.asset-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  background: var(--color-bg);
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s, transform 0.1s;
  font-family: var(--font);
}
.asset-card:hover { border-color: var(--color-accent); transform: translateY(-2px); }
.asset-name { font-weight: 600; font-size: 0.95rem; }
.asset-type { font-size: 0.75rem; color: var(--color-text-light); text-transform: uppercase; margin-top: 4px; }

/* ---- Notebook ---- */
.notebook-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
}
.notebook-card {
  background: var(--color-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--color-text);
  transition: transform 0.15s, box-shadow 0.15s;
  border: 2px solid transparent;
}
.notebook-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--color-accent); }
.notebook-card h3 { font-size: 1rem; margin-bottom: 6px; }
.notebook-dest { font-size: 0.9rem; color: var(--color-accent); font-weight: 600; }
.notebook-dates { font-size: 0.8rem; color: var(--color-text-light); }
.notebook-meta { font-size: 0.75rem; color: var(--color-text-light); margin-top: 8px; }

/* ---- Toast ---- */
.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  z-index: 2000;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
}
.toast--visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast--success { background: #27ae60; color: #fff; }
.toast--error { background: var(--color-error); color: #fff; }
.toast--info { background: var(--color-primary); color: #fff; }

/* ---- Desktop ---- */
@media (min-width: 768px) {
  .module-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .login-card {
    padding: 40px 32px;
  }

  .container {
    padding: 32px 40px;
  }

  .audit-category {
    padding: 24px 28px;
  }

  /* 2-column grid for audit questions on desktop */
  .audit-category .audit-questions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 24px;
  }

  /* Full-width for textareas and image uploads */
  .audit-question:has(textarea),
  .audit-question:has(.image-upload-area) {
    grid-column: 1 / -1;
  }

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

  /* Wider table */
  .data-table {
    font-size: 0.95rem;
  }

  .page-header {
    padding: 16px 0;
  }
}

/* =============================================
   Image Upload
   ============================================= */
.image-upload-area {
  margin-top: 8px;
}
.image-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}
.image-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--color-border);
}
.image-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: pointer;
}
.image-delete-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  font-size: 16px;
  line-height: 24px;
  text-align: center;
  cursor: pointer;
  padding: 0;
}
.image-delete-btn:hover { background: var(--color-error); }
.image-upload-btn {
  display: inline-block;
  cursor: pointer;
  margin-top: 4px;
}
.image-hint {
  display: inline-block;
  margin-left: 8px;
  color: var(--color-accent-2);
  font-weight: 600;
}

/* =============================================
   Changelog Timeline
   ============================================= */
.changelog-timeline { }
.changelog-group {
  border-left: 3px solid var(--color-accent);
  padding-left: 16px;
  margin-bottom: 16px;
  position: relative;
}
.changelog-group::before {
  content: '';
  position: absolute;
  left: -7px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-accent);
}
.changelog-header {
  font-size: 0.85rem;
  color: var(--color-muted);
  margin-bottom: 4px;
}
.changelog-entries {
  list-style: none;
  padding: 0;
  margin: 0;
}
.changelog-entries li {
  font-size: 0.85rem;
  padding: 2px 0;
  border-bottom: 1px solid var(--color-border);
}
.changelog-entries li:last-child { border-bottom: none; }
.changelog-field {
  font-weight: 600;
  color: var(--color-text);
}
.changelog-old {
  color: var(--color-error);
  text-decoration: line-through;
}
.changelog-new {
  color: var(--color-success);
  font-weight: 500;
}

/* =============================================
   Asset Profile Tabs
   ============================================= */
.profile-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 0;
  border-bottom: 2px solid var(--color-border);
  padding-bottom: 0;
}
.profile-tab {
  padding: 8px 16px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
}
.profile-tab:hover { color: var(--color-primary); }
.profile-tab.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  font-weight: 600;
}
.profile-content { margin-top: 16px; }
.profile-panel { display: none; }
.profile-panel.active { display: block; }
.profile-panel h3 {
  font-size: 1rem;
  margin-bottom: 12px;
  color: var(--color-primary);
}
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 6px;
}
.course-form {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 8px;
}
.course-form h4 {
  font-size: 0.9rem;
  margin-bottom: 8px;
  color: var(--color-primary);
}
.hole-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.hole-table th {
  background: var(--color-primary);
  color: #fff;
  padding: 4px 8px;
  text-align: left;
  font-weight: 600;
}
.hole-table td {
  padding: 2px 4px;
  border-bottom: 1px solid var(--color-border);
}
.hole-input {
  width: 70px;
  padding: 4px 6px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-size: 0.85rem;
  text-align: center;
}

/* Hotel profile sections */
.profile-section {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
}
.profile-section h4 {
  font-size: 0.9rem;
  margin-bottom: 8px;
  color: var(--color-primary);
}
.repeater-item {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 8px;
  position: relative;
}
.repeater-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--color-error);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-size: 0.8rem;
  cursor: pointer;
  line-height: 22px;
  text-align: center;
}
.repeater-add {
  font-size: 0.8rem;
  margin-top: 4px;
}
