/* =====================================================
   AGENDA FNAS - Estilos CSS
   ===================================================== */

:root {
  --primary: #005270;
  --primary-dark: #004258;
  --primary-light: #0084A6;
  --accent: #F57E19;
  --teal: #009791;
  --success: #16B878;
  --danger: #E83B3B;
  --warning: #F59E0B;
  --bg: #F2F3F3;
  --sidebar-w: 260px;
}

* { box-sizing: border-box; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: #1a1a2e;
  margin: 0;
}

/* =====================
   Layout Principal
   ===================== */
#app { min-height: 100vh; }

.layout {
  display: flex;
  min-height: 100vh;
}

/* =====================
   Sidebar
   ===================== */
.sidebar {
  width: var(--sidebar-w);
  background: var(--primary);
  color: white;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
  transition: transform 0.3s ease;
}

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

.sidebar-logo h1 {
  font-size: 20px;
  font-weight: 800;
  margin: 0;
  letter-spacing: 1px;
  color: white;
}

.sidebar-logo p {
  font-size: 11px;
  color: rgba(255,255,255,0.6);
  margin: 4px 0 0;
}

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

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

.nav-item:hover {
  background: rgba(255,255,255,0.1);
  color: white;
}

.nav-item.active {
  background: rgba(255,255,255,0.15);
  color: white;
  border-left-color: var(--accent);
}

.nav-item i { width: 20px; text-align: center; font-size: 16px; }

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

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

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 36px; height: 36px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: white;
}

.user-role {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
}

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

.topbar {
  background: white;
  border-bottom: 1px solid #e0e7ef;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
}

.page-content {
  padding: 24px;
  flex: 1;
}

/* =====================
   Cards
   ===================== */
.card {
  background: white;
  border-radius: 12px;
  border: 1px solid #e0e7ef;
  overflow: hidden;
}

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

.card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
}

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

/* =====================
   Stat Cards
   ===================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  border: 1px solid #e0e7ef;
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.stat-icon.blue { background: #EBF4FF; color: var(--primary); }
.stat-icon.green { background: #ECFDF5; color: var(--success); }
.stat-icon.orange { background: #FFF7ED; color: var(--accent); }
.stat-icon.teal { background: #ECFCFB; color: var(--teal); }

.stat-value { font-size: 28px; font-weight: 800; color: #1a1a2e; }
.stat-label { font-size: 12px; color: #6b7280; margin-top: 2px; }

/* =====================
   Buttons
   ===================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  text-decoration: none;
}

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

.btn-accent { background: var(--accent); color: white; }
.btn-accent:hover { background: #e06d10; }

.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #0ea268; }

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

.btn-outline {
  background: white;
  color: var(--primary);
  border: 2px solid var(--primary);
}
.btn-outline:hover { background: var(--primary); color: white; }

.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }

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

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid #e0e7ef;
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.2s;
  outline: none;
  font-family: inherit;
}

.form-control:focus { border-color: var(--primary-light); }

select.form-control { cursor: pointer; }

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

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

thead th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  background: #f8fafc;
  border-bottom: 2px solid #e0e7ef;
}

tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid #f0f4f8;
  font-size: 14px;
  color: #374151;
}

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

/* =====================
   Badges/Status
   ===================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
}

.badge-green { background: #DCFCE7; color: #166534; }
.badge-red { background: #FEE2E2; color: #991B1B; }
.badge-blue { background: #DBEAFE; color: #1E40AF; }
.badge-orange { background: #FEF3C7; color: #92400E; }
.badge-gray { background: #F3F4F6; color: #6B7280; }

/* =====================
   Room Cards
   ===================== */
.rooms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.room-card {
  background: white;
  border-radius: 16px;
  border: 2px solid #e0e7ef;
  overflow: hidden;
  transition: all 0.3s;
  cursor: pointer;
}

.room-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,82,112,0.1); }

.room-card.occupied { border-color: #FCA5A5; }
.room-card.available { border-color: #86EFAC; }

.room-card-header {
  padding: 20px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  position: relative;
}

.room-card.occupied .room-card-header {
  background: linear-gradient(135deg, #991B1B, #E83B3B);
}

.room-card.available .room-card-header {
  background: linear-gradient(135deg, #065F46, var(--teal));
}

.room-number { font-size: 13px; opacity: 0.8; font-weight: 600; }
.room-name { font-size: 18px; font-weight: 800; margin: 4px 0; }
.room-status-badge {
  position: absolute;
  top: 16px; right: 16px;
  background: rgba(255,255,255,0.2);
  padding: 4px 12px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
}

.room-card-body { padding: 16px 20px; }

.room-info-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 8px;
}

.room-info-row i { width: 16px; color: var(--primary-light); }

.room-meeting-info {
  margin-top: 12px;
  padding: 12px;
  background: #f0f4f8;
  border-radius: 8px;
}

.meeting-title { font-weight: 700; font-size: 14px; color: #1a1a2e; margin-bottom: 4px; }
.meeting-time { font-size: 12px; color: #6b7280; }

/* =====================
   Calendar
   ===================== */
.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.calendar-day-header {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: #6b7280;
  padding: 8px 0;
  text-transform: uppercase;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
  position: relative;
}

.calendar-day:hover:not(.empty):not(.other-month) {
  background: #EBF4FF;
}

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

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

.calendar-day.other-month { color: #d1d5db; cursor: default; }
.calendar-day.empty { cursor: default; }

.day-dot {
  width: 5px; height: 5px;
  background: var(--accent);
  border-radius: 50%;
  position: absolute;
  bottom: 4px;
}

.calendar-day.today .day-dot { background: white; }

/* =====================
   Modal
   ===================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(2px);
}

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

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

.modal-title { font-size: 18px; font-weight: 700; color: var(--primary); }
.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #9ca3af;
  padding: 4px;
  border-radius: 6px;
}
.modal-close:hover { background: #f3f4f6; }
.modal-body { padding: 20px 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid #e0e7ef;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* =====================
   Timeline / Slots
   ===================== */
.time-slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 8px;
}

.time-slot {
  padding: 10px;
  border-radius: 8px;
  border: 2px solid #e0e7ef;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 13px;
  font-weight: 600;
}

.time-slot.available:hover {
  border-color: var(--primary);
  background: #EBF4FF;
  color: var(--primary);
}

.time-slot.selected {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
}

.time-slot.occupied {
  background: #FEE2E2;
  border-color: #FCA5A5;
  color: #991B1B;
  cursor: not-allowed;
}

/* =====================
   Progress Bar
   ===================== */
.progress-bar {
  height: 6px;
  background: #e0e7ef;
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  transition: width 1s linear;
}

/* =====================
   Toast Notifications
   ===================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: white;
  border-radius: 10px;
  padding: 14px 18px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 280px;
  max-width: 400px;
  border-left: 4px solid var(--primary);
  animation: slideInRight 0.3s ease;
}

.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }

.toast-icon { font-size: 18px; }
.toast-msg { font-size: 14px; font-weight: 500; flex: 1; }

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* =====================
   Loading
   ===================== */
.spinner {
  display: inline-block;
  width: 24px; height: 24px;
  border: 3px solid rgba(0,82,112,0.15);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  border-radius: inherit;
}

/* =====================
   Empty State
   ===================== */
.empty-state {
  text-align: center;
  padding: 48px 24px;
}

.empty-state i { font-size: 48px; color: #d1d5db; margin-bottom: 16px; }
.empty-state h3 { font-size: 18px; color: #374151; margin: 0 0 8px; }
.empty-state p { font-size: 14px; color: #9ca3af; }

/* =====================
   Confirmation Card
   ===================== */
.confirmation-card {
  background: linear-gradient(135deg, #EBF8FF, #F0FDF4);
  border: 2px solid #86EFAC;
  border-radius: 16px;
  padding: 24px;
  text-align: center;
}

.confirmation-code {
  font-size: 28px;
  font-weight: 900;
  color: var(--primary);
  letter-spacing: 2px;
  margin: 8px 0;
}

/* =====================
   Responsive
   ===================== */
.hamburger {
  display: none;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--primary);
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .hamburger { display: block; }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .rooms-grid {
    grid-template-columns: 1fr;
  }

  .page-content { padding: 16px; }
}

/* =====================
   Login Page
   ===================== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
  padding: 20px;
}

.login-card {
  background: white;
  border-radius: 20px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

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

.login-logo h1 {
  font-size: 28px;
  font-weight: 900;
  color: var(--primary);
  letter-spacing: 2px;
  margin: 0;
}

.login-logo p {
  font-size: 13px;
  color: #6b7280;
  margin: 6px 0 0;
}

/* =====================
   Scrollbar Custom
   ===================== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* =====================
   Utilities
   ===================== */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.text-sm { font-size: 13px; }
.text-muted { color: #9ca3af; }
.font-bold { font-weight: 700; }
.w-full { width: 100%; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Sidebar overlay for mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
}

.sidebar-overlay.active { display: block; }
