/* ===== RESET & BASE ===== */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #eef0f4;
  --ink: #0f1e36;
  --ink-2: #243755;
  --ink-3: #3a4f73;
  --muted: #6b7385;
  --muted-2: #95a0b3;
  --line: #d9dde4;
  --line-2: #e6e9ef;
  --present: #1b8a3c;
  --present-soft: #e6f4ea;
  --absent: #b8252e;
  --absent-soft: #fbe7e8;
  --warn: #b07c0c;
  --warn-soft: #fdf3d6;
  --info: #1e4d8b;
  --info-soft: #e6efff;
  --desligado: #4a4a4a;
  --pending: #cfd4dc;
  --gold: #c9a227;
  --gold-2: #e3b934;
  --gold-soft: #fbf3d8;
  --shadow-sm: 0 1px 2px rgba(15, 30, 54, 0.06);
  --shadow-md: 0 4px 14px rgba(15, 30, 54, 0.10);
  --shadow-lg: 0 8px 28px rgba(15, 30, 54, 0.14);
  --shadow-xl: 0 16px 48px rgba(15, 30, 54, 0.20);
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

html, body { height: 100%; }
html { scroll-padding-top: 140px; }
body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior-y: none;
  font-size: 16px;
  font-feature-settings: 'ss01' on, 'cv11' on;
}

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
  border-radius: 4px;
}
button:focus { outline: none; }
button:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

a { color: var(--ink-2); }
a:hover { color: var(--ink); }

/* ===== HEADER ===== */
header.app-header {
  background:
    radial-gradient(1200px 200px at 80% -50px, rgba(201,162,39,0.18), transparent 60%),
    linear-gradient(180deg, #0a162a 0%, #14294a 100%);
  color: white;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 50;
  padding-top: var(--safe-top);
}
header.app-header::after {
  content: '';
  position: absolute; left:0; right:0; bottom:0; height:3px;
  background: linear-gradient(90deg, var(--gold) 0%, var(--gold-2) 40%, transparent 90%);
}

.brand-row {
  max-width: 1240px;
  margin: 0 auto;
  padding: 12px calc(16px + var(--safe-right)) 12px calc(16px + var(--safe-left));
  display: flex;
  align-items: center;
  gap: 14px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}
.shield {
  width: 42px; height: 42px; flex-shrink: 0;
  background: linear-gradient(160deg, var(--gold-2) 0%, var(--gold) 100%);
  color: var(--ink);
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-weight: 900; font-size: 13px;
  letter-spacing: -0.5px;
  box-shadow:
    inset 0 -2px 0 rgba(0,0,0,0.18),
    0 4px 12px rgba(201,162,39,0.35);
  line-height: 1;
  position: relative;
}
.shield::after {
  content: '';
  position: absolute; inset: 1px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.25);
  pointer-events: none;
}
.brand-text { min-width: 0; flex: 1; }
.brand-text h1 {
  font-size: 15px; font-weight: 700;
  letter-spacing: 0.4px; text-transform: uppercase;
  line-height: 1.15;
  color: white;
}
.brand-text .sub {
  font-size: 11px; opacity: 0.7;
  letter-spacing: 0.9px; text-transform: uppercase;
  margin-top: 3px;
  color: rgba(255,255,255,0.9);
}

.user-cluster {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255,255,255,0.9);
}
.user-cluster .who {
  text-align: right;
  font-size: 12px;
  line-height: 1.2;
}
.user-cluster .who .name {
  font-weight: 700;
  color: white;
}
.user-cluster .who .role {
  font-size: 10px;
  opacity: 0.65;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  margin-top: 2px;
}
.user-cluster .avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255,255,255,0.18), rgba(255,255,255,0.05));
  border: 1px solid rgba(255,255,255,0.25);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
  color: white;
  flex-shrink: 0;
}
.btn-logout {
  background: rgba(255,255,255,0.08);
  color: white;
  border: 1px solid rgba(255,255,255,0.2);
  padding: 7px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.btn-logout:hover { background: rgba(255,255,255,0.18); border-color: rgba(255,255,255,0.35); }

/* ===== NAV STRIP ===== */
.nav-strip {
  background: rgba(0,0,0,0.18);
  border-top: 1px solid rgba(255,255,255,0.06);
}
.nav-strip-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 calc(16px + var(--safe-right)) 0 calc(16px + var(--safe-left));
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.nav-strip-inner::-webkit-scrollbar { display: none; }
.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  font-size: 12.5px;
  font-weight: 600;
  color: rgba(255,255,255,0.72);
  text-decoration: none;
  letter-spacing: 0.3px;
  white-space: nowrap;
  transition: color 0.15s;
  border-bottom: 2px solid transparent;
}
.nav-link:hover {
  color: white;
}
.nav-link.active {
  color: white;
  border-bottom-color: var(--gold);
}
.nav-link.active::before {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 8px;
  background: radial-gradient(50% 100% at 50% 100%, rgba(201,162,39,0.45), transparent 70%);
  pointer-events: none;
}
.nav-link .nav-ico {
  width: 16px; height: 16px;
  opacity: 0.9;
}

main {
  max-width: 1240px;
  margin: 0 auto;
  padding: 16px calc(16px + var(--safe-right)) calc(28px + var(--safe-bottom)) calc(16px + var(--safe-left));
}

/* ===== PAGE HEADER ===== */
.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.page-header .title-block {
  min-width: 0;
}
.page-header .eyebrow {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.page-header .eyebrow::before {
  content: '';
  display: inline-block;
  width: 14px; height: 2px;
  background: var(--gold);
  border-radius: 1px;
}
.page-header h1.page-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--ink);
  line-height: 1.15;
}
.page-header .page-subtitle {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
  max-width: 60ch;
}
.page-header .header-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ===== CARDS ===== */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--line);
  animation: card-in 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.card.compact { padding: 12px 14px; }
.card.glass {
  background: linear-gradient(180deg, rgba(255,255,255,0.95), rgba(255,255,255,0.85));
  backdrop-filter: blur(8px);
}
@keyframes card-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
main > *:nth-child(2)  { animation-delay: 0.04s; }
main > *:nth-child(3)  { animation-delay: 0.08s; }
main > *:nth-child(4)  { animation-delay: 0.12s; }
main > *:nth-child(5)  { animation-delay: 0.16s; }
main > *:nth-child(6)  { animation-delay: 0.20s; }
main > *:nth-child(7)  { animation-delay: 0.24s; }
@media (prefers-reduced-motion: reduce) {
  .card { animation: none; }
  main > * { animation: none !important; }
}

.card-title {
  font-size: 11px; font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}
.card-title::before {
  content: ''; width: 3px; height: 14px;
  background: var(--ink); border-radius: 2px;
}
.card-title.accent::before { background: var(--gold); }

/* ===== FIELDS ===== */
.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field label {
  font-size: 10px; font-weight: 700;
  color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.7px;
}
.field input, .field select, .field textarea {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 16px;
  background: var(--surface-2);
  color: var(--ink);
  font-family: inherit;
  transition: all 0.15s;
  width: 100%;
  min-height: 44px;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--ink);
  background: white;
  box-shadow: 0 0 0 3px rgba(15,30,54,0.08);
}
.field input::placeholder { color: var(--muted-2); }

/* ===== BADGES ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  background: var(--surface-2);
  color: var(--ink-2);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.7;
}
.badge.solid::before { display: none; }
.badge.success { background: var(--present-soft); color: #0a5d27; border-color: #b8e0c7; }
.badge.danger  { background: var(--absent-soft);  color: #951e25; border-color: #f0c8cb; }
.badge.warn    { background: var(--warn-soft);    color: #7a4a05; border-color: #ecd9a4; }
.badge.info    { background: var(--info-soft);    color: var(--info); border-color: #c4d6f0; }
.badge.muted   { background: var(--surface-2);    color: var(--muted); border-color: var(--line); }
.badge.dark    { background: var(--ink); color: white; border-color: transparent; }
.badge.gold    { background: var(--gold-soft); color: #6e570d; border-color: #ecd9a4; }

/* ===== TABS ===== */
.tabs-wrap {
  position: sticky;
  top: 0;
  z-index: 10;
  margin: -16px calc(-16px - var(--safe-right)) 14px calc(-16px - var(--safe-left));
  padding: 10px calc(16px + var(--safe-right)) 10px calc(16px + var(--safe-left));
  background: var(--bg);
  transition: box-shadow 0.2s;
}
.tabs-wrap.scrolled { box-shadow: 0 4px 14px rgba(15, 30, 54, 0.08); }
.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  background: var(--surface);
  padding: 4px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--line);
  max-width: 1208px;
  margin: 0 auto;
}
.tab {
  padding: 12px 6px;
  min-height: 48px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 7px;
  font-weight: 700;
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.8px;
  transition: all 0.2s;
  text-align: center;
  text-decoration: none;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.tab:hover { background: var(--surface-2); color: var(--ink); }
.tab.active {
  background: linear-gradient(180deg, var(--ink-2), var(--ink));
  color: white;
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255,255,255,0.08);
}
.tab .badge-num {
  display: block; font-size: 10px; opacity: 0.7;
  font-weight: 500; margin-top: 2px;
  letter-spacing: 0.3px;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
}
.tab.active .badge-num { opacity: 0.85; }
.tab .badge { display: block; font-size: 10px; opacity: 0.7; font-weight: 500; margin-top: 2px; letter-spacing: 0.3px; font-family: 'JetBrains Mono', 'Courier New', monospace; padding: 0; background: transparent; border: 0; color: inherit; }
.tab .badge::before { display: none; }
.tab.active .badge { opacity: 0.85; }

/* ===== LEGEND ===== */
.legend {
  display: flex; flex-wrap: wrap; gap: 10px 14px;
  padding: 10px 14px;
  background: var(--surface);
  border-radius: var(--radius);
  margin-bottom: 14px;
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.legend-item { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.legend-swatch {
  width: 14px; height: 14px;
  border-radius: 3px;
  border: 1px solid rgba(0,0,0,0.1);
  flex-shrink: 0;
}

/* ===== STATS ===== */
.stats {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.stat {
  background: var(--surface);
  padding: 12px 8px;
  border-radius: 9px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--line);
  border-top: 3px solid var(--ink);
  min-width: 0;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s, box-shadow 0.15s;
}
.stat:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.stat.present-stat { border-top-color: var(--present); }
.stat.absent-stat  { border-top-color: var(--absent); }
.stat.desligado-stat { border-top-color: var(--desligado); }
.stat.pending-stat { border-top-color: var(--pending); }
.stat.gold-stat    { border-top-color: var(--gold); }
.stat-value {
  font-size: 24px; font-weight: 800;
  line-height: 1;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  color: var(--ink);
  letter-spacing: -0.5px;
}
.stat-label {
  font-size: 9.5px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-top: 6px;
  font-weight: 600;
  line-height: 1.15;
}

/* ===== MOSAIC ===== */
.mosaic {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(74px, 1fr));
  gap: 6px;
}
.tile {
  aspect-ratio: 1;
  background: var(--pending);
  border: 2px solid transparent;
  border-radius: 8px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  font-weight: 800;
  font-size: 17px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  transition: transform 0.1s, background 0.15s, box-shadow 0.15s;
  position: relative;
  color: var(--ink);
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  letter-spacing: -0.5px;
  touch-action: manipulation;
  min-height: 44px;
}
@media (hover: hover) {
  .tile:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
}
.tile:active { transform: scale(0.94); }
.tile.presente { background: var(--present); color: white; box-shadow: 0 2px 6px rgba(27,138,60,0.3); }
.tile.falta    { background: var(--absent);  color: white; box-shadow: 0 2px 6px rgba(184,37,46,0.3); }
.tile.desligado { background: var(--desligado); color: rgba(255,255,255,0.85); }
.tile.desligado::after {
  content: '';
  position: absolute;
  top: 50%; left: 10%; right: 10%;
  height: 2px;
  background: white;
  transform: rotate(-25deg);
  opacity: 0.7;
}
.tile.dirty { box-shadow: 0 0 0 3px var(--gold); }
.obs-dot {
  position: absolute;
  top: 4px; right: 4px;
  width: 9px; height: 9px;
  background: var(--gold);
  border-radius: 50%;
  border: 1.5px solid white;
  box-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.longpress-feedback {
  position: absolute; inset: 0;
  border-radius: 8px;
  border: 3px solid var(--gold);
  opacity: 0;
  pointer-events: none;
  animation: pulse 0.5s ease-out;
}
@keyframes pulse {
  0% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.15); }
}

/* ===== MEMBERS LIST ===== */
.members-list {
  max-height: 420px;
  overflow-y: auto;
  padding-right: 4px;
  -webkit-overflow-scrolling: touch;
}
.members-list::-webkit-scrollbar { width: 6px; }
.members-list::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
.member {
  display: flex; align-items: center; gap: 10px;
  padding: 10px;
  border-radius: 7px;
  margin-bottom: 4px;
  border-left: 4px solid var(--pending);
  background: var(--surface-2);
  font-size: 13px;
  transition: background 0.15s, transform 0.1s;
  cursor: pointer;
  min-height: 52px;
}
.member:hover { background: white; }
.member:active { transform: scale(0.997); }
.member.presente  { border-left-color: var(--present); background: var(--present-soft); }
.member.falta     { border-left-color: var(--absent);  background: var(--absent-soft); }
.member.desligado { border-left-color: var(--desligado); opacity: 0.6; }
.member-num {
  font-weight: 800;
  min-width: 38px;
  text-align: center;
  padding: 4px 6px;
  background: white;
  border-radius: 4px;
  font-size: 11px;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  border: 1px solid var(--line);
  letter-spacing: -0.3px;
  flex-shrink: 0;
}
.member-info { flex: 1; min-width: 0; }
.member-name {
  font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 13px;
}
.member-meta {
  font-size: 10px;
  color: var(--muted);
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  letter-spacing: 0.3px;
  margin-top: 2px;
}
.member-obs {
  font-size: 11px;
  color: var(--ink-2);
  font-style: italic;
  margin-top: 4px;
  padding: 3px 7px;
  background: rgba(201,162,39,0.18);
  border-radius: 3px;
  display: inline-block;
}

/* ===== BUTTONS ===== */
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn {
  padding: 12px 18px;
  min-height: 44px;
  background: linear-gradient(180deg, var(--ink-2), var(--ink));
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  font-size: 13px;
  letter-spacing: 0.4px;
  transition: all 0.15s;
  font-family: inherit;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  touch-action: manipulation;
  box-shadow: 0 1px 0 rgba(255,255,255,0.06) inset, var(--shadow-sm);
}
.btn:hover { box-shadow: 0 1px 0 rgba(255,255,255,0.08) inset, var(--shadow-md); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.98); box-shadow: var(--shadow-sm); }
.btn-success { background: linear-gradient(180deg, #21a046, var(--present)); }
.btn-secondary {
  background: white;
  color: var(--ink);
  border: 1.5px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.btn-secondary:hover { background: var(--surface-2); border-color: var(--ink-3); }
.btn-danger { background: linear-gradient(180deg, #d12d36, var(--absent)); }
.btn-gold {
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  color: var(--ink);
  box-shadow: 0 4px 14px rgba(201,162,39,0.35), inset 0 -1px 0 rgba(0,0,0,0.12);
}
.btn-gold:hover { box-shadow: 0 6px 18px rgba(201,162,39,0.5), inset 0 -1px 0 rgba(0,0,0,0.12); }
.btn-sm { padding: 8px 12px; min-height: 36px; font-size: 11.5px; }
.btn-ghost {
  background: transparent;
  color: var(--ink-2);
  border: 1px solid transparent;
  box-shadow: none;
}
.btn-ghost:hover { background: var(--surface-2); border-color: var(--line); box-shadow: none; }

/* ===== DATA TABLE ===== */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table thead th {
  text-align: left;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  padding: 10px 10px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface-2), transparent);
}
.data-table tbody td {
  padding: 10px;
  border-bottom: 1px solid var(--line-2);
  vertical-align: middle;
}
.data-table tbody tr { transition: background 0.12s; }
.data-table tbody tr:hover { background: var(--surface-2); }
.data-table .num { font-family: 'JetBrains Mono', 'Courier New', monospace; }
.data-table .right { text-align: right; }
.data-table .muted { color: var(--muted); }

/* ===== REPORT ===== */
.report-output {
  background: linear-gradient(180deg, #0c1a31, #0f1e36);
  color: #e8ecf3;
  padding: 16px;
  border-radius: 9px;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 13px;
  white-space: pre-wrap;
  margin-bottom: 10px;
  line-height: 1.65;
  max-height: 500px;
  overflow-y: auto;
  border: 1px solid #1f3252;
  word-break: break-word;
  box-shadow: inset 0 0 24px rgba(0,0,0,0.25);
}
.report-output.empty { color: var(--muted); font-style: italic; }

/* ===== MODAL ===== */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(15,30,54,0.65);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center; justify-content: center;
  z-index: 1000;
  padding: 16px;
}
.modal-backdrop.active { display: flex; }
.modal {
  background: white;
  border-radius: 12px;
  padding: 20px;
  max-width: 440px;
  width: 100%;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: card-in 0.25s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.modal h3 { color: var(--ink); font-size: 17px; margin-bottom: 4px; }
.modal .modal-sub {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 14px;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  word-break: break-word;
  line-height: 1.4;
}
.status-buttons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}
.status-btn {
  padding: 12px 8px;
  min-height: 48px;
  border: 2px solid var(--line);
  background: var(--surface-2);
  border-radius: 7px;
  cursor: pointer;
  font-weight: 700;
  font-size: 12px;
  color: var(--muted);
  font-family: inherit;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.12s;
}
.status-btn:hover { background: white; border-color: var(--ink-3); }
.status-btn.selected[data-status="pendente"]  { border-color: var(--ink);       background: var(--ink);       color: white; }
.status-btn.selected[data-status="presente"]  { border-color: var(--present);   background: var(--present);   color: white; }
.status-btn.selected[data-status="falta"]     { border-color: var(--absent);    background: var(--absent);    color: white; }
.status-btn.selected[data-status="desligado"] { border-color: var(--desligado); background: var(--desligado); color: white; }
.modal textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1.5px solid var(--line);
  border-radius: 7px;
  font-family: inherit;
  font-size: 16px;
  resize: vertical;
  min-height: 90px;
  margin-bottom: 14px;
  background: var(--surface-2);
  color: var(--ink);
  line-height: 1.4;
}
.modal-buttons { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: calc(20px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(120px);
  background: var(--ink);
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 2000;
  font-size: 13px;
  border-left: 4px solid var(--gold);
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== FLASH ===== */
.flash {
  border-radius: 9px;
  padding: 11px 14px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid;
  animation: card-in 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.flash.success { background: var(--present-soft); border-color: #b8e0c7; color: #0a5d27; }
.flash.error   { background: var(--absent-soft);  border-color: #f0c8cb; color: #951e25; }
.flash.warn    { background: var(--warn-soft);    border-color: #ecd9a4; color: #7a4a05; }
.flash.info    { background: var(--info-soft);    border-color: #c4d6f0; color: var(--info); }
.flash .ico { font-size: 16px; flex-shrink: 0; }

/* ===== HINT & WARN ===== */
.hint { font-size: 11px; color: var(--muted); margin-top: 10px; font-style: italic; }
.warn-text {
  color: var(--absent);
  font-weight: 600;
  font-size: 12px;
  padding: 10px 12px;
  background: var(--absent-soft);
  border-radius: 6px;
  margin-top: 8px;
  display: none;
  line-height: 1.4;
}
.warn-text.show { display: block; }

/* ===== EMPTY STATE ===== */
.empty-state {
  padding: 36px 18px;
  text-align: center;
  color: var(--muted);
}
.empty-state .ico {
  font-size: 32px;
  margin-bottom: 8px;
  opacity: 0.5;
}
.empty-state .title {
  font-weight: 700;
  font-size: 14px;
  color: var(--ink-2);
  margin-bottom: 4px;
}
.empty-state .desc {
  font-size: 12.5px;
  max-width: 40ch;
  margin: 0 auto;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 800px) {
  .stats { grid-template-columns: repeat(3, 1fr); }
  .page-header h1.page-title { font-size: 19px; }
}
@media (max-width: 600px) {
  main { padding: 12px; }
  .card { padding: 14px; }
  .mosaic { grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); }
  .tile { font-size: 13px; }
  .field-grid { grid-template-columns: repeat(2, 1fr); }
  .brand-row { padding: 10px 14px; }
  .brand-text h1 { font-size: 13.5px; }
  .brand-text .sub { font-size: 10px; }
  .user-cluster .who { display: none; }
  .nav-link { padding: 10px 12px; font-size: 12px; }
}
@media (max-width: 400px) {
  .stats { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .mosaic { grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 4px; }
  .tile { font-size: 12px; }
  .tab { font-size: 12px; }
  .btn-logout { padding: 6px 10px; font-size: 10.5px; }
}

/* ===== PRINT ===== */
@media print {
  body { background: white; color: black; }
  header.app-header, .nav-strip, .tabs-wrap, .legend, .stats, .btn-row, .card-title,
  .modal-backdrop, .toast, .members-list, .mosaic, .hint, .warn-text,
  .card:not(.card-report) { display: none !important; }
  .report-output { background: white !important; color: black !important; border: none; max-height: none; }
}
