:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-alt: #eef2fb;
  --primary: #1f4bff;
  --primary-dark: #1334b8;
  --secondary: #12a579;
  --text: #1b1f3b;
  --muted: #6e738a;
  --border: #e1e4ef;
  --danger: #e55050;
  --danger-dark: #c03535;
  --cal-today: #fff2b3;
  --cal-approved: #e9f9ef;
  --cal-planned: #cfe3ff;
  --cal-weekend: #ffe5e5;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

body.cert-validator-page {
  background: #f4f7fb;
}

body.modal-open {
  overflow: hidden;
  touch-action: none;
  overscroll-behavior: none;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

main.container {
  max-width: 1100px;
  margin: 30px auto;
  background: var(--surface);
  border-radius: 16px;
  padding: 40px;
  box-shadow: 0 25px 45px rgba(15, 23, 42, 0.08);
}

/* Navigation */
nav {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 1100;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-links-list {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.nav-links a {
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 500;
}
.nav-disabled-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 500;
  background: rgba(14, 22, 48, 0.04);
  border: 1px dashed rgba(110, 115, 138, 0.35);
  cursor: not-allowed;
  position: relative;
  user-select: none;
  opacity: 0.8;
}
.nav-disabled-link:hover,
.nav-disabled-link:focus-visible {
  text-decoration: none;
  color: var(--muted);
  background: rgba(14, 22, 48, 0.07);
  outline: none;
}
.nav-disabled-link::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  top: calc(100% + 14px);
  transform: translateX(-50%) translateY(-4px);
  min-width: 220px;
  max-width: 280px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(31, 75, 255, 0.14);
  background: #ffffff;
  color: var(--text);
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.16);
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.45;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
  z-index: 1300;
}
.nav-disabled-link::before {
  content: "";
  position: absolute;
  left: 50%;
  top: calc(100% + 8px);
  transform: translateX(-50%) translateY(-4px);
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 7px solid #ffffff;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
  z-index: 1301;
}
.nav-disabled-link:hover::after,
.nav-disabled-link:hover::before,
.nav-disabled-link:focus-visible::after,
.nav-disabled-link:focus-visible::before {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.nav-links a.qsm-disabled {
  color: var(--muted);
  opacity: 0.65;
  cursor: not-allowed;
}
.qsm-blocked-bubble {
  position: fixed;
  background: #ffffff;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
  z-index: 2200;
  max-width: 240px;
  width: max-content;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 0);
  transition: opacity 0.2s ease;
  font-weight: 600;
}
.qsm-blocked-bubble.visible {
  opacity: 1;
}
.nav-dropdown {
  position: relative;
}
.nav-dropdown-toggle {
  padding: 8px 14px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-weight: 500;
  font-size: 1rem;
  font-family: inherit;
  cursor: pointer;
}
.nav-badge {
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.nav-badge-sub {
  display: none;
  margin-left: 8px;
}
.nav-dropdown:hover .nav-badge-main,
.nav-dropdown.open .nav-badge-main {
  display: none;
}
.nav-dropdown:hover .nav-badge-sub,
.nav-dropdown.open .nav-badge-sub {
  display: inline-flex;
}
.nav-dropdown-toggle:hover,
.nav-dropdown:hover .nav-dropdown-toggle {
  background: var(--surface-alt);
  color: var(--primary);
}
.nav-dropdown-menu {
  position: absolute;
  top: 110%;
  left: 0;
  min-width: 220px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.15);
  padding: 8px 0;
  display: none;
  z-index: 1200;
}
.nav-dropdown:hover .nav-dropdown-menu {
  display: block;
}
.nav-dropdown.open .nav-dropdown-menu {
  display: block;
}
.nav-dropdown.open .nav-dropdown-toggle {
  background: var(--surface-alt);
  color: var(--primary);
}
.nav-dropdown-menu a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  color: var(--text);
  border-radius: 0;
}
.nav-dropdown-menu a .badge-count {
  flex: 0 0 auto;
}
.nav-dropdown-menu a:hover {
  background: var(--surface-alt);
  color: var(--primary);
}

.nav-links a:hover {
  background: var(--surface-alt);
  color: var(--primary);
}
.nav-links a.active {
  background: var(--surface-alt);
  color: var(--primary);
  font-weight: 600;
}
.nav-dropdown-toggle.active {
  background: var(--surface-alt);
  color: var(--primary);
  font-weight: 600;
}

.nav-pill {
  background: rgba(31, 75, 255, 0.15);
  color: var(--primary);
  font-weight: 600;
}

.nav-logo-link img {
  height: 34px;
}

.nav-mobile-logo {
  display: none;
  width: 100%;
  text-align: center;
}

.nav-mobile-logo img {
  width: 120px;
  max-width: 60%;
  margin-bottom: 20px;
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
}

.nav-toggle span {
  width: 20px;
  height: 2px;
  background: var(--text);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

nav.nav-open .nav-toggle span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

nav.nav-open .nav-toggle span:nth-child(2) {
  opacity: 0;
}

nav.nav-open .nav-toggle span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav-logout {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-profile-pill {
  display: inline-flex;
  align-items: stretch;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  height: 50px;
}

.nav-profile-pill .user-chip-link {
  height: 100%;
  display: inline-flex;
}

.nav-profile-pill .user-chip {
  background: transparent;
  border-radius: 999px 0 0 999px;
  padding: 0 16px;
  height: 100%;
  display: inline-flex;
  align-items: center;
}

.nav-profile-pill .user-chip-link:hover .user-chip {
  background: #e7ecff;
}

.nav-profile-pill .btn-danger {
  border-radius: 0 999px 999px 0;
  margin: 0;
  height: 100%;
  padding: 0 24px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.desktop-only {
  display: flex;
}

.nav-mobile-profile {
  display: none;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  border-top: 1px solid var(--border);
  padding-top: 20px;
}

.nav-mobile-profile .btn {
  width: 100%;
}

.nav-mobile-profile .nav-profile-pill {
  width: 100%;
  justify-content: space-between;
}

.nav-mobile-profile .nav-profile-pill .user-chip {
  flex: 1 1 auto;
}

.nav-overlay {
  opacity: 0;
  pointer-events: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(10, 15, 30, 0.5);
  z-index: 900;
  transition: opacity 0.3s ease;
}

.nav-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.user-chip {
  background: var(--surface-alt);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--muted);
  display: inline-flex;
  gap: 10px;
  align-items: center;
}

.user-chip small {
  color: var(--primary);
  font-weight: 600;
}

.user-chip-link {
  text-decoration: none;
  color: inherit;
  display: inline-flex;
}

.user-chip-link:hover {
  text-decoration: none;
}

.user-chip-link:hover .user-chip {
  background: #e7ecff;
}

.user-chip-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.user-chip-name-short {
  display: none;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #eef3ff;
  border: 1px solid #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--primary);
  overflow: hidden;
  flex-shrink: 0;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.flash-container {
  max-width: 1100px;
  margin: 15px auto;
  padding: 0 30px;
}

.alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 10px;
  font-size: 0.95rem;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.alert-text {
  flex: 1;
}
.alert-close {
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  padding: 2px;
  opacity: 0.7;
}
.alert-close:hover {
  opacity: 1;
}
.alert-hide {
  opacity: 0;
  transform: translateY(-4px);
}

.alert-success {
  background: #e8f7ef;
  color: #197749;
}

.alert-error {
  background: #fdecec;
  color: #b61a1a;
}

.alert-info {
  background: #eef3ff;
  color: #1f4bff;
}

.btn {
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.2s ease, color 0.2s ease;
}

.btn.small {
  padding: 6px 12px;
  font-size: 0.85rem;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-secondary {
  background: var(--secondary);
  color: white;
}

.btn-secondary:hover {
  background: #0d7b5a;
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  background: var(--surface-alt);
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover {
  background: var(--danger-dark);
}

.btn.qsm-disabled {
  opacity: 0.65;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-remove-row {
  background: var(--danger);
  color: white;
  border: none;
  border-radius: 8px;
  width: 34px;
  height: 34px;
  font-size: 1rem;
  cursor: pointer;
}

.muted {
  color: var(--muted);
  font-size: 0.95rem;
}

/* Férias */
.date-dual {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}
.date-text {
  width: 100%;
}
.radio-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 8px 0 4px;
}
.radio-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
  font-weight: 500;
}
.radio-chip input {
  accent-color: var(--primary);
}
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  background: #eef2ff;
  color: #3b4cc0;
}
.status-chip.aprovado {
  background: #d1f7df;
  color: #0f7b2e;
}
.status-chip.em_analise {
  background: #ffeecd;
  color: #8a5a00;
}
.status-chip.recusado {
  background: #fde2e1;
  color: #b42318;
}
.status-chip.planejado {
  background: #d4e5ff;
  color: #0f4fbf;
}
.vacation-calendar tr.cal-planejado {
  background: #e8f1ff;
}
.vacation-calendar tr.cal-aprovado {
  background: #e9f9ef;
}
.vacation-month {
  margin-top: 8px;
  background: #f7f9ff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
}
.vacation-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  margin: 10px 0 12px;
}
.vacation-legend .legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--muted);
  font-size: 0.95rem;
}
.legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1px solid var(--border);
  display: inline-block;
}
.legend-weekend {
  background: var(--cal-weekend);
  border-color: #f4b4b4;
}
.legend-today {
  background: var(--cal-today);
  border-color: #f3d76b;
}
.legend-planned {
  background: var(--cal-planned);
  border-color: #8bb0ff;
}
.legend-approved {
  background: var(--cal-approved);
  border-color: #8ed5a8;
}
.vacation-month-header {
  font-weight: 700;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.calendar-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}
.calendar-picker {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}
.calendar-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}
.vacation-grid-head {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 6px;
  text-align: center;
  font-weight: 600;
  color: #475569;
}
.vacation-month {
  position: relative;
  z-index: 20;
}
.vacation-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  position: relative;
  z-index: 25;
}
.vacation-day {
  background: #ffffff;
  border: 1px solid #e4e7f3;
  border-radius: 8px;
  padding: 10px 8px;
  text-align: right;
  font-weight: 600;
  color: #475569;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.vacation-day.day-planejado {
  background: #cfe3ff;
  border-color: #8bb0ff;
}
.vacation-day.day-aprovado {
  background: #e9f9ef;
  border-color: #8ed5a8;
}
.vacation-day.weekend {
  color: #b42318;
  border-color: #f4b4b4;
  background: var(--cal-weekend);
}
.vacation-day.color-mix {
  border-color: #d7def4;
}
.vacation-day.color-mix .day-number {
  color: var(--text);
}
.vacation-day.color-mix.weekend .day-number {
  color: #b42318;
}
.vacation-day .day-number {
  font-weight: 700;
}
.vacation-day {
  position: relative;
}
.vacation-day:not(.empty):hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.12);
  z-index: 20;
}
.day-tooltip {
  display: none;
  position: absolute;
  top: 36px;
  left: 0;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.15);
  min-width: 160px;
  z-index: 9999;
  color: #1b1f3b;
}
.day-tooltip p {
  margin: 0 0 6px 0;
  font-size: 0.9rem;
}
.day-tooltip ul {
  margin: 0;
  padding-left: 16px;
}
.day-tooltip li {
  font-size: 0.9rem;
}
.vacation-day:hover .day-tooltip {
  display: block;
}
.vacation-calendar.table-scroll,
.vacation-calendar .data-table,
.vacation-calendar .data-table thead,
.vacation-calendar .data-table tbody {
  position: relative;
  z-index: 1;
}
.tooltip-title.approved {
  color: #0f7b2e;
  font-weight: 700;
}
.tooltip-title.planned {
  color: #1d4ed8;
  font-weight: 700;
}
.vacation-grid-head .weekend {
  color: #b42318;
}
.date-input {
  background: #f4f6ff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.95rem;
  color: var(--text);
}
.date-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(31, 75, 255, 0.15);
}
.admin-extra {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 8px;
  align-items: center;
}
.recusa-box .refusal-reason {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--surface-alt);
  font-family: inherit;
  font-size: 0.95rem;
  resize: vertical;
  min-height: 70px;
}

.qsm-refusal-chip {
  position: relative;
}

.qsm-refusal-bubble {
  position: fixed;
  background: #ffffff;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.15);
  white-space: normal;
  width: max-content;
  max-width: min(320px, calc(100vw - 24px));
  z-index: 6000;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.qsm-refusal-bubble.visible {
  opacity: 1;
  transform: translate(-50%, 8px);
}
.qsm-refusal-bubble.flip {
  transform: translate(-50%, -8px);
}
.scheduled-days {
  background: #f4f6ff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.95rem;
  color: var(--text);
  max-width: 90px;
}
.scheduled-days:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(31, 75, 255, 0.15);
}
.admin-status-wrap {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 12px;
  align-items: center;
}
.admin-status-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.admin-status-cell {
  min-width: 320px;
}
.small-label {
  font-size: 0.8rem;
  margin: 0;
  display: block;
}

.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 30px;
}
.page-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}
.badge-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-weight: 700;
  font-size: 0.8rem;
  margin-left: 6px;
}

.copy-chip {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.copy-chip.action-stack {
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
.copy-chip.action-stack .action-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.copy-chip form {
  margin: 0;
}

.grid {
  display: grid;
  gap: 24px;
  margin-bottom: 30px;
}

.grid.two {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 12px 30px rgba(82, 95, 127, 0.08);
}

.card.highlight {
  background: linear-gradient(135deg, rgba(31, 75, 255, 0.9), rgba(77, 116, 255, 0.8));
  color: white;
}

.card.highlight p,
.card.highlight h2 {
  color: white;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.card-header a {
  font-size: 0.9rem;
}

.item-list,
.activity-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.item-list li,
.activity-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.item-list li:last-child,
.activity-list li:last-child {
  border-bottom: none;
}

.activity-list li {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  column-gap: 12px;
  align-items: center;
  text-align: center;
}

.activity-list strong,
.activity-list span,
.activity-list small {
  display: block;
  text-align: center;
}

.activity-list small {
  color: var(--muted);
  display: block;
  margin-top: 2px;
}

@media (max-width: 640px) {
  .activity-list li {
    grid-template-columns: 1fr;
    row-gap: 4px;
    text-align: left;
  }

  .activity-list strong,
  .activity-list span,
  .activity-list small {
    text-align: left;
  }
}

.card .button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}
.filter-month {
  display: flex;
  align-items: center;
  gap: 8px;
}
.filter-month input[type="month"] {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  font-size: 0.95rem;
  color: var(--text);
}
.filter-month input[type="month"]:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface-alt);
  box-shadow: 0 0 0 3px rgba(31, 75, 255, 0.15);
}

.steps {
  list-style: decimal;
  padding-left: 18px;
  margin: 0;
}

.form-card label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}

.form-card input[type="text"],
.form-card input[type="password"],
.form-card input[type="number"],
.form-card input[type="month"],
.form-card input[type="date"],
.form-card input[type="email"],
.form-card textarea {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  font-size: 1rem;
}

.form-card select {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  font-size: 1rem;
  appearance: none;
}
.form-card input[type="text"]:focus,
.form-card input[type="password"]:focus,
.form-card input[type="number"]:focus,
.form-card input[type="month"]:focus,
.form-card input[type="date"]:focus,
.form-card input[type="email"]:focus,
.form-card textarea:focus,
.form-card select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(31, 75, 255, 0.15);
}
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(31, 75, 255, 0.15);
}
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(31, 75, 255, 0.15);
}
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
textarea,
select {
  background-clip: padding-box;
}
input:-webkit-autofill,
input:-webkit-autofill:focus,
input:-webkit-autofill:hover,
textarea:-webkit-autofill,
textarea:-webkit-autofill:focus,
select:-webkit-autofill,
select:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--surface-alt) inset;
  box-shadow: 0 0 0 1000px var(--surface-alt) inset;
  border-radius: inherit;
}
.file-picker {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.file-picker input[type="file"] {
  display: none;
}
.file-picker .file-name {
  color: var(--muted);
  font-size: 0.95rem;
}
.ref-picker {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}
.ref-picker input[type="month"] {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  font-size: 0.95rem;
}
.ref-picker input[type="month"]:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface-alt);
  box-shadow: 0 0 0 3px rgba(31, 75, 255, 0.15);
}

.form-card .button-row {
  align-items: center;
  gap: 12px;
}

.verify-actions-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 6px;
  align-items: stretch;
  justify-items: stretch;
  grid-auto-rows: 44px;
}

.verify-actions-grid .btn {
  width: 100%;
  height: 44px;
  padding: 0 18px;
  line-height: 1;
  white-space: nowrap;
}

.verify-actions-grid > * {
  width: 100%;
}

@media (max-width: 520px) {
  .verify-actions-grid {
    grid-template-columns: 1fr;
  }
}

.compact-select {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.compact-select-input {
  width: 190px;
  padding: 10px 40px 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  font-size: 0.95rem;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23333' d='M1 0l4 4 4-4 1 1-5 5-5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.compact-select select {
  width: 190px;
  padding: 10px 40px 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  font-size: 0.95rem;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23333' d='M1 0l4 4 4-4 1 1-5 5-5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.compact-select.no-label {
  margin-top: 0;
}

.input-with-icon {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-alt);
}

.input-with-icon input {
  border: none;
  background: transparent;
  width: 100%;
  padding: 12px 44px 12px 12px;
  font-size: 1rem;
  border-radius: 12px;
  background-clip: padding-box;
}
.input-with-icon input:focus {
  outline: none;
  box-shadow: none;
}
.input-with-icon input:focus-visible {
  outline: none;
  box-shadow: none;
}
.input-with-icon:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(31, 75, 255, 0.15);
}

.input-with-icon .toggle-visibility {
  background: transparent;
  border: none;
  cursor: pointer;
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.input-with-icon .toggle-visibility img {
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  object-fit: contain;
}

.form-card textarea {
  resize: vertical;
}

.item-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.item-form .grid {
  margin-bottom: 0;
}
.item-form label {
  margin-bottom: 0;
}
.item-form label > span {
  display: block;
  margin-bottom: 6px;
}
.item-form .table-header {
  margin: 0;
}
.item-form select {
  padding-right: 36px;
  background-image:
    linear-gradient(45deg, transparent 50%, #6e738a 50%),
    linear-gradient(135deg, #6e738a 50%, transparent 50%);
  background-position:
    calc(100% - 20px) 50%,
    calc(100% - 14px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin: 20px 0 10px;
}

.table-scroll {
  overflow-x: auto;
}

.password-cell {
  vertical-align: middle;
}

.password-content {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}

.password-cell .password-value {
  min-width: 60px;
  display: inline-block;
}

.password-cell .password-toggle {
  background: transparent;
  border: none;
  padding: 2px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 0.2s ease, transform 0.1s ease;
}

.password-cell .password-toggle:hover {
  background: rgba(0, 0, 0, 0.05);
}

.password-cell .password-toggle:active {
  transform: scale(0.95);
}

.password-cell .password-toggle img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.password-cell .password-toggle[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}

.table-scroll.tall {
  max-height: 640px;
  overflow-y: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

table th,
table td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
}

.dynamic-table input[type="text"] {
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
}

table select,
table input[type="text"] {
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 8px;
  background: var(--surface-alt);
  min-height: 38px;
  appearance: none;
}

.form-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-top: 25px;
  flex-wrap: wrap;
}

.qr-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.observations-box {
  background: var(--surface-alt);
  border-radius: 12px;
  padding: 16px;
  white-space: pre-wrap;
  border: 1px solid var(--border);
}

.data-table td.actions {
  vertical-align: middle;
  text-align: center;
}
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  cursor: pointer;
  padding: 6px;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
}
.icon-button img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}
.icon-button:hover {
  background: #eef2ff;
  border-color: var(--primary);
}
.icon-button:active {
  transform: scale(0.97);
}
.icon-button.danger {
  border-color: rgba(229, 80, 80, 0.3);
  background: rgba(229, 80, 80, 0.08);
}
.icon-button.danger:hover {
  border-color: #e55050;
  background: rgba(229, 80, 80, 0.15);
}

.action-buttons {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.action-buttons form {
  margin: 0;
}

.danger-zone {
  border: 1px solid rgba(229, 80, 80, 0.4);
  background: rgba(229, 80, 80, 0.05);
}

/* Login Screens */
.auth-wrapper,
.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 60vh;
}

.auth-card {
  background: var(--surface);
  border-radius: 20px;
  padding: 40px;
  border: 1px solid var(--border);
  width: min(900px, 100%);
}

.auth-headline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.auth-headline img {
  height: 60px;
}

/* Modal genérico */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(12, 18, 36, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 4000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.modal-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}
.modal-card {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 24px;
  width: min(420px, 100%);
  box-shadow: 0 25px 45px rgba(15, 23, 42, 0.18);
  transform: translateY(10px);
  transition: transform 0.2s ease, opacity 0.2s ease;
  opacity: 0;
}
.modal-card input[type="text"],
.modal-card input[type="password"],
.modal-card input[type="email"],
.modal-card input[type="number"] {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text);
  font-size: 1rem;
  margin: 12px 0 4px;
}
.modal-card input[type="text"]:focus,
.modal-card input[type="password"]:focus,
.modal-card input[type="email"]:focus,
.modal-card input[type="number"]:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface-alt);
  box-shadow: 0 0 0 3px rgba(44, 115, 255, 0.18);
}
.modal-card.visible {
  transform: translateY(0);
  opacity: 1;
}
.modal-card.modal-lg {
  width: min(760px, 100%);
}
.modal-card.modal-error h3 {
  color: #b61a1a;
}
.modal-card.modal-error .modal-head {
  align-items: flex-start;
}
.modal-head {
  display: flex;
  gap: 12px;
  align-items: center;
}
.modal-icon {
  /* removed icon usage */
}
.modal-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}
.modal-close-x {
  margin-left: auto;
  border: 1px solid var(--border);
  background: #f8fafc;
  color: #1f2a44;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 1.2rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.modal-close-x:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.12);
}
.signature-terms-body {
  max-height: 45vh;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  background: var(--surface-alt);
  display: grid;
  gap: 10px;
}
.signature-terms-body ol {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 8px;
}
.signature-terms-check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-weight: 600;
  margin-top: 12px;
}
.signature-terms-check input {
  margin-top: 4px;
}
.signature-terms-error {
  color: #b61a1a;
}

.logo-banner {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 24px;
}

.logo-banner img {
  max-height: 90px;
  width: auto;
  object-fit: contain;
}

.log-scroll {
  max-height: 520px;
  overflow-y: auto;
}

.auth-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.auth-panel {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
}

.auth-panel.secondary {
  background: var(--surface-alt);
}

.auth-panel form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 15px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}

.auth-form input {
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 10px;
  background: var(--surface);
}
.auth-form input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(31, 75, 255, 0.15);
}
.btn.loading {
  opacity: 0.7;
  pointer-events: none;
}

.login-container {
  flex-direction: column;
  text-align: center;
  gap: 10px;
}

.copy-chip span {
  font-size: 0.9rem;
  color: var(--muted);
}

/* Tables for logs/tracking */
.data-table {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.table-hover-lift tbody tr {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}
.table-hover-lift tbody tr:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.12);
  z-index: 1;
}
.table-hover-lift tbody tr:hover td {
  background: var(--surface-alt);
}

.collapsible-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.collapse-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}
.collapse-toggle:hover {
  background: #e7ecff;
  transform: translateY(-1px);
  color: var(--text);
}
.collapse-toggle .collapse-label,
.collapse-toggle .collapse-icon {
  color: inherit;
}
.collapse-icon {
  display: inline-flex;
  font-size: 0.75rem;
  transition: transform 0.2s ease;
}
.collapse-toggle[aria-expanded="true"] .collapse-icon {
  transform: rotate(180deg);
}
.collapsible-body {
  margin-top: 12px;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.25s ease, opacity 0.2s ease;
}
.collapsible-body.is-open {
  opacity: 1;
}

.responsibility-log-scroll {
  max-height: 360px;
  overflow-y: auto;
}

.data-table th {
  background: var(--surface-alt);
  font-weight: 600;
  text-align: center;
}

.data-table td {
  vertical-align: middle;
  text-align: center;
}

.table-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.table-filters input,
.table-filters select {
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
}

.inventory-filters {
  margin-bottom: 20px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-items: end;
}

.alert-flag {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.85rem;
  background: rgba(229, 80, 80, 0.15);
  color: var(--danger);
}

.status-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  border: 1px solid transparent;
}

.status-flag.success {
  background: rgba(18, 165, 121, 0.12);
  color: #0d7b5a;
  border-color: rgba(18, 165, 121, 0.2);
}

.status-flag.danger {
  background: rgba(229, 80, 80, 0.12);
  color: #b61a1a;
  border-color: rgba(229, 80, 80, 0.2);
}
.status-flag.info {
  background: rgba(31, 75, 255, 0.12);
  color: #1f4bff;
  border-color: rgba(31, 75, 255, 0.2);
}
.status-flag.warning {
  background: rgba(255, 170, 51, 0.16);
  color: #9c5a00;
  border-color: rgba(255, 170, 51, 0.3);
}

/* Hero / dashboard */
.hero {
  background: linear-gradient(120deg, rgba(31, 75, 255, 0.08), rgba(18, 165, 121, 0.08));
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 28px;
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 20px;
  align-items: center;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
}

.hero-text h1 {
  margin: 6px 0;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.pill {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(31, 75, 255, 0.15);
  color: var(--primary);
  font-weight: 700;
  letter-spacing: 0.02em;
}
.pill.soft {
  background: var(--surface-alt);
  color: var(--text);
  border: 1px solid var(--border);
}

.hero-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}

.hero-panel .stat {
  background: var(--surface-alt);
  border-radius: 12px;
  padding: 12px;
  text-align: center;
  border: 1px solid var(--border);
}

.hero-panel .stat strong {
  display: block;
  font-size: 1.3rem;
  color: var(--primary);
}

.hero-panel .stat span {
  font-size: 0.9rem;
  color: var(--muted);
}

.quick-actions {
  margin-top: 24px;
  margin-bottom: 10px;
}

.section-title {
  margin: 0 0 10px 0;
  font-size: 1.2rem;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.action-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  background: var(--surface);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.05);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.action-card h3 {
  margin: 0;
}

.action-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

/* Drive */
.drive-page main.container {
  background: transparent;
  box-shadow: none;
  padding: 0 0 40px 0;
  max-width: 1200px;
}
.drive-page {
  background: linear-gradient(135deg, #f5f7fb 0%, #eef3ff 40%, #e8f0ff 100%);
}
.glass {
  background: var(--surface);
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.1);
  backdrop-filter: blur(4px);
}
.drive-hero-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px 32px;
  border-radius: 18px;
  color: var(--text);
  background: #ffffff;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.12);
}
.drive-hero-card h1 {
  margin: 6px 0 4px 0;
  color: var(--text);
}
.drive-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.drive-badges .pill.soft {
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.drive-badges .pill.soft:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.14);
  border-color: #c9d7ff;
  background: #f3f6ff;
}
.drive-badges .drive-new-badge {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.drive-badges .drive-new-badge:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 12px 24px rgba(31, 75, 255, 0.22);
}
.drive-clear-form {
  display: inline-flex;
}
.drive-clear-btn {
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
  appearance: none;
}
.drive-clear-btn:hover {
  background: #e7ecff;
  color: var(--text);
  transform: translateY(-1px);
}
.drive-shell {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.drive-breadcrumb-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.chip-nav {
  background: var(--surface);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-weight: 600;
}
.chip-nav.active {
  background: rgba(31,75,255,0.12);
  border-color: rgba(31,75,255,0.35);
}
.crumb-sep {
  color: var(--muted);
}
.drive-create-row {
  display: flex;
  gap: 10px;
  align-items: center;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 14px;
  padding: 10px;
}
.drive-subchips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.drive-dropzone {
  border: 1px dashed var(--primary);
  border-radius: 14px;
  padding: 28px 22px;
  text-align: center;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--surface);
}
.explorer-row {
  display: grid;
  grid-template-columns: 30px auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
}
.row-select-box {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding-left: 6px;
}
.row-select {
  width: 18px;
  height: 18px;
}
.drive-dropzone h3 {
  margin: 6px 0;
  color: var(--text);
}
.drive-dropzone.dragging {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px rgba(31,75,255,0.2);
  background: rgba(31, 75, 255, 0.08);
}
.drive-card {
  padding: 18px;
  border-radius: 16px;
  color: var(--text);
}
.explorer-card.dragging {
  border: 1px dashed var(--primary);
  background: rgba(31, 75, 255, 0.05);
}
.selection-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}
.selection-bar.hidden {
  display: none;
}
.drive-card-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.new-menu {
  position: relative;
}
.new-menu-list {
  position: absolute;
  right: 0;
  top: 110%;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.16);
  padding: 6px;
  display: none;
  min-width: 160px;
  z-index: 40;
}
.new-menu-list.open {
  display: block;
}
.new-menu-list button {
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
}
.new-menu-list button:hover {
  background: #eef2ff;
}
.new-panel {
  margin: 10px 0 12px;
}
.hidden {
  display: none !important;
}
.upload-overlay {
  position: fixed;
  inset: 0;
  background: rgba(12, 18, 36, 0.4);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 5000;
}
.upload-overlay.visible {
  display: flex;
}
.upload-card {
  background: #fff;
  padding: 24px 28px;
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.18);
  text-align: center;
  min-width: 320px;
  width: min(92vw, 460px);
}
.upload-card .spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #e4e8ff;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  margin: 0 auto 12px;
}
.upload-card .spinner.hidden {
  display: none;
}
.upload-progress-shell {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: #e7edf8;
  overflow: hidden;
  margin: 18px 0 10px;
}
.upload-progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), #6f92ff);
  transition: width 0.2s ease;
}
.upload-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.95rem;
  color: var(--text);
}
.upload-progress-meta strong {
  font-size: 1rem;
}
#upload-overlay-detail {
  margin-top: 12px;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.drive-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.collapse-toggle {
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text);
  border-radius: 12px;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
}
.collapse-toggle:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.drive-config-head {
  cursor: pointer;
}
.drive-config-card .collapse-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}
.drive-config-card .collapse-toggle:hover {
  background: #e7ecff;
  transform: translateY(-1px);
  color: var(--text);
  border-color: var(--border);
}
.drive-config-card .collapse-toggle .collapse-label,
.drive-config-card .collapse-toggle .collapse-icon {
  color: inherit;
}
.drive-config-card .collapse-icon {
  display: inline-flex;
  font-size: 0.75rem;
  transition: transform 0.2s ease;
}
.drive-config-card .collapse-toggle[aria-expanded="true"] .collapse-icon {
  transform: rotate(180deg);
}
.drive-config-card .collapsible-body {
  margin-top: 12px;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.25s ease, opacity 0.2s ease;
}
.drive-config-card .collapsible-body.is-open {
  opacity: 1;
}
.drive-config-card.is-collapsed .collapsible-body {
  pointer-events: none;
}
.collapsible-body {
  margin-top: 16px;
}
.collapsible.collapsed .collapsible-body {
  display: none;
}
.drive-card-head h3 {
  margin: 2px 0;
  color: var(--text);
}
.status-dot {
  padding: 6px 12px;
  border-radius: 12px;
  background: rgba(18,165,121,0.12);
  color: #0f7a58;
  border: 1px solid rgba(18,165,121,0.3);
  font-weight: 700;
}
.drive-table thead th {
  color: var(--muted);
}
.drive-table tbody tr {
  border-color: var(--border);
}
.drive-table tr.is-new {
  background: rgba(18,165,121,0.08);
}
.drive-table tr.is-new .chip {
  background: #12a579;
  color: var(--text);
}
.file-name {
  display: flex;
  gap: 10px;
  align-items: center;
}
.file-icon {
  font-size: 20px;
}
.chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
}
.explorer-main .chip {
  margin-left: 8px;
}
.chip.new-count {
  background: rgba(31, 75, 255, 0.18);
  color: var(--primary);
}
.chip.new-file {
  background: rgba(18, 165, 121, 0.18);
  color: #0f7a58;
}
.chip-choices {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.chip-removable {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--text);
}
.chip-removable .chip-name {
  font-weight: 700;
}
.chip-removable small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  margin-left: 4px;
  line-height: 1.2;
}
.chip-remove {
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 2px 4px;
}
.drive-config-grid {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}
.drive-config-grid .input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.drive-create-row input[type="text"],
.drive-config-grid input[type="text"] {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--surface-alt);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.drive-create-row input[type="text"]:focus,
.drive-config-grid input[type="text"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(31,75,255,0.15);
}
.chip-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip-options.inline {
  align-items: center;
}
.chip-option {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  background: var(--surface-alt);
  transition: all 0.15s ease;
  color: var(--text);
}
.chip-option input {
  accent-color: var(--primary);
}
.chip-option:hover {
  border-color: var(--primary);
}
.chip-option small {
  color: var(--muted);
  font-size: 12px;
}
.scrollable {
  max-height: 180px;
  overflow-y: auto;
  padding: 6px;
  border: 1px dashed var(--border);
  border-radius: 10px;
}
.inline-danger {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
}
.badge-soft {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 12px;
  color: var(--text);
  font-weight: 600;
}
.inline-form {
  margin-top: 8px;
}
.inline-form .btn.small {
  padding: 6px 10px;
  font-size: 0.85rem;
}
.summary-box {
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 12px;
  background: var(--surface-alt);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.summary-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
}
.summary-chips .chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 600;
}
.summary-chips .chip.danger {
  background: rgba(229, 80, 80, 0.12);
  border-color: rgba(229, 80, 80, 0.35);
  color: #b61a1a;
}
.summary-chips .chip.soft {
  background: var(--surface);
}
.drive-dropzone .pill.soft {
  background: var(--surface-alt);
  color: var(--muted);
  border-color: var(--border);
}
.neon {
  box-shadow: 0 6px 22px rgba(44, 115, 255, 0.35);
}
.drive-subchips .chip-nav {
  background: var(--surface);
}

.folder-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  padding: 10px;
  margin-top: 10px;
}
.folder-pill {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.05);
}
.folder-pill:hover {
  border-color: var(--primary);
  box-shadow: 0 14px 26px rgba(31, 75, 255, 0.08);
}
.folder-icon {
  font-size: 20px;
}

.explorer-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  color: var(--text);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}
.explorer-card.selection-active .row-menu-toggle {
  opacity: 0;
  pointer-events: none;
}
.explorer-card.selection-active .row-menu {
  display: none !important;
}
.explorer-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
  max-height: calc(8 * 68px + 7 * 10px);
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-gutter: stable;
}
.explorer-row {
  display: grid;
  grid-template-columns: 30px auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

@media (max-width: 640px) {
  .explorer-list {
    max-height: 70vh;
  }
  .explorer-row,
  .explorer-row.readonly {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "main actions"
      "meta meta"
      "select select";
    padding: 6px 8px;
    gap: 6px;
  }
  .explorer-main {
    grid-area: main;
  }
  .explorer-actions {
    grid-area: actions;
    align-self: start;
  }
  .explorer-meta {
    grid-area: meta;
    display: none;
  }
  .row-select-box {
    grid-area: select;
    justify-content: flex-start;
    padding-left: 0;
  }
  .explorer-name {
    font-size: 0.9rem;
  }
  .row-menu-toggle {
    width: 30px;
    height: 30px;
    padding: 4px;
    border-radius: 9px;
  }
}
.explorer-row.readonly {
  grid-template-columns: auto 1fr auto;
}
.explorer-row:hover {
  background: #e9efff;
  border-color: #d5def7;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}
.explorer-row.drag-target {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(31, 75, 255, 0.2);
  background: rgba(31, 75, 255, 0.08);
}
.explorer-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.type-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.type-badge img {
  width: 18px;
  height: 18px;
  display: block;
}
.explorer-name {
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.explorer-name:hover {
  text-decoration: underline;
}
.explorer-meta {
  display: flex;
  gap: 16px;
  justify-content: flex-end;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  margin-left: auto;
  margin-right: 8px;
  flex-wrap: wrap;
}
.explorer-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.explorer-actions {
  justify-self: end;
}
.explorer-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  align-items: center;
  position: relative;
}

@media (max-width: 900px) {
  .explorer-row,
  .explorer-row.readonly {
    grid-template-columns: 1fr;
    align-items: flex-start;
    padding: 10px 12px;
    gap: 8px;
  }
  .row-select-box {
    order: 3;
    padding-left: 2px;
  }
  .row-select {
    width: 16px;
    height: 16px;
  }
  .explorer-meta {
    justify-content: flex-start;
    margin: 4px 0 0 0;
    white-space: normal;
    gap: 10px;
    font-size: 12px;
  }
  .explorer-meta span {
    font-size: 12px;
  }
  .explorer-main {
    width: 100%;
    gap: 8px;
  }
  .explorer-name {
    white-space: normal;
    font-size: 0.95rem;
  }
  .type-badge {
    padding: 4px;
    border-radius: 10px;
  }
  .type-badge img {
    width: 16px;
    height: 16px;
  }
  .row-menu-toggle {
    width: 34px;
    height: 34px;
    padding: 6px;
    border-radius: 10px;
  }
}

@media (max-width: 640px) {
  .explorer-list {
    gap: 8px;
  }
  .explorer-row,
  .explorer-row.readonly {
    padding: 8px 10px;
  }
}

.row-menu-toggle {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 10px;
  cursor: pointer;
  color: var(--text);
  box-shadow: 0 6px 18px rgba(44, 115, 255, 0.12);
  transition: all 0.2s ease;
}
.row-menu-toggle.active,
.row-menu-toggle:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 6px 18px rgba(44, 115, 255, 0.25);
}

.row-menu {
  position: absolute;
  right: 0;
  top: 110%;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.16);
  padding: 6px;
  display: none;
  min-width: 220px;
  max-height: min(320px, calc(100vh - 120px));
  overflow-y: auto;
  z-index: 3000;
}
.row-menu.fixed {
  position: fixed;
}
.row-menu.open {
  display: block;
}

.move-card {
  width: min(560px, 100%);
}
.move-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 10px 0 12px;
}
.move-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
}
.move-crumb {
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text);
  border-radius: 10px;
  padding: 6px 10px;
  font-weight: 600;
  cursor: pointer;
}
.move-crumb:hover {
  background: #eef2ff;
}
.move-sep {
  color: var(--muted);
}
.move-list {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px;
  max-height: 260px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.move-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--surface-alt);
  cursor: pointer;
  text-align: left;
}
.move-item:hover {
  border-color: var(--primary);
  background: #eef2ff;
}
.move-icon {
  width: 18px;
  height: 14px;
  display: inline-block;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: #ffffff;
}
.move-name {
  font-weight: 600;
}
.modal-error {
  color: var(--danger);
  margin: 8px 0 0;
}
.row-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  background: transparent;
  border: none;
  width: 100%;
  font: inherit;
  cursor: pointer;
}
.row-menu-item:hover {
  background: #eef2ff;
}
.row-menu-item button {
  border: none;
  background: transparent;
  padding: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.row-menu-item.row-rename-form {
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}
.row-menu-item.row-rename-form input {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  width: 100%;
}
.row-menu-item.row-rename-form button {
  align-self: flex-end;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  border: 1px solid var(--primary);
}

.explorer-actions form {
  margin: 0;
}

.explorer-actions .btn.small {
  padding: 8px 14px;
  line-height: 1.1;
  border-radius: 10px;
}

.explorer-actions .btn.btn-danger {
  background: #f15555;
  color: #fff;
  border-color: #de3f3f;
}

.explorer-actions .btn {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 6px 18px rgba(44, 115, 255, 0.25);
}
.explorer-actions .btn:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  box-shadow: 0 8px 20px rgba(44, 115, 255, 0.35);
}
.explorer-actions .btn.btn-danger:hover {
  background: #d63e3e;
  border-color: #c93232;
  box-shadow: 0 8px 20px rgba(217, 62, 62, 0.35);
}
.perm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin: 8px 0 10px;
}
.perm-block {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--surface);
}
.toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  margin-bottom: 8px;
}
.toggle-row input {
  accent-color: var(--primary);
}
.nested-block {
  display: none;
  padding-top: 6px;
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    padding: 20px;
  }
}

/* Timesheet */
.timesheet-form .small-chip {
  margin-top: 6px;
  font-size: 0.9rem;
}

.timesheet-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  font-size: 0.95rem;
}

.timesheet-info .box {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  background: var(--surface-alt);
}

.timesheet-info .box strong {
  display: block;
  margin-bottom: 6px;
}

.timesheet-info .legend {
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(31, 75, 255, 0.08);
  color: var(--text);
  border: 1px dashed var(--primary);
}

.timesheet-info .legend p {
  margin: 2px 0;
}

.timesheet-form .compact-grid {
  align-items: flex-start;
}

.table-card .table-scroll {
  overflow-x: auto;
  overflow-y: auto;
  max-height: 70vh;
  position: relative;
}

.table-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 8px;
}

.table-nav .nav-info {
  flex: 1;
  text-align: center;
  font-size: 0.95rem;
}

.table-scroll-wrapper {
  position: relative;
  display: flex;
}

.table-nav-floating {
  position: sticky;
  top: 40vh;
  align-self: flex-start;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.18);
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 700;
  color: var(--text);
  z-index: 3;
}

.table-nav-floating.left {
  left: -46px;
}

.table-nav-floating.right {
  right: -46px;
}

.table-nav-floating:hover {
  background: var(--surface-alt);
}

@media (max-width: 900px) {
  .table-nav-floating {
    display: none;
  }
}

.timesheet-table {
  min-width: 1080px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.timesheet-table th,
.timesheet-table td {
  font-size: 0.85rem;
  padding: 8px 6px;
  text-align: center;
}

.timesheet-table th {
  background: var(--surface-alt);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.timesheet-table thead th {
  position: sticky;
  top: 0;
  z-index: 4;
  background: var(--surface-alt);
  box-shadow: 0 2px 0 rgba(225, 228, 239, 0.9);
}

.timesheet-table th.short {
  font-size: 0.78rem;
  line-height: 1.2;
}

.timesheet-table input[type="time"],
.timesheet-table input[type="text"],
.timesheet-table input[type="month"] {
  width: 100%;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  font-size: 0.85rem;
}

.checkbox-cell {
  text-align: center;
}

.checkbox-cell input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

.day-label {
  font-weight: 700;
  color: var(--primary-dark);
}

.weekend .day-label {
  color: #b61a1a;
  font-weight: 700;
}

.sticky-col {
  position: sticky;
  left: 0;
  background: var(--surface);
  z-index: 2;
  min-width: 70px;
  text-align: left;
}

.timesheet-table thead .sticky-col {
  z-index: 5;
}

@media (max-width: 900px) {
  main.container {
    margin: 0;
    border-radius: 0;
    padding: 20px;
  }

  nav {
    padding: 12px 16px;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 0;
    left: -260px;
    width: 240px;
    height: 100vh;
    background: var(--surface);
    flex-direction: column;
    align-items: flex-start;
    padding: 80px 26px 40px;
    gap: 16px;
    box-shadow: 16px 0 40px rgba(15, 23, 42, 0.15);
    transition: left 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  nav.nav-open .nav-links {
    left: 0;
  }

  .nav-links-list {
    flex-direction: column;
    width: 100%;
    flex: 1 1 auto;
    gap: 12px;
  }

  .nav-mobile-logo {
    display: block;
  }

  .nav-links a {
    width: 100%;
  }
  .nav-disabled-link {
    width: 100%;
    justify-content: space-between;
  }
  .nav-disabled-link::after,
  .nav-disabled-link::before {
    display: none;
  }

  .nav-links-list .nav-dropdown {
    width: 100%;
  }

  .nav-links-list .nav-dropdown-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    padding: 10px 14px;
    border-radius: 12px;
  }

  .nav-links-list .nav-dropdown-menu {
    position: relative;
    top: 0;
    left: 0;
    width: 100%;
    box-shadow: none;
    border-radius: 10px;
    margin-top: 6px;
  }

  /* Em mobile o dropdown abre só via classe .open, não por hover */
  .nav-dropdown:hover .nav-dropdown-menu {
    display: none;
  }
  .nav-dropdown.open .nav-dropdown-menu {
    display: block;
  }

  .desktop-only {
    display: none;
  }

  .nav-mobile-profile {
    display: flex;
    position: sticky;
    bottom: 0;
    background: var(--surface);
    padding-bottom: 16px;
    width: 100%;
  }

  .nav-mobile-profile .nav-mobile-account {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    height: auto;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid #d9e2f7;
    background: #eef3ff;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
    padding: 0;
    box-sizing: border-box;
  }

  .nav-mobile-profile .nav-mobile-account-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: transparent;
    color: var(--text);
    text-decoration: none;
    border-bottom: 1px solid #dfe6f7;
    box-sizing: border-box;
    cursor: pointer;
    transition: background 0.2s ease;
    border-radius: 0 !important;
  }

  .nav-mobile-profile .nav-mobile-account-profile:active {
    background: #e5ecff;
  }

  .nav-mobile-profile .nav-mobile-account-profile:hover,
  .nav-mobile-profile .nav-mobile-account-profile:focus {
    background: #e9efff;
    color: var(--text);
  }

  .nav-mobile-profile .nav-mobile-account-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #e0e8ff;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-weight: 700;
    flex: 0 0 auto;
  }

  .nav-mobile-profile .nav-mobile-account-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  .nav-mobile-profile .nav-mobile-account-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1 1 auto;
  }

  .nav-mobile-profile .nav-mobile-account-name {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .nav-mobile-profile .nav-mobile-account-role {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
    line-height: 1.2;
  }

  .nav-mobile-profile .nav-mobile-account-logout {
    width: 100%;
    height: 46px;
    border-radius: 0;
    border: 0;
    background: var(--danger);
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    cursor: pointer;
    transition: filter 0.2s ease;
    border-radius: 0 !important;
  }

  .nav-mobile-profile .nav-mobile-account-logout:hover,
  .nav-mobile-profile .nav-mobile-account-logout:focus,
  .nav-mobile-profile .nav-mobile-account-logout:active {
    background: var(--danger);
    color: #fff;
  }

  .nav-mobile-profile .nav-mobile-account-logout:active {
    filter: brightness(0.95);
  }

  .page-heading {
    flex-direction: column;
    align-items: flex-start;
  }

  /* Calendário de férias - evitar overflow horizontal em mobile */
  .vacation-month {
    max-width: 100%;
    overflow-x: hidden;
    overflow-y: visible;
  }
  .vacation-month-header {
    flex-wrap: wrap;
    gap: 10px;
  }
  .calendar-nav {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }
  .calendar-picker {
    width: 100%;
  }
  .calendar-picker input[type="month"] {
    width: 100%;
  }
  .vacation-grid-head,
  .vacation-grid {
    width: 100%;
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }

  .qr-card {
    flex-direction: column;
  }

  .form-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 360px) {
  .nav-mobile-profile .nav-mobile-account-name {
    font-size: 0.82rem;
  }
}

@media (max-width: 640px) {
  .vacation-day .day-tooltip {
    position: fixed;
    top: auto;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    max-width: min(320px, calc(100vw - 24px));
    width: max-content;
    max-height: 45vh;
    overflow-y: auto;
    z-index: 7000;
  }
}

@media (max-width: 900px) {
  .drive-wrapper {
    grid-template-columns: 1fr;
  }
  .drive-main {
    grid-template-columns: 1fr;
  }
  .drive-tree-card {
    position: relative;
    top: 0;
  }
}

@media (max-width: 900px) {
  .drive-hero-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
  .drive-create-row {
    flex-direction: column;
    align-items: stretch;
  }
  .drive-create-row button {
    width: 100%;
  }
}

.app-toast-stack {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 2600;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  pointer-events: none;
  width: min(92vw, 380px);
}

.app-toast-stack > * {
  pointer-events: auto;
}

.qsms-informe-toast {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #ffffff;
  border: 1px solid #d7e8df;
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: 0 18px 36px rgba(12, 28, 22, 0.18);
  max-width: 360px;
  width: 100%;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.qsms-informe-toast-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.qsms-informe-toast .btn {
  flex: 0 0 auto;
}

.qsms-toast-close {
  border: none;
  background: #f2f6f4;
  color: #0c1c16;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, transform 0.1s ease;
}

.qsms-toast-close:hover {
  background: #e5f1eb;
  transform: translateY(-1px);
}

.qsms-informe-toast.is-hidden {
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
}

@media (max-width: 700px) {
  .app-toast-stack {
    left: 16px;
    right: 16px;
    bottom: 16px;
    width: auto;
    align-items: stretch;
  }
  .qsms-informe-toast {
    max-width: none;
  }
}

