/* ============================================================
   MB GAMES — Design System Global (Light Mode - Branco / Cinza Claro)
   Identidade Visual: Laranja Vibrante MB GAMES, Branco Puro e Cinza Claro Elegante
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@500;600;700&family=Inter:wght@300;400;500;600;700&family=Orbitron:wght@600;700;800;900&display=swap');

:root {
  /* ── Paleta Oficial MB GAMES ── */
  --brand-orange:       #ff6600;
  --brand-orange-light: #ff8533;
  --brand-orange-dark:  #e05500;
  --brand-orange-glow:  rgba(255, 102, 0, 0.25);
  
  --brand-white:        #ffffff;
  --brand-white-muted:  #f8fafc;
  
  /* Status Colors */
  --status-working:     #059669;
  --status-working-bg:  rgba(5, 150, 105, 0.1);
  --status-lunch:       #d97706;
  --status-lunch-bg:    rgba(217, 119, 6, 0.1);
  --status-away:        #dc2626;
  --status-away-bg:     rgba(220, 38, 38, 0.1);
  --status-absent:      #64748b;

  /* Light Theme Surfaces (Branco meio cinza claro) */
  --bg-main:            #f1f5f9;
  --bg-card:            #ffffff;
  --bg-card-hover:      #f8fafc;
  --bg-input:           #ffffff;
  --bg-header:          rgba(255, 255, 255, 0.95);

  /* Borders */
  --border-subtle:      #e2e8f0;
  --border-card:        #e2e8f0;
  --border-focus:       #ff6600;
  --border-active:      rgba(255, 102, 0, 0.5);

  /* Text Colors */
  --text-white:         #0f172a;
  --text-heading:       #0f172a;
  --text-main:          #1e293b;
  --text-muted:         #64748b;
  --text-dim:           #94a3b8;
  --text-orange:        #ff6600;

  /* Typography */
  --font-brand:         'Orbitron', sans-serif;
  --font-heading:       'Rajdhani', sans-serif;
  --font-body:          'Inter', sans-serif;

  /* Shadows */
  --shadow-card:        0 4px 20px -2px rgba(0, 0, 0, 0.05), 0 2px 6px -1px rgba(0, 0, 0, 0.03);
  --shadow-glow:        0 4px 20px rgba(255, 102, 0, 0.18);
  --shadow-btn:         0 4px 14px rgba(255, 102, 0, 0.3);

  /* Radii */
  --radius-sm:          6px;
  --radius-md:          12px;
  --radius-lg:          18px;
  --radius-full:        9999px;

  /* Touch & Safe Areas */
  --touch-target:       48px;
  --safe-top:           env(safe-area-inset-top, 0px);
  --safe-bottom:        env(safe-area-inset-bottom, 0px);
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  min-height: 100dvh;
  line-height: 1.5;
  overflow-x: hidden;
}

/* Background com sutil gradiente laranja suave */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: 
    radial-gradient(circle at 50% -10%, rgba(255, 102, 0, 0.07) 0%, transparent 60%),
    radial-gradient(circle at 80% 90%, rgba(255, 102, 0, 0.04) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-main); }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--brand-orange); }

/* ── Typography ── */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text-heading);
  letter-spacing: 0.5px;
}

/* ── Avatares (Tamanhos Rigorosos) ── */
.avatar {
  width: 42px !important;
  height: 42px !important;
  min-width: 42px !important;
  max-width: 42px !important;
  min-height: 42px !important;
  max-height: 42px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  background: #e2e8f0;
  border: 2px solid var(--border-card);
  display: inline-block;
  flex-shrink: 0;
}

.avatar-sm {
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  max-width: 36px !important;
  min-height: 36px !important;
  max-height: 36px !important;
}

.avatar-md {
  width: 48px !important;
  height: 48px !important;
  min-width: 48px !important;
  max-width: 48px !important;
  min-height: 48px !important;
  max-height: 48px !important;
}

.avatar-lg {
  width: 64px !important;
  height: 64px !important;
  min-width: 64px !important;
  max-width: 64px !important;
  min-height: 64px !important;
  max-height: 64px !important;
}

/* ── Cards ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  border-color: var(--border-active);
  box-shadow: 0 8px 30px -4px rgba(0, 0, 0, 0.08);
}

/* ── Botões ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: var(--touch-target);
  padding: 0.8rem 1.5rem;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.75px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand-orange) 0%, var(--brand-orange-dark) 100%);
  color: #ffffff !important;
  box-shadow: var(--shadow-btn);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--brand-orange-light) 0%, var(--brand-orange) 100%);
  box-shadow: 0 6px 20px rgba(255, 102, 0, 0.45);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-secondary {
  background: #ffffff;
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.btn-secondary:hover {
  background: #fffaf5;
  border-color: var(--brand-orange);
  color: var(--brand-orange);
}

.btn-danger {
  background: #fee2e2;
  color: #dc2626;
  border: 1px solid #fca5a5;
}

.btn-danger:hover {
  background: #dc2626;
  color: #ffffff;
}

.btn-sm {
  min-height: 38px;
  padding: 0.4rem 1rem;
  font-size: 0.88rem;
}

.btn-full { width: 100%; }

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* ── Formulários e Inputs ── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-label {
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.form-input, .form-select, .form-textarea {
  background: var(--bg-input);
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-md);
  color: var(--text-heading);
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.85rem 1rem;
  min-height: var(--touch-target);
  width: 100%;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--brand-orange);
  box-shadow: 0 0 0 3px rgba(255, 102, 0, 0.15);
}

.form-input::placeholder { color: var(--text-dim); }
.form-select { cursor: pointer; }
.form-select option { background: #ffffff; color: var(--text-heading); }

/* Checkboxes Customizados */
.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  accent-color: var(--brand-orange);
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.checkbox-label span {
  transition: color 0.15s ease;
}

.checkbox-label:hover span {
  color: var(--text-heading);
}

/* ── Badges de Status ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  font-family: var(--font-heading);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.badge-working { background: var(--status-working-bg); color: var(--status-working); border: 1px solid rgba(5, 150, 105, 0.25); }
.badge-lunch   { background: var(--status-lunch-bg);   color: var(--status-lunch);   border: 1px solid rgba(217, 119, 6, 0.25); }
.badge-away    { background: var(--status-away-bg);    color: var(--status-away);    border: 1px solid rgba(220, 38, 38, 0.25); }
.badge-absent  { background: #f1f5f9; color: #64748b; border: 1px solid #cbd5e1; }

/* Indicadores de bolinha */
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-green  { background: var(--status-working); box-shadow: 0 0 8px rgba(5, 150, 105, 0.4); }
.dot-yellow { background: var(--status-lunch);   box-shadow: 0 0 8px rgba(217, 119, 6, 0.4); }
.dot-red    { background: var(--status-away); }
.dot-gray   { background: var(--status-absent); }

/* ── Navbar ── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-header);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
  padding: 0.75rem 1.25rem;
  padding-top: calc(0.75rem + var(--safe-top));
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-logo {
  height: 38px;
  width: auto;
  object-fit: contain;
}

.nav-title {
  font-family: var(--font-brand);
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-heading);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.nav-title span {
  color: var(--brand-orange);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* ── Bottom Navigation (Mobile) ── */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 200;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-subtle);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.04);
  display: none;
  align-items: center;
  justify-content: space-around;
  padding: 0.35rem 0.1rem;
  padding-bottom: calc(0.35rem + var(--safe-bottom));
}

.bottom-nav-item {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.18rem;
  padding: 0.35rem 0.1rem;
  background: none;
  border: none;
  color: var(--text-dim);
  font-family: var(--font-heading);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  text-transform: uppercase;
  text-decoration: none;
  min-height: var(--touch-target);
  transition: color 0.15s ease, transform 0.1s ease;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bottom-nav-item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.bottom-nav-item.active {
  color: var(--brand-orange);
  font-weight: 800;
}

@media (max-width: 768px) {
  .bottom-nav { display: flex; }
  .navbar-hide-mobile { display: none !important; }
}

/* ── Modais ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow: hidden;
}

.modal {
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  max-height: calc(100dvh - 2rem);
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

.modal-header {
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.modal-footer {
  padding: 1rem 1.5rem;
  background: #f8fafc;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  gap: 0.75rem;
  flex-shrink: 0;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 0.3rem;
  line-height: 1;
}

.modal-close:hover { color: var(--text-heading); }

/* ── Toasts ── */
.toast-container {
  position: fixed;
  top: calc(1rem + var(--safe-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: calc(100% - 2rem);
  max-width: 420px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1.25rem;
  border-radius: var(--radius-md);
  background: #ffffff;
  border: 1px solid var(--brand-orange);
  color: var(--text-heading);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
  pointer-events: all;
  font-size: 0.92rem;
  font-weight: 500;
  animation: slideDown 0.25s ease;
}

.toast-success { border-color: var(--status-working); }
.toast-error   { border-color: var(--status-away); }
.toast-info    { border-color: var(--brand-orange); }

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-15px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Spinner */
.spinner {
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(0, 0, 0, 0.1);
  border-top-color: var(--brand-orange);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

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

/* Utility */
.text-orange { color: var(--brand-orange) !important; }
.text-white  { color: var(--text-heading) !important; }
.text-muted  { color: var(--text-muted) !important; }
.text-center { text-align: center; }
.hidden      { display: none !important; }
