/* ===== GITreal — Glassmorphism Theme ===== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --bg-gradient: linear-gradient(145deg, #e8eaf0 0%, #c9cdd6 30%, #d5d0dc 60%, #e0dce6 100%);
  --surface: rgba(255, 255, 255, 0.45);
  --surface-hover: rgba(255, 255, 255, 0.6);
  --text: #1a1a2e;
  --text-secondary: rgba(26, 26, 46, 0.55);
  --primary: rgba(80, 100, 200, 0.85);
  --primary-glow: rgba(80, 100, 200, 0.3);
  --success: rgba(34, 180, 100, 0.85);
  --success-glow: rgba(34, 180, 100, 0.25);
  --danger: rgba(220, 60, 60, 0.85);
  --danger-glow: rgba(220, 60, 60, 0.25);
  --border: rgba(255, 255, 255, 0.5);
  --border-subtle: rgba(255, 255, 255, 0.25);
  --glass-blur: 20px;
  --btn-bg: rgba(255, 255, 255, 0.45);
  --btn-bg-hover: rgba(255, 255, 255, 0.6);
  --card-bg: #ebebef;
  --glass-shadow: 0 4px 30px rgba(0, 0, 0, 0.06);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body.dark {
  --bg-gradient: linear-gradient(160deg, #0c0c14 0%, #121218 40%, #16141f 70%, #0e0e16 100%);
  --surface: rgba(255, 255, 255, 0.05);
  --surface-hover: rgba(255, 255, 255, 0.08);
  --text: rgba(255, 255, 255, 0.9);
  --text-secondary: rgba(255, 255, 255, 0.35);
  --primary: rgba(120, 140, 255, 0.8);
  --primary-glow: rgba(120, 140, 255, 0.15);
  --success: rgba(80, 220, 140, 0.8);
  --success-glow: rgba(80, 220, 140, 0.15);
  --danger: rgba(255, 90, 90, 0.8);
  --danger-glow: rgba(255, 90, 90, 0.15);
  --border: rgba(255, 255, 255, 0.08);
  --border-subtle: rgba(255, 255, 255, 0.04);
  --glass-blur: 24px;
  --btn-bg: rgba(0, 0, 0, 0.5);
  --btn-bg-hover: rgba(0, 0, 0, 0.65);
  --card-bg: #1a1a22;
  --glass-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

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

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font);
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  font-weight: 400;
  letter-spacing: 0.01em;
}

input, textarea, select {
  -webkit-user-select: text;
  user-select: text;
}

/* ===== Screens ===== */

.screen {
  display: none;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  padding: 16px;
}

.screen.active {
  display: flex;
}

/* ===== Header ===== */

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  margin-bottom: 16px;
  flex-shrink: 0;
}

.header h1 {
  font-size: 22px;
  font-weight: 300;
  letter-spacing: 2px;
  text-transform: lowercase;
}

.header-btn {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 20px;
  cursor: pointer;
  border-radius: 14px;
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  transition: background 0.2s, border-color 0.2s;
}

.header-btn:active {
  background: var(--surface-hover);
}

/* ===== Buttons ===== */

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 24px;
  border: 1px solid var(--border);
  border-radius: 14px;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0.5px;
  cursor: pointer;
  gap: 8px;
  width: 100%;
  transition: all 0.2s ease;
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
}

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

.btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 0 20px var(--primary-glow);
  font-weight: 500;
}

.btn-primary:active {
  box-shadow: 0 0 30px var(--primary-glow);
}

.btn-big {
  min-height: 56px;
  font-size: 16px;
  letter-spacing: 1px;
}

.btn-secondary {
  background: var(--btn-bg);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:active {
  background: var(--btn-bg-hover);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 0 20px var(--danger-glow);
}

.btn-ghost {
  background: none;
  border: none;
  color: var(--primary);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.btn-outline {
  background: var(--btn-bg);
  border: 1px dashed var(--border);
  color: var(--text-secondary);
}

/* ===== Inputs ===== */

.input {
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 14px;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 400;
  outline: none;
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 16px var(--primary-glow);
}

.input::placeholder {
  color: var(--text-secondary);
  font-weight: 300;
}

textarea.input {
  min-height: 80px;
  resize: none;
  overflow: hidden;
}

/* ===== Cards ===== */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  box-shadow: var(--glass-shadow);
}

/* ===== Badge ===== */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.badge-mechanical { background: rgba(80, 130, 255, 0.15); color: #5082ff; border: 1px solid rgba(80, 130, 255, 0.2); }
.badge-electrical { background: rgba(245, 170, 50, 0.15); color: #f5aa32; border: 1px solid rgba(245, 170, 50, 0.2); }
.badge-hydraulic_pneumatic { background: rgba(140, 90, 245, 0.15); color: #8c5af5; border: 1px solid rgba(140, 90, 245, 0.2); }
.badge-sensor_plc_software { background: rgba(50, 200, 210, 0.15); color: #32c8d2; border: 1px solid rgba(50, 200, 210, 0.2); }
.badge-other { background: rgba(150, 150, 170, 0.15); color: rgba(150, 150, 170, 0.8); border: 1px solid rgba(150, 150, 170, 0.2); }

/* ===== Divider ===== */

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 300;
  letter-spacing: 0.5px;
  margin: 16px 0;
}

.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ===== Step Indicator ===== */

.step-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 0;
  flex-shrink: 0;
}

.step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  cursor: default;
  border: none;
  padding: 0;
  transition: all 0.3s ease;
}

.step-dot.active {
  background: var(--primary);
  width: 24px;
  height: 8px;
  border-radius: 4px;
  box-shadow: 0 0 12px var(--primary-glow);
}

.step-dot.completed {
  background: var(--primary);
  cursor: pointer;
}

/* ===== Log List ===== */

.log-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.log-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.log-item:active {
  background: var(--surface-hover);
}

/* Category color indicator on log cards */
.log-item.cat-mechanical { border-left: 3px solid rgba(80, 130, 255, 0.5); }
.log-item.cat-electrical { border-left: 3px solid rgba(245, 170, 50, 0.5); }
.log-item.cat-hydraulic_pneumatic { border-left: 3px solid rgba(140, 90, 245, 0.5); }
.log-item.cat-sensor_plc_software { border-left: 3px solid rgba(50, 200, 210, 0.5); }
.log-item.cat-other { border-left: 3px solid rgba(150, 150, 170, 0.3); }

.log-item-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.log-item-header .badge {
  flex-shrink: 0;
}

.log-item-machine {
  font-weight: 500;
  font-size: 14px;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: 0.3px;
}

.log-item-time {
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
  font-weight: 300;
}

.log-item-desc {
  font-size: 13px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 300;
}

/* ===== Machine List ===== */

.machine-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  cursor: pointer;
  min-height: 48px;
  transition: background 0.2s;
}

.machine-item:active {
  background: var(--surface-hover);
}

.machine-info {
  flex: 1;
  overflow: hidden;
}

.machine-name {
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.3px;
}

.machine-detail {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 300;
}

.machine-actions {
  display: flex;
  gap: 4px;
}

.machine-actions button {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 16px;
  cursor: pointer;
  border-radius: 10px;
  transition: background 0.2s;
}

.machine-actions button:active {
  background: var(--surface-hover);
}

/* ===== Category Buttons ===== */

.category-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.category-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0.3px;
  cursor: pointer;
  width: 100%;
  text-align: left;
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  transition: all 0.2s ease;
}

.category-btn.selected {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
  box-shadow: 0 0 20px var(--primary-glow);
}

.category-btn:active {
  background: var(--surface-hover);
}

.category-btn.selected:active {
  background: var(--primary);
}

/* ===== Photo Grid ===== */

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

.photo-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-thumb .remove-photo {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff;
  border: none;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== Parts List ===== */

.parts-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.part-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 400;
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
}

.part-tag button {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 16px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

/* ===== Autocomplete ===== */

.autocomplete-wrapper {
  position: relative;
}

.autocomplete-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0 0 14px 14px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 10;
  display: none;
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  box-shadow: var(--glass-shadow);
}

.autocomplete-list.open {
  display: block;
}

.autocomplete-item {
  padding: 12px 16px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 400;
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.15s;
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-item:active {
  background: var(--primary);
  color: #fff;
}

/* ===== Confirmation ===== */

.confirmation {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex: 1;
  text-align: center;
}

.confirmation .check-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--success);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  box-shadow: 0 0 40px var(--success-glow);
}

.confirmation h2 {
  font-size: 24px;
  font-weight: 300;
  letter-spacing: 1px;
}

.confirmation p {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 300;
}

/* ===== Bottom Nav ===== */

.bottom-nav {
  display: flex;
  gap: 12px;
  padding: 16px 0;
  flex-shrink: 0;
}

.bottom-nav .btn {
  flex: 1;
}

/* ===== Onboarding ===== */

.onboarding-center {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 24px;
  text-align: center;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.onboarding-center.active {
  display: flex;
}

.onboarding-center h2 {
  font-size: 32px;
  font-weight: 300;
  letter-spacing: 2px;
}

.onboarding-center p {
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 300;
  letter-spacing: 0.5px;
}

.lang-buttons, .theme-buttons {
  display: flex;
  gap: 12px;
  width: 100%;
  max-width: 320px;
}

.lang-buttons .btn, .theme-buttons .btn {
  flex: 1;
}

.lang-buttons .btn.selected, .theme-buttons .btn.selected {
  background: var(--primary);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 0 20px var(--primary-glow);
}

/* ===== Form ===== */

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.form-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Machine added list (onboarding) */
.machines-added-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0;
  width: 100%;
}

/* ===== Empty State ===== */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 40px 20px;
  color: var(--text-secondary);
  text-align: center;
}

.empty-state-icon {
  font-size: 48px;
  opacity: 0.2;
}

/* ===== Filter Bar ===== */

.filter-bar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
  flex-shrink: 0;
}

.filter-row {
  display: flex;
  gap: 8px;
}

.filter-row select, .filter-row input[type="date"] {
  flex: 1;
  min-height: 40px;
  padding: 8px 12px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: var(--font);
  font-size: 13px;
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
}

/* ===== Settings ===== */

.settings-section {
  margin-bottom: 24px;
}

.settings-section h3 {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 12px;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.settings-row:last-child {
  border-bottom: none;
}

.settings-label {
  font-size: 15px;
  font-weight: 400;
}

.toggle-group {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
}

.toggle-option {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 400;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.2s;
}

.toggle-option.active {
  background: var(--primary);
  color: #fff;
}

/* ===== Detail View ===== */

.detail-section {
  margin-bottom: 20px;
}

.detail-label {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 6px;
}

.detail-value {
  font-size: 15px;
  font-weight: 400;
}

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

.detail-photos img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 12px;
  cursor: pointer;
  border: 1px solid var(--border);
}

/* ===== Modal ===== */

.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-overlay.open {
  display: flex;
}

.modal {
  background: var(--surface);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--glass-shadow);
}

.modal h3 {
  margin-bottom: 12px;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 0.3px;
}

.modal p {
  margin-bottom: 20px;
  color: var(--text-secondary);
  font-weight: 300;
  font-size: 14px;
}

.modal-actions {
  display: flex;
  gap: 12px;
}

.modal-actions .btn {
  flex: 1;
}

/* ===== Photo Viewer ===== */

.photo-viewer {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 200;
  align-items: center;
  justify-content: center;
}

.photo-viewer.open {
  display: flex;
}

.photo-viewer img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.photo-viewer .close-viewer {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 22px;
  border-radius: 14px;
  cursor: pointer;
}

/* ===== Inline Add Row ===== */

.inline-add {
  display: flex;
  gap: 8px;
}

.inline-add .input {
  flex: 1;
}

.inline-add .btn {
  width: auto;
  min-width: 80px;
}

/* ===== Count Badge ===== */

.count-badge {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  font-weight: 300;
  letter-spacing: 0.3px;
}

/* ===== Scrollable Content ===== */

.screen-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ===== Machine List ===== */

.machine-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ===== Helpers ===== */

.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.flex-1 { flex: 1; }

/* ===== Edit Form ===== */

.edit-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--primary);
  border-radius: 16px;
  margin-bottom: 8px;
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  box-shadow: 0 0 20px var(--primary-glow);
}

.edit-form .btn-row {
  display: flex;
  gap: 8px;
}

.edit-form .btn-row .btn {
  flex: 1;
}

/* ===== Toast ===== */

.toast {
  position: fixed;
  bottom: 24px;
  left: 16px;
  right: 16px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 14px 16px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 300;
  font-size: 14px;
  font-weight: 400;
  transform: translateY(100px);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  pointer-events: none;
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  box-shadow: var(--glass-shadow);
}

.toast.visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.toast .toast-action {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  white-space: nowrap;
  padding: 4px 8px;
  min-height: 40px;
  display: flex;
  align-items: center;
}

/* ===== Swipe to Delete ===== */

.log-item-swipe-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
}

.log-item-swipe-wrapper .swipe-delete-bg {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 80px;
  background: var(--danger);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 20px;
  border-radius: 0 16px 16px 0;
}

.log-item-swipe-wrapper .log-item {
  position: relative;
  z-index: 1;
  transition: transform 0.2s ease;
  border-radius: 16px;
}

/* ===== Sort Bar ===== */

.sort-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  flex-shrink: 0;
}

.sort-bar span {
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sort-btn {
  padding: 6px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 400;
  cursor: pointer;
  font-family: var(--font);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  transition: all 0.2s;
}

.sort-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 0 12px var(--primary-glow);
}

.sort-btn.desc::after {
  content: ' \2193';
}

.sort-btn.asc::after {
  content: ' \2191';
}

/* ===== Bulk Select ===== */

.bulk-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 0;
  flex-shrink: 0;
}

.bulk-bar.active {
  display: flex;
}

.bulk-bar .bulk-count {
  font-size: 13px;
  font-weight: 500;
}

.bulk-bar .btn {
  width: auto;
  min-height: 40px;
  padding: 8px 16px;
  font-size: 13px;
}

.log-item.selectable {
  cursor: pointer;
}

.log-item .select-check {
  width: 22px;
  height: 22px;
  border: 1px solid var(--border);
  border-radius: 6px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: transparent;
  background: var(--surface);
  transition: all 0.2s;
}

.log-item.selected-item .select-check {
  background: var(--primary);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 0 10px var(--primary-glow);
}

.log-item.selected-item {
  border-color: var(--primary);
  box-shadow: 0 0 16px var(--primary-glow);
}

/* ===== Downtime Fields ===== */

.downtime-row {
  display: flex;
  gap: 8px;
}

.downtime-row .form-group {
  flex: 1;
}

.downtime-row input[type="datetime-local"] {
  width: 100%;
  min-height: 48px;
  padding: 12px 12px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 14px;
  font-family: var(--font);
  font-size: 13px;
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
}

/* ===== Backup Reminder ===== */

.backup-banner {
  background: rgba(245, 170, 50, 0.1);
  border: 1px solid rgba(245, 170, 50, 0.25);
  border-radius: 14px;
  padding: 12px 16px;
  margin-bottom: 12px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  font-weight: 400;
  flex-shrink: 0;
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
}

.backup-banner-text {
  flex: 1;
}

.backup-banner-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.backup-banner-actions button {
  background: none;
  border: none;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 8px;
  min-height: 32px;
}

.backup-banner-actions .banner-go {
  color: #f5aa32;
}

.backup-banner-actions .banner-dismiss {
  color: var(--text-secondary);
}

/* ===== Scrollbar Styling ===== */

::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* ===== Stats Dashboard ===== */

.stats-summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}

.stats-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  text-align: center;
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
}

.stats-card-number {
  font-size: 28px;
  font-weight: 300;
  letter-spacing: 1px;
  color: var(--primary);
}

.stats-card-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 4px;
}

.stats-section {
  margin-bottom: 28px;
}

.stats-section h3 {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 12px;
}

/* Bar charts */
.bar-chart {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.bar-label {
  width: 100px;
  font-size: 12px;
  font-weight: 400;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 0;
}

.bar-track {
  flex: 1;
  height: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 6px;
  min-width: 4px;
  transition: width 0.4s ease;
}

.bar-fill-parts {
  background: var(--success);
}

.bar-fill-downtime {
  background: var(--danger);
}

.bar-value {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  min-width: 32px;
  text-align: right;
  white-space: nowrap;
}

/* Chart containers */
.stats-chart-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
}

.stats-chart-donut {
  max-width: 280px;
  margin: 0 auto;
}

.stats-chart-line canvas {
  max-height: 200px;
}

/* Period toggle */
.stats-period-toggle {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.stats-period-toggle .sort-btn {
  flex: 1;
  text-align: center;
}

/* ===== Invite / QR ===== */

#join-qr-scanner {
  border-radius: 14px;
  overflow: hidden;
}

#invite-qr-container canvas,
#invite-qr-container img {
  border-radius: 12px;
  max-width: 200px;
}

#invite-code-display {
  word-break: break-all;
}
