/* ========================================
   AGENDA MONTAPRO - ESTILOS COMPLETOS
   ======================================== */

/* === RESET E BASE === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Cores principais */
  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --primary-light: #60a5fa;
  
  /* Cores de sucesso/erro */
  --success: #10b981;
  --success-dark: #059669;
  --warning: #f59e0b;
  --error: #ef4444;
  
  /* Cores de status */
  --status-agendado: #3b82f6;
  --status-confirmado: #f59e0b;
  --status-concluido: #10b981;
  
  /* Cores neutras */
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  
  /* Sombras */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  
  /* Bordas */
  --radius: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;
  
  /* Transições */
  --transition: all 0.2s ease;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: var(--gray-900);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* === CONTAINER PRINCIPAL === */
.app-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
  min-height: 100vh;
}

@media (min-width: 768px) {
  .app-container {
    padding: 2rem;
  }
}

/* === HEADER === */
.top-bar {
  background: white;
  padding: 1rem 1.5rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  animation: slideDown 0.4s ease;
}

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

.top-bar h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

@media (max-width: 640px) {
  .top-bar h1 {
    font-size: 1.25rem;
  }
}

/* === TELAS === */
.screen {
  display: none;
  animation: fadeIn 0.4s ease;
}

.screen.active {
  display: block;
}

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

/* === CARTÕES DE AUTENTICAÇÃO === */
.auth-card {
  background: white;
  padding: 2.5rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  max-width: 420px;
  margin: 2rem auto;
  animation: scaleIn 0.4s ease;
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.auth-card h2 {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 0.5rem;
  text-align: center;
}

.auth-card > p {
  text-align: center;
  color: var(--gray-600);
  margin-bottom: 2rem;
}

.auth-footer {
  text-align: center;
  margin-top: 1.5rem;
  color: var(--gray-600);
  font-size: 0.875rem;
}

.auth-footer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
}

.auth-footer a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* === FORMULÁRIOS === */
.input-group {
  margin-bottom: 1.25rem;
}

.input-group label {
  display: block;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}

.input-group input,
.input-group select,
.input-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
  transition: var(--transition);
  background: white;
}

.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.input-group input::placeholder,
.input-group textarea::placeholder {
  color: var(--gray-400);
}

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

.input-group small {
  display: block;
  margin-top: 0.5rem;
  color: var(--gray-500);
  font-size: 0.75rem;
}

/* Layout em linha para campos lado a lado */
.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

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

/* === BOTÕES === */
.btn-primary,
.btn-success,
.btn-action,
.btn-nav,
.btn-today,
.btn-export,
.btn-text {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-primary {
  background: var(--primary);
  color: white;
  width: 100%;
  box-shadow: var(--shadow);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

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

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-success {
  background: var(--success);
  color: white;
  width: 100%;
  box-shadow: var(--shadow);
  margin-top: 1rem;
}

.btn-success:hover {
  background: var(--success-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-text {
  background: transparent;
  color: var(--primary);
  padding: 0.5rem 1rem;
}

.btn-text:hover {
  background: var(--gray-100);
}

/* === DASHBOARD === */
.welcome-bar {
  background: white;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
  font-size: 1.125rem;
  color: var(--gray-700);
  animation: slideRight 0.4s ease;
}

@keyframes slideRight {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.welcome-bar strong {
  color: var(--primary);
  font-weight: 700;
}

/* === AVISO DE TRIAL === */
.trial-warning {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: var(--radius-lg);
  margin-bottom: 1.5rem;
  text-align: center;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  animation: pulse 2s infinite;
}

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

.trial-warning a {
  color: white;
  text-decoration: underline;
  font-weight: 700;
}

.trial-warning a:hover {
  text-decoration: none;
}

/* === CARDS DO DASHBOARD === */
.dashboard-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.dash-card {
  background: white;
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  display: flex;
  gap: 1rem;
  align-items: center;
  transition: var(--transition);
  animation: fadeInUp 0.4s ease backwards;
}

.dash-card:nth-child(1) { animation-delay: 0.1s; }
.dash-card:nth-child(2) { animation-delay: 0.2s; }
.dash-card:nth-child(3) { animation-delay: 0.3s; }
.dash-card:nth-child(4) { animation-delay: 0.4s; }

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

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

.dash-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  flex-shrink: 0;
}

.dash-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.dash-label {
  font-size: 0.875rem;
  color: var(--gray-600);
  font-weight: 500;
}

.dash-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-900);
}

/* === CARD GENÉRICO === */
.card {
  background: white;
  padding: 2rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
  animation: fadeIn 0.4s ease;
}

.card h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* === CALENDÁRIO === */
.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.calendar-header h3 {
  margin: 0;
  font-size: 1.25rem;
}

.calendar-actions {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.btn-nav {
  background: var(--gray-100);
  color: var(--gray-700);
  padding: 0.5rem 1rem;
  min-width: auto;
}

.btn-nav:hover {
  background: var(--gray-200);
}

.btn-today {
  background: var(--primary);
  color: white;
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
}

.btn-today:hover {
  background: var(--primary-dark);
}

.btn-export {
  background: var(--success);
  color: white;
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
}

.btn-export:hover {
  background: var(--success-dark);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.calendar-day-header {
  text-align: center;
  font-weight: 600;
  color: var(--gray-600);
  padding: 0.75rem 0;
  font-size: 0.875rem;
  text-transform: uppercase;
}

.calendar-day {
  aspect-ratio: 1;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  background: white;
  min-height: 60px;
}

.calendar-day:hover:not(.empty) {
  border-color: var(--primary-light);
  background: var(--gray-50);
  transform: scale(1.05);
}

.calendar-day.empty {
  background: transparent;
  border-color: transparent;
  cursor: default;
}

.calendar-day.today {
  border-color: var(--primary);
  background: rgba(59, 130, 246, 0.05);
  font-weight: 700;
}

.calendar-day.selected {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
  font-weight: 700;
}

.calendar-day.has-services {
  background: var(--gray-50);
}

.day-number {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.status-indicators {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
  justify-content: center;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot.status-agendado {
  background: var(--status-agendado);
}

.status-dot.status-confirmado {
  background: var(--status-confirmado);
}

.status-dot.status-concluido {
  background: var(--status-concluido);
}

.calendar-legend {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
  padding-top: 1rem;
  border-top: 1px solid var(--gray-200);
  font-size: 0.875rem;
  color: var(--gray-600);
}

.calendar-legend span {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.calendar-legend .status-dot {
  width: 12px;
  height: 12px;
}

/* === LISTA DE AGENDAMENTOS === */
.services-section {
  background: white;
  padding: 2rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  animation: fadeIn 0.4s ease;
}

.services-section h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 1.5rem;
}

.loading {
  text-align: center;
  padding: 2rem;
  color: var(--gray-500);
  font-style: italic;
}

.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--gray-500);
  font-size: 1.125rem;
}

.services-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.service-item {
  background: var(--gray-50);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: var(--transition);
  animation: slideRight 0.3s ease;
}

.service-item:hover {
  border-color: var(--gray-300);
  box-shadow: var(--shadow-md);
  transform: translateX(4px);
}

.service-item.status-agendado {
  border-left: 4px solid var(--status-agendado);
}

.service-item.status-confirmado {
  border-left: 4px solid var(--status-confirmado);
}

.service-item.status-concluido {
  border-left: 4px solid var(--status-concluido);
  background: rgba(16, 185, 129, 0.05);
}

.service-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.service-client-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gray-900);
}

.service-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--success);
}

.service-info {
  margin-bottom: 1rem;
  color: var(--gray-700);
  line-height: 1.8;
}

.status-text {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-text.status-agendado {
  background: rgba(59, 130, 246, 0.1);
  color: var(--status-agendado);
}

.status-text.status-confirmado {
  background: rgba(245, 158, 11, 0.1);
  color: var(--status-confirmado);
}

.status-text.status-concluido {
  background: rgba(16, 185, 129, 0.1);
  color: var(--status-concluido);
}

.service-photos {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.service-photo-thumb {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: var(--radius);
  cursor: pointer;
  border: 2px solid var(--gray-200);
  transition: var(--transition);
}

.service-photo-thumb:hover {
  transform: scale(1.1);
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.service-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.btn-action {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  flex: 1;
  min-width: 120px;
}

.btn-whatsapp {
  background: #25d366;
  color: white;
}

.btn-whatsapp:hover {
  background: #1da851;
}

.btn-maps {
  background: #4285f4;
  color: white;
}

.btn-maps:hover {
  background: #3367d6;
}

.btn-waze {
  background: #33ccff;
  color: white;
}

.btn-waze:hover {
  background: #00b8e6;
}

.btn-edit {
  background: var(--gray-700);
  color: white;
}

.btn-edit:hover {
  background: var(--gray-800);
}

.btn-delete {
  background: var(--error);
  color: white;
}

.btn-delete:hover {
  background: #dc2626;
}

.btn-finish {
  background: var(--success);
  color: white;
}

.btn-finish:hover {
  background: var(--success-dark);
}

/* === RESPONSIVIDADE === */
@media (max-width: 768px) {
  .auth-card {
    padding: 2rem 1.5rem;
  }
  
  .card {
    padding: 1.5rem;
  }
  
  .calendar-grid {
    gap: 0.25rem;
  }
  
  .calendar-day {
    min-height: 50px;
  }
  
  .day-number {
    font-size: 0.875rem;
  }
  
  .dashboard-cards {
    grid-template-columns: 1fr;
  }
  
  .service-actions {
    flex-direction: column;
  }
  
  .btn-action {
    width: 100%;
  }
  
  .calendar-actions {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .app-container {
    padding: 1rem;
  }
  
  .top-bar {
    padding: 1rem;
  }
  
  .top-bar h1 {
    font-size: 1.125rem;
  }
  
  .card,
  .services-section {
    padding: 1.25rem;
  }
  
  .service-item {
    padding: 1.25rem;
  }
  
  .dash-value {
    font-size: 1.25rem;
  }
}

/* === SCROLLBAR CUSTOMIZADA === */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--gray-100);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gray-400);
}

/* === PRINT === */
@media print {
  body {
    background: white;
  }
  
  .top-bar,
  .btn-action,
  .calendar-actions,
  .service-actions {
    display: none !important;
  }
  
  .card,
  .service-item {
    box-shadow: none;
    border: 1px solid var(--gray-300);
  }
}