@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600&family=Roboto+Mono:wght@500&display=swap');

:root {
  --bg: #03030b;
  --bg-alt: #04071a;
  --surface: rgba(9, 13, 32, 0.92);
  --surface-strong: rgba(13, 18, 42, 0.95);
  --stroke: rgba(255, 255, 255, 0.06);
  --text: #f6f9ff;
  --muted: #99a5cc;
  --accent: #7bd7ff;
  --accent-strong: #8c7aff;
  --danger: #ff6e8b;
  --radius: 26px;
  --radius-sm: 16px;
  --shadow: 0 25px 70px rgba(2, 3, 10, 0.55);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

/* Prevent zoom on double-tap and pinch */
html {
  touch-action: manipulation;
  -ms-touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Ensure all form elements use 16px+ to prevent iOS/Android zoom */
input, select, textarea, button {
  font-size: 16px;
  touch-action: manipulation;
}

body {
  min-height: 100vh;
  font-family: 'Space Grotesk', 'Roboto', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-weight: 400;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 0%, rgba(124, 215, 255, 0.12), transparent 60%),
    radial-gradient(circle at 100% 10%, rgba(140, 122, 255, 0.16), transparent 45%),
    linear-gradient(180deg, var(--bg), var(--bg-alt));
  padding: 32px 18px 48px;
}

.app-shell {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.top-bar {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 20px;
  flex-wrap: nowrap; /* avoid wrapping so gear stays in the same line */
  /* keep top-bar content aligned with card inner padding */
  padding-left: 24px;
  padding-right: 24px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gear-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.02));
  border: 1px solid rgba(255,255,255,0.06);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  margin-left: auto; /* naturally push to the right until panel limit */
  flex-shrink: 0;
  /* alignment handled by .top-bar padding; avoid extra transform to keep layout stable */
  transform: none;
  transition: transform 220ms cubic-bezier(.2,.9,.3,1);
  position: relative; /* allow vertical offset without changing document flow */
  z-index: 21005; /* sit above nearby cards */
}

.gear-popover {
  position: absolute;
  z-index: 2000;
  min-width: 260px;
  max-width: 320px;
  display: none;
}

.gear-popover[aria-hidden="false"] {
  display: block;
}

.gp-card {
  background: linear-gradient(180deg, rgba(6,12,28,0.98), rgba(12,18,36,0.98));
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 18px 48px rgba(3,6,20,0.7);
  border: 1px solid rgba(123,215,255,0.06);
}

.gp-head {
  padding: 6px 8px 10px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  margin-bottom: 8px;
}

.gp-body { padding: 6px 8px; }

.gp-row { display: flex; gap: 10px; align-items: center; cursor: pointer; }
.gp-row input { width: 18px; height: 18px; accent-color: var(--accent); }
.gp-copy { display: flex; flex-direction: column; }
.gp-title { font-weight: 600; font-size: 0.95rem; }
.gp-sub { font-size: 0.78rem; color: var(--muted); }


.now-chip {
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--stroke);
  /* allow the now-chip to expand to available space inside .app-shell */
 
  min-width: 0; /* allow children to shrink properly on small screens */
}

.now-label {
  font-size: 0.72rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--muted);
}

.now-time {
  font-size: 1.6rem;
  font-weight: 500;
}

.brand-mark {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-orb {
  width: 72px;
  height: 72px;
  border-radius: 24px;
  background:
    radial-gradient(circle at 0 0, rgba(123, 215, 255, 0.55), transparent 55%),
    radial-gradient(circle at 100% 100%, rgba(140, 122, 255, 0.75), transparent 60%),
    linear-gradient(145deg, #050716, #161b3a);
  box-shadow:
    0 18px 40px rgba(2, 4, 12, 0.85),
    0 0 0 1px rgba(151, 174, 255, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.brand-orb::before {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: inherit;
  background:
    radial-gradient(circle at 20% 0, rgba(255, 255, 255, 0.2), transparent 60%),
    linear-gradient(160deg, rgba(103, 249, 255, 0.14), rgba(103, 249, 255, 0));
}

.brand-initials {
  position: relative;
  font-family: 'Roboto Mono', monospace;
  font-weight: 700;
  letter-spacing: 0.24em;
  font-size: 1.2rem;
  text-transform: uppercase;
  color: #f5fbff;
  text-shadow:
    0 0 14px rgba(123, 215, 255, 0.8),
    0 0 28px rgba(140, 122, 255, 0.85);
}

.brand-glow {
  position: absolute;
  inset: -22px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(123, 215, 255, 0.22), transparent 70%);
  opacity: 0.7;
  filter: blur(22px);
  pointer-events: none;
}

.grid-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.85fr);
  gap: 24px;
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

/* container for right-aligned header actions (share / fullscreen) */
.card-head-actions {
  display: flex;
  gap: 10px; /* ~10px spacing as requested */
  align-items: center;
}

/* ensure pill stays on the left and actions on the right within the header */
.card-head .pill { margin-right: 12px; }

.pill {
  padding: 6px 12px;
  flex-direction: column;
  gap: 8px;
  justify-content: flex-end;
  text-transform: uppercase;
  font-size: 0.68rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  position: relative;
  top: -8px;
}

.pill-success {
  background: rgba(123, 215, 255, 0.2);
  color: #041120;
}

.progress-card {
  grid-column: 1 / -1;
  background: var(--surface-strong);
  position: relative;
  overflow: hidden;
}

.progress-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 85% -10%, rgba(139, 122, 255, 0.25), transparent 45%);
}

.progress-card .card-head,
.progress-stats,
.progress-rail,
.timeline {
  position: relative;
  z-index: 1;
}

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  box-shadow: 0 12px 28px rgba(123, 215, 255, 0.25);
}

.icon-btn:active {
  transform: scale(0.95);
}

.icon-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.progress-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.progress-stats div {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
}

.progress-stats small {
  font-size: 0.75rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
}

.progress-stats strong {
  display: block;
  margin-top: 8px;
  font-size: 1.7rem;
  font-family: 'Roboto Mono', monospace;
}

.progress-rail {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
  margin-bottom: 16px;
}

.progress-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
  transition: width 0.4s ease;
}

.timeline {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--muted);
}

.timeline span {
  display: block;
  margin-top: 4px;
  font-size: 1.1rem;
  font-family: 'Roboto Mono', monospace;
  color: var(--text);
}

.progress-message {
  margin-top: 16px;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.middle-split {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.panel-card {
  grid-column: 1 / 2;
}

.insights-card {
  grid-column: 2 / 3;
  background: radial-gradient(circle at top right, rgba(139, 122, 255, 0.12), transparent 55%) var(--surface);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.panel-head h2 {
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.input-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.field span {
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  line-height: 1;
  margin-top: 4px;
  transform: translateY(0px);
}

.field-row {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  align-items: flex-end;
}

.field-row-compact {
  justify-content: flex-start;
  gap: 12px;
}

.field-row .input-stack {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field-row-compact .input-stack {
  max-width: 190px;
}

.field-row .time-input {
  width: 100%;
  min-width: 0;
}

.time-input {
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.04) 100%);
  font-size: 16px; /* >= 16px prevents auto-zoom on mobile */
  letter-spacing: 0.1em;
  text-align: center;
  color: var(--text);
  font-family: 'Roboto Mono', monospace;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 0;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  box-shadow: 
    0 1px 2px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* Ensure all inputs inside the Controle panel have consistent, compact height
   without affecting other inputs elsewhere */
.panel-card .time-input {
  height: 46px;
  padding: 10px 12px;
  box-sizing: border-box;
}

.time-input:focus,
.time-input:focus-visible {
  outline: none;
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(123, 215, 255, 0.12) 0%, rgba(123, 215, 255, 0.06) 100%);
  box-shadow: 
    0 0 0 3px rgba(123, 215, 255, 0.2),
    0 4px 12px rgba(123, 215, 255, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

.time-input:active {
  transform: translateY(0);
  box-shadow: 
    0 0 0 3px rgba(123, 215, 255, 0.25),
    0 2px 6px rgba(123, 215, 255, 0.1);
}

/* Modern placeholder styling */
.time-input::placeholder {
  color: var(--muted);
  opacity: 0.6;
}

/* Hover state for non-touch devices */
@media (hover: hover) {
  .time-input:hover:not(:focus) {
    border-color: rgba(255, 255, 255, 0.28);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.06) 100%);
    box-shadow: 
      0 2px 8px rgba(0, 0, 0, 0.15),
      inset 0 1px 0 rgba(255, 255, 255, 0.08);
  }
}

.micro-label {
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: none;
  color: var(--muted);
  transform: translateY(5px);
}

/* fine-tune vertical offsets */
.field:nth-of-type(1) .time-input,
.field:nth-of-type(2) .time-input {
  position: relative;
  top: 3px;
}

.field:nth-of-type(3) > span,
.field:nth-of-type(4) > span {
  transform: translateY(20px);
}

.micro-placeholder {
  opacity: 0;
}

.field-fim {
  position: relative;
  /* ocultar por padrão via CSS para evitar "flash" ao recarregar a página
     a lógica em JS reforça/insere a exibição conforme preferência do usuário */
  display: none;
}

/* quando o JS quiser forçar a exibição (usuário desmarcou a opção), aplica flex */
.field-fim.show-by-js {
  display: flex !important;
}

.time-locker {
  position: relative;
  width: 100%;
  z-index: 0; /* keep locker below the label/tooltip */
}

.time-locker .time-input {
  width: 100%;
}

.time-lock-shield {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 80, 100, 0.55);
  background: rgba(12, 0, 4, 0.92);
  color: #ffeef2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  z-index: 1; /* keep below label/tooltip */
  transform: translateY(3px); /* nudge shield 3px down as requested */
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
}

.time-locker:not(.is-locked) .time-lock-shield {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  opacity: 0;
  pointer-events: none;
}

.time-lock-pill {
  font-size: 0.62rem;
  letter-spacing: 0.28em;
  color: rgba(255, 255, 255, 0.95);
}

.time-lock-hint {
  font-size: 0.55rem;
  letter-spacing: 0.28em;
  color: rgba(255, 238, 242, 0.85);
}

.time-locker:not(.is-locked) .time-lock-pill,
.time-locker:not(.is-locked) .time-lock-hint {
  opacity: 0;
}
.field-label-with-help {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 10002; /* ensure label and icon sit above the time-lock shield */
  overflow: visible;
}

.field-label-with-help > span:first-child {
  white-space: nowrap;
}

.info-icon {
  width: 22px;
  height: 22px; 
  right: 4px;
  top:  2px;
  position: relative;
  border-radius: 999px;
  border: 1px solid rgba(123, 215, 255, 0.6);
  background: radial-gradient(circle at 30% 20%, rgba(255,255,255,0.06), transparent 60%), rgba(6,12,28,0.9);
  color: rgba(188, 220, 255, 0.96);
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 22px; /* center the '?' vertically inside the 22px circle */
  cursor: help;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(6, 12, 28, 0.6);
  /* keep default padding minimal so we don't alter nearby input heights */
  padding: 0 2px;
  z-index: 10003; /* ensure the icon itself is on top */
}

.info-icon:focus-visible {
  outline: 2px solid rgba(123, 215, 255, 0.9);
  outline-offset: 3px;
}

.info-tooltip {
  position: absolute;
  top: calc(100% + 6px);
  left: -10px; /* shift more to the left so it doesn't overlap input on narrow screens */
  opacity: 0;
  pointer-events: none;
  background: rgba(6, 12, 28, 0.96); /* darker, bluish-black */
  color: var(--text);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(123, 215, 255, 0.12);
  box-shadow: 0 10px 28px rgba(3, 8, 20, 0.7);
  transform: translateY(6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  max-width: 220px;
  line-height: 1.3;
  z-index: 10004; /* ensure it's on top of overlays/shields */
}

.info-icon:hover + .info-tooltip,
.info-icon:focus-visible + .info-tooltip,
.field-fim .time-input:hover ~ .info-tooltip {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* On narrow screens keep tooltip within viewport and shift left more */
@media (max-width: 420px) {
  .info-tooltip {
    left: -12px;
    top: calc(100% + 6px);
    font-size: 0.7rem;
  }
}

.divider {
  height: 2px;
  background: linear-gradient(90deg, rgba(123,215,255,0.2), rgba(255,255,255,0.04));
  margin: 10px 0 18px;
  border-radius: 4px;
}

/* base schedule info styles */

.base-schedule { position: relative; display: flex; flex-direction: column; gap: 8px; }
.base-info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid rgba(123,215,255,0.6);
  background: rgba(6,12,28,0.9);
  color: rgba(188,220,255,0.96);
  font-weight: 700;
  cursor: pointer;
  z-index: 10005;
}

/* fixed mini-panel that overlays the inputs; created once and positioned by JS */
/* Tooltip stays fixed relative to base-schedule, not viewport */
.base-schedule { position: relative; }
.base-info-tooltip {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 340px;
  max-width: calc(100% - 40px);
  min-height: 120px;
  background: rgba(6,12,28,0.98);
  color: var(--text);
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid rgba(123,215,255,0.15);
  box-shadow: 0 25px 80px rgba(2,4,12,0.95), 0 0 0 1px rgba(123,215,255,0.1);
  /* use proportional font to allow better wrapping */
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.35;
  display: none;
  z-index: 999999;
  backdrop-filter: blur(16px);
  isolation: isolate;
}

.base-info-tooltip .bp-title { font-weight:700; margin-bottom:8px; }
.base-info-tooltip .bp-body { color: var(--muted); white-space: normal; overflow-wrap: anywhere; hyphens: auto; }

.base-info-tooltip[aria-hidden="false"], .base-info-tooltip.visible { display: block; }

/* visible state with smooth fade */
.base-info-tooltip.visible{
  opacity: 1;
  transition: opacity .18s ease, transform .18s ease;
}

/* pre-show placeholder: positioned and nearly transparent so layout appears instant
   pointer-events disabled until full reveal */
.base-info-tooltip.pre-show{
  opacity: 0.03 !important;
  pointer-events: none;
}

.base-schedule.highlight {
  animation: mh-highlight 1600ms ease-in-out;
  box-shadow: 0 10px 30px rgba(123,215,255,0.06);
  border-radius: 12px;
}

@keyframes mh-highlight {
  0% { transform: translateY(0); background-position: 0 0; }
  20% { box-shadow: 0 18px 40px rgba(123,215,255,0.12); }
  100% { box-shadow: none; }
}

/* subtle highlight for inputs inside the base schedule when tip is shown */
.base-schedule.highlight .time-input {
  border-color: rgba(123,215,255,0.6);
  box-shadow: 0 12px 34px rgba(123,215,255,0.12);
  transition: box-shadow 220ms ease, border-color 220ms ease;
}


.base-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.base-schedule {
  min-width: 240px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.label-sm {
  font-size: 0.72rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--muted);
}

.base-fields {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.base-compact {
    width: 43%;
    min-width: 0;
}


.base-toggle {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.base-toggle:hover {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
}

.base-toggle input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.base-toggle-track {
  width: 54px;
  height: 28px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  position: relative;
  transition: background 0.2s ease;
}

.base-toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 8px 18px rgba(123, 215, 255, 0.35);
  transition: transform 0.2s ease;
}

.base-toggle input:checked + .base-toggle-track {
  background: rgba(123, 215, 255, 0.25);
}

.base-toggle input:checked + .base-toggle-track .base-toggle-thumb {
  transform: translateX(26px);
}

.base-toggle input:focus-visible + .base-toggle-track {
  box-shadow: 0 0 0 3px rgba(123, 215, 255, 0.35);
}

.base-toggle-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.base-toggle-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  font-size: 0.9rem;
}

.base-toggle-state-on {
  display: none;
  color: var(--text);
}

.base-toggle-state-off {
  display: inline;
  color: var(--muted);
}

.base-toggle input:checked ~ .base-toggle-copy .base-toggle-state-on {
  display: inline;
}

.base-toggle input:checked ~ .base-toggle-copy .base-toggle-state-off {
  display: none;
}

.base-toggle-sub {
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.panel-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.btn {
  border: none;
  border-radius: 999px;
  padding: 12px 24px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn.primary {
  background: linear-gradient(120deg, var(--accent), var(--accent-strong));
  color: #041226;
  box-shadow: 0 12px 28px rgba(123, 215, 255, 0.35);
}

.btn.danger {
  background: linear-gradient(120deg, #f87171, #ef4444);
  color: #fff;
  box-shadow: 0 12px 28px rgba(248, 113, 113, 0.35);
}

.btn.ghost {
  color: var(--muted);
}

.btn:active {
  transform: scale(0.97);
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--muted);
}

.switch input {
  position: absolute;
  opacity: 0;
}

.track {
  width: 46px;
  height: 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  position: relative;
  transition: background 0.2s ease;
}

.track::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  top: 2px;
  left: 2px;
  transition: transform 0.2s ease;
}

.switch input:checked + .track {
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
}

.switch input:checked + .track::after {
  transform: translateX(22px);
}

.switch-label {
  font-weight: 500;
}

.neg-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.neg-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.04);
}

.neg-row.bad {
  border-color: rgba(255, 110, 139, 0.55);
  background: linear-gradient(120deg, rgba(255, 110, 139, 0.18), rgba(255, 255, 255, 0.04));
}

.neg-row.good {
  border-color: rgba(16, 185, 129, 0.55);
  background: linear-gradient(120deg, rgba(16, 185, 129, 0.18), rgba(255, 255, 255, 0.04));
}

.neg-row-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.neg-row-label {
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.26em;
  color: var(--muted);
}

.neg-row.good .neg-row-label {
  color: #10B981;
}

.neg-row-value {
  font-weight: 600;
}

.neg-row-value.good-value {
  color: #10B981;
}

.neg-row-sub {
  font-size: 0.75rem;
  color: var(--muted);
  opacity: 0.8;
}

.neg-row.good .neg-row-sub {
  color: rgba(16, 185, 129, 0.8);
}

.neg-row-extra {
  font-size: 0.8rem;
  color: var(--muted);
}

.neg-total-card {
  border-radius: var(--radius-sm);
  padding: 16px;
  background: linear-gradient(120deg, var(--accent), var(--accent-strong));
  color: #031225;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.neg-total-card.good {
  background: linear-gradient(120deg, #10B981, #34D399);
}

.neg-total-card.neutral {
  background: linear-gradient(120deg, #6366F1, #8B5CF6);
}

.neg-total-sub {
  font-size: 0.85rem;
  opacity: 0.8;
}

.app-footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.78rem;
}

.app-footer .footer-link {
  color: var(--accent);
  text-decoration: none;
  cursor: pointer;
}

.app-footer .footer-link:hover {
  text-decoration: underline;
}

/* ===== FULLSCREEN TIME PICKER - ULTRA MODERN ===== */
.timepicker-fullscreen {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 99999;
  touch-action: none;
  overscroll-behavior: contain;
}

.timepicker-fullscreen[aria-hidden="false"] {
  display: block;
}

.tp-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, 
    rgba(4, 6, 14, 0.97) 0%,
    rgba(8, 10, 20, 0.99) 100%
  );
  animation: tpFadeIn 0.25s ease-out;
}

@keyframes tpFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.tp-content {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 20px;
  padding-top: env(safe-area-inset-top, 20px);
  padding-bottom: env(safe-area-inset-bottom, 20px);
  animation: tpSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes tpSlideIn {
  from { 
    opacity: 0;
    transform: translateY(20px);
  }
  to { 
    opacity: 1;
    transform: translateY(0);
  }
}

.tp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 4px;
  margin-bottom: 20px;
}

.tp-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.tp-close {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: all 0.2s ease;
}

.tp-close:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.tp-close:active {
  transform: scale(0.92);
  background: rgba(255, 255, 255, 0.2);
}

/* Display grande do horário */
.tp-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 30px 0;
}

.tp-display-hours,
.tp-display-minutes {
  font-family: 'Roboto Mono', 'SF Mono', monospace;
  font-size: 5rem;
  font-weight: 200;
  color: #fff;
  line-height: 1;
  letter-spacing: -0.02em;
  transition: all 0.15s ease;
}

.tp-display-hours:hover,
.tp-display-minutes:hover {
  color: var(--accent);
}

.tp-display-sep {
  font-family: 'Roboto Mono', 'SF Mono', monospace;
  font-size: 4.5rem;
  font-weight: 200;
  color: rgba(255, 255, 255, 0.3);
  line-height: 1;
  margin: 0 2px;
  animation: tpBlink 1.5s ease-in-out infinite;
}

@keyframes tpBlink {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

/* Área das rodas */
.tp-wheels {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  min-height: 280px;
  max-height: 400px;
  margin: 20px 0;
}

.tp-wheel-highlight {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: calc(100% - 32px);
  max-width: 320px;
  height: 64px;
  background: rgba(123, 215, 255, 0.06);
  border-top: 1px solid rgba(123, 215, 255, 0.15);
  border-bottom: 1px solid rgba(123, 215, 255, 0.15);
  pointer-events: none;
  z-index: 1;
}

.tp-wheel-divider {
  width: 1px;
  height: 200px;
  background: linear-gradient(180deg,
    transparent 0%,
    rgba(255, 255, 255, 0.1) 30%,
    rgba(255, 255, 255, 0.1) 70%,
    transparent 100%
  );
  margin: 0 10px;
  flex-shrink: 0;
}

.tp-wheel {
  width: 120px;
  height: 100%;
  overflow: hidden;
  position: relative;
  z-index: 2;
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(0,0,0,0.05) 15%,
    rgba(0,0,0,0.3) 30%,
    rgba(0,0,0,1) 45%,
    rgba(0,0,0,1) 55%,
    rgba(0,0,0,0.3) 70%,
    rgba(0,0,0,0.05) 85%,
    transparent 100%
  );
  mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(0,0,0,0.05) 15%,
    rgba(0,0,0,0.3) 30%,
    rgba(0,0,0,1) 45%,
    rgba(0,0,0,1) 55%,
    rgba(0,0,0,0.3) 70%,
    rgba(0,0,0,0.05) 85%,
    transparent 100%
  );
}

.tp-wheel-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.15s cubic-bezier(0.25, 0.1, 0.25, 1);
  will-change: transform;
}

.tp-wheel.dragging .tp-wheel-inner {
  transition: none;
}

.tp-wheel-item {
  width: 100%;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Roboto Mono', 'SF Mono', monospace;
  font-size: 1.6rem;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.15);
  transition: all 0.15s ease;
  user-select: none;
  cursor: grab;
}

.tp-wheel-item:active {
  cursor: grabbing;
}

.tp-wheel-item.selected {
  color: #fff;
  font-size: 2.4rem;
  font-weight: 400;
}

.tp-wheel-item.near {
  color: rgba(255, 255, 255, 0.35);
  font-size: 1.8rem;
}

/* Footer com botões */
.tp-footer {
  display: flex;
  gap: 12px;
  padding: 16px 0;
}

.tp-action {
  flex: 1;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.tp-action-clear {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.6);
}

.tp-action-clear:hover {
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.tp-action-clear:active {
  transform: scale(0.98);
}

.tp-action-confirm {
  background: #fff;
  color: #08090c;
  font-weight: 600;
}

.tp-action-confirm:hover {
  background: rgba(255, 255, 255, 0.9);
}

.tp-action-confirm:active {
  transform: scale(0.98);
}

/* ===== STYLE EDITOR MODAL ===== */
.style-editor { position: fixed; inset: 0; display: none; z-index: 21000; }
.style-editor[aria-hidden="false"] { display: block; }
.style-editor .se-backdrop { position: absolute; inset: 0; background: rgba(2,4,12,0.6); backdrop-filter: blur(6px); }
.style-editor .se-card { position: absolute; left: 50%; top: 12%; transform: translateX(-50%); width: min(880px, 94vw); max-height: 76vh; overflow: auto; background: var(--surface-strong); border-radius: 14px; border: 1px solid var(--stroke); box-shadow: 0 30px 90px rgba(2,3,12,0.8); z-index: 21010; padding: 18px; }
.se-head { display:flex; justify-content:space-between; align-items:center; margin-bottom:12px; }
.se-head strong { color: var(--text); font-size: 1rem; }
.se-head-actions { display:flex; gap:8px; align-items:center; }
.se-head-actions .se-share-btn { width:38px; height:38px; border-radius:8px; display:inline-flex; align-items:center; justify-content:center; background: rgba(255,255,255,0.06); border:1px solid rgba(255,255,255,0.08); cursor:pointer; color: var(--text); }
.se-head-actions .se-share-btn:hover { background: rgba(255,255,255,0.1); }
.se-close-btn { width:38px; height:38px; border-radius:8px; display:inline-flex; align-items:center; justify-content:center; background: rgba(255,255,255,0.06); border:1px solid rgba(255,255,255,0.08); cursor:pointer; color: var(--text); font-size: 1.2rem; }
.se-close-btn:hover { background: rgba(255,255,255,0.1); }
.se-body { display:flex; gap:12px; flex-direction: column; }
.se-preview { width: 100%; padding: 12px; background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent); border-radius: 10px; min-width: 280px; display:flex; align-items:center; justify-content:center; }
.se-preview .progress-card { width: 100%; margin: 0; box-shadow: none; }
.se-controls { width: 100%; display:flex; flex-direction:column; gap:12px; }
.se-presets {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 6px 4px;
  align-items: center;
}
.se-presets::-webkit-scrollbar { height: 8px; }
.se-presets::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 6px; }
.se-thumb {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  border-radius: 999px;
  overflow: visible;
  box-shadow: 0 6px 18px rgba(2,4,12,0.35);
  background: linear-gradient(180deg, rgba(255,255,255,0.01), rgba(255,255,255,0.02));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.06);
  padding: 6px;
  transition: transform 160ms cubic-bezier(.2,.9,.3,1), border-color 160ms ease, box-shadow 200ms ease;
}
.se-thumb:active { transform: scale(0.96); }
.se-thumb:hover { transform: translateY(-4px); box-shadow: 0 10px 30px rgba(2,4,12,0.5); }
.se-thumb.selected { border-color: var(--accent, #2b8aef); box-shadow: 0 14px 38px rgba(43,138,239,0.12); }
.se-thumb .thumb-dot {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  box-shadow: inset 0 -4px 12px rgba(0,0,0,0.14), 0 6px 20px rgba(2,4,12,0.22);
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  transition: transform 160ms ease, box-shadow 200ms ease;
}

/* Manual thumb */
.se-thumb.manual {
  border-style: dashed;
  background: linear-gradient(180deg, rgba(255,255,255,0.015), rgba(255,255,255,0.02));
}
.se-thumb.manual .manual-icon {
  width: 28px; height: 28px; display:inline-flex; align-items:center; justify-content:center; color:var(--muted);
}

/* Floating manual toolbar */
.se-manual-toolbar {
  position: absolute;
  z-index: 22000;
  left: 50%; top: 30%; transform: translateX(-50%);
  background: linear-gradient(180deg, #0b0b0b 0%, #0f0f12 55%, #121215 100%);
  border: 1px solid rgba(255,255,255,0.06);
  padding: 8px;
  border-radius: 12px;
  display: grid;
  grid-template-columns: auto repeat(5, auto);
  grid-auto-rows: 40px;
  gap: 8px;
  align-items: center;
  box-shadow: 0 12px 40px rgba(3,4,8,0.6);
  touch-action: none;
  color: #f7f9fb;
}
.se-manual-toolbar .m-icon { width:32px; height:32px; border-radius:8px; display:inline-flex; align-items:center; justify-content:center; cursor:pointer; background: rgba(255,255,255,0.02); border:1px solid rgba(255,255,255,0.04); color: #f4f7fb; box-shadow: 0 6px 18px rgba(0,0,0,0.6); }
.se-manual-toolbar .m-icon svg { width:16px; height:16px; fill: currentColor; opacity: 0.95; }
.se-manual-toolbar .m-icon.m-limit { box-shadow: 0 6px 18px rgba(0,0,0,0.6), 0 0 0 2px rgba(255,64,64,0.95) inset; color: #ff6e6e; }
.se-manual-toolbar .m-icon.m-reverse { box-shadow: 0 6px 18px rgba(0,0,0,0.6), 0 0 0 2px rgba(34,88,140,0.9) inset; color: #5fa0d9; }
.se-manual-toolbar .m-icon:active { transform: scale(0.98); }
.se-manual-toolbar .se-manual-drag-handle {
  width:12px; height:36px; border-radius:8px;
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(0,0,0,0.18));
  border: 1px solid rgba(255,255,255,0.04);
  margin-right:6px; cursor:grab; display:inline-block; align-self:center;
  grid-row: 1 / span 2;
  grid-column: 1 / 2;
}
.se-manual-toolbar.dragging .se-manual-drag-handle { cursor:grabbing; }

.se-actions { display:flex; gap:8px; justify-content:flex-end; margin-top:8px; }
.se-actions .btn { min-width:120px; }

/* Hide progress/fullscreen/share icons in preview */
.se-preview .icon-btn { display: none !important; }

.se-preview .progress-card { border-left: none !important; border-right: none !important; box-shadow: none !important; }
.se-preview .progress-card::after { display: none; }

.progress-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(3, 4, 15, 0.78);
  backdrop-filter: blur(14px);
  z-index: 1000;
}

.progress-overlay[aria-hidden="false"] {
  display: flex;
}

.progress-card.is-fullscreen {
  width: min(720px, 94vw);
  max-height: calc(100vh - 64px);
  overflow: auto;
  box-shadow: 0 30px 90px rgba(2, 3, 12, 0.75);
}

.overlay-hint {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  pointer-events: none;
}

@media (min-width: 900px) {
  .middle-split {
    display:contents;
  }

  .panel-card {
    grid-column: 1 / 2;
  }

  .insights-card {
    grid-column: 2 / 3;
  }

  .result-card {
    grid-column: 1 / -1;
  }
}

@media (min-width: 720px) {
  /* on larger screens show modal side-by-side */
  .se-body { flex-direction: row; }
  .se-preview { flex: 1 1 48%; }
  .se-controls { flex: 1 1 44%; }
}

@media (max-width: 900px) {
  body {
    padding: 24px 14px 32px;
  }

  .grid-layout {
    grid-template-columns: 1fr;

/* Move gear button upward on mobile so it visually lines up with the "Agora" pill and
   the right-edge controls of the progress card (approx. 50px) */
@media (max-width: 460px) {
  .gear-btn {
    /* translateY negative to move up; uses relative positioning so layout not broken */
    transform: translateY(-50px);
    /* ensure it remains above the progress-card background */
    z-index: 22000;
  }
  /* keep top-bar padding consistent when gear is elevated */
  .top-bar { padding-top: 12px; }
}
  }

  .middle-split {
    grid-column: 1 / -1;
  }
}

@media (max-width: 600px) {
  /* Keep top-bar items on a single row on narrow screens so the gear button
     does not wrap under the "Agora" pill. Allow the now-chip to shrink. */
  .top-bar {
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding-left: 14px;
    padding-right: 14px;
    flex-wrap: nowrap;
  }

  .card {
    padding: 20px;
  }

  .progress-stats {
    grid-template-columns: 1fr;
  }

  .panel-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .base-grid {
    flex-direction: column;
    align-items: stretch;
  }

  .base-toggle {
    width: 100%;
  }

  /* ensure the now-chip can shrink if space becomes tight */
  .now-chip { min-width: 0; }
}

/* On very small screens remove the extra horizontal nudge so it doesn't overflow */
@media (max-width: 420px) {
  .gear-btn { transform: none; }
}

/* ===== TOP ACTIONS GROUP ===== */
.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

/* ===== USER BUTTON ===== */
.user-btn {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(.2,.9,.3,1);
}

.user-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.2);
}

.user-btn.logged-in {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(34, 197, 94, 0.1));
  border-color: rgba(34, 197, 94, 0.4);
  color: #22c55e;
}

.user-indicator {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #6b7280;
  border: 2px solid var(--bg);
}

.user-btn.logged-in .user-indicator {
  background: #22c55e;
}

/* ===== USER MENU ===== */
.user-menu {
  position: fixed;
  top: 70px;
  right: 20px;
  min-width: 240px;
  background: var(--surface-strong);
  border: 1px solid var(--stroke);
  border-radius: 16px;
  padding: 12px 0;
  box-shadow: var(--shadow);
  z-index: 99999;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
}

.user-menu[aria-hidden="false"] {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.user-menu-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px 12px;
}

.user-menu-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(123, 215, 255, 0.2), rgba(140, 122, 255, 0.2));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.user-menu-info {
  flex: 1;
  overflow: hidden;
}

.user-menu-name {
  font-weight: 500;
  color: var(--text);
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-menu-email {
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-menu-divider {
  height: 1px;
  background: var(--stroke);
  margin: 8px 0;
}

.user-menu-section-title {
  padding: 8px 16px 4px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.user-menu-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  cursor: pointer;
}

.user-menu-toggle .toggle-label {
  font-size: 0.85rem;
  color: var(--text);
}

.user-menu-toggle input[type="checkbox"] {
  display: none;
}

.user-menu-toggle .toggle-switch {
  width: 40px;
  height: 22px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 11px;
  position: relative;
  transition: background 0.2s;
}

.user-menu-toggle .toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}

.user-menu-toggle input:checked + .toggle-switch {
  background: var(--accent);
}

.user-menu-toggle input:checked + .toggle-switch::after {
  transform: translateX(18px);
}

.user-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 16px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s;
}

.user-menu-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.user-menu-item svg {
  color: var(--muted);
}

.user-menu-item.logout {
  color: #ef4444;
}

.user-menu-item.logout svg {
  color: #ef4444;
}

/* ===== REGISTRO BUTTON ===== */
.registro-btn,
.stats-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
}

.registro-btn:hover,
.stats-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.15);
}

.registro-btn:active,
.stats-btn:active {
  transform: scale(0.95);
}

/* ===== STATS MODAL - FULLSCREEN PREMIUM ===== */
.stats-modal {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  z-index: 50000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  background: #08090c;
}

.stats-modal[aria-hidden="false"] {
  opacity: 1;
  visibility: visible;
}

.stats-backdrop {
  display: none;
}

.stats-card {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  background: transparent;
  border-radius: 0;
  border: none;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(15px);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.stats-modal[aria-hidden="false"] .stats-card {
  opacity: 1;
  transform: translateY(0);
}

/* Header Minimal */
.stats-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  padding-top: max(14px, env(safe-area-inset-top));
  background: rgba(212, 175, 55, 0.03);
  border-bottom: 1px solid rgba(212, 175, 55, 0.08);
  flex-shrink: 0;
}

.stats-head-content {
  display: flex;
  align-items: center;
  gap: 14px;
}

.stats-head-icon {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  background: linear-gradient(135deg, #d4af37 0%, #b8962e 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stats-head-icon svg {
  color: #08090c;
}

.stats-head-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stats-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
  letter-spacing: -0.01em;
}

.stats-subtitle {
  font-size: 0.75rem;
  color: rgba(212, 175, 55, 0.8);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.stats-close {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.stats-close:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.stats-body {
  padding: 16px;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Hero Cards */
.stats-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stats-hero-card {
  position: relative;
  border-radius: 4px;
  padding: 14px 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stats-hero-card.gold {
  background: rgba(212, 175, 55, 0.08);
  border: 1px solid rgba(212, 175, 55, 0.2);
}

.stats-hero-card.gold::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #d4af37, transparent);
}

.stats-hero-card.white {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.stats-hero-card.white::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, rgba(255,255,255,0.3), transparent);
}

.stats-hero-shine {
  display: none;
}

@keyframes heroShine {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.2); }
}

@keyframes pulseGold {
  0% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.5); }
  50% { box-shadow: 0 0 0 8px rgba(212, 175, 55, 0); }
  100% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0); }
}

.stats-hero-label {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.45);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  position: relative;
  z-index: 1;
}

.stats-hero-card.gold .stats-hero-label {
  color: rgba(212, 175, 55, 0.7);
}

.stats-hero-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
  line-height: 1;
  position: relative;
  z-index: 1;
}

.stats-hero-card.gold .stats-hero-value {
  color: #d4af37;
}

.stats-hero-value.mono {
  font-family: 'Roboto Mono', monospace;
  font-size: 1.4rem;
  font-weight: 600;
}

.stats-hero-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stats-hero-card.gold .stats-hero-badge {
  background: rgba(212, 175, 55, 0.12);
  color: #d4af37;
}

.stats-hero-card.white .stats-hero-badge {
  color: rgba(255, 255, 255, 0.35);
}

/* Métricas Inline Row */
.stats-metrics-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.stats-metric-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 8px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  text-align: center;
  position: relative;
}

.stats-metric-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
}

.stats-metric-box.positive::before {
  background: linear-gradient(90deg, #4ade80, transparent);
}

.stats-metric-box.negative::before {
  background: linear-gradient(90deg, #f87171, transparent);
}

.stats-metric-box.saldo::before {
  background: linear-gradient(90deg, #d4af37, transparent);
}

.stats-metric-box-value {
  font-size: 1.1rem;
  font-weight: 700;
  font-family: 'Roboto Mono', monospace;
  line-height: 1.2;
}

.stats-metric-box.positive .stats-metric-box-value {
  color: #4ade80;
}

.stats-metric-box.negative .stats-metric-box-value {
  color: #f87171;
}

.stats-metric-box.saldo .stats-metric-box-value {
  color: #d4af37;
}

.stats-metric-box-label {
  font-size: 0.6rem;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2px;
}

/* Calculadora Premium */
.stats-earnings-premium {
  position: relative;
  background: rgba(212, 175, 55, 0.04);
  border-radius: 4px;
  padding: 14px;
  border: 1px solid rgba(212, 175, 55, 0.15);
  overflow: visible;
}

.stats-earnings-premium::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #d4af37, transparent 70%);
}

.stats-earnings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
}

.stats-earnings-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #d4af37;
}

.stats-earnings-title svg {
  color: #d4af37;
  width: 18px;
  height: 18px;
}

.stats-help-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: 4px;
  color: #d4af37;
  font-size: 0.7rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.stats-help-btn svg {
  width: 14px;
  height: 14px;
}

.stats-help-btn:hover {
  background: rgba(212, 175, 55, 0.18);
}

.stats-earnings-input-group {
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
}

.stats-earnings-label {
  display: block;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 6px;
}

.stats-value-type {
  color: #d4af37;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 2px;
  transition: all 0.2s;
  padding: 2px 6px;
  background: rgba(212, 175, 55, 0.15);
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.65rem;
  letter-spacing: 0.5px;
}

.stats-value-type:hover {
  color: #f5d67b;
  background: rgba(212, 175, 55, 0.25);
}

.stats-value-type:active {
  transform: scale(0.95);
}

.stats-earnings-field {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 4px;
  overflow: hidden;
  transition: all 0.2s ease;
}

.stats-earnings-field:focus-within {
  border-color: #d4af37;
}

.stats-earnings-currency {
  padding: 10px 12px;
  background: rgba(212, 175, 55, 0.1);
  color: #d4af37;
  font-weight: 600;
  font-size: 0.85rem;
}

.stats-earnings-field input {
  flex: 1;
  padding: 10px 12px;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
}

.stats-earnings-field input:focus {
  outline: none;
}

.stats-earnings-field input::placeholder {
  color: rgba(255, 255, 255, 0.2);
}

.stats-earnings-result {
  padding-top: 12px;
  border-top: 1px solid rgba(212, 175, 55, 0.1);
  position: relative;
  z-index: 1;
}

.stats-earnings-result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stats-earnings-result-row span {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
}

.stats-total-type {
  color: #d4af37;
  font-weight: 600;
  text-transform: capitalize;
}

.stats-total-earned {
  font-size: 1.3rem;
  font-weight: 700;
  color: #4ade80;
}

/* Salary Popup */
.stats-salary-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  width: calc(100% - 40px);
  max-width: 360px;
  background: #0c0d10;
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: 8px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 100000;
}

.stats-salary-popup[aria-hidden="false"] {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

.stats-salary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.12);
}

.stats-salary-header span {
  font-size: 0.85rem;
  font-weight: 600;
  color: #d4af37;
}

.stats-salary-close {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  border: none;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.stats-salary-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.stats-salary-body {
  padding: 14px;
}

.stats-salary-desc {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.45);
  margin: 0 0 12px 0;
  line-height: 1.4;
}

.stats-salary-input {
  margin-bottom: 10px;
}

.stats-salary-input label {
  display: block;
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.4);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stats-salary-field {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.stats-salary-field span {
  padding: 8px 10px;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.8rem;
}

.stats-salary-field input {
  flex: 1;
  padding: 8px 10px;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 0.95rem;
}

.stats-salary-field input:focus {
  outline: none;
}

.stats-salary-results {
  background: rgba(212, 175, 55, 0.06);
  border: 1px solid rgba(212, 175, 55, 0.15);
  border-radius: 4px;
  padding: 12px;
  margin-bottom: 12px;
}

.stats-salary-result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
}

.stats-salary-result-item:first-child {
  border-bottom: 1px solid rgba(212, 175, 55, 0.1);
  padding-bottom: 8px;
  margin-bottom: 2px;
}

.stats-salary-result-item span {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.55);
}

.stats-salary-result-value {
  display: flex;
  align-items: center;
  gap: 6px;
}

.stats-salary-result-value strong {
  font-size: 0.95rem;
  color: #d4af37;
}

.stats-copy-btn {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  border: 1px solid rgba(212, 175, 55, 0.2);
  background: rgba(212, 175, 55, 0.06);
  color: #d4af37;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.stats-copy-btn:hover {
  background: rgba(212, 175, 55, 0.15);
}

/* Botões de aplicar (Hora e Dia) */
.stats-salary-buttons {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.stats-salary-apply-btn {
  flex: 1;
  padding: 10px 12px;
  background: linear-gradient(135deg, #d4af37 0%, #b8962e 100%);
  border: none;
  border-radius: 4px;
  color: #08090c;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all 0.2s ease;
}

.stats-salary-apply-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}

.stats-salary-apply-btn:active {
  transform: scale(0.98);
}

.stats-salary-apply {
  width: 100%;
  padding: 10px;
  background: linear-gradient(135deg, #d4af37 0%, #b8962e 100%);
  border: none;
  border-radius: 4px;
  color: #08090c;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.stats-salary-apply:hover {
  transform: translateY(-1px);
}

/* Table Premium */
.stats-table-container {
  background: rgba(255, 255, 255, 0.01);
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 180px;
}

.stats-table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  flex-shrink: 0;
}

.stats-table-header span:first-child {
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.75);
}

.stats-table-count {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.35);
}

.stats-table-scroll {
  flex: 1;
  overflow-y: auto;
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.stats-table th {
  text-align: left;
  padding: 10px 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.35);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.6rem;
  background: rgba(0, 0, 0, 0.25);
  position: sticky;
  top: 0;
  z-index: 1;
}

.stats-table th:last-child {
  text-align: right;
}

.stats-table td {
  padding: 12px 14px;
  color: rgba(255, 255, 255, 0.8);
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  vertical-align: middle;
}

.stats-table td:last-child {
  text-align: right;
}

.stats-table tr:last-child td {
  border-bottom: none;
}

.stats-table-date {
  font-weight: 600;
  color: #fff;
  font-size: 0.85rem;
}

.stats-table-time {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 1px;
  font-family: 'Roboto Mono', monospace;
}

.stats-table-empty {
  text-align: center;
  padding: 30px 20px !important;
  color: rgba(255, 255, 255, 0.35);
}

.stats-table .text-muted {
  color: rgba(255, 255, 255, 0.4);
}

.stats-table .ganho-value {
  color: #4ade80;
  font-weight: 600;
  font-size: 0.8rem;
  font-family: 'Roboto Mono', monospace;
}

.stats-table .status-positive {
  color: #4ade80;
}

.stats-table .status-negative {
  color: #f87171;
}

.stats-table .status-ok {
  color: #4ade80;
  font-family: 'Roboto Mono', monospace;
}

.stats-table .status-pending {
  color: #fbbf24;
  font-size: 0.75rem;
  font-family: 'Roboto Mono', monospace;
}

/* Linha em andamento */
.stats-table .row-em-andamento {
  background: rgba(251, 191, 36, 0.05);
}

.stats-table .row-em-andamento td {
  border-color: rgba(251, 191, 36, 0.15);
}

/* Backdrop para popup de salário */
.stats-salary-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 99999;
}

.stats-salary-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.stats-table .status-warning {
  color: rgba(255, 255, 255, 0.45);
}

/* Empty State */
.stats-empty {
  text-align: center;
  padding: 40px 20px;
}

.stats-empty svg {
  color: rgba(255, 255, 255, 0.15);
  margin-bottom: 16px;
}

.stats-empty p {
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.9rem;
  margin: 0;
}

/* ===== LOGIN MODAL - SOPHISTICATED DESIGN ===== */
.login-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100000;
}

.login-modal[aria-hidden="false"] {
  display: flex;
}

.login-backdrop {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #0a0a0f 0%, #0d1117 50%, #0a0c10 100%);
}

.login-card {
  position: relative;
  width: 100%;
  max-width: 380px;
  background: rgba(18, 20, 28, 0.95);
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 36px 28px;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6);
  animation: loginSlideIn 0.35s cubic-bezier(.2,.9,.3,1);
}

@keyframes loginSlideIn {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-header {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo {
  width: 64px;
  height: 64px;
  margin: 0 auto 18px;
  border-radius: 16px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-logo-text {
  font-size: 1.5rem;
  font-weight: 800;
  color: #0a0a0f;
  letter-spacing: -0.03em;
  font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, sans-serif;
}

.login-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
  letter-spacing: -0.02em;
}

.login-subtitle {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.45);
  margin-top: 6px;
  font-weight: 400;
}

.login-tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 28px;
}

.login-tab {
  flex: 1;
  padding: 11px 16px;
  background: none;
  border: none;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.login-tab.active {
  background: #fff;
  color: #0a0a0f;
  font-weight: 600;
}

.login-tab:hover:not(.active) {
  color: rgba(255, 255, 255, 0.8);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.login-field label {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
}

.login-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.login-input-wrap svg {
  position: absolute;
  left: 14px;
  color: rgba(255, 255, 255, 0.3);
  transition: color 0.2s ease;
  z-index: 1;
}

.login-input-wrap input {
  width: 100%;
  padding: 14px 14px 14px 44px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  color: #fff;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.login-input-wrap input:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.06);
}

.login-input-wrap:focus-within svg {
  color: rgba(255, 255, 255, 0.6);
}

.login-input-wrap input::placeholder {
  color: rgba(255, 255, 255, 0.25);
}

.register-fields {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.login-message {
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 0.85rem;
  display: none;
}

.login-message.error {
  display: block;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #f87171;
}

.login-message.success {
  display: block;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.25);
  color: #4ade80;
}

.login-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  border: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 4px;
}

.login-btn.primary {
  background: #fff;
  color: #0a0a0f;
}

.login-btn.primary:hover {
  background: rgba(255, 255, 255, 0.9);
}

.login-btn.primary:active {
  transform: scale(0.98);
}

.login-btn svg {
  transition: transform 0.2s ease;
}

.login-btn:hover svg {
  transform: translateX(3px);
}

.login-footer {
  text-align: center;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.login-footer p {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.3);
  margin: 0;
}

/* ===== REGISTRO MODAL ===== */
.registro-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  z-index: 50000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  touch-action: none;
  overscroll-behavior: contain;
}

.registro-modal[aria-hidden="false"] {
  opacity: 1;
  visibility: visible;
}

.registro-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 3, 11, 0.85);
  backdrop-filter: blur(12px);
  opacity: 0;
  transition: opacity 0.35s ease;
  touch-action: none;
}

.registro-modal[aria-hidden="false"] .registro-backdrop {
  opacity: 1;
}

.registro-card {
  position: relative;
  width: 100%;
  max-width: 100%;
  max-height: calc(100vh - 16px);
  overflow: auto;
  background: var(--surface-strong);
  border-radius: 24px;
  opacity: 0;
  transform: translateY(30px) scale(0.95);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.registro-modal[aria-hidden="false"] .registro-card {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.registro-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 24px 20px;
  border-bottom: 1px solid var(--stroke);
  position: sticky;
  top: 0;
  background: var(--surface-strong);
  border-radius: 24px 24px 0 0;
  z-index: 10;
}

.registro-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.registro-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.registro-date {
  font-size: 0.85rem;
  color: var(--muted);
}

.registro-close {
  flex-shrink: 0;
}

.registro-body {
  padding: 24px;
}

.registro-progress-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
  margin-bottom: 8px;
}

.registro-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
  transition: width 0.4s ease;
}

.registro-progress-text {
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
  margin-bottom: 24px;
}

.registro-pontos {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.registro-ponto {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.registro-ponto:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.registro-ponto:active {
  transform: translateY(0);
}

.registro-ponto.batido {
  background: rgba(79, 209, 197, 0.04);
  border-color: rgba(79, 209, 197, 0.2);
}

.registro-ponto-check {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
  cursor: pointer;
  position: relative;
}

.registro-ponto-check:hover {
  border-color: rgba(255, 255, 255, 0.3);
}

.registro-ponto-check:active {
  transform: scale(0.95);
}

.registro-ponto.batido .registro-ponto-check {
  background: rgba(79, 209, 197, 0.15);
  border-color: var(--accent);
}

.registro-ponto-check svg {
  width: 18px;
  height: 18px;
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.2s ease;
}

.registro-ponto.batido .registro-ponto-check svg {
  opacity: 1;
  transform: scale(1);
}

.registro-ponto-check svg path {
  fill: var(--accent);
}

.registro-ponto-info {
  flex: 1;
  min-width: 0;
  cursor: pointer;
  padding: 4px 0;
  transition: transform 0.2s ease;
}

.registro-ponto-info:hover {
  transform: translateX(4px);
}

.registro-ponto-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  transition: color 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.registro-ponto.batido .registro-ponto-label {
  color: #fff;
}

.registro-ponto-time {
  font-size: 0.82rem;
  color: var(--muted);
  font-family: 'Roboto Mono', monospace;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.registro-ponto-time:not(.batido) {
  font-style: italic;
  font-family: inherit;
  opacity: 0.7;
}

.registro-ponto-time.batido {
  color: var(--accent);
  font-size: 1.1rem;
  font-weight: 500;
}

/* Span de edição de horário (substitui input) */
.registro-edit-time {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 60px;
  padding: 6px 10px;
  border: 1px solid rgba(123, 215, 255, 0.3);
  border-radius: 4px;
  background: transparent;
  color: var(--accent);
  font-family: 'Roboto Mono', monospace;
  font-size: 1.1rem;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.registro-edit-time:hover {
  border-color: var(--accent);
  background: rgba(123, 215, 255, 0.1);
}

.registro-edit-time:active {
  transform: scale(0.98);
}

/* Input de edição de horário (legado) */
.registro-edit-input {
  width: 75px;
  padding: 6px 4px;
  border: 1px solid rgba(123, 215, 255, 0.3);
  border-radius: 4px;
  background: transparent;
  color: var(--accent);
  font-family: 'Roboto Mono', monospace;
  font-size: 1.1rem;
  font-weight: 600;
  text-align: center;
  outline: none;
  transition: all 0.2s ease;
  letter-spacing: 0;
}

.registro-edit-input:focus {
  border-color: var(--accent);
}

/* Input manual ativo */
.registro-edit-input.manual-active {
  border-color: rgba(79, 209, 197, 0.4);
  background: rgba(0, 0, 0, 0.7);
}

.registro-edit-input.manual-active:focus {
  border-color: var(--accent);
}

/* Botão aplicar edição */
.registro-edit-apply {
  width: 26px;
  height: 26px;
  border-radius: 4px;
  background: var(--accent);
  border: none;
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.registro-edit-apply:hover {
  background: var(--accent-strong);
  transform: scale(1.05);
}

.registro-edit-apply:active {
  transform: scale(0.95);
}

/* Botão cancelar edição manual */
.registro-edit-cancel {
  width: 26px;
  height: 26px;
  border-radius: 4px;
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.25);
  color: #f87171;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.registro-edit-cancel:hover {
  background: rgba(248, 113, 113, 0.2);
  border-color: rgba(248, 113, 113, 0.4);
}

.registro-edit-cancel:active {
  transform: scale(0.95);
}

/* Badge Manual */
.manual-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.55rem;
  padding: 1px 5px;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #000;
  border-radius: 3px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  flex-shrink: 0;
  line-height: 1.4;
}

/* Ponto em modo manual */
.registro-ponto.manual {
  border-color: rgba(251, 191, 36, 0.3);
  background: rgba(251, 191, 36, 0.05);
}

.registro-ponto.manual .registro-ponto-check {
  border-color: rgba(251, 191, 36, 0.4);
}

.registro-ponto.manual.batido .registro-ponto-check {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  border-color: #fbbf24;
}

.registro-ponto-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.registro-ponto-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  border: 2px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--muted);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.registro-ponto-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #8c7aff);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.registro-ponto-btn:hover {
  border-color: rgba(123, 215, 255, 0.4);
  transform: scale(1.08);
}

.registro-ponto-btn:active {
  transform: scale(0.95);
}

.registro-ponto-btn.has-image {
  border-color: transparent;
}

.registro-ponto-btn.has-image::before {
  opacity: 1;
}

.registro-ponto-btn.has-image {
  box-shadow: 0 4px 20px rgba(123, 215, 255, 0.4),
              0 0 0 2px rgba(123, 215, 255, 0.2);
}

.registro-ponto-btn svg {
  width: 18px;
  height: 18px;
  position: relative;
  z-index: 1;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.registro-ponto-btn.has-image svg {
  color: #fff;
  stroke: #fff;
}

.registro-ponto-btn.camera-btn {
  background: linear-gradient(145deg, rgba(16, 185, 129, 0.12), rgba(5, 150, 105, 0.08));
  border: 2px solid rgba(16, 185, 129, 0.4);
  box-shadow: 0 2px 12px rgba(16, 185, 129, 0.15),
              inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.registro-ponto-btn.camera-btn::before {
  background: linear-gradient(135deg, #10B981, #34D399);
}

.registro-ponto-btn.camera-btn:hover {
  border-color: rgba(16, 185, 129, 0.7);
  box-shadow: 0 6px 24px rgba(16, 185, 129, 0.35),
              0 0 0 3px rgba(16, 185, 129, 0.15);
  transform: scale(1.1) translateY(-2px);
}

.registro-ponto-btn.camera-btn:active {
  transform: scale(0.95);
}

.registro-ponto-btn.camera-btn:active::before {
  opacity: 1;
}

.registro-ponto-btn.camera-btn:active svg {
  color: #fff;
  stroke: #fff;
}

.registro-ponto-btn.camera-btn svg {
  color: #10B981;
  stroke: #10B981;
  filter: drop-shadow(0 1px 2px rgba(16, 185, 129, 0.3));
}

.registro-ponto-btn:hover svg {
  transform: scale(1.15);
}

/* Botão galeria */
.registro-ponto-btn.gallery-btn {
  background: linear-gradient(145deg, rgba(99, 102, 241, 0.12), rgba(79, 70, 229, 0.08));
  border: 2px solid rgba(99, 102, 241, 0.4);
  box-shadow: 0 2px 12px rgba(99, 102, 241, 0.15),
              inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.registro-ponto-btn.gallery-btn::before {
  background: linear-gradient(135deg, #6366F1, #818CF8);
}

.registro-ponto-btn.gallery-btn:hover {
  border-color: rgba(99, 102, 241, 0.7);
  box-shadow: 0 6px 24px rgba(99, 102, 241, 0.35),
              0 0 0 3px rgba(99, 102, 241, 0.15);
  transform: scale(1.1) translateY(-2px);
}

.registro-ponto-btn.gallery-btn:active {
  transform: scale(0.95);
}

.registro-ponto-btn.gallery-btn:active::before {
  opacity: 1;
}

.registro-ponto-btn.gallery-btn:active svg {
  color: #fff;
  stroke: #fff;
}.registro-ponto-btn.gallery-btn svg {
  color: #818CF8;
  stroke: #818CF8;
}

.registro-ponto-btn.gallery-btn.has-image {
  background: linear-gradient(135deg, #6366F1, #8B5CF6);
  border-color: transparent;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
}

.registro-ponto-btn.gallery-btn.has-image svg {
  color: #fff;
  stroke: #fff;
}

/* ===== CAMERA CAPTURE MODAL ===== */
.camera-capture-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 65000;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.camera-capture-modal.show {
  opacity: 1;
}

.camera-capture-backdrop {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.95) 0%, rgba(10, 10, 20, 0.98) 100%);
}

.camera-capture-content {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.camera-capture-content video {
  width: 100%;
  max-width: 600px;
  max-height: 70vh;
  object-fit: cover;
  border-radius: 24px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 
              0 0 0 1px rgba(255, 255, 255, 0.05),
              inset 0 0 60px rgba(0, 0, 0, 0.3);
  transform: scale(0.95);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.camera-capture-modal.show .camera-capture-content video {
  transform: scale(1);
}

/* Frame overlay para dar efeito de viewfinder */
.camera-capture-content::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 280px;
  height: 280px;
  border: 2px solid rgba(123, 215, 255, 0.4);
  border-radius: 20px;
  pointer-events: none;
  z-index: 10;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.3);
  animation: pulse-frame 2s ease-in-out infinite;
}

@keyframes pulse-frame {
  0%, 100% { border-color: rgba(123, 215, 255, 0.4); }
  50% { border-color: rgba(123, 215, 255, 0.7); }
}

/* Corner marks */
.camera-capture-content::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 290px;
  height: 290px;
  pointer-events: none;
  z-index: 11;
  background: 
    linear-gradient(to right, rgba(123, 215, 255, 0.8) 3px, transparent 3px) 0 0,
    linear-gradient(to right, rgba(123, 215, 255, 0.8) 3px, transparent 3px) 0 100%,
    linear-gradient(to left, rgba(123, 215, 255, 0.8) 3px, transparent 3px) 100% 0,
    linear-gradient(to left, rgba(123, 215, 255, 0.8) 3px, transparent 3px) 100% 100%,
    linear-gradient(to bottom, rgba(123, 215, 255, 0.8) 3px, transparent 3px) 0 0,
    linear-gradient(to bottom, rgba(123, 215, 255, 0.8) 3px, transparent 3px) 100% 0,
    linear-gradient(to top, rgba(123, 215, 255, 0.8) 3px, transparent 3px) 0 100%,
    linear-gradient(to top, rgba(123, 215, 255, 0.8) 3px, transparent 3px) 100% 100%;
  background-repeat: no-repeat;
  background-size: 30px 30px;
}

.camera-capture-actions {
  position: absolute;
  bottom: 50px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 40px;
  padding: 16px 32px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  border-radius: 100px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.camera-capture-btn {
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.camera-capture-btn.cancel,
.camera-capture-btn.switch {
  width: 52px;
  height: 52px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  color: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.camera-capture-btn.cancel:hover,
.camera-capture-btn.switch:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  transform: scale(1.1);
  border-color: rgba(255, 255, 255, 0.3);
}

.camera-capture-btn.cancel:active,
.camera-capture-btn.switch:active {
  transform: scale(0.95);
}

.camera-capture-btn.capture {
  width: 76px;
  height: 76px;
  background: linear-gradient(145deg, #fff, #f0f0f0);
  color: transparent;
  box-shadow: 0 8px 32px rgba(255, 255, 255, 0.3),
              0 0 0 4px rgba(255, 255, 255, 0.2),
              inset 0 2px 4px rgba(255, 255, 255, 0.5);
  position: relative;
}

.camera-capture-btn.capture::before {
  content: '';
  position: absolute;
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, #FF4757, #FF6B81);
  border-radius: 50%;
  transition: all 0.2s ease;
}

.camera-capture-btn.capture:hover {
  transform: scale(1.08);
  box-shadow: 0 12px 40px rgba(255, 255, 255, 0.4),
              0 0 0 6px rgba(255, 255, 255, 0.25),
              inset 0 2px 4px rgba(255, 255, 255, 0.5);
}

.camera-capture-btn.capture:hover::before {
  transform: scale(1.05);
}

.camera-capture-btn.capture:active {
  transform: scale(0.95);
}

.camera-capture-btn.capture:active::before {
  transform: scale(0.9);
  background: linear-gradient(135deg, #e63946, #FF4757);
}

/* ===== CAMERA ERROR MODAL ===== */
.camera-error-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 70000;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.camera-error-modal.show {
  opacity: 1;
}

.camera-error-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 3, 11, 0.95);
  backdrop-filter: blur(20px);
}

.camera-error-content {
  position: relative;
  background: linear-gradient(145deg, rgba(30, 30, 50, 0.95), rgba(20, 20, 40, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  padding: 40px;
  max-width: 340px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.camera-error-modal.show .camera-error-content {
  transform: scale(1);
}

.camera-error-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  background: linear-gradient(145deg, rgba(239, 68, 68, 0.2), rgba(220, 38, 38, 0.1));
  border: 2px solid rgba(239, 68, 68, 0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #EF4444;
}

.camera-error-icon.warning {
  background: linear-gradient(145deg, rgba(251, 191, 36, 0.2), rgba(245, 158, 11, 0.1));
  border-color: rgba(251, 191, 36, 0.3);
  color: #FBBF24;
}

.camera-error-content h3 {
  margin: 0 0 12px;
  font-size: 1.25rem;
  font-weight: 600;
  color: #fff;
}

.camera-error-content p {
  margin: 0 0 24px;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.5;
}

.camera-error-content button {
  background: linear-gradient(135deg, var(--accent, #7BD7FF), #8c7aff);
  border: none;
  border-radius: 12px;
  padding: 12px 32px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
}

.camera-error-content button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(123, 215, 255, 0.3);
}

/* ===== IMAGE PREVIEW MODAL ===== */
.image-preview-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 60000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.image-preview-modal.show {
  opacity: 1;
}

.image-preview-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 3, 11, 0.95);
  backdrop-filter: blur(20px);
}

.image-preview-content {
  position: relative;
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.image-preview-modal.show .image-preview-content {
  transform: scale(1);
}

.image-preview-content img {
  max-width: 100%;
  max-height: 70vh;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  object-fit: contain;
}

.image-preview-close {
  position: absolute;
  top: -50px;
  right: -10px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.image-preview-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(90deg);
}

.image-preview-actions {
  display: flex;
  gap: 12px;
}

.image-preview-actions button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.image-preview-actions button:hover {
  background: var(--accent);
  border-color: var(--accent);
}

.registro-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  margin-bottom: 30px;
  padding-bottom: max(20px, env(safe-area-inset-bottom));
  justify-content: center;
  flex-wrap: wrap;
}

.registro-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* ===== GALERIA MODAL ===== */
.galeria-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 51000;
}

.galeria-modal[aria-hidden="false"] {
  display: flex;
}

.galeria-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 3, 11, 0.9);
  backdrop-filter: blur(14px);
}

.galeria-card {
  position: relative;
  width: 100%;
  max-width: 680px;
  max-height: calc(100vh - 80px);
  overflow: auto;
  background: var(--surface-strong);
  border-radius: 24px;
  border: 1px solid var(--stroke);
  box-shadow: 0 30px 80px rgba(2, 3, 12, 0.8);
}

.galeria-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--stroke);
  position: sticky;
  top: 0;
  background: var(--surface-strong);
  z-index: 10;
}

.galeria-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.galeria-date {
  font-size: 0.85rem;
  color: var(--muted);
  margin-left: auto;
  margin-right: 12px;
}

.galeria-close {
  flex-shrink: 0;
}

.galeria-body {
  padding: 24px;
}

.galeria-empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--muted);
}

.galeria-empty svg {
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
  opacity: 0.4;
}

.galeria-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.galeria-item {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: all 0.25s ease;
}

.galeria-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
  border-color: rgba(123, 215, 255, 0.3);
}

.galeria-item img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
}

.galeria-item-info {
  padding: 12px;
  background: linear-gradient(0deg, rgba(0,0,0,0.8), transparent);
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
}

.galeria-item-tipo {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 2px;
}

.galeria-item-hora {
  font-size: 0.85rem;
  color: var(--text);
  font-family: 'Roboto Mono', monospace;
}

/* ===== IMAGE VIEWER MODAL ===== */
.image-viewer-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 52000;
}

.image-viewer-modal[aria-hidden="false"] {
  display: flex;
}

.image-viewer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
}

.image-viewer-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.image-viewer-close {
  position: absolute;
  top: -48px;
  right: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.image-viewer-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.image-viewer-content img {
  max-width: 100%;
  max-height: calc(90vh - 80px);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.image-viewer-caption {
  margin-top: 16px;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: white;
  font-size: 0.9rem;
  text-align: center;
}

/* ===== ICON-ONLY BUTTONS ===== */
.btn.icon-only {
  padding: 10px;
  min-width: 44px;
  justify-content: center;
}

.btn.icon-only svg {
  margin: 0;
}

/* ===== CALENDAR MODAL ===== */
.calendar-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 51000;
}

.calendar-modal[aria-hidden="false"] {
  display: flex;
}

.calendar-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 3, 11, 0.9);
  backdrop-filter: blur(14px);
}

.calendar-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  max-height: calc(100vh - 80px);
  overflow: auto;
  background: var(--surface-strong);
  border-radius: 24px;
  border: 1px solid var(--stroke);
  box-shadow: 0 30px 80px rgba(2, 3, 12, 0.8);
}

.calendar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--stroke);
}

.calendar-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.calendar-body {
  padding: 20px 24px;
}

.calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.calendar-nav-btn {
  background: transparent;
  border: 1px solid var(--stroke);
  color: var(--text-soft);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.calendar-nav-btn:hover {
  background: var(--surface-btn);
  color: var(--text);
  border-color: var(--accent);
}

.calendar-month-label {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}

.calendar-grid {
  background: var(--surface-btn);
  border-radius: 16px;
  padding: 16px;
  border: 1px solid var(--stroke);
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 8px;
}

.calendar-weekdays span {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-soft);
  text-transform: uppercase;
  padding: 8px 4px;
}

.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.calendar-day:hover:not(.disabled):not(.empty) {
  background: var(--surface);
  border-color: var(--accent);
}

.calendar-day.today {
  border-color: var(--accent);
  background: rgba(123, 215, 255, 0.1);
}

.calendar-day.selected {
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
}

.calendar-day.has-data::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--good);
}

.calendar-day.has-data.partial::after {
  background: var(--warn);
}

.calendar-day.disabled {
  color: var(--text-faint);
  cursor: not-allowed;
  opacity: 0.4;
}

.calendar-day.empty {
  cursor: default;
}

/* Delete mode styles */
.calendar-delete-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s;
}

.calendar-delete-btn:hover {
  background: rgba(248, 113, 113, 0.15);
  color: #f87171;
}

.calendar-delete-btn.active {
  background: rgba(248, 113, 113, 0.2);
  color: #f87171;
}

.calendar-delete-btn svg {
  width: 20px;
  height: 20px;
}

/* Restore button */
.calendar-restore-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s;
}

.calendar-restore-btn:hover {
  background: rgba(123, 215, 255, 0.15);
}

.calendar-restore-btn.active {
  background: rgba(123, 215, 255, 0.2);
}

.calendar-restore-btn svg {
  width: 20px;
  height: 20px;
}

.calendar-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.calendar-day.delete-mode {
  cursor: pointer;
}

.calendar-day.delete-mode.has-data:not(.deleted):hover {
  border-color: #f87171;
  background: rgba(248, 113, 113, 0.15);
}

.calendar-day.delete-mode.selected {
  background: rgba(248, 113, 113, 0.25);
  border: 2px solid #f87171;
  color: #f87171;
}

.calendar-day.deleted {
  opacity: 0.35;
  text-decoration: line-through;
  color: var(--text-soft);
  pointer-events: none;
}

/* Restore mode - deleted days become clickable */
.calendar-day.restore-mode.deleted {
  opacity: 0.7;
  pointer-events: auto;
  cursor: pointer;
  text-decoration: line-through;
}

.calendar-day.restore-mode.deleted:hover {
  border-color: var(--accent);
  background: rgba(123, 215, 255, 0.15);
  opacity: 1;
}

.calendar-day.restore-mode.deleted.selected {
  background: rgba(123, 215, 255, 0.25);
  border: 2px solid var(--accent);
  color: var(--accent);
  opacity: 1;
  text-decoration: none;
}

.calendar-day.deleted::after {
  display: none;
}

.delete-mode-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(248, 113, 113, 0.15);
  border: 1px solid rgba(248, 113, 113, 0.3);
  border-radius: 10px;
  margin-bottom: 16px;
}

.delete-mode-bar span {
  color: #f87171;
  font-weight: 500;
  font-size: 0.9rem;
}

.delete-mode-bar button {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.delete-mode-bar .cancel-btn {
  background: transparent;
  color: var(--text-soft);
  border: 1px solid var(--stroke);
}

.delete-mode-bar .delete-btn {
  background: #f87171;
  color: #fff;
}

.delete-mode-bar .delete-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.calendar-selected-info {
  margin-top: 20px;
  padding: 16px;
  background: var(--surface-btn);
  border-radius: 12px;
  border: 1px solid var(--stroke);
  text-align: center;
}

.calendar-selected-date {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
}

.calendar-selected-info .btn {
  width: 100%;
}

/* ===== HISTORICAL MODAL ADJUSTMENTS ===== */
.historical-card .registro-head {
  background: linear-gradient(135deg, rgba(123, 215, 255, 0.1) 0%, rgba(123, 215, 255, 0.05) 100%);
}

.historical-card .registro-title::before {
  content: '📅 ';
}

/* ===== HIDDEN INPUT FOR FILE UPLOAD ===== */
.hidden-file-input {
  display: none;
}

/* ===== ANIMAÇÕES ===== */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.spin {
  animation: spin 1s linear infinite;
}

/* ===== TUTORIAL MODAL ===== */
.tutorial-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: none;
  align-items: center;
  justify-content: center;
}

.tutorial-modal[aria-hidden="false"] {
  display: flex;
}

.tutorial-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
}

.tutorial-modal-content {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  z-index: 1;
}

.tutorial-modal-close {
  position: absolute;
  top: 10px;
  left: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 100;
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
}

.tutorial-modal-close:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: scale(1.1);
}

.tutorial-modal-close svg {
  width: 20px;
  height: 20px;
}

#tutorialFrame {
  width: 100%;
  height: 100%;
  border: none;
}

/* User menu help item */
.user-menu-item.help {
  color: var(--accent);
}

.user-menu-item.help svg {
  color: var(--accent);
}

/* ===== RESTORE DELETED MODAL ===== */
.restore-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.restore-modal[aria-hidden="false"] {
  opacity: 1;
  visibility: visible;
}

.restore-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
}

.restore-card {
  position: relative;
  width: 100%;
  max-width: 360px;
  max-height: 80vh;
  background: linear-gradient(180deg, var(--surface-strong) 0%, var(--surface) 100%);
  border-radius: 20px;
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(20px) scale(0.95);
  transition: transform 0.3s ease;
}

.restore-modal[aria-hidden="false"] .restore-card {
  transform: translateY(0) scale(1);
}

.restore-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px;
  border-bottom: 1px solid var(--stroke);
}

.restore-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(248, 113, 113, 0.15);
  border: 1px solid rgba(248, 113, 113, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f87171;
}

.restore-title {
  flex: 1;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}

.restore-close {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.restore-close:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text);
}

.restore-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}

.restore-hint {
  font-size: 0.85rem;
  color: var(--text-soft);
  margin-bottom: 16px;
  text-align: center;
}

.restore-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.restore-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--stroke);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.restore-item:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.1);
}

.restore-item.selected {
  background: rgba(123, 215, 255, 0.1);
  border-color: var(--accent);
}

.restore-item-check {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 2px solid var(--stroke);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.restore-item.selected .restore-item-check {
  background: var(--accent);
  border-color: var(--accent);
}

.restore-item-check svg {
  width: 14px;
  height: 14px;
  opacity: 0;
  color: #000;
  transition: opacity 0.2s ease;
}

.restore-item.selected .restore-item-check svg {
  opacity: 1;
}

.restore-item-info {
  flex: 1;
  min-width: 0;
}

.restore-item-date {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 2px;
}

.restore-item-meta {
  font-size: 0.75rem;
  color: var(--text-soft);
}

.restore-footer {
  display: flex;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid var(--stroke);
}

.restore-footer .btn {
  flex: 1;
}

.restore-empty {
  text-align: center;
  padding: 32px 20px;
  color: var(--text-soft);
}

.restore-empty svg {
  width: 48px;
  height: 48px;
  margin-bottom: 12px;
  opacity: 0.3;
}

.restore-empty p {
  font-size: 0.9rem;
}

/* ===== APP DIALOG (Custom Confirm/Alert) ===== */
.app-dialog {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
}

.app-dialog[aria-hidden="false"] {
  opacity: 1;
  visibility: visible;
}

.app-dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
}

.app-dialog-card {
  position: relative;
  width: 100%;
  max-width: 320px;
  background: linear-gradient(180deg, var(--surface-strong) 0%, var(--surface) 100%);
  border-radius: 20px;
  border: 1px solid var(--stroke);
  box-shadow: 
    0 25px 60px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.05);
  padding: 28px 24px 20px;
  text-align: center;
  transform: translateY(20px) scale(0.9);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.app-dialog[aria-hidden="false"] .app-dialog-card {
  transform: translateY(0) scale(1);
}

.app-dialog-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(248, 113, 113, 0.15);
  border: 1px solid rgba(248, 113, 113, 0.25);
  color: #f87171;
}

.app-dialog-icon.success {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.25);
  color: #10B981;
}

.app-dialog-icon.info {
  background: rgba(123, 215, 255, 0.15);
  border-color: rgba(123, 215, 255, 0.25);
  color: var(--accent);
}

.app-dialog-icon.warning {
  background: rgba(251, 191, 36, 0.15);
  border-color: rgba(251, 191, 36, 0.25);
  color: #FBBF24;
}

.app-dialog-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.app-dialog-message {
  font-size: 0.9rem;
  color: var(--text-soft);
  line-height: 1.5;
  margin-bottom: 24px;
}

.app-dialog-actions {
  display: flex;
  gap: 10px;
}

.app-dialog-btn {
  flex: 1;
  padding: 14px 20px;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  font-family: inherit;
}

.app-dialog-btn.cancel {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--stroke);
  color: var(--text-soft);
}

.app-dialog-btn.cancel:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.app-dialog-btn.confirm {
  background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
  color: #fff;
  box-shadow: 0 4px 15px rgba(248, 113, 113, 0.3);
}

.app-dialog-btn.confirm:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(248, 113, 113, 0.4);
}

.app-dialog-btn.confirm:active {
  transform: translateY(0);
}

.app-dialog-btn.confirm.primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  box-shadow: 0 4px 15px rgba(123, 215, 255, 0.3);
}

.app-dialog-btn.confirm.primary:hover {
  box-shadow: 0 6px 20px rgba(123, 215, 255, 0.4);
}

.app-dialog-btn.confirm.success {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

/* Single button (alert mode) */
.app-dialog-actions.single {
  justify-content: center;
}

.app-dialog-actions.single .app-dialog-btn {
  flex: none;
  min-width: 120px;
}
