/* ===== RESET & ROOT ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --brand:       #1A4F8A;
  --brand-dark:  #123a68;
  --brand-light: #2a6bc7;
  --accent:      #F59E0B;
  --accent-dark: #D97706;
  --success:     #10B981;
  --danger:      #EF4444;
  --warning:     #F59E0B;
  --info:        #3B82F6;
  --bg:          #F0F4F9;
  --surface:     #FFFFFF;
  --surface2:    #F7F9FC;
  --border:      #DDE3EE;
  --text:        #1E293B;
  --text-2:      #475569;
  --text-3:      #94A3B8;
  --sidebar-w:   240px;
  --topbar-h:    58px;
  --radius:      10px;
  --shadow:      0 2px 8px rgba(30,41,59,.08);
  --shadow-md:   0 4px 16px rgba(30,41,59,.12);
  --transition:  .18s ease;
  --font:        'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

html, body { height: 100%; font-family: var(--font); font-size: 14px; color: var(--text); background: var(--bg); }

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; font-family: var(--font); }
input, select, textarea { font-family: var(--font); }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ===== LAYOUT ===== */
#app { display: flex; flex-direction: column; height: 100vh; }
#layout { display: flex; flex: 1; overflow: hidden; }
#main-content { flex: 1; overflow-y: auto; padding: 24px; transition: margin-left var(--transition); }
#view-container { max-width: 1280px; margin: 0 auto; }

/* ===== TOPBAR ===== */
#topbar {
  height: var(--topbar-h);
  background: var(--brand);
  color: #fff;
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 300;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
}
.topbar-toggle {
  background: none; border: none; color: #fff; font-size: 20px;
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  border-radius: 6px; transition: background var(--transition);
}
.topbar-toggle:hover { background: rgba(255,255,255,.15); }
.topbar-brand { font-size: 16px; font-weight: 700; letter-spacing: .3px; display: flex; align-items: center; gap: 8px; }
.topbar-brand-icon {
  width: 30px; height: 30px; background: var(--accent); border-radius: 7px;
  display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 14px; color: #1E293B;
}
.topbar-breadcrumb { flex: 1; font-size: 13px; color: rgba(255,255,255,.7); padding-left: 8px; }
.topbar-breadcrumb span { color: rgba(255,255,255,.5); margin: 0 5px; }
.topbar-breadcrumb .bc-current { color: #fff; font-weight: 600; }
.topbar-actions { display: flex; gap: 8px; align-items: center; }
.topbar-btn {
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2); color: #fff;
  padding: 5px 13px; border-radius: 6px; font-size: 12px; font-weight: 600;
  transition: background var(--transition); display: flex; align-items: center; gap: 5px;
}
.topbar-btn:hover { background: rgba(255,255,255,.22); }
.topbar-user {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2);
  padding: 4px 12px 4px 4px; border-radius: 20px;
}
.topbar-avatar {
  width: 28px; height: 28px; background: var(--accent); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 11px; color: #1E293B;
}
.topbar-username { font-size: 12px; font-weight: 600; }

/* ===== SIDEBAR ===== */
#sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  transition: width var(--transition), transform var(--transition);
  flex-shrink: 0;
  z-index: 200;
}
#sidebar.collapsed { width: 56px; }
#sidebar.collapsed .nav-label,
#sidebar.collapsed .sidebar-section-title,
#sidebar.collapsed .nav-badge { display: none; }
#sidebar.collapsed .nav-item { justify-content: center; padding: 0 12px; }
#sidebar.collapsed .nav-icon { margin: 0; }

.sidebar-section { padding: 8px 0; }
.sidebar-section-title {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .8px; color: var(--text-3); padding: 10px 16px 4px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; color: var(--text-2); font-size: 13px; font-weight: 500;
  cursor: pointer; border-left: 3px solid transparent;
  transition: all var(--transition); border-radius: 0;
  white-space: nowrap;
}
.nav-item:hover { background: var(--surface2); color: var(--brand); }
.nav-item.active { background: #EEF4FF; color: var(--brand); border-left-color: var(--brand); font-weight: 700; }
.nav-icon {
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 16px; border-radius: 7px;
}
.nav-item:hover .nav-icon, .nav-item.active .nav-icon { background: rgba(26,79,138,.1); }
.nav-badge {
  margin-left: auto; background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 700; border-radius: 10px; padding: 1px 6px;
}
.sidebar-overlay { display: none; }

/* ===== PAGE HEADER ===== */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.page-title { font-size: 20px; font-weight: 700; color: var(--text); }
.page-subtitle { font-size: 13px; color: var(--text-2); margin-top: 2px; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 7px; font-size: 13px; font-weight: 600;
  border: 1px solid transparent; transition: all var(--transition); cursor: pointer;
}
.btn-primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn-primary:hover { background: var(--brand-dark); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--surface2); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #0ea674; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-warning { background: var(--warning); color: #1E293B; }
.btn-warning:hover { background: var(--accent-dark); }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 5px; }
.btn-icon { padding: 6px 8px; }
.btn-ghost { background: none; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface2); color: var(--brand); }

/* ===== CARDS ===== */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
}
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-title { font-size: 15px; font-weight: 700; color: var(--text); }
.card-subtitle { font-size: 12px; color: var(--text-3); margin-top: 2px; }

/* ===== STAT CARDS ===== */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 4px; position: relative; overflow: hidden;
  transition: box-shadow var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow-md); }
.stat-card-accent { position: absolute; top: 0; left: 0; width: 4px; height: 100%; }
.stat-card-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--text-3); }
.stat-card-value { font-size: 28px; font-weight: 800; color: var(--text); line-height: 1; margin: 6px 0 2px; }
.stat-card-sub { font-size: 11px; color: var(--text-3); }

/* ===== GRID ===== */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

/* ===== TABLE ===== */
.table-wrapper { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  background: var(--surface2); color: var(--text-2);
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
  padding: 10px 14px; text-align: left; border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
.data-table td { padding: 11px 14px; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--surface2); }
.table-actions { display: flex; gap: 6px; flex-wrap: nowrap; }

/* ===== SEARCH BAR ===== */
.search-bar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.search-input-wrap { position: relative; flex: 1; min-width: 200px; }
.search-input-wrap input {
  width: 100%; padding: 9px 12px 9px 36px; border: 1px solid var(--border);
  border-radius: 7px; font-size: 13px; outline: none; background: var(--surface);
  transition: border var(--transition);
}
.search-input-wrap input:focus { border-color: var(--brand); }
.search-input-wrap .search-icon {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  color: var(--text-3); font-size: 14px; pointer-events: none;
}
.filter-select {
  padding: 8px 32px 8px 10px; border: 1px solid var(--border);
  border-radius: 7px; font-size: 13px; background: var(--surface); outline: none;
  cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394A3B8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
  transition: border var(--transition);
}
.filter-select:focus { border-color: var(--brand); }

/* ===== FORM ===== */
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group.full-width { grid-column: 1 / -1; }
.form-label { font-size: 12px; font-weight: 700; color: var(--text-2); text-transform: uppercase; letter-spacing: .4px; }
.form-control {
  padding: 9px 12px; border: 1px solid var(--border);
  border-radius: 7px; font-size: 13px; outline: none; background: var(--surface);
  transition: border var(--transition), box-shadow var(--transition);
}
.form-control:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(26,79,138,.1); }
.form-control.error { border-color: var(--danger); }
.form-error { font-size: 11px; color: var(--danger); font-weight: 600; }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-actions { display: flex; gap: 10px; margin-top: 24px; justify-content: flex-end; }

/* ===== BADGE ===== */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 700;
  white-space: nowrap;
}
.badge-success { background: #D1FAE5; color: #065F46; }
.badge-danger  { background: #FEE2E2; color: #991B1B; }
.badge-warning { background: #FEF3C7; color: #92400E; }
.badge-info    { background: #DBEAFE; color: #1E40AF; }
.badge-gray    { background: #F1F5F9; color: #475569; }
.badge-purple  { background: #EDE9FE; color: #5B21B6; }

/* ===== BADGE DOT ===== */
.badge-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* ===== AVATAR PLACEHOLDER ===== */
.item-avatar {
  width: 38px; height: 38px; border-radius: 8px; display: flex; align-items: center;
  justify-content: center; font-weight: 800; font-size: 13px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--brand), var(--brand-light)); color: #fff;
}

/* ===== TOAST ===== */
#toast-container {
  position: fixed; bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 10px; z-index: 9999;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 16px;
  box-shadow: var(--shadow-md); min-width: 300px; max-width: 420px;
  pointer-events: all; animation: slideInToast .25s ease;
  border-left: 4px solid var(--info);
}
.toast.success { border-left-color: var(--success); }
.toast.error   { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
.toast-icon { font-size: 18px; flex-shrink: 0; }
.toast-message { flex: 1; font-size: 13px; font-weight: 500; }
.toast-close { background: none; border: none; color: var(--text-3); font-size: 16px; cursor: pointer; padding: 0 4px; }
@keyframes slideInToast { from { transform: translateX(110%); opacity: 0; } to { transform: none; opacity: 1; } }
.toast.removing { animation: slideOutToast .2s ease forwards; }
@keyframes slideOutToast { to { transform: translateX(110%); opacity: 0; } }

/* ===== MODAL ===== */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15,23,42,.45);
  z-index: 1000; display: flex; align-items: center; justify-content: center;
  animation: fadeIn .18s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--surface); border-radius: 12px; box-shadow: var(--shadow-md);
  padding: 28px; width: 90%; max-width: 480px; animation: slideUp .22s ease;
}
.modal-lg { max-width: 600px; }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-title { font-size: 17px; font-weight: 700; margin-bottom: 10px; }
.modal-body { color: var(--text-2); font-size: 14px; margin-bottom: 22px; line-height: 1.6; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* ===== DETAIL CARD ===== */
.detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.detail-field { display: flex; flex-direction: column; gap: 3px; }
.detail-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--text-3); }
.detail-value { font-size: 14px; color: var(--text); font-weight: 600; }

/* ===== TIMELINE ===== */
.timeline { display: flex; align-items: center; gap: 0; margin: 20px 0; flex-wrap: wrap; }
.timeline-step {
  display: flex; flex-direction: column; align-items: center; flex: 1;
  min-width: 100px; position: relative;
}
.timeline-step::before {
  content: ''; position: absolute; top: 18px; left: calc(50% + 18px);
  width: calc(100% - 36px); height: 2px; background: var(--border);
}
.timeline-step:last-child::before { display: none; }
.timeline-step.active::before { background: var(--brand); }
.timeline-circle {
  width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--border);
  background: var(--surface); display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: var(--text-3); z-index: 1;
  transition: all var(--transition);
}
.timeline-step.done .timeline-circle { background: var(--brand); border-color: var(--brand); color: #fff; }
.timeline-step.current .timeline-circle { background: var(--accent); border-color: var(--accent); color: #1E293B; }
.timeline-label { font-size: 11px; font-weight: 600; color: var(--text-3); margin-top: 6px; text-align: center; }
.timeline-step.done .timeline-label,
.timeline-step.current .timeline-label { color: var(--text); }

/* ===== ALERT BOX ===== */
.alert {
  padding: 12px 16px; border-radius: 8px; font-size: 13px;
  display: flex; align-items: flex-start; gap: 10px; margin-bottom: 8px;
  border-left: 3px solid transparent;
}
.alert-danger  { background: #FEF2F2; border-left-color: var(--danger); color: #991B1B; }
.alert-warning { background: #FFFBEB; border-left-color: var(--warning); color: #92400E; }
.alert-info    { background: #EFF6FF; border-left-color: var(--info); color: #1E40AF; }
.alert-success { background: #F0FDF4; border-left-color: var(--success); color: #065F46; }

/* ===== SHORTCUT BUTTONS ===== */
.shortcut-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-top: 16px; }
.shortcut-btn {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 18px; border-radius: var(--radius); border: 2px solid var(--border);
  background: var(--surface); cursor: pointer; transition: all var(--transition);
  color: var(--text-2); font-size: 12px; font-weight: 600; text-align: center;
}
.shortcut-btn:hover { border-color: var(--brand); color: var(--brand); background: #EEF4FF; transform: translateY(-2px); box-shadow: var(--shadow-md); }
.shortcut-icon { font-size: 24px; }

/* ===== BAR CHART (CSS Only) ===== */
.bar-chart { display: flex; align-items: flex-end; gap: 10px; height: 140px; padding-top: 10px; }
.bar-group { display: flex; flex-direction: column; align-items: center; flex: 1; gap: 4px; height: 100%; justify-content: flex-end; }
.bar {
  width: 100%; border-radius: 5px 5px 0 0;
  background: linear-gradient(180deg, var(--brand-light), var(--brand));
  transition: height .5s cubic-bezier(.4,0,.2,1); min-height: 4px;
}
.bar-label { font-size: 10px; color: var(--text-3); font-weight: 600; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60px; }
.bar-value { font-size: 11px; font-weight: 700; color: var(--text-2); }

/* ===== PHOTO PLACEHOLDER ===== */
.photo-placeholder {
  width: 80px; height: 80px; border-radius: 10px;
  background: linear-gradient(135deg, #E0E7FF, #C7D2FE);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 800; color: var(--brand); margin-bottom: 12px;
}

/* ===== EMPTY STATE ===== */
.empty-state { text-align: center; padding: 48px 24px; color: var(--text-3); }
.empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-title { font-size: 16px; font-weight: 700; color: var(--text-2); margin-bottom: 6px; }
.empty-sub { font-size: 13px; }

/* ===== SECTION ===== */
.section { margin-bottom: 28px; }
.section-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--text-3); margin-bottom: 12px; }

/* ===== LOADING ===== */
.loading { display: flex; align-items: center; justify-content: center; padding: 40px; color: var(--text-3); }

/* ===== QTY INPUT ===== */
.qty-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 13px; font-weight: 700;
}
.qty-badge.critical { color: var(--danger); }
.qty-badge.ok { color: var(--success); }
.qty-badge.low { color: var(--warning); }

/* ===== INLINE ITEMS TABLE (REQUISIÇÃO) ===== */
.inline-add { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 12px; }
.inline-add .form-group { margin: 0; }

/* ===== TAGS ===== */
.tag { display: inline-block; background: var(--surface2); border: 1px solid var(--border); border-radius: 5px; padding: 2px 8px; font-size: 11px; color: var(--text-2); }

/* ===== DIVIDER ===== */
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* ===== PROGRESS BAR ===== */
.progress-bar { background: var(--border); border-radius: 4px; height: 8px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 4px; transition: width .5s ease; }

/* ===== CHIP TABS ===== */
.chip-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.chip-tab {
  padding: 5px 14px; border-radius: 20px; border: 1.5px solid var(--border);
  font-size: 12px; font-weight: 600; cursor: pointer; background: var(--surface);
  color: var(--text-2); transition: all var(--transition);
}
.chip-tab.active { background: var(--brand); color: #fff; border-color: var(--brand); }

/* ===== AUTOCOMPLETE ===== */
.autocomplete-wrap { position: relative; }
.autocomplete-list {
  position: absolute; top: 100%; left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: 7px;
  box-shadow: var(--shadow-md); z-index: 100; max-height: 200px; overflow-y: auto;
  margin-top: 4px;
}
.autocomplete-item { padding: 8px 12px; cursor: pointer; font-size: 13px; transition: background var(--transition); }
.autocomplete-item:hover, .autocomplete-item.focused { background: var(--surface2); }

/* ===== TIMELINE VERTICAL ===== */
.timeline-vertical {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 8px 0;
}

.timeline-vertical .timeline-step {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  position: relative;
  padding-bottom: 28px;
}

.timeline-vertical .timeline-step:last-child { padding-bottom: 0; }

.timeline-vertical .timeline-step::before {
  content: '';
  position: absolute;
  left: 19px;
  top: 40px;
  bottom: 0;
  width: 2px;
  background: var(--border);
}
.timeline-vertical .timeline-step:last-child::before { display: none; }
.timeline-vertical .timeline-step.done::before      { background: var(--success); }
.timeline-vertical .timeline-step.current::before   { background: linear-gradient(var(--brand), var(--border)); }
.timeline-vertical .timeline-step.reprovada::before { background: var(--danger); }

.timeline-vertical .timeline-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--text-3);
  z-index: 1;
}
.timeline-vertical .timeline-step.done    .timeline-circle { background: var(--success); border-color: var(--success); color: #fff; font-size: 14px; }
.timeline-vertical .timeline-step.current .timeline-circle { background: var(--brand);   border-color: var(--brand);   color: #fff; box-shadow: 0 0 0 4px rgba(99,102,241,.15); }
.timeline-vertical .timeline-step.reprovada .timeline-circle { background: var(--danger); border-color: var(--danger); color: #fff; }

.timeline-info { flex: 1; padding-top: 8px; }
.timeline-label { font-size: 14px; font-weight: 700; color: var(--text); }
.timeline-desc  { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.timeline-evento-data { font-size: 11px; color: var(--text-3); margin-top: 4px; }
.timeline-evento-ator { font-size: 12px; font-weight: 600; color: var(--brand); margin-top: 2px; }

/* ===== BADGE PURPLE (Compras) ===== */
.badge-purple { background: #EDE9FE; color: #7C3AED; }
.toggle-switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--border); border-radius: 24px; transition: .2s;
}
.toggle-slider::before {
  content: ''; position: absolute;
  width: 18px; height: 18px; left: 3px; bottom: 3px;
  background: #fff; border-radius: 50%; transition: .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.toggle-switch input:checked + .toggle-slider { background: var(--brand); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ===== PONTO REPOSICAO MARKER ===== */
.rep-marker {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 700; color: var(--brand);
  background: #EEF4FF; padding: 3px 9px; border-radius: 20px;
  border: 1.5px solid var(--brand);
}
@media (max-width: 768px) {
  #sidebar {
    position: fixed; left: 0; top: var(--topbar-h); bottom: 0;
    width: var(--sidebar-w) !important; transform: translateX(-100%);
    z-index: 250; box-shadow: var(--shadow-md);
  }
  #sidebar.mobile-open { transform: translateX(0); }
  .sidebar-overlay { display: block; position: fixed; inset: 0; top: var(--topbar-h); background: rgba(0,0,0,.4); z-index: 240; opacity: 0; pointer-events: none; transition: opacity var(--transition); }
  .sidebar-overlay.active { opacity: 1; pointer-events: all; }
  #main-content { padding: 16px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr 1fr; }
  .stat-cards { grid-template-columns: 1fr 1fr; }
  .topbar-brand span { display: none; }
}

@media (max-width: 480px) {
  .stat-cards { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .timeline { flex-direction: column; align-items: flex-start; gap: 12px; }
  .timeline-step { flex-direction: row; gap: 12px; width: 100%; }
  .timeline-step::before { top: 18px; left: 50px; width: 2px; height: 100%; }
}
