@import url('./fonts.css');

/* =========================================
   VARIÁVEIS — Design System SMFy
   ========================================= */
:root {
  /* Primary — Violet */
  --primary-50:  #f5f3ff;
  --primary-100: #ede9fe;
  --primary-200: #ddd6fe;
  --primary-300: #c4b5fd;
  --primary-400: #a78bfa;
  --primary-500: #8b5cf6;
  --primary-600: #7c3aed;
  --primary-700: #6d28d9;
  --primary-800: #5b21b6;
  --primary-900: #4c1d95;

  /* Neutral — Slate */
  --gray-50:  #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;

  /* Status */
  --success:       #10b981;
  --success-bg:    #d1fae5;
  --success-text:  #065f46;
  --warning:       #f59e0b;
  --warning-bg:    #fef3c7;
  --warning-text:  #92400e;
  --danger:        #ef4444;
  --danger-bg:     #fee2e2;
  --danger-text:   #991b1b;
  --info:          #3b82f6;
  --info-bg:       #dbeafe;
  --info-text:     #1e40af;

  /* Background */
  --bg-base:   #eef2f8;
  --bg-card:   #ffffff;
  --bg-subtle: #f7f9fc;

  /* Layout */
  --sidebar-width: 240px;
  --header-height: 60px;

  /* Sidebar */
  --sidebar-bg:          #ffffff;
  --sidebar-border:      rgba(0,0,0,.07);
  --sidebar-text:        #64748b;
  --sidebar-text-hover:  #1e293b;
  --sidebar-text-active: #6d28d9;
  --sidebar-hover:       rgba(109,40,217,.06);
  --sidebar-active:      rgba(109,40,217,.10);
  --sidebar-active-dot:  #7c3aed;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0,0,0,.05);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px -1px rgba(0,0,0,.06);
  --shadow:    0 4px 8px -2px rgba(0,0,0,.10), 0 2px 4px -2px rgba(0,0,0,.06);
  --shadow-md: 0 8px 20px -4px rgba(0,0,0,.12), 0 4px 6px -4px rgba(0,0,0,.07);
  --shadow-lg: 0 20px 40px -8px rgba(0,0,0,.14), 0 8px 12px -6px rgba(0,0,0,.08);
  --shadow-xl: 0 32px 64px -16px rgba(0,0,0,.20), 0 0 0 1px rgba(0,0,0,.04);

  /* Radius */
  --radius-sm: 5px;
  --radius:    8px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Transitions */
  --ease:      all .15s ease;
  --ease-slow: all .28s cubic-bezier(.4,0,.2,1);
}

/* =========================================
   RESET
   ========================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-base);
  color: var(--gray-900);
  line-height: 1.5;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; }
ul, ol { list-style: none; }
img { max-width: 100%; display: block; }

/* =========================================
   APP LAYOUT
   ========================================= */
.app-layout {
  display: flex;
  min-height: 100vh;
}
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* =========================================
   PAGE STRUCTURE
   ========================================= */
.page-header {
  padding: 32px 36px 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.page-header-left { flex: 1; }
.page-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -.4px;
}
.page-subtitle {
  font-size: 13px;
  color: var(--gray-500);
  margin-top: 3px;
}
.page-body {
  padding: 24px 36px 52px;
  flex: 1;
}

/* =========================================
   TYPOGRAPHY UTILITIES
   ========================================= */
.text-xs   { font-size: 11px; }
.text-sm   { font-size: 13px; }
.text-base { font-size: 15px; }
.text-lg   { font-size: 17px; }
.text-xl   { font-size: 20px; }
.text-2xl  { font-size: 24px; }

.font-normal   { font-weight: 400; }
.font-medium   { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold     { font-weight: 700; }

.text-muted   { color: var(--gray-500); }
.text-danger  { color: var(--danger); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-primary { color: var(--primary-600); }

/* =========================================
   FLEX / LAYOUT UTILITIES
   ========================================= */
.flex         { display: flex; }
.inline-flex  { display: inline-flex; }
.flex-col     { flex-direction: column; }
.flex-wrap    { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start  { align-items: flex-start; }
.items-end    { align-items: flex-end; }
.justify-center  { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end     { justify-content: flex-end; }
.flex-1  { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }

.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-5 { gap: 20px; }
.gap-6 { gap: 24px; }

.w-full  { width: 100%; }
.h-full  { height: 100%; }
.hidden  { display: none !important; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* =========================================
   GRID
   ========================================= */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

/* =========================================
   AVATAR
   ========================================= */
.avatar {
  width: 36px; height: 36px;
  border-radius: var(--radius-full);
  background: var(--primary-100);
  color: var(--primary-700);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600;
  flex-shrink: 0; overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm  { width: 28px; height: 28px; font-size: 11px; }
.avatar-md  { width: 40px; height: 40px; font-size: 15px; }
.avatar-lg  { width: 48px; height: 48px; font-size: 18px; }
.avatar-xl  { width: 64px; height: 64px; font-size: 22px; }

/* =========================================
   TOAST NOTIFICATIONS
   ========================================= */
.toast-container {
  position: fixed; bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 9999; pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 16px;
  background: #1a2035;
  color: #fff;
  border-radius: var(--radius-md);
  font-size: 13.5px; font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,.18), 0 0 0 1px rgba(255,255,255,.06);
  animation: toastIn .22s cubic-bezier(.34,1.56,.64,1);
  pointer-events: all;
  min-width: 280px; max-width: 420px;
  border-left: 3px solid rgba(255,255,255,.15);
}
.toast-success { background: #062c22; border-left-color: var(--success); }
.toast-danger  { background: #3f0f0f; border-left-color: var(--danger); }
.toast-warning { background: #3d1f00; border-left-color: var(--warning); }
.toast.removing { animation: toastOut .2s ease forwards; }

@keyframes toastIn  { from { transform: translateX(110%) scale(.95); opacity: 0; } to { transform: translateX(0) scale(1); opacity: 1; } }
@keyframes toastOut { from { transform: translateX(0); opacity: 1; } to { transform: translateX(110%); opacity: 0; } }

/* =========================================
   LOADING OVERLAY
   ========================================= */
.loading-overlay {
  position: fixed; inset: 0;
  background: rgba(238,242,248,.8);
  display: flex; align-items: center; justify-content: center;
  z-index: 9998; backdrop-filter: blur(3px);
}
.spinner {
  width: 22px; height: 22px;
  border: 2.5px solid var(--gray-200);
  border-top-color: var(--primary-600);
  border-radius: 50%;
  animation: spin .65s linear infinite;
  flex-shrink: 0;
}
.spinner-lg { width: 44px; height: 44px; border-width: 3px; }
@keyframes spin   { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity:0; transform:translateY(10px) } to { opacity:1; transform:translateY(0) } }

/* =========================================
   EMPTY STATE
   ========================================= */
.empty-state {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 72px 32px; text-align: center;
}
.empty-icon {
  width: 60px; height: 60px;
  background: var(--bg-subtle);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
  color: var(--gray-400);
}
.empty-title {
  font-size: 15px; font-weight: 600;
  color: var(--gray-800); margin-bottom: 6px;
}
.empty-desc {
  font-size: 13px; color: var(--gray-500);
  max-width: 300px; margin-bottom: 24px; line-height: 1.65;
}

/* =========================================
   DIVIDER
   ========================================= */
.divider { height: 1px; background: var(--gray-200); margin: 20px 0; }

/* =========================================
   SECTION HEADER
   ========================================= */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.section-title {
  font-size: 15px; font-weight: 600; color: var(--gray-800);
}

/* =========================================
   SCROLLBAR
   ========================================= */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .page-header, .page-body { padding-left: 20px; padding-right: 20px; }
}
