@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@500;600;700;800&family=Space+Grotesk:wght@500;600;700&display=swap');

/* Modernized UI layer on top of Tailwind */
.sheet-table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  background: white;
}
.sheet-table th, .sheet-table td {
  border-bottom: 1px solid #e5e7eb;
  padding: 10px;
  vertical-align: middle;
  text-align: center;
}
.sheet-table th {
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  font-weight: 600;
}
.sheet-table tbody tr:hover { background-color: #f8fafc; }
.row-warning { background-color: #fff8db; }  /* jaune pale */
.row-danger { background-color: #ffe0e0; }   /* rouge pale */
.badge {
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 12px;
  display: inline-block;
  font-weight: 600;
}
.badge.Haut { background:#fee2e2; color:#991b1b; }
.badge.Moyen { background:#fef3c7; color:#92400e; }
.badge.Bas { background:#dcfce7; color:#065f46; }
/* Role badges */
.badge.role-root { background:#fee2e2; color:#991b1b; }
.badge.role-admin { background:#dbeafe; color:#1e40af; }
.badge.role-user { background:#e2e8f0; color:#0f172a; }
.toolbar input, .toolbar select {
  border: 1px solid #e5e7eb;
  padding: 6px 12px; /* more breathing space */
  padding-left: 14px; /* avoid crowding rounded edge */
  border-radius: 6px;
  transition: box-shadow .2s ease, border-color .2s ease;
}
.toolbar input:focus, .toolbar select:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: none; /* avoid double halo; segmented wrappers handle focus */
}
button.btn {
  border: 1px solid #e5e7eb;
  background: #ffffff;
  padding: 8px 12px;
  border-radius: 10px;
  transition: transform .05s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
  box-shadow: 0 1px 0 rgba(15,23,42,0.05);
}
button.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 14px rgba(15,23,42,0.08); }
button.btn:active { transform: translateY(0); box-shadow: 0 2px 6px rgba(15,23,42,0.08); }
button.btn.primary {
  color: white;
  background: linear-gradient(135deg, #6366f1 0%, #2563eb 100%);
  border-color: #2563eb;
  box-shadow: 0 6px 14px rgba(37,99,235,0.25);
}
button.btn.primary:hover { filter: brightness(1.05); transform: translateY(-1px); box-shadow: 0 10px 22px rgba(37,99,235,0.28); }
button.btn.primary:active { transform: translateY(0); box-shadow: 0 4px 10px rgba(37,99,235,0.22); }
button.btn.danger {
  color: white;
  background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
  border-color: #ef4444;
}
button.btn.danger:hover { filter: brightness(1.05); }
button.btn.ghost { background: #ffffff; }
button.btn.icon { padding: 6px; width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; }
button.btn.icon svg { width: 18px; height: 18px; pointer-events: none; }
.summary-card { 
  border: 1px solid #e5e7eb; border-radius: 12px; padding: 12px; background: white;
}
.summary-card h3 { font-weight:600; }
.sparkline-path { fill: rgba(37,99,235,0.12); stroke: #2563eb; stroke-width:2; }
.sparkline-line { fill: none; stroke: #2563eb; stroke-width:2; }
/* Sortable headers with dual-line indicator (no arrows or text) */
.sortable { cursor: pointer; position: relative; padding-right: 22px; }
.sortable::after, .sortable::before {
  content: '';
  position: absolute; right: 6px; width: 12px; height: 2px; border-radius: 2px;
  background: #cbd5e1; opacity: 0; transition: opacity .12s ease, background .12s ease, transform .12s ease;
}
.sortable::after { top: 50%; transform: translateY(-4px); }
.sortable::before { top: 50%; transform: translateY(4px); }
/* On hover show neutral bars */
.sortable:hover::after, .sortable:hover::before { opacity: .8; }
/* Active sort: color the active bar; asc = top, desc = bottom */
.sortable.sort-active { color:#2563eb; }
.sortable.sort-active::after, .sortable.sort-active::before { opacity: .5; }
.sortable.sort-active:not(.sort-desc)::after { background: #2563eb; opacity: 1; }
.sortable.sort-active.sort-desc::before { background: #2563eb; opacity: 1; }

/* Alignments for specific columns */
.sheet-table th.col-nom, .sheet-table td.col-nom { text-align: left; }

/* Modal polish */
#modal { backdrop-filter: blur(2px); }
#motoEditModal { backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); z-index: 60; }
#rolesModal { backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); z-index: 60; }
#motoCreateModal { backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); z-index: 60; }
#ctAssurModal { display:none; }
#ctModal { backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); z-index: 60; }
#assurModal { backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); z-index: 60; }
#kmModal { backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); z-index: 60; }
.modal-card {
  position: relative;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 40%);
  box-shadow: 0 20px 60px rgba(2,6,23,0.15);
  transform: translateY(6px) scale(0.99);
  opacity: 0;
  animation: modalIn .18s ease-out forwards;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.modal-card::before {
  content: '';
  position: absolute; inset: 0 0 auto 0; height: 4px;
  background: linear-gradient(90deg, #6366f1 0%, #2563eb 50%, #22d3ee 100%);
  border-top-left-radius: 16px; border-top-right-radius: 16px;
}
@keyframes modalIn { to { transform: translateY(0) scale(1); opacity: 1; } }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #eef2f7;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
  border-top-left-radius: 16px; border-top-right-radius: 16px;
}
.ro-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 9999px;
  background: #e2e8f0;
  color: #475569;
  font-size: 11px;
  font-weight: 600;
}
.modal-body {
  background: linear-gradient(180deg, #f0f4f8 0%, #ffffff 80%);
  border-bottom-left-radius: 16px; border-bottom-right-radius: 16px;
  flex: 1 1 auto;
  overflow-y: auto;
}

/* Unified inputs */
input[type="text"], input[type="number"], input[type="date"], select, textarea {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px 16px; /* default for inputs */
  background: #ffffff;
  transition: border-color .15s ease, box-shadow .15s ease;
}
/* Ensure modal selects (Priorité, Statut) use uniform 10px 16px padding */
#priorite, #statut { padding: 10px 16px !important; }
input::placeholder, textarea::placeholder {
  color: #94a3b8; /* softer placeholder */
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: none; /* remove global halo; container handles focus visuals */
}

/* Read-only (disabled) fields: tone down text and hide placeholder */
input:disabled, select:disabled, textarea:disabled {
  color: #64748b;
  background: #f8fafc;
}
input:disabled::placeholder, textarea:disabled::placeholder { color: transparent; }

/* Sections in form */
.form-section {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #f8fafc;
  padding: 14px;
}
.form-section h3 { font-weight: 600; font-size: 14px; color: #0f172a; margin-bottom: 10px; }
.section-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.section-header h3 { margin: 0; line-height: 1.2; }
/* Minimal text-like action for N/A */
.na-text-btn {
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1.2;
}
.na-text-btn:hover { color: #0f172a; text-decoration: underline; }

/* Notes area */
#tuto { min-height: 200px; resize: vertical; line-height: 1.45; font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, Apple Color Emoji, Segoe UI Emoji; padding: 14px 16px; }
/* Compte-rendu area: slightly taller than Notes, same padding */
#compte_rendu { min-height: 200px; resize: vertical; line-height: 1.45; font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, Apple Color Emoji, Segoe UI Emoji; padding: 14px 16px; }

/* Tabs underline accent */
.tab-active { border-bottom-color: #3b82f6 !important; color: #1d4ed8; font-weight: 600; }

/* Segmented control for tabs */
.segmented {
  display: inline-flex;
  gap: 6px;
  padding: 6px;
  border-radius: 9999px;
  background: #f1f5f9;
  border: 1px solid #e5e7eb;
}
.segmented.compact { gap: 4px; padding: 4px; }
.seg-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: transparent;
  border: none;
  border-radius: 9999px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
}
.segmented.compact .seg-item { padding: 6px 10px; font-weight: 600; }
.seg-item.icon-only { padding: 6px; }
.seg-item:hover { background: #e2e8f0; }
.seg-item.active {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  color: #1d4ed8;
  box-shadow: 0 2px 8px rgba(2,6,23,0.06);
  border: 1px solid #cbd5e1;
}
.segmented.compact .seg-item.active { border: 1px solid #cbd5e1; }
.seg-item svg { width: 16px; height: 16px; }
.ico-primary { color: #2563eb; }
.ico-danger { color: #ef4444; }
.ico-muted { color: #475569; }
.seg-badge {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 9999px;
  background: #e2e8f0;
  color: #0f172a;
  font-size: 12px;
  line-height: 20px;
  text-align: center;
}
.v-sep { width: 1px; height: 34px; background: #e5e7eb; }
.seg-item.active .seg-badge { background: #dbeafe; color: #1e40af; }
/* Danger variant for segmented items */
.seg-item.danger {
  background: linear-gradient(180deg, #fee2e2 0%, #fff 100%);
  color: #991b1b;
  border: 1px solid #fecaca;
}
.seg-item.confirm {
  background: linear-gradient(180deg, #dcfce7 0%, #ffffff 100%);
  color: #166534;
  border: 1px solid #86efac;
}

/* Accent variant for segmented buttons */
.seg-item.accent {
  background: linear-gradient(135deg, #6366f1 0%, #2563eb 100%);
  color: #ffffff;
  box-shadow: 0 6px 14px rgba(37,99,235,0.25);
}
.seg-item.accent svg { color: #ffffff; }
.seg-item.accent:hover { filter: brightness(1.05); transform: translateY(-1px); box-shadow: 0 10px 22px rgba(37,99,235,0.28); }
.seg-item.accent:active { transform: translateY(0); box-shadow: 0 4px 10px rgba(37,99,235,0.22); }
.seg-item.accent:focus-visible { outline: 1px solid rgba(59,130,246,0.5); outline-offset: 2px; }

/* Segmented-style search input */
.seg-input {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: #f1f5f9;
  border: 1px solid #e5e7eb;
  border-radius: 9999px;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
  min-height: 40px;
}
.seg-input:focus-within {
  background: #ffffff;
  border-color: #93c5fd;
  outline: 1px solid rgba(59,130,246,0.35);
  outline-offset: 0;
}
.seg-input input:focus, .seg-select select:focus, .seg-custom-btn:focus { outline: none !important; box-shadow: none !important; }
.seg-input svg { width: 16px; height: 16px; color: #64748b; }
.seg-input input {
  border: none;
  background: transparent;
  outline: none;
  padding: 8px 6px;
  min-width: 0; /* allow shrink to fit containers */
}
.seg-input.disabled { opacity: .6; pointer-events: none; }
.seg-clear {
  border: none;
  background: #e2e8f0;
  color: #334155;
  padding: 4px 8px;
  border-radius: 9999px;
  font-size: 12px;
  cursor: pointer;
}
.seg-clear:hover { background: #cbd5e1; }

/* Segmented-style select */
.seg-select {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: #f1f5f9;
  border: 1px solid #e5e7eb;
  border-radius: 9999px;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
  min-height: 40px;
}
.seg-select:focus-within {
  background: #ffffff;
  border-color: #93c5fd;
  outline: 1px solid rgba(59,130,246,0.35);
  outline-offset: 0;
}
.seg-select svg { width: 16px; height: 16px; color: #64748b; }
.seg-select select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  border: none;
  background: transparent;
  outline: none;
  padding: 8px 24px 8px 6px; /* leave space for caret */
}
.seg-select .seg-caret { pointer-events: none; margin-left: auto; }
/* Statut tints */
.seg-select.statut-fait { background: #dcfce7; border-color: #86efac; }
.seg-select.statut-fait > svg:first-child { color: #16a34a; }
/* À faire = bleu pâle */
.seg-select.statut-a-faire { background: #dbeafe; border-color: #bfdbfe; }
.seg-select.statut-a-faire > svg:first-child { color: #1d4ed8; }
/* tinted backgrounds for priority */
.seg-select.prio-haut { background: #fee2e2; border-color: #fecaca; }
.seg-select.prio-moyen { background: #fef3c7; border-color: #fde68a; }
.seg-select.prio-bas { background: #dcfce7; border-color: #86efac; }

/* Custom select (priority) */
.seg-custom { position: relative; cursor: pointer; }
.seg-custom-btn { border: none; background: transparent; cursor: pointer; padding: 8px 6px; font-weight: 600; color: #0f172a; flex: 1; text-align: left; }
.seg-custom .seg-caret { transition: transform .15s ease; }
.seg-custom.open .seg-caret { transform: rotate(180deg); }
.seg-menu {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: #ffffff;
  border: 1px solid #e5e7eb; border-radius: 12px;
  box-shadow: 0 12px 30px rgba(2,6,23,0.12);
  padding: 6px;
  z-index: 1000;
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  transition: opacity .14s ease, transform .14s ease;
  will-change: transform, opacity;
  pointer-events: none;
}
.seg-custom.open .seg-menu { display: block !important; opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
/* Open state subtle emphasis */
.seg-custom.open { outline: 1px solid rgba(59,130,246,0.25); outline-offset: 0; }

/* Segmented-style action icon buttons */
.seg-actions { display: inline-flex; align-items: center; gap: 6px; }
.seg-action {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border-radius: 9999px;
  background: #f1f5f9;
  border: 1px solid #e5e7eb;
  color: #334155;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease, transform .05s ease;
}
.seg-action:hover { background: #e2e8f0; box-shadow: 0 2px 8px rgba(2,6,23,0.06); transform: translateY(-1px); }
.seg-action:active { transform: translateY(0); box-shadow: 0 1px 3px rgba(2,6,23,0.08); }
.seg-action svg { width: 16px; height: 16px; pointer-events: none; }
.seg-action.primary { background: #2563eb; border-color: #2563eb; color: #ffffff; }
.seg-action.primary:hover { filter: brightness(1.05); }
.seg-action.danger { background: #ef4444; border-color: #ef4444; color: #ffffff; }
.seg-action.danger:hover { filter: brightness(1.05); }
.seg-action:focus { outline: 1px solid rgba(59,130,246,0.35); outline-offset: 0; }

/* Clean icon-only buttons (no pill styling) */
.icon-btn {
  border: none;
  background: transparent;
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 9999px;
  color: #334155;
  transition: background .15s ease, color .15s ease;
}
.icon-btn:hover { background: #e2e8f0; }
.icon-btn:active { background: #cbd5e1; }
.icon-btn svg { width: 18px; height: 18px; }

/* Expandable chip button (icon + label) */
.expand-btn {
  border: none;
  background: transparent;
  height: 36px;
  padding: 0 10px;
  display: inline-flex; align-items: center; gap: 8px;
  border-radius: 9999px;
  color: #334155;
  transition: background .15s ease, color .15s ease;
}
.expand-btn:hover { background: #e2e8f0; }
.expand-btn:active { background: #cbd5e1; }
.expand-btn svg { width: 18px; height: 18px; }

/* Menu item animations and selected state */
.seg-menu button { transition: background .12s ease, transform .12s ease; position: relative; display: flex; align-items: center; gap: 8px; }
.seg-menu button + button { margin-top: 6px; }
.seg-menu button:hover { transform: translateX(2px); }
.seg-menu button.selected { box-shadow: inset 2px 0 0 #2563eb; }
.seg-menu button.selected::after {
  content: "✓";
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  color: #1e40af; opacity: .85; font-weight: 700; font-size: 12px;
}
/* Leading color dots */
.seg-menu .opt-haut::before, .seg-menu .opt-moyen::before, .seg-menu .opt-bas::before,
.seg-menu .opt-a-faire::before, .seg-menu .opt-fait::before { content: ""; width: 8px; height: 8px; border-radius: 9999px; display: inline-block; }
.seg-menu .opt-haut::before { background: #ef4444; }
.seg-menu .opt-moyen::before { background: #f59e0b; }
.seg-menu .opt-bas::before { background: #10b981; }
.seg-menu .opt-a-faire::before { background: #1d4ed8; }
.seg-menu .opt-fait::before { background: #16a34a; }
.seg-menu button {
  width: 100%; text-align: left; border: none; background: transparent;
  padding: 8px 10px; border-radius: 8px; cursor: pointer; font-weight: 600; color: #0f172a;
}
.seg-menu button:hover { background: #f1f5f9; }
.seg-menu .opt-haut { background: #fee2e2; color: #991b1b; }
.seg-menu .opt-moyen { background: #fef3c7; color: #92400e; }
.seg-menu .opt-bas { background: #dcfce7; color: #065f46; }
.seg-menu .opt-haut:hover { background: #fecaca; }
.seg-menu .opt-moyen:hover { background: #fde68a; }
.seg-menu .opt-bas:hover { background: #bbf7d0; }
/* Statut menu tints */
.seg-menu .opt-a-faire { background: #dbeafe; color: #1d4ed8; }
.seg-menu .opt-a-faire:hover { background: #bfdbfe; }
.seg-menu .opt-fait { background: #dcfce7; color: #166534; }
.seg-menu .opt-fait:hover { background: #bbf7d0; }

/* Remove number input spinners */
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }

/* Priority select color accent */
.seg-select.prio-haut > svg:first-child { color: #ef4444; }
.seg-select.prio-moyen > svg:first-child { color: #f59e0b; }
.seg-select.prio-bas > svg:first-child { color: #10b981; }

/* Notes read-only view */
.tuto-view {
  margin-top: 8px;
  padding: 12px 16px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #ffffff;
  white-space: pre-wrap;
}
.tuto-view a { color: #2563eb; text-decoration: underline; }

/* Labels padding */
.form-section label { padding-left: 6px; }

/* Center helpers */
.vh-center { min-height: calc(100vh - 2rem); }

/* Glassmorphism card (login) */
.glass-card {
  position: relative;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0.55) 0%, rgba(255,255,255,0.35) 100%);
  border: 1px solid rgba(255,255,255,0.45);
  box-shadow: 0 20px 60px rgba(2,6,23,0.20), inset 0 1px 0 rgba(255,255,255,0.6);
  backdrop-filter: blur(10px);
}
/* Subtle colored top border accent */
.glass-card::before {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 4px;
  background: linear-gradient(90deg, #6366f1 0%, #22d3ee 50%, #10b981 100%);
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  opacity: 0.9;
}
@supports not ((-webkit-backdrop-filter: none) or (backdrop-filter: none)) {
  .glass-card { background: #ffffff; }
}

/* Auth hero background (less white, subtle gradient + glow) */
.auth-hero {
  position: relative;
  border-radius: 20px;
  padding: 24px;
  background: linear-gradient(135deg, #0b1220 0%, #0f172a 50%, #111827 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 20px 60px rgba(2,6,23,0.35);
  overflow: hidden;
}
.auth-hero::before,
.auth-hero::after {
  content: '';
  position: absolute;
  width: 520px; height: 520px; border-radius: 50%;
  filter: blur(24px);
  pointer-events: none;
}
.auth-hero::before { top: -140px; left: -120px; background: radial-gradient(circle at 30% 30%, rgba(99,102,241,0.35), rgba(14,165,233,0.18), transparent 65%); }
.auth-hero::after { bottom: -180px; right: -140px; background: radial-gradient(circle at 70% 70%, rgba(34,197,94,0.25), rgba(59,130,246,0.2), transparent 60%); }

/* Small emblem used on auth card */
.logo-badge {
  width: 48px; height: 48px;
  border-radius: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #22d3ee 0%, #2563eb 60%, #7c3aed 100%);
  box-shadow: 0 6px 16px rgba(2,6,23,0.25), inset 0 1px 0 rgba(255,255,255,0.35);
  color: white; font-size: 22px;
}
/* Circular avatar badge for profile */
.avatar-badge {
  width: 44px; height: 44px;
  border-radius: 9999px;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  color: #fff;
  font-weight: 700; font-size: 18px;
  box-shadow: 0 6px 16px rgba(2,6,23,0.18);
}

/* Text-like action button */
.link-btn {
  display: inline-flex; align-items: center; gap: 8px;
  color: #2563eb;
  font-weight: 600;
  text-decoration: none;
  border: none; background: transparent; padding: 6px 8px; border-radius: 10px;
  transition: background .15s ease, color .15s ease, transform .05s ease, box-shadow .15s ease;
}
.link-btn:hover { background: #e2e8f0; color: #1d4ed8; transform: translateY(-1px); box-shadow: 0 2px 8px rgba(2,6,23,0.06); }
.link-btn:active { transform: translateY(0); box-shadow: 0 1px 3px rgba(2,6,23,0.08); }
.link-btn:focus-visible { outline: 1px solid rgba(59,130,246,0.35); outline-offset: 2px; }
.link-btn svg { width: 16px; height: 16px; }

/* Accent chip button with subtle gradient and glow */
.accent-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  border-radius: 9999px;
  color: #fff;
  background: linear-gradient(135deg, #6366f1 0%, #2563eb 100%);
  box-shadow: 0 6px 14px rgba(37,99,235,0.25);
  transition: filter .15s ease, transform .05s ease, box-shadow .15s ease;
  text-decoration: none;
}
.accent-chip:hover { filter: brightness(1.05); transform: translateY(-1px); box-shadow: 0 10px 22px rgba(37,99,235,0.28); }
.accent-chip:active { transform: translateY(0); box-shadow: 0 4px 10px rgba(37,99,235,0.22); }
.accent-chip:focus-visible { outline: 1px solid rgba(59,130,246,0.5); outline-offset: 2px; }
.accent-chip svg { width: 16px; height: 16px; }

/* Small discreet corner link inside cards */
.card-corner-link {
  position: absolute; top: 12px; right: 14px;
  font-size: 12px; color: #64748b;
  padding: 4px 8px; border-radius: 9999px; text-decoration: none;
  transition: background .15s ease, color .15s ease, transform .05s ease;
}
.card-corner-link:hover { background: #e2e8f0; color: #0f172a; transform: translateY(-1px); }
.card-corner-link:focus-visible { outline: 1px solid rgba(59,130,246,0.35); outline-offset: 2px; }

/* Login helper text */
.muted { color: #a4b4cd; }

/* Global default app background */
body.app-body-bg {
  background:
    radial-gradient(900px 500px at -10% -10%, rgba(14,165,233,0.22), transparent 60%),
    radial-gradient(700px 420px at 110% 18%, rgba(249,115,22,0.16), transparent 58%),
    radial-gradient(780px 440px at 50% 120%, rgba(56,189,248,0.12), transparent 62%),
    linear-gradient(155deg, #020617 0%, #0b1324 48%, #0f172a 100%);
  background-attachment: fixed;
}

/* Home page refresh (Home2 cards only) */
body.home-body-bg {
  background:
    radial-gradient(900px 500px at -10% -10%, rgba(14,165,233,0.22), transparent 60%),
    radial-gradient(700px 420px at 110% 18%, rgba(249,115,22,0.16), transparent 58%),
    radial-gradient(780px 440px at 50% 120%, rgba(56,189,248,0.12), transparent 62%),
    linear-gradient(155deg, #020617 0%, #0b1324 48%, #0f172a 100%);
  background-attachment: fixed;
}

.home-shell {
  position: relative;
  isolation: isolate;
  padding: 14px;
  border-radius: 34px;
  border: 1px solid rgba(30,41,59,0.8);
  background: linear-gradient(145deg, #020617 0%, #0b1324 48%, #0f172a 100%);
  box-shadow: inset 0 1px 0 rgba(148,163,184,0.08), 0 16px 40px rgba(2,6,23,0.35);
}
.home-shell::before,
.home-shell::after {
  content: '';
  position: absolute;
  pointer-events: none;
  z-index: -1;
  filter: blur(10px);
}
.home-shell::before {
  width: 360px;
  height: 360px;
  top: -120px;
  left: -150px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, rgba(14,165,233,0.26), rgba(2,132,199,0.11), transparent 70%);
}
.home-shell::after {
  width: 300px;
  height: 300px;
  right: -110px;
  top: 210px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 55%, rgba(249,115,22,0.18), rgba(234,88,12,0.08), transparent 72%);
}

.home-grid-main {
  display: grid;
  gap: clamp(22px, 3.2vw, 36px);
}
@media (min-width: 1024px) {
  .home-grid-main {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.45fr);
    align-items: start;
  }
}

.home-hero-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: 30px;
  border: 1px solid rgba(125,211,252,0.24);
  background: linear-gradient(145deg, #050b17 0%, #0b1424 45%, #0f2740 100%);
  box-shadow: 0 24px 58px rgba(2,6,23,0.48), inset 0 1px 0 rgba(255,255,255,0.06);
}
.home-hero-card::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 4px;
  border-top-left-radius: 30px;
  border-top-right-radius: 30px;
  background: linear-gradient(90deg, #f97316 0%, #f59e0b 35%, #06b6d4 68%, #38bdf8 100%);
  opacity: .95;
  z-index: 2;
}
.home-hero-card::after {
  content: '';
  position: absolute;
  right: -120px;
  bottom: -150px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle at 35% 35%, rgba(56,189,248,0.36), rgba(6,182,212,0.16), transparent 72%);
  filter: blur(2px);
  z-index: 0;
}
.home-hero-card > * {
  position: relative;
  z-index: 1;
}
.home-hero-eyebrow {
  margin: 0;
  font-family: "Manrope", "Segoe UI", sans-serif;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .11em;
  color: #93c5fd;
  font-weight: 700;
}
.home-hero-title {
  margin: 8px 0 0;
  color: #f8fafc;
  font-size: clamp(1.85rem, 1.25rem + 1.8vw, 2.65rem);
  line-height: 1.05;
  font-family: "Space Grotesk", "Avenir Next", "Segoe UI", sans-serif;
  font-weight: 700;
}
.home-hero-subtitle {
  margin: 10px 0 0;
  max-width: 58ch;
  color: #cbd5e1;
  font-family: "Manrope", "Segoe UI", sans-serif;
}
.home-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.home-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 700;
  color: #dbeafe;
  background: rgba(15,23,42,0.42);
  border: 1px solid rgba(148,163,184,0.38);
  font-family: "Manrope", "Segoe UI", sans-serif;
}
.home-chip-admin {
  color: #fef3c7;
  border-color: rgba(253,224,71,0.35);
  background: rgba(120,53,15,0.34);
}
.home-hero-actions {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.home-shell .home-admin-btn.link-btn {
  color: #7dd3fc;
  background: rgba(30,41,59,0.62);
}
.home-shell .home-admin-btn.link-btn:hover {
  color: #e0f2fe;
  background: rgba(30,41,59,0.9);
}
.home-shell .danger-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 9999px;
  color: #fee2e2;
  border: 1px solid rgba(248,113,113,0.45);
  background: linear-gradient(135deg, rgba(127,29,29,0.65) 0%, rgba(153,27,27,0.62) 100%);
  text-decoration: none;
  font-weight: 700;
  transition: transform .08s ease, background .16s ease, box-shadow .16s ease;
}
.home-shell .danger-chip:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, rgba(153,27,27,0.76) 0%, rgba(185,28,28,0.72) 100%);
  box-shadow: 0 10px 24px rgba(127,29,29,0.34);
}

.home-panel {
  position: relative;
  animation: homeRise .5s ease-out both;
  transition: transform .16s ease, box-shadow .18s ease;
}
.home2 { animation-delay: .08s; }
.home-panel:hover {
  transform: translateY(-4px);
  box-shadow: 0 30px 72px rgba(2,6,23,0.4);
}
@keyframes homeRise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.home-strong-card {
  isolation: isolate;
  overflow: hidden;
  border-radius: 26px;
  border: 1px solid rgba(125,211,252,0.24);
  background: linear-gradient(145deg, #050b17 0%, #0b1424 45%, #0f2740 100%);
  box-shadow: 0 22px 56px rgba(2,6,23,0.47), inset 0 1px 0 rgba(255,255,255,0.06);
}
.home-strong-card.glass-card::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 4px;
  border-top-left-radius: 26px;
  border-top-right-radius: 26px;
  background: linear-gradient(90deg, #f97316 0%, #f59e0b 38%, #06b6d4 72%, #38bdf8 100%);
  opacity: .95;
  z-index: 2;
}
.home-strong-card::after {
  content: '';
  position: absolute;
  inset: auto -85px -120px auto;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle at 35% 35%, rgba(56,189,248,0.34), rgba(6,182,212,0.14), transparent 70%);
  filter: blur(2px);
  z-index: 0;
}
.home1.home-strong-card::after {
  background: radial-gradient(circle at 35% 35%, rgba(249,115,22,0.34), rgba(234,88,12,0.14), transparent 70%);
}
.home1.home-strong-card {
  background: linear-gradient(145deg, #101321 0%, #1a1a2e 42%, #312e38 100%);
  border-color: rgba(251,191,36,0.26);
}
.home1.home-strong-card.glass-card::before {
  background: linear-gradient(90deg, #fb923c 0%, #f59e0b 42%, #f43f5e 100%);
}
.home-strong-card > * {
  position: relative;
  z-index: 1;
}
.home-strong-card .home-section-title,
.home-strong-card .home-user-name,
.home-strong-card .text-2xl,
.home-strong-card .md\:text-3xl {
  color: #f8fafc !important;
  font-family: "Space Grotesk", "Avenir Next", "Segoe UI", sans-serif;
}
.home-strong-card .muted,
.home-strong-card .text-slate-500,
.home-strong-card .text-gray-600,
.home-strong-card .opt-meta {
  color: #a9b7cf !important;
}
.home-profile-panel .avatar-badge {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 45%, #dc2626 100%);
}
.home-profile-identity,
.home-role-card {
  border: 1px solid rgba(148,163,184,0.34);
  background: linear-gradient(180deg, rgba(15,23,42,0.84) 0%, rgba(15,23,42,0.64) 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}
.home1 .home-profile-identity,
.home1 .home-role-card {
  border-color: rgba(251,191,36,0.26);
  background: linear-gradient(180deg, rgba(39,39,42,0.84) 0%, rgba(24,24,27,0.68) 100%);
}

.home-panel .accent-chip,
.home-panel .seg-item.accent {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 45%, #06b6d4 100%);
  box-shadow: 0 8px 18px rgba(2,132,199,0.34);
}
.home-panel .accent-chip:hover,
.home-panel .seg-item.accent:hover {
  box-shadow: 0 12px 26px rgba(2,132,199,0.4);
}
.home-moto-panel .option-body {
  border-color: rgba(125,211,252,0.26);
  background: linear-gradient(180deg, rgba(15,23,42,0.88) 0%, rgba(15,23,42,0.72) 100%);
}
.home-moto-panel .opt-title { color: #e2e8f0; }
.home-moto-panel .opt-check {
  border-color: #64748b;
  color: #7dd3fc;
}
.home-moto-panel .option-body:hover {
  border-color: rgba(125,211,252,0.52);
  box-shadow: 0 10px 24px rgba(2,6,23,0.24);
}
.home-moto-panel label.option-card input[type="radio"]:checked + .option-body {
  border-color: #38bdf8;
  background: linear-gradient(180deg, rgba(8,47,73,0.92) 0%, rgba(14,116,144,0.4) 100%);
}
.home-moto-panel label.option-card input[type="radio"]:checked + .option-body .opt-check {
  background: #082f49;
  border-color: #38bdf8;
  box-shadow: inset 0 0 0 2px #082f49;
}
.home-moto-panel .home-moto-create-btn {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 45%, #06b6d4 100%);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(2,132,199,0.34);
}
.home-moto-panel .home-moto-create-btn:hover {
  box-shadow: 0 12px 26px rgba(2,132,199,0.4);
}
.home-moto-panel .mb-5 > .segmented {
  background: rgba(15,23,42,0.82);
  border-color: rgba(71,85,105,0.7);
}
.home-moto-panel .home-moto-actions {
  gap: 12px;
}
.home-moto-panel .home-moto-io-actions {
  flex-wrap: wrap;
}
.home-moto-panel .home-moto-action {
  border: 1px solid rgba(125,211,252,0.3);
  background: linear-gradient(180deg, rgba(15,23,42,0.86) 0%, rgba(15,23,42,0.68) 100%);
  color: #e2e8f0;
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 700;
  transition: transform .08s ease, border-color .14s ease, background .14s ease, box-shadow .14s ease;
}
.home-moto-panel .home-moto-action:hover {
  transform: translateY(-1px);
  border-color: rgba(125,211,252,0.46);
  background: linear-gradient(180deg, rgba(30,41,59,0.92) 0%, rgba(15,23,42,0.78) 100%);
  box-shadow: 0 10px 24px rgba(2,6,23,0.24);
}
.home-moto-panel .home-moto-action-primary {
  color: #ffffff;
  border-color: rgba(56,189,248,0.52);
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 45%, #06b6d4 100%);
  box-shadow: 0 8px 18px rgba(2,132,199,0.34);
}
.home-moto-panel .home-moto-action-primary:hover {
  box-shadow: 0 12px 26px rgba(2,132,199,0.4);
}

/* Home moto modals (create/edit) */
#motoEditModal .modal-card,
#motoCreateModal .modal-card {
  border-color: rgba(125,211,252,0.24);
  background: linear-gradient(145deg, #050b17 0%, #0b1424 45%, #0f2740 100%);
  box-shadow: 0 22px 56px rgba(2,6,23,0.47), inset 0 1px 0 rgba(255,255,255,0.06);
}
#motoEditModal .modal-card::before,
#motoCreateModal .modal-card::before {
  background: linear-gradient(90deg, #f97316 0%, #f59e0b 35%, #06b6d4 68%, #38bdf8 100%);
}
#motoEditModal .modal-header,
#motoCreateModal .modal-header {
  border-bottom-color: rgba(71,85,105,0.6);
  background: linear-gradient(180deg, rgba(15,23,42,0.84) 0%, rgba(15,23,42,0.66) 100%);
}
#motoEditModal .modal-header h2,
#motoCreateModal .modal-header h2 {
  color: #f8fafc !important;
}
#motoEditModal .modal-body,
#motoCreateModal .modal-body {
  background: linear-gradient(180deg, rgba(15,23,42,0.84) 0%, rgba(15,23,42,0.68) 100%);
}
#motoEditModal .form-section,
#motoCreateModal .form-section {
  border-color: rgba(148,163,184,0.34);
  background: linear-gradient(180deg, rgba(15,23,42,0.84) 0%, rgba(15,23,42,0.64) 100%);
}
#motoEditModal .form-section h3,
#motoCreateModal .form-section h3,
#motoEditModal label,
#motoCreateModal label {
  color: #e2e8f0;
}
#motoEditModal .segmented,
#motoCreateModal .segmented {
  background: rgba(15,23,42,0.82);
  border-color: rgba(71,85,105,0.7);
}
#motoEditModal .seg-item,
#motoCreateModal .seg-item {
  color: #cbd5e1;
}
#motoEditModal .seg-item:hover,
#motoCreateModal .seg-item:hover {
  background: rgba(30,41,59,0.9);
  color: #f8fafc;
}
#motoEditModal .seg-item.accent,
#motoCreateModal .seg-item.accent {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 45%, #06b6d4 100%);
  color: #ffffff;
}
#motoEditModal .seg-input,
#motoCreateModal .seg-input {
  background: rgba(15,23,42,0.9);
  border-color: rgba(148,163,184,0.38);
}
#motoEditModal .seg-input svg,
#motoCreateModal .seg-input svg {
  color: #94a3b8;
}
#motoEditModal .seg-input input,
#motoCreateModal .seg-input input {
  color: #e2e8f0;
}
#motoEditModal .seg-input input::placeholder,
#motoCreateModal .seg-input input::placeholder {
  color: #94a3b8;
}

@media (max-width: 768px) {
  .home-grid-main { gap: 18px; }
  .home-panel:hover { transform: none; }
  .home-hero-actions { gap: 8px; }
  .home-shell {
    border-radius: 24px;
    padding: 10px;
  }
}

/* Login page in the same visual language */
body.auth-body-bg {
  background:
    radial-gradient(900px 500px at -10% -10%, rgba(14,165,233,0.22), transparent 60%),
    radial-gradient(700px 420px at 110% 18%, rgba(249,115,22,0.16), transparent 58%),
    radial-gradient(780px 440px at 50% 120%, rgba(56,189,248,0.12), transparent 62%),
    linear-gradient(155deg, #020617 0%, #0b1324 48%, #0f172a 100%);
  background-attachment: fixed;
}
.auth-shell {
  width: 100%;
}
.auth-login-card {
  position: relative;
  overflow: hidden;
  border-color: rgba(125,211,252,0.24);
  border-radius: 26px;
  background: linear-gradient(145deg, #050b17 0%, #0b1424 45%, #0f2740 100%);
  box-shadow: 0 22px 56px rgba(2,6,23,0.47), inset 0 1px 0 rgba(255,255,255,0.06);
}
.auth-login-card::before {
  left: 0;
  right: 0;
  top: 0;
  height: 4px;
  border-top-left-radius: 26px;
  border-top-right-radius: 26px;
  background: linear-gradient(90deg, #f97316 0%, #f59e0b 35%, #06b6d4 68%, #38bdf8 100%);
}
.auth-login-head .text-2xl,
.auth-login-head .md\:text-3xl {
  color: #f8fafc;
  font-family: "Space Grotesk", "Avenir Next", "Segoe UI", sans-serif;
}
.auth-login-card .muted {
  color: #94a3b8;
}
.auth-login-form .seg-input {
  background: rgba(15,23,42,0.9);
  border-color: rgba(148,163,184,0.38);
}
.auth-login-form .seg-input:focus-within {
  background: rgba(30,41,59,0.92);
  border-color: rgba(125,211,252,0.52);
  outline-color: rgba(56,189,248,0.35);
}
.auth-login-form .seg-input svg {
  color: #94a3b8;
}
.auth-login-form .seg-input input {
  color: #e2e8f0;
}
.auth-login-form .seg-input input::placeholder {
  color: #94a3b8;
}
.auth-login-form .seg-clear {
  background: rgba(51,65,85,0.8);
  color: #cbd5e1;
}
.auth-login-form .seg-clear:hover {
  background: rgba(71,85,105,0.9);
  color: #f8fafc;
}
.auth-login-card .bg-red-100 {
  background: rgba(127,29,29,0.28) !important;
  border-color: rgba(248,113,113,0.45) !important;
  color: #fee2e2 !important;
}
.auth-login-submit {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 45%, #06b6d4 100%) !important;
  border-color: rgba(56,189,248,0.52) !important;
  box-shadow: 0 10px 24px rgba(2,132,199,0.35) !important;
}
.auth-login-submit:hover {
  box-shadow: 0 14px 30px rgba(2,132,199,0.42) !important;
}

/* Admin pages (same visual language as home) */
body.admin-body-bg {
  background:
    radial-gradient(900px 500px at -10% -10%, rgba(14,165,233,0.22), transparent 60%),
    radial-gradient(700px 420px at 110% 18%, rgba(249,115,22,0.16), transparent 58%),
    radial-gradient(780px 440px at 50% 120%, rgba(56,189,248,0.12), transparent 62%),
    linear-gradient(155deg, #020617 0%, #0b1324 48%, #0f172a 100%);
  background-attachment: fixed;
}
.admin-shell {
  position: relative;
  isolation: isolate;
  padding: 14px;
  border-radius: 34px;
  border: 1px solid rgba(30,41,59,0.8);
  background: linear-gradient(145deg, #020617 0%, #0b1324 48%, #0f172a 100%);
  box-shadow: inset 0 1px 0 rgba(148,163,184,0.08), 0 16px 40px rgba(2,6,23,0.35);
}
.admin-shell::before,
.admin-shell::after {
  content: '';
  position: absolute;
  pointer-events: none;
  z-index: -1;
  border-radius: 50%;
  filter: blur(10px);
}
.admin-shell::before {
  width: 340px;
  height: 340px;
  top: -100px;
  left: -120px;
  background: radial-gradient(circle at 40% 35%, rgba(14,165,233,0.22), rgba(2,132,199,0.10), transparent 70%);
}
.admin-shell::after {
  width: 280px;
  height: 280px;
  right: -90px;
  top: 170px;
  background: radial-gradient(circle at 50% 55%, rgba(249,115,22,0.15), rgba(234,88,12,0.08), transparent 72%);
}

.admin-hero-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: 30px;
  border: 1px solid rgba(125,211,252,0.24);
  background: linear-gradient(145deg, #050b17 0%, #0b1424 45%, #0f2740 100%);
  box-shadow: 0 24px 58px rgba(2,6,23,0.48), inset 0 1px 0 rgba(255,255,255,0.06);
}
.admin-hero-card::before {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 4px;
  border-top-left-radius: 30px;
  border-top-right-radius: 30px;
  background: linear-gradient(90deg, #f97316 0%, #f59e0b 35%, #06b6d4 68%, #38bdf8 100%);
  opacity: .95;
  z-index: 2;
}
.admin-hero-card::after {
  content: '';
  position: absolute;
  right: -120px;
  bottom: -150px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle at 35% 35%, rgba(56,189,248,0.36), rgba(6,182,212,0.16), transparent 72%);
  filter: blur(2px);
  z-index: 0;
}
.admin-hero-card > * { position: relative; z-index: 1; }
.admin-hero-eyebrow {
  margin: 0;
  font-family: "Manrope", "Segoe UI", sans-serif;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .11em;
  color: #93c5fd;
  font-weight: 700;
}
.admin-hero-title {
  margin: 8px 0 0;
  color: #f8fafc;
  font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.2rem);
  line-height: 1.05;
  font-family: "Space Grotesk", "Avenir Next", "Segoe UI", sans-serif;
  font-weight: 700;
}
.admin-hero-subtitle {
  margin: 8px 0 0;
  max-width: 58ch;
  color: #cbd5e1;
  font-family: "Manrope", "Segoe UI", sans-serif;
}
.admin-hero-actions {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.admin-nav-btn {
  color: #7dd3fc !important;
  background: rgba(30,41,59,0.62);
}
.admin-nav-btn:hover {
  color: #e0f2fe !important;
  background: rgba(30,41,59,0.9) !important;
}

.admin-tile {
  border: 1px solid rgba(125,211,252,0.24);
  border-radius: 18px;
  background: linear-gradient(145deg, #050b17 0%, #0b1424 45%, #0f2740 100%);
  box-shadow: 0 14px 34px rgba(2,6,23,0.34), inset 0 1px 0 rgba(255,255,255,0.06);
}
.admin-tile-title {
  color: #f8fafc;
  font-family: "Space Grotesk", "Avenir Next", "Segoe UI", sans-serif;
}
.admin-tile-text { color: #a9b7cf; }

.admin-table-wrap {
  border-color: rgba(125,211,252,0.24) !important;
  background: linear-gradient(145deg, #050b17 0%, #0b1424 45%, #0f2740 100%);
  box-shadow: 0 14px 34px rgba(2,6,23,0.34), inset 0 1px 0 rgba(255,255,255,0.06);
}
.admin-sheet-table {
  background: transparent;
}
.admin-sheet-table th {
  background: linear-gradient(180deg, rgba(15,23,42,0.84) 0%, rgba(15,23,42,0.66) 100%);
  color: #d7e2f2;
  border-bottom-color: rgba(71,85,105,0.6);
}
.admin-sheet-table td {
  color: #e7eefa;
  border-bottom-color: rgba(71,85,105,0.45);
}
.admin-sheet-table tbody tr:hover {
  background: rgba(30,41,59,0.55);
}
.admin-body-bg .segmented {
  background: rgba(15,23,42,0.82);
  border-color: rgba(71,85,105,0.7);
}
.admin-body-bg .seg-item {
  color: #cbd5e1;
}
.admin-body-bg .seg-item:hover {
  background: rgba(30,41,59,0.9);
  color: #f8fafc;
}
.admin-body-bg .seg-item.active {
  background: linear-gradient(180deg, rgba(30,41,59,0.96) 0%, rgba(15,23,42,0.9) 100%);
  color: #38bdf8;
  border: 1px solid rgba(125,211,252,0.45);
  box-shadow: 0 4px 12px rgba(2,6,23,0.35);
}
.admin-body-bg .seg-item.danger {
  background: linear-gradient(180deg, rgba(127,29,29,0.8) 0%, rgba(153,27,27,0.62) 100%);
  color: #fee2e2;
  border: 1px solid rgba(248,113,113,0.45);
}
.admin-body-bg .seg-badge {
  background: rgba(51,65,85,0.82);
  color: #e2e8f0;
}
.admin-body-bg .seg-item.active .seg-badge {
  background: rgba(8,47,73,0.92);
  color: #7dd3fc;
}
.admin-body-bg .seg-input,
.admin-body-bg .seg-select {
  background: rgba(15,23,42,0.9);
  border-color: rgba(148,163,184,0.38);
}
.admin-body-bg .seg-input:focus-within,
.admin-body-bg .seg-select:focus-within {
  background: rgba(30,41,59,0.92);
  border-color: rgba(125,211,252,0.52);
  outline-color: rgba(56,189,248,0.35);
}
.admin-body-bg .seg-input svg,
.admin-body-bg .seg-select svg {
  color: #a9b7cf;
}
.admin-body-bg .seg-input input,
.admin-body-bg .seg-select select,
.admin-body-bg .seg-custom-btn {
  color: #e2e8f0;
}
.admin-body-bg .text-gray-500,
.admin-body-bg .text-gray-600,
.admin-body-bg .text-xs {
  color: #a9b7cf !important;
}
.admin-body-bg .seg-select select option {
  color: #0f172a;
}
.admin-body-bg button.btn,
.admin-body-bg .btn {
  background: linear-gradient(180deg, rgba(15,23,42,0.88) 0%, rgba(15,23,42,0.72) 100%);
  border-color: rgba(125,211,252,0.28);
  color: #e2e8f0;
  box-shadow: 0 4px 12px rgba(2,6,23,0.22);
}
.admin-body-bg button.btn:hover,
.admin-body-bg .btn:hover {
  background: linear-gradient(180deg, rgba(30,41,59,0.92) 0%, rgba(15,23,42,0.78) 100%);
  border-color: rgba(125,211,252,0.42);
}
.admin-body-bg button.btn.ghost,
.admin-body-bg .btn.ghost {
  background: rgba(30,41,59,0.6);
  color: #cbd5e1;
}
.admin-body-bg button.btn.ghost:hover,
.admin-body-bg .btn.ghost:hover {
  background: rgba(30,41,59,0.9);
  color: #f8fafc;
}
.admin-body-bg .modal-card {
  border-color: rgba(125,211,252,0.24);
  background: linear-gradient(145deg, #050b17 0%, #0b1424 45%, #0f2740 100%);
  box-shadow: 0 22px 56px rgba(2,6,23,0.47), inset 0 1px 0 rgba(255,255,255,0.06);
}
.admin-body-bg .modal-card::before {
  background: linear-gradient(90deg, #f97316 0%, #f59e0b 35%, #06b6d4 68%, #38bdf8 100%);
}
.admin-body-bg .modal-header {
  border-bottom-color: rgba(71,85,105,0.6);
  background: linear-gradient(180deg, rgba(15,23,42,0.84) 0%, rgba(15,23,42,0.66) 100%);
}
.admin-body-bg .modal-header h2 {
  color: #f8fafc !important;
}
.admin-body-bg .modal-body {
  background: linear-gradient(180deg, rgba(15,23,42,0.84) 0%, rgba(15,23,42,0.68) 100%);
}
.admin-body-bg .form-section {
  border-color: rgba(148,163,184,0.34);
  background: linear-gradient(180deg, rgba(15,23,42,0.84) 0%, rgba(15,23,42,0.64) 100%);
}
.admin-body-bg .form-section h3,
.admin-body-bg .form-section label {
  color: #e2e8f0;
}
.admin-body-bg .modal-card input[type="text"],
.admin-body-bg .modal-card input[type="number"],
.admin-body-bg .modal-card input[type="date"],
.admin-body-bg .modal-card select,
.admin-body-bg .modal-card textarea {
  border-color: rgba(148,163,184,0.38);
  background: rgba(15,23,42,0.9);
  color: #e2e8f0;
}
.admin-body-bg .modal-card input::placeholder,
.admin-body-bg .modal-card textarea::placeholder {
  color: #a9b7cf;
}

@media (max-width: 768px) {
  .admin-shell {
    border-radius: 24px;
    padding: 10px;
  }
  .admin-hero-actions { gap: 8px; }
}

/* Moto main page (index) */
body.moto-body-bg {
  background:
    radial-gradient(900px 500px at -10% -10%, rgba(14,165,233,0.22), transparent 60%),
    radial-gradient(700px 420px at 110% 18%, rgba(249,115,22,0.16), transparent 58%),
    radial-gradient(780px 440px at 50% 120%, rgba(56,189,248,0.12), transparent 62%),
    linear-gradient(155deg, #020617 0%, #0b1324 48%, #0f172a 100%);
  background-attachment: fixed;
}
.moto-shell {
  position: relative;
  isolation: isolate;
  padding: 14px;
  border-radius: 34px;
  border: 1px solid rgba(30,41,59,0.8);
  background: linear-gradient(145deg, #020617 0%, #0b1324 48%, #0f172a 100%);
  box-shadow: inset 0 1px 0 rgba(148,163,184,0.08), 0 16px 40px rgba(2,6,23,0.35);
}
.moto-shell::before,
.moto-shell::after {
  content: '';
  position: absolute;
  pointer-events: none;
  z-index: -1;
  border-radius: 50%;
  filter: blur(10px);
}
.moto-shell::before {
  width: 340px;
  height: 340px;
  top: -100px;
  left: -120px;
  background: radial-gradient(circle at 40% 35%, rgba(14,165,233,0.22), rgba(2,132,199,0.10), transparent 70%);
}
.moto-shell::after {
  width: 280px;
  height: 280px;
  right: -90px;
  top: 170px;
  background: radial-gradient(circle at 50% 55%, rgba(249,115,22,0.15), rgba(234,88,12,0.08), transparent 72%);
}

.moto-topbar {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: 26px;
  border: 1px solid rgba(125,211,252,0.24);
  background: linear-gradient(145deg, #050b17 0%, #0b1424 45%, #0f2740 100%);
  box-shadow: 0 22px 52px rgba(2,6,23,0.42), inset 0 1px 0 rgba(255,255,255,0.06);
}
.moto-topbar::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 4px;
  border-top-left-radius: 26px;
  border-top-right-radius: 26px;
  background: linear-gradient(90deg, #f97316 0%, #f59e0b 35%, #06b6d4 68%, #38bdf8 100%);
  opacity: .95;
  z-index: 2;
}
.moto-topbar > * { position: relative; z-index: 1; }
.moto-topbar .expand-btn,
.moto-topbar .icon-btn,
.moto-topbar .seg-item {
  color: #e2e8f0;
}
.moto-topbar .seg-item.active {
  color: #0ea5e9;
}
.moto-topbar .v-sep {
  background: rgba(148,163,184,0.45);
}

.moto-body-bg .segmented {
  background: rgba(15,23,42,0.82);
  border-color: rgba(71,85,105,0.7);
}
.moto-body-bg .seg-item {
  color: #cbd5e1;
}
.moto-body-bg .seg-item:hover {
  background: rgba(30,41,59,0.9);
  color: #f8fafc;
}
.moto-body-bg .seg-item.active {
  background: linear-gradient(180deg, rgba(30,41,59,0.96) 0%, rgba(15,23,42,0.9) 100%);
  color: #38bdf8;
  border: 1px solid rgba(125,211,252,0.45);
  box-shadow: 0 4px 12px rgba(2,6,23,0.35);
}
.moto-body-bg .seg-badge {
  background: rgba(51,65,85,0.82);
  color: #e2e8f0;
}
.moto-body-bg .seg-item.active .seg-badge {
  background: rgba(8,47,73,0.92);
  color: #7dd3fc;
}
.moto-body-bg .v-sep {
  background: rgba(71,85,105,0.75);
}

.moto-kpi-grid .moto-kpi-card {
  border: 1px solid rgba(125,211,252,0.24);
  border-radius: 18px;
  background: linear-gradient(145deg, #050b17 0%, #0b1424 45%, #0f2740 100%);
  box-shadow: 0 14px 34px rgba(2,6,23,0.34), inset 0 1px 0 rgba(255,255,255,0.06);
}
.moto-kpi-grid .moto-kpi-card h3,
.moto-kpi-grid .moto-kpi-card #totalGlobal,
.moto-kpi-grid .moto-kpi-card #motoInfo,
.moto-kpi-grid .moto-kpi-card #kmCurrent {
  color: #f8fafc;
}
.moto-kpi-grid .moto-kpi-card .text-gray-500,
.moto-kpi-grid .moto-kpi-card .text-slate-400,
.moto-kpi-grid .moto-kpi-card #totalGlobalLabel {
  color: #a9b7cf !important;
}
.moto-kpi-grid .moto-kpi-card .bg-gray-50 {
  background: linear-gradient(180deg, rgba(15,23,42,0.84) 0%, rgba(15,23,42,0.64) 100%) !important;
  border: 1px solid rgba(148,163,184,0.3);
  color: #e2e8f0;
}
.moto-kpi-grid .moto-kpi-card .bg-gray-50 span {
  color: #e2e8f0;
}

.moto-table-wrap {
  border-color: rgba(125,211,252,0.24) !important;
  background: linear-gradient(145deg, #050b17 0%, #0b1424 45%, #0f2740 100%);
  box-shadow: 0 14px 34px rgba(2,6,23,0.34), inset 0 1px 0 rgba(255,255,255,0.06);
}
.moto-sheet-table {
  background: transparent;
}
.moto-sheet-table th {
  background: linear-gradient(180deg, rgba(15,23,42,0.84) 0%, rgba(15,23,42,0.66) 100%);
  color: #d7e2f2;
  border-bottom-color: rgba(71,85,105,0.6);
}
.moto-sheet-table td {
  color: #e7eefa;
  border-bottom-color: rgba(71,85,105,0.45);
}
.moto-sheet-table tbody tr:hover {
  background: rgba(30,41,59,0.55);
}
.moto-sheet-table tbody tr.row-warning {
  background: rgba(146, 64, 14, 0.28); /* amber dark tint */
}
.moto-sheet-table tbody tr.row-danger {
  background: rgba(127, 29, 29, 0.32); /* red dark tint */
}
.moto-sheet-table tbody tr.row-warning td,
.moto-sheet-table tbody tr.row-danger td {
  color: #f1f5f9;
}
.moto-body-bg #historyDrawer {
  background: linear-gradient(145deg, #050b17 0%, #0b1424 45%, #0f2740 100%);
  border-left: 1px solid rgba(125,211,252,0.24);
}
.moto-body-bg #historyDrawer .border-b {
  border-bottom-color: rgba(71,85,105,0.6);
}
.moto-body-bg #historyDrawer .font-semibold,
.moto-body-bg #historyDrawer #historyList {
  color: #e2e8f0;
}
.moto-body-bg .modal-card {
  border-color: rgba(125,211,252,0.24);
  background: linear-gradient(145deg, #050b17 0%, #0b1424 45%, #0f2740 100%);
  box-shadow: 0 22px 56px rgba(2,6,23,0.47), inset 0 1px 0 rgba(255,255,255,0.06);
}
.moto-body-bg .modal-card::before {
  background: linear-gradient(90deg, #f97316 0%, #f59e0b 35%, #06b6d4 68%, #38bdf8 100%);
}
.moto-body-bg .modal-header {
  border-bottom-color: rgba(71,85,105,0.6);
  background: linear-gradient(180deg, rgba(15,23,42,0.84) 0%, rgba(15,23,42,0.66) 100%);
}
.moto-body-bg .modal-header h2,
.moto-body-bg #formTitle {
  color: #f8fafc !important;
}
.moto-body-bg .modal-body {
  background: linear-gradient(180deg, rgba(15,23,42,0.84) 0%, rgba(15,23,42,0.68) 100%);
}
.moto-body-bg .form-section {
  border-color: rgba(148,163,184,0.34);
  background: linear-gradient(180deg, rgba(15,23,42,0.84) 0%, rgba(15,23,42,0.64) 100%);
}
.moto-body-bg .form-section h3,
.moto-body-bg .form-section label,
.moto-body-bg .section-header h3 {
  color: #e2e8f0;
}
.moto-body-bg .na-text-btn {
  color: #94a3b8;
}
.moto-body-bg .na-text-btn:hover {
  color: #f8fafc;
}
.moto-body-bg .seg-input,
.moto-body-bg .seg-select {
  background: rgba(15,23,42,0.9);
  border-color: rgba(148,163,184,0.38);
}
.moto-body-bg .seg-input:focus-within,
.moto-body-bg .seg-select:focus-within {
  background: rgba(30,41,59,0.92);
  border-color: rgba(125,211,252,0.52);
  outline-color: rgba(56,189,248,0.35);
}
.moto-body-bg .seg-input svg,
.moto-body-bg .seg-select svg,
.moto-body-bg .seg-caret {
  color: #a9b7cf;
}
.moto-body-bg .seg-input input,
.moto-body-bg .seg-select select,
.moto-body-bg .seg-custom-btn {
  color: #e2e8f0;
}
.moto-body-bg .seg-select select option {
  color: #0f172a;
}
.moto-body-bg .modal-card input[type="text"],
.moto-body-bg .modal-card input[type="number"],
.moto-body-bg .modal-card input[type="date"],
.moto-body-bg .modal-card select,
.moto-body-bg .modal-card textarea {
  border-color: rgba(148,163,184,0.38);
  background: rgba(15,23,42,0.9);
  color: #e2e8f0;
}
.moto-body-bg .modal-card input::placeholder,
.moto-body-bg .modal-card textarea::placeholder {
  color: #a9b7cf;
}
.moto-body-bg .modal-card .text-gray-500,
.moto-body-bg .modal-card .text-gray-600,
.moto-body-bg .modal-card .text-xs {
  color: #a9b7cf !important;
}
.moto-body-bg .modal-card .tuto-view {
  border-color: rgba(148,163,184,0.34);
  background: rgba(15,23,42,0.84);
  color: #e2e8f0;
}
.moto-body-bg .seg-item.confirm {
  background: linear-gradient(180deg, rgba(22,101,52,0.8) 0%, rgba(21,128,61,0.62) 100%);
  color: #dcfce7;
  border: 1px solid rgba(74,222,128,0.45);
}
.moto-body-bg .seg-item.danger {
  background: linear-gradient(180deg, rgba(127,29,29,0.8) 0%, rgba(153,27,27,0.62) 100%);
  color: #fee2e2;
  border: 1px solid rgba(248,113,113,0.45);
}
.moto-body-bg button.btn,
.moto-body-bg .btn {
  background: linear-gradient(180deg, rgba(15,23,42,0.88) 0%, rgba(15,23,42,0.72) 100%);
  border-color: rgba(125,211,252,0.28);
  color: #e2e8f0;
  box-shadow: 0 4px 12px rgba(2,6,23,0.22);
}
.moto-body-bg button.btn:hover,
.moto-body-bg .btn:hover {
  background: linear-gradient(180deg, rgba(30,41,59,0.92) 0%, rgba(15,23,42,0.78) 100%);
  border-color: rgba(125,211,252,0.42);
}
.moto-body-bg button.btn.ghost,
.moto-body-bg .btn.ghost {
  background: rgba(30,41,59,0.6);
  color: #cbd5e1;
}
.moto-body-bg button.btn.ghost:hover,
.moto-body-bg .btn.ghost:hover {
  background: rgba(30,41,59,0.9);
  color: #f8fafc;
}

@media (max-width: 768px) {
  .moto-shell {
    border-radius: 24px;
    padding: 10px;
  }
  .moto-topbar {
    padding: 12px;
    gap: 10px !important;
  }
}

/* History drawer + overlay */
#historyDrawer { transform: translateX(100%); transition: transform .18s ease-out, box-shadow .18s ease-out; box-shadow: none; }
#historyDrawer.open { transform: translateX(0); box-shadow: 0 20px 60px rgba(2,6,23,0.18); }
#historyOverlay { background: rgba(2,6,23,0.28); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); opacity: 0; transition: opacity .18s ease-out; }
#historyOverlay.show { opacity: 1; }

/* Option cards (radio list) */
label.option-card { display: block; }
label.option-card input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.option-body {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px;
  border: 1px solid #e5e7eb; border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  transition: border-color .15s ease, box-shadow .15s ease, transform .05s ease, background .15s ease;
}
label.option-card:hover .option-body { border-color: #cbd5e1; box-shadow: 0 6px 16px rgba(2,6,23,0.06); transform: translateY(-1px); }
/* Remove blue focus halo on moto selection cards */
label.option-card input[type="radio"]:focus + .option-body { outline: none; outline-offset: 0; }
label.option-card input[type="radio"]:checked + .option-body {
  border-color: #93c5fd;
  box-shadow: 0 10px 26px rgba(2,6,23,0.10);
  background: linear-gradient(180deg, #ffffff 0%, #f0f6ff 100%);
}
.opt-title { font-weight: 700; color: #0f172a; }
.opt-meta { font-size: 12px; color: #64748b; }
.opt-check {
  width: 24px; height: 24px; border-radius: 9999px;
  border: 2px solid #cbd5e1; display: inline-flex; align-items: center; justify-content: center; color: #2563eb;
  transition: all .15s ease;
}
label.option-card input[type="radio"]:checked + .option-body .opt-check { background: #dbeafe; border-color: #2563eb; box-shadow: inset 0 0 0 2px #dbeafe; }
