/* ============================================
   Sistema PNQC ABRAMAN — Design System CSS
   Paleta: Navy #001630 (primary) + Sky #0284c7 (accent)
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@100..900&display=swap');

/* ---- Base Reset ---- */
@layer base {
  html, body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
    background-color: #f8fafc;
    color: #0f172a;
    -webkit-font-smoothing: antialiased;
  }
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #94a3b8; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #64748b; }

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.animate-fade-in {
  animation: fadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes modalSlideUp {
  from { opacity: 0; transform: scale(0.97) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.animate-modal-up {
  animation: modalSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ============================================
   LAYOUT — Page Structure
   ============================================ */
.page-section {
  @apply flex flex-col w-full min-h-[calc(100vh-56px)] animate-fade-in;
  padding: 24px;
  max-width: 1280px;
  margin: 0 auto;
}

.page-header {
  @apply flex flex-col md:flex-row justify-between items-start md:items-center gap-4;
  padding-bottom: 20px;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 24px;
}

.page-header-info {}

.page-overline {
  font-size: 11px;
  font-weight: 600;
  color: #0284c7;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.page-title {
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
  margin-top: 2px;
  line-height: 1.3;
}

.page-subtitle {
  font-size: 12px;
  color: #64748b;
  margin-top: 4px;
  max-width: 600px;
}

/* ============================================
   CARDS
   ============================================ */
.card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 20px;
  transition: border-color 0.15s ease;
}

.card-elevated {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

/* ---- Stat / Metric Card ---- */
.stat-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stat-label {
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-value-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1;
}

.stat-trend {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
}

.stat-trend-up {
  color: #059669;
  background: #ecfdf5;
}

.stat-trend-down {
  color: #dc2626;
  background: #fef2f2;
}

.stat-trend-neutral {
  color: #64748b;
  background: #f1f5f9;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn-primary {
  background: #0284c7;
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: background 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-primary:hover { background: #0369a1; }

.btn-secondary {
  background: #ffffff;
  color: #334155;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-secondary:hover { background: #f8fafc; border-color: #94a3b8; }

.btn-ghost {
  background: transparent;
  color: #0284c7;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: background 0.15s ease;
}
.btn-ghost:hover { background: #f0f9ff; }

/* ============================================
   BADGES
   ============================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 9999px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  white-space: nowrap;
}

.badge-warning {
  background: #fffbeb;
  color: #92400e;
  border-color: #fde68a;
}

.badge-success {
  background: #f0f9ff;
  color: #075985;
  border-color: #bae6fd;
}

.badge-info {
  background: #f0f9ff;
  color: #0369a1;
  border-color: #bae6fd;
}

.badge-error {
  background: #fef2f2;
  color: #991b1b;
  border-color: #fecaca;
}

.badge-neutral {
  background: #f1f5f9;
  color: #475569;
  border-color: #e2e8f0;
}

/* ============================================
   FORMS
   ============================================ */
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 4px;
}

.form-input {
  width: 100%;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 9px 14px;
  font-size: 12px;
  color: #0f172a;
  font-family: 'Inter', sans-serif;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-input:focus {
  outline: none;
  border-color: #0284c7;
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.12);
}

.form-textarea {
  width: 100%;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12px;
  color: #0f172a;
  font-family: 'Inter', sans-serif;
  resize: vertical;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-textarea:focus {
  outline: none;
  border-color: #0284c7;
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.12);
}

/* ============================================
   DATA TABLES
   ============================================ */
.data-table {
  width: 100%;
  text-align: left;
  font-size: 12px;
  border-collapse: collapse;
}

.data-table thead tr {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.data-table th {
  padding: 10px 16px;
  font-weight: 600;
  color: #475569;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.data-table td {
  padding: 10px 16px;
  color: #334155;
}

.data-table tbody tr {
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.1s ease;
}

.data-table tbody tr:hover {
  background: #f8fafc;
}

/* ============================================
   SIDEBAR — Navy Dark
   ============================================ */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  height: 100%;
  width: 264px;
  background: #001630;
  z-index: 50;
  display: flex;
  flex-direction: column;
  transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.sidebar-brand {
  padding: 20px 20px 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.sidebar-brand img {
  height: 32px;
  width: auto;
  filter: brightness(0) invert(1);
}

.sidebar-brand .sidebar-collapse-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.4);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
}
.sidebar-brand .sidebar-collapse-btn:hover {
  color: rgba(255,255,255,0.8);
  background: rgba(255,255,255,0.06);
}

/* Role Switcher */
.sidebar-role-switcher {
  padding: 12px 16px 4px;
}

.role-pill-container {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  padding: 3px;
  display: flex;
  gap: 3px;
}

.role-pill {
  flex: 1;
  padding: 6px 4px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  color: rgba(255,255,255,0.5);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.role-pill:hover { color: rgba(255,255,255,0.8); }

.role-pill-active {
  background: #0284c7;
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* Navigation */
.sidebar-nav {
  flex: 1;
  padding: 12px 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-group-label {
  font-size: 10px;
  font-weight: 700;
  color: rgba(255,255,255,0.3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 16px 12px 6px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
}
.nav-group-label:hover { color: rgba(255,255,255,0.5); }

.nav-group-label .caret {
  font-size: 16px;
  transition: transform 0.2s ease;
}

.nav-subgroup {
  margin-left: 18px;
  padding-left: 12px;
  border-left: 2px solid rgba(2,132,199,0.2);
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  transition: all 0.12s ease;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.nav-link:hover {
  color: #ffffff;
  background: rgba(255,255,255,0.06);
}

.nav-link-active {
  color: #ffffff !important;
  background: rgba(2,132,199,0.15) !important;
  font-weight: 600 !important;
}

.nav-link-active .material-symbols-outlined {
  color: #38bdf8 !important;
}

.nav-link .material-symbols-outlined {
  font-size: 19px;
  color: rgba(255,255,255,0.4);
  transition: color 0.12s ease;
}
.nav-link:hover .material-symbols-outlined {
  color: rgba(255,255,255,0.7);
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: rgba(255,255,255,0.3);
}
.sidebar-footer a {
  color: #38bdf8;
  text-decoration: none;
  font-weight: 600;
}
.sidebar-footer a:hover { text-decoration: underline; }

/* Sidebar Collapsed State */
.sidebar-collapsed {
  width: 64px !important;
}

.sidebar-collapsed .sidebar-text {
  display: none !important;
}

.sidebar-collapsed .sidebar-brand {
  padding: 16px 12px;
  justify-content: center;
}

.sidebar-collapsed .sidebar-brand img {
  height: 24px;
}

.sidebar-collapsed .sidebar-role-switcher {
  padding: 8px 6px 4px;
}

.sidebar-collapsed .role-pill {
  padding: 6px 2px;
  font-size: 0;
}
.sidebar-collapsed .role-pill .material-symbols-outlined {
  font-size: 16px;
}

.sidebar-collapsed .sidebar-nav {
  padding: 8px 6px;
}

.sidebar-collapsed .nav-link {
  justify-content: center;
  padding: 8px;
}

.sidebar-collapsed .nav-group-label {
  justify-content: center;
  padding: 12px 6px 4px;
}
.sidebar-collapsed .nav-group-label .sidebar-text,
.sidebar-collapsed .nav-group-label .caret {
  display: none !important;
}

.sidebar-collapsed .nav-subgroup {
  margin-left: 0;
  padding-left: 0;
  border-left: none;
}

.sidebar-collapsed .sidebar-footer {
  justify-content: center;
  padding: 10px 6px;
}

.main-wrapper {
  padding-left: 264px;
  flex: 1;
  display: flex;
  flex-direction: column;
  transition: padding-left 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.main-collapsed {
  padding-left: 64px !important;
}

/* ============================================
   HEADER — 56px
   ============================================ */
.top-header {
  position: fixed;
  top: 0;
  left: 264px;
  right: 0;
  height: 56px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 40;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  transition: left 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.header-collapsed {
  left: 64px !important;
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #94a3b8;
}

.breadcrumb-separator {
  color: #cbd5e1;
  font-size: 11px;
}

.breadcrumb-current {
  color: #0f172a;
  font-weight: 600;
}

/* Header Controls */
.header-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-notif-btn {
  position: relative;
  background: none;
  border: none;
  color: #64748b;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
}
.header-notif-btn:hover { background: #f1f5f9; color: #0f172a; }

.notif-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 7px;
  height: 7px;
  background: #ef4444;
  border-radius: 9999px;
  border: 2px solid #ffffff;
}

/* Avatar Initials */
.avatar-initials {
  width: 34px;
  height: 34px;
  border-radius: 9999px;
  background: #0284c7;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 12px;
  border-left: 1px solid #e2e8f0;
}

.header-user-name {
  font-size: 12px;
  font-weight: 600;
  color: #0f172a;
}

.header-user-role {
  font-size: 10px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Role Badge (Header) */
.header-role-badge {
  display: none;
  align-items: center;
  gap: 6px;
  background: rgba(2,132,199,0.08);
  color: #0284c7;
  border: 1px solid rgba(2,132,199,0.15);
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
}
@media (min-width: 768px) { .header-role-badge { display: flex; } }

.role-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 9999px;
  background: #0284c7;
}

/* ============================================
   NOTIFICATIONS DRAWER
   ============================================ */
.notif-drawer {
  position: absolute;
  right: 0;
  margin-top: 8px;
  width: 360px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.1);
  z-index: 50;
  overflow: hidden;
}

.notif-drawer-header {
  background: #001630;
  padding: 14px 16px;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.notif-item {
  padding: 12px 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  transition: background 0.1s ease;
  border-bottom: 1px solid #f1f5f9;
}
.notif-item:hover { background: #f8fafc; }
.notif-item:last-child { border-bottom: none; }

.notif-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ============================================
   MODALS
   ============================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,22,48,0.5);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
  width: 100%;
  max-width: 480px;
  margin: 0 16px;
  padding: 24px;
  border: 1px solid #e2e8f0;
}

.modal-content-lg {
  max-width: 560px;
}

/* ============================================
   ALERT CARDS (Dashboard)
   ============================================ */
.alert-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* ============================================
   PROGRESS BAR
   ============================================ */
.progress-track {
  height: 6px;
  width: 100%;
  background: #e2e8f0;
  border-radius: 9999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: #0284c7;
  border-radius: 9999px;
  transition: width 0.4s ease;
}

/* ============================================
   FILE UPLOAD AREA
   ============================================ */
.upload-area {
  padding: 12px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
}

.upload-area-label {
  font-size: 12px;
  font-weight: 600;
  color: #1e293b;
  display: block;
  margin-bottom: 4px;
}

/* ============================================
   MISC UTILITIES
   ============================================ */
.text-mono {
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 12px;
}

.divider {
  border-top: 1px solid #e2e8f0;
  margin: 16px 0;
}

.section-title {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}

.section-subtitle {
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Radio option card */
.radio-card {
  padding: 14px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.12s ease;
}
.radio-card:hover { background: #f1f5f9; }
.radio-card-selected {
  border-color: #0284c7;
  background: rgba(2,132,199,0.04);
}

/* Slot button (agendamentos) */
.slot-btn {
  padding: 10px;
  text-align: center;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  color: #1e293b;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s ease;
  background: #ffffff;
}
.slot-btn:hover { border-color: #0284c7; }
.slot-btn-active {
  border-color: #0284c7;
  background: #0284c7;
  color: #ffffff;
}

/* Detail block (inside cards) */
.detail-block {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 14px;
}

/* Tab selectors (payment modal) */
.pay-tab {
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  color: #475569;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.12s ease;
  background: #ffffff;
}
.pay-tab:hover { border-color: #0284c7; }
.pay-tab-active {
  border-color: #0284c7;
  background: #f0f9ff;
  color: #075985;
}
