/* =====================================================================
   Sistema de Limpeza da Capela — Design System
   Palette: deep navy + sky blue + warm white, with per-group accent chips
   Type: Fraunces (display) + Inter (UI) + IBM Plex Mono (data/timestamps)
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600;9..144,700&family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  /* Color */
  --navy-900: #0F2A47;
  --navy-800: #163854;
  --navy-700: #1E3F66;
  --blue-500: #3B7DD8;
  --blue-100: #E8F1FC;
  --sky-50: #F5F9FF;
  --white: #FFFFFF;
  --slate-700: #3B4A5A;
  --slate-500: #64758A;
  --slate-400: #8A97A8;
  --border: #E1E8F0;
  --green-600: #2F9E6E;
  --green-100: #E4F6EE;
  --amber-500: #D9A441;
  --amber-100: #FBF1DD;
  --red-500: #D14343;
  --red-100: #FBE7E7;

  /* Group signature accents (assigned round-robin to new groups) */
  --accent-teal: #1E8F84;
  --accent-terracotta: #C1653B;
  --accent-plum: #7C5AA6;
  --accent-forest: #3E7A3F;
  --accent-gold: #B8862F;
  --accent-slateblue: #4A5FA6;

  /* Type */
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'IBM Plex Mono', 'Courier New', monospace;

  /* Shape & elevation */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(15, 42, 71, 0.06), 0 1px 3px rgba(15, 42, 71, 0.08);
  --shadow-md: 0 4px 12px rgba(15, 42, 71, 0.08), 0 2px 4px rgba(15, 42, 71, 0.06);
  --shadow-lg: 0 12px 32px rgba(15, 42, 71, 0.12);

  --sidebar-width: 264px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--sky-50);
  color: var(--slate-700);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .display {
  font-family: var(--font-display);
  color: var(--navy-900);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 4px;
}

a { color: var(--blue-500); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 3px solid var(--blue-500);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ---------------------------------------------------------------------
   Guest layout (login screen)
   --------------------------------------------------------------------- */
.guest-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 15% 15%, rgba(59,125,216,0.16), transparent 45%),
    radial-gradient(circle at 85% 85%, rgba(15,42,71,0.10), transparent 45%),
    var(--sky-50);
  padding: 24px;
}

.guest-card {
  width: 100%;
  max-width: 400px;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 40px 36px;
  border: 1px solid var(--border);
}

.guest-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.guest-brand-mark {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--navy-700), var(--blue-500));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
}

.guest-brand-name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--navy-900);
  line-height: 1.2;
}

.guest-title {
  font-size: 24px;
  margin-bottom: 4px;
}

.guest-subtitle {
  color: var(--slate-500);
  font-size: 14px;
  margin-bottom: 24px;
}

/* ---------------------------------------------------------------------
   Authenticated app layout
   --------------------------------------------------------------------- */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  background: var(--navy-900);
  color: #CBD9EA;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  z-index: 40;
  transition: transform 0.2s ease;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-brand-mark {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--blue-500), var(--accent-teal));
  flex-shrink: 0;
}

.sidebar-brand-name {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: white;
  line-height: 1.25;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: #AFC2DA;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 2px;
  transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-link:hover { background: rgba(255,255,255,0.06); color: white; text-decoration: none; }

.sidebar-link.active {
  background: rgba(59,125,216,0.22);
  color: white;
}

.sidebar-link svg { flex-shrink: 0; width: 18px; height: 18px; }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 13px;
  color: #8DA0BC;
}

.main {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 68px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 30;
}

.topbar-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--navy-900);
}

.breadcrumb {
  font-size: 13px;
  color: var(--slate-500);
}

.breadcrumb strong { color: var(--navy-900); }

.topbar-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--blue-100);
  color: var(--navy-700);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600;
  font-size: 13px;
}

.content {
  padding: 28px;
  flex: 1;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-header p {
  color: var(--slate-500);
  margin: 6px 0 0;
  font-size: 14px;
}

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .main { margin-left: 0; }
  .topbar-menu-btn { display: inline-flex; }
  .content { padding: 18px; }
}

/* ---------------------------------------------------------------------
   Components
   --------------------------------------------------------------------- */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 22px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 20px 22px;
}

.stat-card .stat-label {
  font-size: 13px;
  color: var(--slate-500);
  font-weight: 500;
  margin-bottom: 8px;
}

.stat-card .stat-value {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 600;
  color: var(--navy-900);
}

.stat-card .stat-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--blue-100);
  color: var(--navy-700);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--navy-700); color: white; }
.btn-primary:hover { background: var(--navy-900); }

.btn-secondary { background: var(--blue-100); color: var(--navy-700); }
.btn-secondary:hover { background: #DAEAFB; }

.btn-danger { background: var(--red-100); color: var(--red-500); }
.btn-danger:hover { background: #F7D6D6; }

.btn-ghost { background: transparent; color: var(--slate-500); }
.btn-ghost:hover { background: var(--blue-100); color: var(--navy-700); }

.btn-block { width: 100%; justify-content: center; }

.form-group { margin-bottom: 18px; }

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy-900);
  margin-bottom: 6px;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--slate-700);
  background: var(--white);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(59,125,216,0.15);
}

.form-hint { font-size: 12.5px; color: var(--slate-400); margin-top: 6px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
}

.badge-success { background: var(--green-100); color: var(--green-600); }
.badge-warning { background: var(--amber-100); color: var(--amber-500); }
.badge-danger  { background: var(--red-100); color: var(--red-500); }
.badge-neutral { background: var(--blue-100); color: var(--navy-700); }

.group-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 11px 4px 8px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  background: var(--sky-50);
  border: 1px solid var(--border);
}

.group-chip .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

.table-wrap {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

table { width: 100%; border-collapse: collapse; font-size: 14px; }

thead th {
  text-align: left;
  padding: 13px 18px;
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--slate-500);
  background: var(--sky-50);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}

tbody td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  color: var(--slate-700);
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--sky-50); }

.mono { font-family: var(--font-mono); font-size: 13px; color: var(--slate-500); }

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--slate-500);
}

.empty-state svg { margin-bottom: 14px; color: var(--slate-400); }
.empty-state h3 { color: var(--navy-900); font-size: 17px; margin-bottom: 6px; }
.empty-state p { font-size: 14px; margin: 0; }

/* Toasts */
.toast-stack {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 360px;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-size: 13.5px;
  font-weight: 500;
  animation: toast-in 0.25s ease;
  background: white;
  border-left: 4px solid var(--blue-500);
}

.toast-success { border-left-color: var(--green-600); }
.toast-error { border-left-color: var(--red-500); }
.toast-warning { border-left-color: var(--amber-500); }

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

.error-list {
  background: var(--red-100);
  color: var(--red-500);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 13.5px;
  margin-bottom: 18px;
}
