/* =============================================
   LAGOA DOCE BEACH - Estilos Principais
   Tema: Tropical / Moderno / Clean
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&family=Playfair+Display:wght@700;800&display=swap');

:root {
  --primary: #0077b6;
  --primary-dark: #005f92;
  --secondary: #00b4d8;
  --accent: #f77f00;
  --accent-light: #fca311;
  --success: #06d6a0;
  --danger: #ef476f;
  --warning: #ffd166;
  --dark: #1a1a2e;
  --dark2: #16213e;
  --text: #2d3748;
  --text-light: #718096;
  --bg: #f0f4f8;
  --white: #ffffff;
  --card-bg: #ffffff;
  --border: #e2e8f0;
  --sidebar-w: 260px;
  --radius: 16px;
  --radius-sm: 8px;
  --shadow: 0 4px 20px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.12);
}

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

body {
  font-family: 'Nunito', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
}

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--secondary); border-radius: 10px; }

/* ===================== LAYOUT ===================== */
.app-wrapper { display: flex; min-height: 100vh; }

/* ---- SIDEBAR ---- */
.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(175deg, var(--dark) 0%, var(--dark2) 100%);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
  overflow-y: auto;
}

.sidebar-logo {
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-logo .logo-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  color: var(--white);
  font-weight: 800;
  line-height: 1.2;
}

.sidebar-logo .logo-sub {
  font-size: 0.7rem;
  color: var(--secondary);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 700;
  margin-top: 2px;
}

.sidebar-logo .wave-emoji {
  font-size: 2rem;
  display: block;
  margin-bottom: 8px;
  filter: drop-shadow(0 2px 4px rgba(0,180,216,0.4));
}

.sidebar-nav { flex: 1; padding: 16px 0; }

.nav-section-title {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: rgba(255,255,255,0.35);
  padding: 16px 20px 6px;
  font-weight: 700;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 20px;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: 0;
  transition: all 0.2s;
  position: relative;
  margin: 2px 10px;
  border-radius: 10px;
}

.nav-link:hover {
  color: var(--white);
  background: rgba(255,255,255,0.08);
}

.nav-link.active {
  color: var(--white);
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  box-shadow: 0 4px 15px rgba(0,119,182,0.4);
}

.nav-link .nav-icon { font-size: 1.1rem; width: 22px; text-align: center; }

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(255,255,255,0.05);
  margin-bottom: 10px;
}

.user-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; font-weight: 800; color: white;
  flex-shrink: 0;
}

.user-name { font-size: 0.8rem; font-weight: 700; color: var(--white); }
.user-role { font-size: 0.65rem; color: var(--secondary); text-transform: uppercase; letter-spacing: 1px; }

.btn-logout {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 9px 14px;
  background: rgba(239,71,111,0.15);
  color: #ff8fab;
  border: none; cursor: pointer;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s;
  font-family: 'Nunito', sans-serif;
}

.btn-logout:hover { background: rgba(239,71,111,0.25); color: #ff4d77; }

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

/* ---- TOP BAR ---- */
.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow);
}

.topbar-left { display: flex; align-items: center; gap: 12px; }
.menu-toggle {
  display: none;
  background: none; border: none; cursor: pointer;
  font-size: 1.4rem; color: var(--text);
}

.page-title { font-size: 1.15rem; font-weight: 800; color: var(--dark); }
.breadcrumb { font-size: 0.75rem; color: var(--text-light); }

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

.topbar-date {
  font-size: 0.8rem;
  color: var(--text-light);
  font-weight: 600;
  background: var(--bg);
  padding: 6px 12px;
  border-radius: 8px;
}

/* ---- PAGE CONTENT ---- */
.page-content { padding: 28px; flex: 1; }

/* ===================== ALERTS ===================== */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-weight: 600;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideDown 0.3s ease;
}

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

.alert-success { background: #d1fae5; color: #065f46; border-left: 4px solid var(--success); }
.alert-error { background: #fee2e2; color: #991b1b; border-left: 4px solid var(--danger); }

/* ===================== CARDS ===================== */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--dark);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-body { padding: 24px; }

/* ===================== STAT CARDS ===================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.stat-icon {
  width: 56px; height: 56px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
  flex-shrink: 0;
}

.stat-icon.blue { background: linear-gradient(135deg, #dbeafe, #bfdbfe); }
.stat-icon.teal { background: linear-gradient(135deg, #d1fae5, #a7f3d0); }
.stat-icon.orange { background: linear-gradient(135deg, #ffedd5, #fed7aa); }
.stat-icon.purple { background: linear-gradient(135deg, #ede9fe, #ddd6fe); }

.stat-value { font-size: 1.8rem; font-weight: 900; color: var(--dark); line-height: 1; }
.stat-label { font-size: 0.78rem; color: var(--text-light); font-weight: 600; margin-top: 4px; }

/* ===================== TABLES ===================== */
.table-wrapper { overflow-x: auto; }

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

th {
  text-align: left;
  padding: 12px 16px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-light);
  background: var(--bg);
  font-weight: 700;
  border-bottom: 2px solid var(--border);
}

td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
  color: var(--text);
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: #f8fafc; }

/* ===================== BADGES ===================== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-primary { background: #e0f2fe; color: #075985; }

/* ===================== BUTTONS ===================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all 0.2s;
  font-family: 'Nunito', sans-serif;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  box-shadow: 0 4px 15px rgba(0,119,182,0.35);
}
.btn-primary:hover { box-shadow: 0 6px 20px rgba(0,119,182,0.5); transform: translateY(-1px); }

.btn-accent {
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: white;
  box-shadow: 0 4px 15px rgba(247,127,0,0.35);
}
.btn-accent:hover { box-shadow: 0 6px 20px rgba(247,127,0,0.5); transform: translateY(-1px); }

.btn-success {
  background: linear-gradient(135deg, #059669, var(--success));
  color: white;
  box-shadow: 0 4px 15px rgba(6,214,160,0.35);
}

.btn-danger { background: #fee2e2; color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: white; }

.btn-sm { padding: 6px 14px; font-size: 0.78rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-block { width: 100%; justify-content: center; }

.btn-outline {
  background: transparent;
  border: 2px solid var(--border);
  color: var(--text);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: #f0f9ff; }

/* ===================== FORMS ===================== */
.form-group { margin-bottom: 18px; }

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-control {
  width: 100%;
  padding: 11px 14px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--white);
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: 'Nunito', sans-serif;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0,119,182,0.1);
}

.form-control-lg { padding: 14px 18px; font-size: 1rem; }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 100px; }

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

/* ===================== GPS BUTTON ===================== */
.gps-group { display: flex; gap: 8px; align-items: flex-end; }
.gps-group .form-control { flex: 1; }
.btn-gps {
  padding: 11px 14px;
  background: var(--success);
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1.1rem;
  flex-shrink: 0;
  transition: all 0.2s;
}
.btn-gps:hover { background: #047857; }

/* ===================== PRODUCT CARDS (Vendas) ===================== */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.product-card {
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  transition: all 0.2s;
}

.product-card:focus-within {
  border-color: var(--primary);
  background: #f0f9ff;
  box-shadow: 0 0 0 3px rgba(0,119,182,0.08);
}

.product-emoji { font-size: 2rem; display: block; margin-bottom: 8px; }
.product-name { font-weight: 800; font-size: 0.9rem; color: var(--dark); margin-bottom: 4px; }
.product-price { font-size: 0.78rem; color: var(--text-light); font-weight: 600; margin-bottom: 12px; }

.qty-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.qty-btn {
  width: 32px; height: 32px;
  border: none;
  border-radius: 8px;
  background: var(--primary);
  color: white;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  flex-shrink: 0;
  transition: all 0.2s;
}
.qty-btn:hover { background: var(--primary-dark); }

.qty-input {
  width: 60px;
  text-align: center;
  padding: 6px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 800;
  font-family: 'Nunito', sans-serif;
}

.product-subtotal { font-size: 0.8rem; color: var(--primary); font-weight: 700; margin-top: 8px; }

/* ===================== CHECKIN CARDS ===================== */
.checkin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }

.checkin-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  border-top: 4px solid var(--border);
}

.checkin-card.falesia { border-top-color: var(--accent); }
.checkin-card.lagoa { border-top-color: var(--secondary); }

.checkin-title {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 0.82rem;
}

.checkin-row:last-child { border-bottom: none; }
.checkin-label { color: var(--text-light); font-weight: 600; }
.checkin-value { font-weight: 700; color: var(--dark); }
.checkin-value.done { color: var(--success); }
.checkin-value.pending { color: var(--warning); }

/* ===================== FECHAMENTO ===================== */
.total-box {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
  margin-bottom: 20px;
}

.total-box .total-label { font-size: 0.85rem; opacity: 0.85; text-transform: uppercase; letter-spacing: 1px; font-weight: 700; }
.total-box .total-value { font-size: 3rem; font-weight: 900; font-family: 'Playfair Display', serif; line-height: 1; margin: 8px 0; }
.total-box .credito-info { font-size: 0.9rem; opacity: 0.9; font-weight: 600; }

.credito-box {
  background: linear-gradient(135deg, #065f46, var(--success));
  color: white;
  border-radius: var(--radius);
  padding: 20px 28px;
  text-align: center;
  margin-bottom: 20px;
}

.credito-box .credito-label { font-size: 0.8rem; opacity: 0.85; text-transform: uppercase; letter-spacing: 1px; font-weight: 700; }
.credito-box .credito-value { font-size: 2rem; font-weight: 900; }

/* ===================== LOGIN ===================== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--dark) 0%, var(--dark2) 50%, #0a3d62 100%);
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.login-page::before {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(ellipse at center, rgba(0,180,216,0.1) 0%, transparent 70%);
  animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.login-card {
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(10px);
  border-radius: 24px;
  padding: 44px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 25px 60px rgba(0,0,0,0.3);
  position: relative;
  z-index: 1;
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo .emoji { font-size: 3.5rem; display: block; margin-bottom: 12px; }
.login-logo h1 {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  color: var(--dark);
  font-weight: 800;
}
.login-logo p { color: var(--text-light); font-size: 0.82rem; font-weight: 600; margin-top: 4px; }

/* ===================== PAGE HEADER ===================== */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-header h1 {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--dark);
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ===================== FILTERS ===================== */
.filter-bar {
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.filter-bar .form-group { margin-bottom: 0; min-width: 140px; }

/* ===================== EMPTY STATE ===================== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
}

.empty-state .empty-emoji { font-size: 3.5rem; display: block; margin-bottom: 12px; }
.empty-state p { font-size: 0.95rem; font-weight: 600; }

/* ===================== DIVIDER ===================== */
.section-divider {
  height: 1px;
  background: var(--border);
  margin: 24px 0;
}

/* ===================== WHATSAPP BTN ===================== */
.btn-whatsapp {
  background: #25d366;
  color: white;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  transition: all 0.2s;
  box-shadow: 0 4px 15px rgba(37,211,102,0.35);
}
.btn-whatsapp:hover { background: #1ebe5c; transform: translateY(-1px); }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  
  .sidebar {
    transform: translateX(-260px);
    width: 260px;
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  .main-content { margin-left: 0; }
  
  .menu-toggle { display: flex; }
  
  .page-content { padding: 16px; }
  
  .topbar { padding: 12px 16px; }
  
  .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
  
  .checkin-grid { grid-template-columns: 1fr; }
  
  .stats-grid { grid-template-columns: 1fr 1fr; }
  
  .products-grid { grid-template-columns: 1fr 1fr; }
  
  .filter-bar { flex-direction: column; }
  
  .total-box .total-value { font-size: 2.2rem; }
  
  .login-card { padding: 30px 24px; }

  .overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99;
  }
  
  .overlay.active { display: block; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .products-grid { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; }
}
