/* ============================================================
   🎨  SISTEMA DE GESTÃO — ESTILOS
   Tema: Dark Industrial · Syne + DM Sans
   ============================================================ */

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

:root {
  /* Cores principais */
  --bg-base:        #0d0f14;
  --bg-panel:       #13161e;
  --bg-card:        #1a1e28;
  --bg-card-hover:  #1f2435;
  --bg-input:       #10131a;
  --border:         #252b3b;
  --border-light:   #2e3548;

  /* Texto */
  --text-primary:   #e8ecf4;
  --text-secondary: #8892a8;
  --text-muted:     #55617a;

  /* Accent */
  --accent:         #4f8ef7;
  --accent-hover:   #6ba3ff;
  --accent-glow:    rgba(79,142,247,.15);
  --accent-dim:     rgba(79,142,247,.08);

  /* Estados */
  --success:        #34d399;
  --success-bg:     rgba(52,211,153,.1);
  --danger:         #f87171;
  --danger-bg:      rgba(248,113,113,.1);
  --warning:        #fbbf24;

  /* Layout */
  --sidebar-w:      240px;
  --sidebar-collapsed: 0px;
  --topbar-h:       60px;
  --radius:         10px;
  --radius-sm:      6px;
  --radius-lg:      16px;

  /* Sombras */
  --shadow-sm:  0 1px 3px rgba(0,0,0,.4);
  --shadow-md:  0 4px 16px rgba(0,0,0,.5);
  --shadow-lg:  0 8px 32px rgba(0,0,0,.6);

  /* Transições */
  --t-fast: .15s ease;
  --t-mid:  .25s ease;
  --t-slow: .4s ease;
}

html { font-size: 15px; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.55;
  overflow-x: hidden;
}

/* ── UTILITÁRIOS ── */
.hidden { display: none !important; }

/* ============================================================
   🔐  TELA DE LOGIN
   ============================================================ */

.login-screen {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  overflow: hidden;
}

/* Grid de fundo */
.login-bg-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: .4;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 30%, transparent 100%);
}

/* Glow de fundo */
.login-glow {
  position: absolute;
  width: 600px; height: 600px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.login-card {
  position: relative;
  background: var(--bg-panel);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 48px 44px;
  width: 420px;
  max-width: 92vw;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255,255,255,.03);
  animation: cardIn .5s cubic-bezier(.22,1,.36,1) both;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(24px) scale(.97); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}

.login-brand {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 32px;
}

.brand-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  animation: pulse 2.5s ease-in-out infinite;
}

@keyframes pulse {
  0%,100% { box-shadow: 0 0 6px var(--accent); }
  50%      { box-shadow: 0 0 18px var(--accent); }
}

.brand-name {
  font-family: 'Syne', sans-serif;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .2em;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.login-title {
  font-family: 'Syne', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.login-title em {
  font-style: italic;
  color: var(--accent);
  font-weight: 400;
}

.login-sub {
  font-size: .85rem;
  color: var(--text-muted);
  margin-bottom: 32px;
}

.login-error {
  background: var(--danger-bg);
  border: 1px solid var(--danger);
  color: var(--danger);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: .82rem;
  margin-bottom: 16px;
}

/* ============================================================
   📝  FORM ELEMENTS
   ============================================================ */

.form-group {
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.form-group label {
  font-size: .78rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: .05em;
  text-transform: uppercase;
}

.form-group input,
.form-group textarea,
.form-group select {
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: 'DM Sans', sans-serif;
  font-size: .9rem;
  padding: 10px 14px;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  outline: none;
  width: 100%;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

/* ── Input date/time color fix ── */
input[type="date"], input[type="time"] {
  color-scheme: dark;
}

/* ── BOTÕES ── */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--accent);
  color: #fff;
  border: none; cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: .9rem; font-weight: 500;
  padding: 11px 22px;
  border-radius: var(--radius-sm);
  width: 100%;
  transition: background var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
  margin-top: 8px;
}

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 16px rgba(79,142,247,.35);
  transform: translateY(-1px);
}

.btn-primary:active { transform: translateY(0); }

.btn-primary.small { width: auto; padding: 8px 18px; font-size: .82rem; margin-top: 0; }

.btn-secondary {
  display: inline-flex; align-items: center; gap: 7px;
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: .82rem; font-weight: 500;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  transition: all var(--t-fast);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

.btn-secondary svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; }

.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: transparent; border: 1px solid var(--border);
  color: var(--text-secondary); cursor: pointer;
  font-family: 'DM Sans', sans-serif; font-size: .82rem;
  padding: 8px 16px; border-radius: var(--radius-sm);
  transition: all var(--t-fast);
}

.btn-ghost:hover { border-color: var(--border-light); color: var(--text-primary); }
.btn-ghost.small { padding: 7px 14px; }

.btn-danger {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--danger-bg); border: 1px solid var(--danger);
  color: var(--danger); cursor: pointer;
  font-family: 'DM Sans', sans-serif; font-size: .82rem; font-weight: 500;
  padding: 8px 18px; border-radius: var(--radius-sm);
  transition: all var(--t-fast);
}

.btn-danger:hover { background: rgba(248,113,113,.2); }
.btn-danger.small { padding: 7px 14px; }

/* SVG ícones globais */
svg { display: block; }
button svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ============================================================
   🖥️  LAYOUT DO APP
   ============================================================ */

.app {
  display: flex;
  min-height: 100vh;
}

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0; top: 0; bottom: 0;
  z-index: 200;
  transition: transform var(--t-mid);
}

.sidebar.collapsed {
  transform: translateX(-100%);
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 20px 22px;
  border-bottom: 1px solid var(--border);
}

.sidebar-brand {
  font-family: 'Syne', sans-serif;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .2em;
  color: var(--text-secondary);
  flex: 1;
}

.btn-toggle-sidebar {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 1.4rem; line-height: 1;
  padding: 2px 4px;
  transition: color var(--t-fast);
}

.btn-toggle-sidebar:hover { color: var(--text-primary); }

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-section-label {
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 10px 10px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: none; border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: .88rem;
  font-weight: 400;
  text-align: left;
  width: 100%;
  transition: all var(--t-fast);
}

.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.nav-item:hover { background: var(--bg-card); color: var(--text-primary); }

.nav-item.active {
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 500;
}

.nav-item.active svg { stroke: var(--accent); }

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: .85rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.user-info {
  display: flex; flex-direction: column; min-width: 0;
}

.user-name {
  font-size: .85rem;
  font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.user-role {
  font-size: .72rem;
  color: var(--text-muted);
}

.btn-logout {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted);
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: all var(--t-fast);
  flex-shrink: 0;
}

.btn-logout:hover { color: var(--danger); background: var(--danger-bg); }
.btn-logout svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ── MAIN CONTENT ── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left var(--t-mid);
}

.main-content.full-width {
  margin-left: 0;
}

/* ── TOPBAR ── */
.topbar {
  height: var(--topbar-h);
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky; top: 0; z-index: 100;
}

.btn-menu {
  background: none; border: none; cursor: pointer;
  color: var(--text-secondary);
  padding: 6px;
  border-radius: var(--radius-sm);
  display: none;
  transition: color var(--t-fast);
}

.btn-menu:hover { color: var(--text-primary); }
.btn-menu svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; }

.topbar-title {
  font-family: 'Syne', sans-serif;
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: .05em;
  color: var(--text-primary);
}

.topbar-spacer { flex: 1; }

/* ============================================================
   📋  VIEWS
   ============================================================ */

.view { display: none; padding: 32px 28px; animation: viewIn .3s ease both; }
.view.active { display: block; }

@keyframes viewIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.section-title {
  font-family: 'Syne', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.section-desc {
  font-size: .8rem;
  color: var(--text-muted);
  letter-spacing: .02em;
}

/* ── STATS ── */
.stats-row {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 22px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 140px;
}

.stat-value {
  font-family: 'Syne', sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--accent);
}

.stat-label {
  font-size: .75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
}

/* ── ESTADOS ── */
.loading-state, .empty-state, .error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 60px 20px;
  color: var(--text-muted);
  font-size: .9rem;
}

.loading-state svg, .empty-state svg, .error-state svg {
  width: 36px; height: 36px; stroke: currentColor; fill: none; stroke-width: 1.5;
  opacity: .5;
}

.error-state { color: var(--danger); }
.error-state svg { opacity: .8; }

.spinner {
  width: 28px; height: 28px;
  border: 2px solid var(--border-light);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── SEARCH BAR ── */
.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  margin-bottom: 16px;
  transition: border-color var(--t-fast);
}

.search-bar:focus-within { border-color: var(--accent); }

.search-bar svg { width: 15px; height: 15px; stroke: var(--text-muted); fill: none; stroke-width: 2; flex-shrink: 0; }

.search-bar input {
  background: none; border: none; outline: none;
  color: var(--text-primary);
  font-family: 'DM Sans', sans-serif;
  font-size: .88rem;
  width: 100%;
}

.search-bar input::placeholder { color: var(--text-muted); }

/* ── TABELA ── */
.table-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table thead {
  background: var(--bg-base);
}

.data-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table td {
  padding: 13px 16px;
  font-size: .85rem;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  max-width: 220px;
}

.data-table tbody tr:last-child td { border-bottom: none; }

.data-table tbody tr {
  transition: background var(--t-fast);
}

.data-table tbody tr:hover { background: var(--bg-card-hover); }

.data-table td .cell-sub {
  font-size: .75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Coluna mensagem truncada */
.msg-cell {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  transition: color var(--t-fast);
}

.msg-cell:hover { color: var(--accent); white-space: normal; }

.table-footer {
  padding: 12px 16px;
  font-size: .78rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  background: var(--bg-base);
}

/* ── BADGES ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .04em;
}

.badge-blue { background: var(--accent-dim); color: var(--accent); border: 1px solid rgba(79,142,247,.2); }
.badge-green { background: var(--success-bg); color: var(--success); border: 1px solid rgba(52,211,153,.2); }

/* ── CARD FORM ── */
.card-form {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 28px;
  animation: viewIn .2s ease both;
}

.form-title {
  font-family: 'Syne', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 22px;
  color: var(--text-primary);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-grid .full-width { grid-column: 1 / -1; }

.form-grid .form-group { margin-bottom: 0; }

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}

/* ── FEEDBACK ── */
.feedback {
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: .82rem;
}

.feedback.success {
  background: var(--success-bg);
  border: 1px solid var(--success);
  color: var(--success);
}

.feedback.error {
  background: var(--danger-bg);
  border: 1px solid var(--danger);
  color: var(--danger);
}

/* ============================================================
   📅  EVENTOS
   ============================================================ */

.eventos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 16px;
}

.evento-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  animation: viewIn .2s ease both;
  transition: border-color var(--t-fast), transform var(--t-fast);
}

.evento-card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
}

.evento-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 100%;
  background: var(--accent);
  border-radius: 3px 0 0 3px;
}

.evento-nome {
  font-family: 'Syne', sans-serif;
  font-size: .95rem;
  font-weight: 700;
  margin-bottom: 10px;
  padding-right: 32px;
}

.evento-meta {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 12px;
}

.evento-meta-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: .78rem;
  color: var(--text-secondary);
}

.evento-meta-item svg { width: 12px; height: 12px; stroke: var(--text-muted); fill: none; stroke-width: 2; flex-shrink: 0; }

.evento-desc {
  font-size: .82rem;
  color: var(--text-muted);
  line-height: 1.5;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.btn-delete-evento {
  position: absolute;
  top: 14px; right: 14px;
  background: none; border: none; cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: all var(--t-fast);
}

.btn-delete-evento:hover { color: var(--danger); background: var(--danger-bg); }
.btn-delete-evento svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }

/* ============================================================
   👤  FUNCIONÁRIOS
   ============================================================ */

.func-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.func-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  animation: viewIn .2s ease both;
  transition: border-color var(--t-fast);
}

.func-card:hover { border-color: var(--border-light); }

.func-avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--bg-base);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  font-family: 'Syne', sans-serif;
  font-weight: 700; font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.func-info { flex: 1; min-width: 0; }

.func-name {
  font-size: .9rem;
  font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.func-user {
  font-size: .75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.btn-delete-func {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); padding: 5px;
  border-radius: var(--radius-sm);
  transition: all var(--t-fast);
  flex-shrink: 0;
}

.btn-delete-func:hover { color: var(--danger); background: var(--danger-bg); }
.btn-delete-func svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }

/* ============================================================
   🪟  MODAL
   ============================================================ */

.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 500;
  animation: fadeIn .2s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-box {
  background: var(--bg-panel);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 380px;
  max-width: 90vw;
  box-shadow: var(--shadow-lg);
  animation: cardIn .25s cubic-bezier(.22,1,.36,1) both;
}

.modal-title {
  font-family: 'Syne', sans-serif;
  font-size: 1.05rem; font-weight: 700;
  margin-bottom: 10px;
}

.modal-msg {
  font-size: .88rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
  line-height: 1.5;
}

.modal-actions { display: flex; gap: 10px; }

/* ============================================================
   📱  RESPONSIVIDADE
   ============================================================ */

/* ── STATUS CLIENTES ── */

.status-wrapper {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 130px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .04em;
  white-space: nowrap;
}

.status-aguardando { background: rgba(251,191,36,.12); color: #fbbf24; border: 1px solid rgba(251,191,36,.3); }
.status-andamento  { background: rgba(79,142,247,.12);  color: #4f8ef7; border: 1px solid rgba(79,142,247,.3); }
.status-atendido   { background: rgba(52,211,153,.12);  color: #34d399; border: 1px solid rgba(52,211,153,.3); }

.status-select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: 'DM Sans', sans-serif;
  font-size: .75rem;
  padding: 4px 7px;
  cursor: pointer;
  outline: none;
  transition: border-color var(--t-fast);
  width: 100%;
}

.status-select:focus { border-color: var(--accent); }

/* Cor das stats por status */
.stat-aguardando .stat-value { color: var(--warning); }
.stat-andamento  .stat-value { color: var(--accent); }
.stat-atendido   .stat-value { color: var(--success); }

/* ── TABELA — scroll horizontal no mobile ── */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ============================================================
   📱  RESPONSIVIDADE MELHORADA
   ============================================================ */

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: 280px;
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

  .main-content {
    margin-left: 0 !important;
  }

  .btn-menu { display: flex !important; }
  .btn-toggle-sidebar { display: none; }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .view { padding: 16px 14px; }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .section-title { font-size: 1.25rem; }

  /* Stats em grade 2x no mobile */
  .stats-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .stat-card { padding: 12px 14px; }
  .stat-value { font-size: 1.3rem; }

  /* Tabela: esconder colunas menos críticas */
  .data-table th:nth-child(4),
  .data-table td:nth-child(4),
  .data-table th:nth-child(5),
  .data-table td:nth-child(5) { display: none; }

  /* Status select menor */
  .status-wrapper { min-width: 110px; }

  /* Cards de evento em coluna única */
  .eventos-grid { grid-template-columns: 1fr; }
  .func-grid    { grid-template-columns: 1fr; }

  /* Topbar */
  .topbar { padding: 0 14px; gap: 10px; }
  .topbar-title { font-size: .85rem; }

  /* Login */
  .login-card { padding: 32px 22px; }
  .login-title { font-size: 1.7rem; }

  /* Formulários de card */
  .card-form { padding: 18px; }
  .form-actions { flex-wrap: wrap; }

  /* Modal */
  .modal-box { padding: 24px 20px; }
}

@media (max-width: 420px) {
  .stats-row { grid-template-columns: 1fr; }

  .data-table th:nth-child(3),
  .data-table td:nth-child(3) { display: none; }

  .login-title { font-size: 1.45rem; }

  .view { padding: 12px 10px; }
}

/* ── Overlay para fechar sidebar no mobile ── */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 150;
}

.sidebar-overlay.active { display: block; }
/* ============================================================
   🟢  NOVOS BOTÕES: STATUS E PRESENÇA (LOCALSTORAGE)
   ============================================================ */

.status-buttons {
  display: flex; gap: 6px; flex-wrap: wrap; min-width: 200px;
}

.btn-status {
  background: var(--bg-input); border: 1px solid var(--border); color: var(--text-muted);
  border-radius: 6px; padding: 6px 10px; font-size: .75rem; font-weight: 600;
  cursor: pointer; transition: all var(--t-fast);
}

.btn-status:hover { filter: brightness(1.2); }
.btn-status.pendente.active { background: rgba(251,191,36,.15); color: #fbbf24; border-color: #fbbf24; }
.btn-status.atendido.active { background: rgba(52,211,153,.15); color: #34d399; border-color: #34d399; }
.btn-status.nao-atendido.active { background: rgba(248,113,113,.15); color: #f87171; border-color: #f87171; }

.rsvp-actions {
  display: flex; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border);
}

.btn-rsvp {
  background: var(--bg-input); border: 1px solid var(--border); color: var(--text-primary);
  border-radius: var(--radius-sm); padding: 8px 14px; font-size: .8rem; font-weight: 500;
  cursor: pointer; transition: all var(--t-fast); flex: 1;
}

.btn-rsvp:hover { filter: brightness(1.2); }
.btn-rsvp.vou.active { background: rgba(52,211,153,.15); border-color: #34d399; color: #34d399; }
.btn-rsvp.nao-vou.active { background: rgba(248,113,113,.15); border-color: #f87171; color: #f87171; }

.card-actions { position: absolute; top: 14px; right: 14px; display: flex; gap: 4px; }
.btn-icon { background: none; border: none; cursor: pointer; color: var(--text-muted); padding: 4px; border-radius: var(--radius-sm); transition: all var(--t-fast); }
.btn-icon:hover { color: var(--text-primary); background: var(--bg-card-hover); }
.btn-icon.danger:hover { color: var(--danger); background: var(--danger-bg); }
.btn-icon svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }

/* ... (mantenha seu CSS original e adicione/substitua estas partes no final) ... */

.admin-only.hidden { display: none !important; }

/* Botões de Status na Tabela */
.status-buttons { display: flex; gap: 4px; }
.btn-status {
  border: 1px solid var(--border); background: var(--bg-input);
  cursor: pointer; padding: 5px; border-radius: 4px; font-size: 14px;
  transition: all 0.2s; opacity: 0.4;
}
.btn-status:hover { opacity: 1; }
.btn-status.active { opacity: 1; transform: scale(1.1); }
.btn-status.pendente.active { border-color: #fbbf24; background: rgba(251,191,36,0.1); }
.btn-status.atendido.active { border-color: #34d399; background: rgba(52,211,153,0.1); }
.btn-status.nao-atendido.active { border-color: #f87171; background: rgba(248,113,113,0.1); }

/* RSVP Eventos */
.rsvp-actions { display: flex; gap: 8px; margin-top: 15px; border-top: 1px solid var(--border); padding-top: 10px; }
.btn-rsvp {
  flex: 1; padding: 8px; border-radius: 6px; cursor: pointer; border: 1px solid var(--border);
  background: var(--bg-input); color: var(--text-secondary); transition: 0.2s;
}
.btn-rsvp.active.vou { background: #34d39920; border-color: #34d399; color: #34d399; }
.btn-rsvp.active.nao-vou { background: #f8717120; border-color: #f87171; color: #f87171; }

/* Card Actions (Edit/Delete) */
.card-actions { position: absolute; top: 10px; right: 10px; display: flex; gap: 5px; }
.btn-icon { background: none; border: none; cursor: pointer; color: var(--text-muted); }
.btn-icon:hover { color: var(--text-primary); }