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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f0f2f5;
  min-height: 100vh;
}

/* ==================== AUTH / LANDING PAGE ==================== */
.auth-screen {
  min-height: 100vh;
  background: linear-gradient(135deg, #1a237e 0%, #283593 50%, #3949ab 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-container {
  width: 100%;
  max-width: 480px;
}

.auth-section { display: none; }
.auth-section.active { display: block; }

.landing-hero {
  text-align: center;
  margin-bottom: 36px;
}

.landing-logo-img {
  width: 220px;
  height: auto;
  margin-bottom: 8px;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.15));
}

.landing-logo {
  font-size: 2.8rem;
  font-weight: 800;
  color: white;
  letter-spacing: -1px;
}

.landing-tagline {
  color: rgba(255,255,255,0.85);
  font-size: 1.1rem;
  margin-top: 8px;
  line-height: 1.5;
}

.landing-benefits {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 32px;
}

.benefit-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 16px 18px;
  color: white;
}

.benefit-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
  width: 40px;
  text-align: center;
}

.benefit-item strong { font-size: 0.95rem; }
.benefit-item span { font-size: 0.82rem; color: rgba(255,255,255,0.75); line-height: 1.4; }

.landing-cta {
  text-align: center;
  margin-bottom: 24px;
}

.cta-text {
  color: rgba(255,255,255,0.7);
  font-size: 0.9rem;
}

.auth-card {
  background: white;
  border-radius: 16px;
  padding: 32px 28px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.auth-card h2 {
  font-size: 1.3rem;
  color: #1a237e;
  margin-bottom: 6px;
}

.auth-subtitle {
  color: #888;
  font-size: 0.85rem;
  margin-bottom: 20px;
}

.auth-error {
  background: #fce4ec;
  color: #c62828;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-bottom: 16px;
  border: 1px solid #f8bbd0;
}

.auth-input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-size: 0.95rem;
  transition: border-color 0.2s;
  background: white;
}

.auth-input:focus {
  outline: none;
  border-color: #1a237e;
  box-shadow: 0 0 0 3px rgba(26,35,126,0.1);
}

.auth-btn-primary {
  width: 100%;
  background: linear-gradient(135deg, #1a237e, #283593);
  color: white;
  border: none;
  padding: 13px 24px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 8px;
}

.auth-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(26,35,126,0.35);
}

.auth-switch {
  text-align: center;
  margin-top: 18px;
  font-size: 0.9rem;
  color: #777;
}

.auth-switch a {
  color: #1a237e;
  font-weight: 600;
  text-decoration: none;
}

.auth-switch a:hover { text-decoration: underline; }

.auth-divider {
  border-top: 1px solid #eee;
  margin: 20px 0;
}

/* ==================== APP (POS-LOGIN) ==================== */
.app-screen { display: flex; }

.sidebar {
  width: 260px;
  min-height: 100vh;
  background: linear-gradient(135deg, #1a237e 0%, #283593 100%);
  color: white;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 100;
  transition: transform 0.3s ease;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.sidebar .logo {
  padding: 20px;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar .logo h2 {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 1px;
}

.sidebar-logo-img {
  width: 170px;
  height: auto;
  filter: brightness(0) invert(1);
  margin-bottom: 4px;
}

.sidebar .logo small {
  color: rgba(255,255,255,0.7);
  font-size: 0.75rem;
}

.sidebar nav {
  flex: 1;
}

.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  transition: all 0.2s;
  border-left: 3px solid transparent;
  font-size: 0.95rem;
}

.sidebar nav a:hover, .sidebar nav a.active {
  background: rgba(255,255,255,0.1);
  color: white;
  border-left-color: #64b5f6;
}

.sidebar nav a .icon { font-size: 1.2rem; width: 24px; text-align: center; }

.sidebar-footer {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 8px 0;
}

.sidebar-footer a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  transition: all 0.2s;
  font-size: 0.9rem;
}

.sidebar-footer a:hover {
  color: white;
  background: rgba(255,255,255,0.05);
}

.main-content {
  margin-left: 260px;
  padding: 20px 30px;
  min-height: 100vh;
  width: 100%;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  flex-wrap: wrap;
  gap: 10px;
}

.page-header h1 {
  font-size: 1.6rem;
  color: #1a237e;
  font-weight: 700;
}

.card-stat {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: transform 0.2s;
  border-left: 4px solid;
}

.card-stat:hover { transform: translateY(-2px); }
.card-stat.primary { border-left-color: #1a237e; }
.card-stat.success { border-left-color: #2e7d32; }
.card-stat.warning { border-left-color: #f57f17; }
.card-stat.danger { border-left-color: #c62828; }
.card-stat.info { border-left-color: #0277bd; }

.card-stat .stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: #333;
}

.card-stat .stat-label {
  font-size: 0.85rem;
  color: #777;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.card-stat .stat-sub {
  font-size: 0.8rem;
  color: #999;
  margin-top: 4px;
}

.card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  margin-bottom: 20px;
}

.card-header-custom {
  padding: 16px 20px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-header-custom h3 {
  font-size: 1.05rem;
  color: #333;
  margin: 0;
}

.card-body-custom { padding: 20px; }

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

.table-custom th {
  background: #f8f9fa;
  padding: 12px 16px;
  text-align: left;
  font-size: 0.85rem;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid #eee;
}

.table-custom td {
  padding: 12px 16px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.9rem;
  color: #333;
  vertical-align: middle;
}

.table-custom tr:hover td { background: #f8f9ff; }

.badge-status {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-pendente { background: #fff3e0; color: #e65100; }
.badge-aguardando { background: #e3f2fd; color: #1565c0; }
.badge-visualizado { background: #f3e5f5; color: #7b1fa2; }
.badge-fechado { background: #e8f5e9; color: #2e7d32; }
.badge-executado { background: #e0f7fa; color: #00695c; }
.badge-cancelado { background: #fce4ec; color: #c62828; }
.badge-pago { background: #e8f5e9; color: #2e7d32; }
.badge-atrasado { background: #fce4ec; color: #c62828; }

.btn-action {
  padding: 6px 12px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s;
}

.btn-edit { background: #e3f2fd; color: #1565c0; }
.btn-edit:hover { background: #bbdefb; }
.btn-delete { background: #fce4ec; color: #c62828; }
.btn-delete:hover { background: #f8bbd0; }
.btn-view { background: #f3e5f5; color: #7b1fa2; }
.btn-view:hover { background: #e1bee7; }
.btn-pdf { background: #fff3e0; color: #e65100; }
.btn-pdf:hover { background: #ffe0b2; }
.btn-whatsapp { background: #e8f5e9; color: #2e7d32; }
.btn-whatsapp:hover { background: #c8e6c9; }
.btn-email { background: #e3f2fd; color: #1565c0; }
.btn-email:hover { background: #bbdefb; }

.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 0.85rem;
  color: #555;
}

.form-control-custom {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-size: 0.95rem;
  transition: border-color 0.2s;
  background: white;
}

.form-control-custom:focus {
  outline: none;
  border-color: #1a237e;
  box-shadow: 0 0 0 3px rgba(26,35,126,0.1);
}

.btn-primary-custom {
  background: linear-gradient(135deg, #1a237e, #283593);
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary-custom:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(26,35,126,0.3);
}

.btn-secondary-custom {
  background: #f5f5f5;
  color: #555;
  border: 1px solid #ddd;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary-custom:hover { background: #eee; }

.btn-success-custom {
  background: linear-gradient(135deg, #2e7d32, #388e3c);
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-danger-custom {
  background: linear-gradient(135deg, #c62828, #d32f2f);
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  justify-content: center;
  align-items: center;
}

.modal-overlay.active { display: flex; }

.modal-content {
  background: white;
  border-radius: 12px;
  width: 95%;
  max-width: 700px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-header-custom {
  padding: 20px 24px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header-custom h2 {
  font-size: 1.2rem;
  color: #333;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #999;
}

.modal-body-custom { padding: 24px; }
.modal-footer-custom {
  padding: 16px 24px;
  border-top: 1px solid #eee;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.alert-custom {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 12px;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert-warning-custom { background: #fff8e1; color: #f57f17; border: 1px solid #ffecb3; }
.alert-danger-custom { background: #fce4ec; color: #c62828; border: 1px solid #f8bbd0; }

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #999;
}

.empty-state .icon { font-size: 3rem; margin-bottom: 12px; }
.empty-state p { font-size: 0.95rem; }

.page-section { display: none; }
.page-section.active { display: block; }

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

.section-divider {
  margin: 24px 0 16px;
  font-size: 0.9rem;
  font-weight: 700;
  color: #1a237e;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 2px solid #e8eaf6;
  padding-bottom: 8px;
}

.item-row input, .item-row select {
  padding: 6px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.85rem;
}

.add-item-btn {
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px dashed #2e7d32;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  margin-top: 8px;
}

.remove-item-btn {
  background: #fce4ec;
  color: #c62828;
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-size: 1rem;
}

.mobile-toggle { display: none; }

.btn-whatsapp-upgrade {
  display: inline-block;
  background: #25d366;
  color: white;
  border: none;
  padding: 14px 32px;
  border-radius: 8px;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
  box-shadow: 0 4px 16px rgba(37,211,102,0.3);
}

.btn-whatsapp-upgrade:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(37,211,102,0.4);
  background: #20bd5a;
}

.plan-badge-free {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  background: #fff3e0;
  color: #e65100;
}

.plan-badge-full {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  background: #e8f5e9;
  color: #2e7d32;
}

.limit-bar {
  height: 6px;
  background: #e0e0e0;
  border-radius: 3px;
  overflow: hidden;
  margin-top: 6px;
}

.limit-bar-fill {
  height: 100%;
  background: #1a237e;
  border-radius: 3px;
  transition: width 0.3s;
}

.limit-bar-fill.warning { background: #f57f17; }
.limit-bar-fill.danger { background: #c62828; }

/* ==================== MOBILE ==================== */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); width: 280px; }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; padding: 15px; padding-bottom: 80px; }
  .mobile-toggle {
    display: block !important;
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a237e, #283593);
    color: white;
    border: none;
    font-size: 1.5rem;
    z-index: 150;
    box-shadow: 0 4px 16px rgba(26,35,126,0.4);
    cursor: pointer;
  }
  .page-header { flex-direction: column; align-items: flex-start; }
  .resumo-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .card-stat { padding: 14px; }
  .card-stat .stat-value { font-size: 1.3rem; }
  .table-custom { font-size: 0.8rem; }
  .table-custom th, .table-custom td { padding: 8px 6px; }
  .modal-content { width: 100%; max-width: 100%; height: 100%; border-radius: 0; max-height: 100vh; }
  .modal-footer-custom { flex-wrap: wrap; }
  .btn-action { padding: 6px 8px; font-size: 0.7rem; }
  .item-row { grid-template-columns: 1fr 1fr !important; gap: 6px !important; }
  .item-row input:first-child { grid-column: 1 / -1; }
  input, select, textarea { font-size: 16px !important; }

  .auth-container { max-width: 100%; }
  .landing-logo-img { width: 180px; }
  .sidebar-logo-img { width: 140px; }
  .auth-card { padding: 24px 20px; }
  .benefit-item { padding: 12px 14px; }
}
