/* ==========================================================================
   FP PERÍCIAS MÉDICAS — DESIGN SYSTEM & DASHBOARD STYLES
   Baseado no Moveflux Design System + Identidade Visual Dr. Fábio Pizzini
   ========================================================================== */

:root {
  /* Surfaces */
  --bg-canvas: #e7e5e4;
  --bg-card: #ffffff;
  --bg-card-tinted: #f5f5f4;
  --bg-card-elevated: #fafaf9;
  --bg-dark: #1c1917;
  --bg-dark-subtle: #292524;
  --bg-brand-slate: #2f3840;
  --bg-brand-slate-deep: #232a31;
  --bg-glass: rgba(255, 255, 255, 0.86);

  /* Text Hierarchy */
  --text-primary: #1c1917;
  --text-secondary: #57534e;
  --text-muted: #78716c;
  --text-faint: #a8a29e;
  --text-on-dark: #ffffff;
  --text-on-dark-muted: #a8a29e;

  /* Brand & Accents (Dr. Fábio Pizzini + Moveflux) */
  --brand-teal: #76b9be;
  --brand-teal-light: #bae3e6;
  --brand-teal-deep: #4c8c91;
  --brand-taupe: #c6bcb3;
  --brand-rose: #ebbab3;
  --accent-orange: #fb923c;
  --accent-orange-deep: #f97316;
  --accent-yellow: #facc15;
  --accent-emerald: #10b981;
  --accent-sky: #38bdf8;
  --accent-rose: #f43f5e;

  /* Borders & Shadows */
  --border-hairline: rgba(28, 25, 23, 0.06);
  --border-card: #e7e5e4;
  --border-dark: #292524;
  --shadow-card: 0 2px 10px -2px rgba(28, 25, 23, 0.05), 0 1px 3px -1px rgba(28, 25, 23, 0.03);
  --shadow-card-hover: 0 14px 32px -6px rgba(28, 25, 23, 0.09), 0 4px 12px -2px rgba(28, 25, 23, 0.05);
  --shadow-float: 0 24px 48px -12px rgba(28, 25, 23, 0.22);

  /* Radii */
  --radius-card: 28px;
  --radius-inner: 20px;
  --radius-tile: 16px;
  --radius-pill: 9999px;
}

* {
  box-sizing: border-box;
}

html, body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: rgba(231, 229, 228, 0.6);
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb {
  background: #a8a29e;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #78716c;
}

/* Moveflux Card & Bento Surfaces */
.mf-card {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow-card);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.22s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease;
}

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

.mf-card-slate {
  background: linear-gradient(145deg, #2f3840 0%, #222930 100%);
  color: #ffffff;
  border-radius: var(--radius-card);
  border: 1px solid rgba(186, 227, 230, 0.14);
  box-shadow: 0 12px 32px -8px rgba(28, 25, 23, 0.28);
}

.mf-card-dark {
  background: linear-gradient(145deg, #1c1917 0%, #292524 100%);
  color: #ffffff;
  border-radius: var(--radius-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 32px -8px rgba(28, 25, 23, 0.28);
}

/* Brand Metallic Gradients */
.bg-brand-gradient {
  background: linear-gradient(135deg, #76b9be 0%, #bae3e6 55%, #76b9be 100%);
}

.bg-brand-slate-gradient {
  background: radial-gradient(circle at 85% 15%, rgba(118, 185, 190, 0.22), transparent 55%),
              linear-gradient(135deg, #2f3840 0%, #1e242b 100%);
}

.bg-moveflux-progress {
  background: linear-gradient(90deg, #76b9be 0%, #38bdf8 50%, #10b981 100%);
}

.bg-warm-progress {
  background: linear-gradient(90deg, #facc15 0%, #fb923c 55%, #f97316 100%);
}

.text-brand-gradient {
  background: linear-gradient(135deg, #76b9be 0%, #e0f5f7 50%, #8fd3d8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Conic Ring Gauges (Moveflux Signature Component) */
.conic-ring {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  transition: background 0.4s ease;
}

.conic-ring-inner {
  border-radius: 9999px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Top Navigation Pills */
.nav-tab-btn {
  position: relative;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-tab-btn.active {
  background-color: #1c1917;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(28, 25, 23, 0.18);
}

.nav-tab-btn:not(.active):hover {
  background-color: #e7e5e4;
  color: #1c1917;
}

/* Filter Controls */
.filter-select, .filter-input {
  background-color: #fafaf9;
  border: 1px solid #e7e5e4;
  border-radius: 14px;
  padding: 0.48rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: #1c1917;
  transition: all 0.15s ease;
  outline: none;
}

.filter-select:focus, .filter-input:focus {
  border-color: #76b9be;
  background-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(118, 185, 190, 0.22);
}

.filter-select.active-filter, .filter-input.active-filter {
  background-color: #f0fdfa;
  border-color: #4c8c91;
  color: #134e4a;
  font-weight: 600;
}

/* Quick Filter Pill */
.quick-pill {
  transition: all 0.18s ease;
  cursor: pointer;
  user-select: none;
}
.quick-pill:hover {
  transform: translateY(-1px);
}
.quick-pill.active {
  background-color: #1c1917 !important;
  color: #ffffff !important;
  border-color: #1c1917 !important;
}

/* Status Badges */
.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

/* Table Styling */
.mf-table th {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #78716c;
  font-weight: 700;
  padding: 0.85rem 1rem;
  background: #fafaf9;
  border-bottom: 1px solid #e7e5e4;
}

.mf-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #f5f5f4;
  vertical-align: middle;
}

.mf-table tr.proc-row {
  transition: background-color 0.15s ease;
}

.mf-table tr.proc-row:hover {
  background-color: #f5f5f4;
}

/* Brand Watermark Overlay */
.brand-watermark {
  pointer-events: none;
  user-select: none;
  opacity: 0.07;
  filter: grayscale(10%);
}

/* Modal Backdrop & Drawer */
.modal-backdrop {
  background-color: rgba(28, 25, 23, 0.55);
  backdrop-filter: blur(6px);
  transition: opacity 0.22s ease;
}

/* Pulse Live Dot */
@keyframes pulse-ring {
  0% { transform: scale(0.85); opacity: 0.9; }
  70% { transform: scale(1.9); opacity: 0; }
  100% { transform: scale(1.9); opacity: 0; }
}

.live-dot::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 9999px;
  background-color: currentColor;
  animation: pulse-ring 2s infinite;
}

/* Print / PDF Export Styles */
@media print {
  @page {
    size: A4 landscape;
    margin: 10mm;
  }

  body {
    background: #ffffff !important;
    color: #1c1917 !important;
    padding: 0 !important;
  }

  .no-print {
    display: none !important;
  }

  .print-only {
    display: block !important;
  }

  .mf-card, .mf-card-slate, .mf-card-dark {
    box-shadow: none !important;
    border: 1px solid #d6d3d1 !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .mf-card-slate, .mf-card-dark {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}
