/* ==========================================================================
   Condomínio Sistema - Design System Premium v2
   ========================================================================== */

:root {
  /* Paleta principal - Indigo/Violeta premium */
  --primary-50: #eef2ff;
  --primary-100: #e0e7ff;
  --primary-200: #c7d2fe;
  --primary-300: #a5b4fc;
  --primary-400: #818cf8;
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-darker: #4338ca;
  --primary-light: #eef2ff;
  --primary-soft: #e0e7ff;

  --success-50: #ecfdf5;
  --success-100: #d1fae5;
  --success: #10b981;
  --success-dark: #059669;
  --success-darker: #047857;
  --success-light: #d1fae5;

  --warning-50: #fffbeb;
  --warning-100: #fef3c7;
  --warning: #f59e0b;
  --warning-dark: #d97706;
  --warning-darker: #b45309;
  --warning-light: #fef3c7;

  --danger-50: #fef2f2;
  --danger-100: #fee2e2;
  --danger: #ef4444;
  --danger-dark: #dc2626;
  --danger-darker: #b91c1c;
  --danger-light: #fee2e2;

  --info-50: #ecfeff;
  --info-100: #cffafe;
  --info: #06b6d4;
  --info-dark: #0891b2;
  --info-darker: #0e7490;
  --info-light: #cffafe;

  /* Neutros expandidos */
  --gray-25: #fcfcfd;
  --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;
  --gray-950: #020617;

  /* Layout */
  --sidebar-width: 268px;
  --sidebar-collapsed: 72px;
  --topbar-height: 64px;
  --sidebar-bg: #0f172a;
  --sidebar-bg-2: #1e293b;
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;
  --radius-2xl: 32px;
  --radius-full: 9999px;

  /* Sombras refinadas */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow: 0 4px 16px -2px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 12px 24px -6px rgba(15, 23, 42, 0.1), 0 4px 8px -6px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 24px 48px -12px rgba(15, 23, 42, 0.16), 0 8px 16px -8px rgba(15, 23, 42, 0.08);
  --shadow-xl: 0 32px 64px -12px rgba(15, 23, 42, 0.2), 0 12px 24px -8px rgba(15, 23, 42, 0.1);
  --shadow-inner: inset 0 2px 4px rgba(15, 23, 42, 0.06);
  --shadow-primary: 0 12px 24px -8px rgba(99, 102, 241, 0.55);
  --primary-ring: 0 0 0 4px rgba(99, 102, 241, 0.18);
  --shadow-success: 0 12px 24px -8px rgba(16, 185, 129, 0.5);
  --success-ring: 0 0 0 4px rgba(16, 185, 129, 0.18);
  --shadow-warning: 0 12px 24px -8px rgba(245, 158, 11, 0.5);
  --warning-ring: 0 0 0 4px rgba(245, 158, 11, 0.18);
  --shadow-danger: 0 12px 24px -8px rgba(239, 68, 68, 0.45);
  --danger-ring: 0 0 0 4px rgba(239, 68, 68, 0.18);
  --shadow-info: 0 12px 24px -8px rgba(6, 182, 212, 0.5);
  --info-ring: 0 0 0 4px rgba(6, 182, 212, 0.18);

  /* Gradientes */
  --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --gradient-primary-hover: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  --gradient-primary-soft: linear-gradient(135deg, #eef2ff 0%, #ede9fe 100%);
  --gradient-sidebar: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --gradient-success-hover: linear-gradient(135deg, #059669 0%, #047857 100%);
  --gradient-danger: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  --gradient-danger-hover: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  --gradient-warning: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  --gradient-warning-hover: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  --gradient-info: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
  --gradient-info-hover: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
  --gradient-hero: linear-gradient(135deg, #0f172a 0%, #312e81 100%);
  --gradient-surface: linear-gradient(180deg, #fff 0%, var(--gray-50) 100%);

  /* Tipografia */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;

  /* Espaçamento */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;

  /* Transições */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slower: 500ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Z-index */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-fixed: 300;
  --z-modal-backdrop: 400;
  --z-modal: 500;
  --z-popover: 600;
  --z-tooltip: 700;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background: var(--gray-100);
  color: var(--gray-800);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.011em;
  text-rendering: optimizeLegibility;
  -webkit-overflow-scrolling: touch;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-dark);
}

a:focus-visible {
  outline: none;
  box-shadow: var(--primary-ring);
  border-radius: var(--radius-xs);
}

::selection {
  background: var(--primary-200);
  color: var(--primary-darker);
}

/* Scrollbar sutil e moderno */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: var(--radius-full);
  border: 2px solid transparent;
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gray-400);
  border: none;
}

/* ==========================================================================
   Layout
   ========================================================================== */

.layout {
  display: flex;
  min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
  width: var(--sidebar-width);
  background: var(--gradient-sidebar);
  color: var(--gray-400);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: var(--z-fixed);
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-slow);
  box-shadow: 4px 0 32px rgba(2, 6, 23, 0.25);
}

.sidebar::-webkit-scrollbar {
  width: 4px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-full);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1.5rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
}

.sidebar-brand::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 1.5rem;
  right: 1.5rem;
  height: 1px;
  background: linear-gradient(90deg, var(--primary) 0%, transparent 100%);
  opacity: 0.5;
}

.sidebar-brand .logo {
  width: 44px;
  height: 44px;
  background: var(--gradient-primary);
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 1.25rem;
  flex-shrink: 0;
  box-shadow: var(--shadow-primary);
  position: relative;
}

.sidebar-brand .logo::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 13px;
  background: linear-gradient(135deg, transparent 0%, rgba(255, 255, 255, 0.2) 100%);
}

.sidebar-brand .brand-text {
  font-weight: 700;
  color: #fff;
  font-size: 1.05rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.sidebar-brand .brand-sub {
  font-size: 0.72rem;
  color: #94a3b8;
  font-weight: 400;
  letter-spacing: 0.02em;
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0.85rem;
}

.sidebar-section {
  padding: 1rem 0.85rem 0.5rem;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #64748b;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sidebar-section::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0.7;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 0.7rem 0.85rem;
  color: var(--gray-300);
  font-size: var(--text-sm);
  font-weight: 500;
  border-radius: var(--radius-sm);
  margin-bottom: 2px;
  transition: all var(--transition-base);
  border-left: 3px solid transparent;
  position: relative;
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  transform: translateX(4px);
}

.sidebar-link.active {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.35) 0%, rgba(99, 102, 241, 0.1) 100%);
  color: #fff;
  border-left-color: var(--primary);
  font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.sidebar-link.active::after {
  content: "";
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.7);
  animation: pulse-ring 2s ease-in-out infinite;
}

@keyframes pulse-ring {
  0%, 100% { opacity: 1; transform: translateY(-50%) scale(1); }
  50% { opacity: 0.6; transform: translateY(-50%) scale(1.3); }
}

.sidebar-link .icon {
  width: 24px;
  text-align: center;
  font-size: 1.05rem;
  flex-shrink: 0;
  opacity: 0.9;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-footer {
  padding: 1.25rem 1.4rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.8rem;
  color: #94a3b8;
}

.sidebar-footer-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  font-size: 0.72rem;
  color: #64748b;
}

.sidebar-footer-version {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.68rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  color: #94a3b8;
  letter-spacing: 0.04em;
}

.sidebar-footer .btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  font-weight: 500;
}

.sidebar-footer .btn:hover {
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.3);
  box-shadow: none;
  transform: none;
}

/* ---------- Main ---------- */
.main {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---------- Topbar ---------- */
.topbar {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--gray-200);
  padding: 0.85rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  box-shadow: var(--shadow-xs);
}

.topbar-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.topbar-title::before {
  content: "";
  width: 5px;
  height: 22px;
  border-radius: 3px;
  background: var(--gradient-primary);
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.35rem 0.75rem 0.35rem 0.35rem;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  transition: all var(--transition-base);
  cursor: pointer;
}

.topbar-user:hover {
  background: var(--gray-50);
  border-color: var(--gray-200);
  box-shadow: var(--shadow-sm);
}

.topbar-user .avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gradient-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: var(--shadow-primary);
  border: 2px solid #fff;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.topbar-user:hover .avatar {
  transform: scale(1.05);
  box-shadow: 0 14px 28px -10px rgba(99, 102, 241, 0.6);
}

.topbar-user .user-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-800);
  line-height: 1.3;
}

.topbar-user .user-role {
  font-size: 0.75rem;
  color: var(--gray-500);
  line-height: 1.3;
}

/* ---------- Content ---------- */
.content {
  padding: 2rem 2rem 2.5rem;
  flex: 1;
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
}

/* ==========================================================================
   Page Header
   ========================================================================== */

.page-header {
  margin-bottom: 2rem;
}

.page-title {
  font-size: var(--text-3xl);
  font-weight: 800;
  color: var(--gray-900);
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.page-subtitle {
  font-size: var(--text-base);
  color: var(--gray-500);
  margin-top: 0.35rem;
}

/* ==========================================================================
   Badges
   ========================================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
  letter-spacing: 0.01em;
  text-transform: capitalize;
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.badge-success { background: var(--success-100); color: var(--success-dark); }
.badge-danger { background: var(--danger-100); color: var(--danger-dark); }
.badge-warning { background: var(--warning-100); color: var(--warning-dark); }
.badge-info { background: var(--info-100); color: var(--info-dark); }
.badge-primary { background: var(--primary-100); color: var(--primary-dark); }
.badge-gray { background: var(--gray-100); color: var(--gray-600); }

/* ==========================================================================
   Cards
   ========================================================================== */

.card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--gray-200);
  transition: all var(--transition-slow);
  position: relative;
}

.card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--gray-300);
  transform: translateY(-2px);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.card-title {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.card-subtitle {
  font-size: var(--text-sm);
  color: var(--gray-500);
  margin-top: 0.25rem;
}

.card-body {
  padding: 0;
}

/* ==========================================================================
   Stats Grid (Dashboard)
   ========================================================================== */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.1rem;
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-slow);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.08) 0%, transparent 70%);
  border-radius: 50%;
  transform: translate(35%, -35%);
  transition: transform var(--transition-slower);
  pointer-events: none;
}

.stat-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-soft);
}

.stat-card:hover::before {
  transform: translate(30%, -30%) scale(1.25);
}

.stat-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius);
  background: var(--gradient-primary-soft);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
  transition: all var(--transition-slow);
  box-shadow: var(--shadow-xs);
}

.stat-card:hover .stat-icon {
  transform: scale(1.1) rotate(-5deg);
  box-shadow: var(--shadow-md);
}

.stat-info {
  flex: 1;
  min-width: 0;
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--gray-900);
  line-height: 1.1;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: var(--text-sm);
  color: var(--gray-500);
  font-weight: 500;
  margin-top: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   Quick Links
   ========================================================================== */

.quick-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.75rem;
}

.quick-links .btn {
  justify-content: flex-start;
  padding: 0.75rem 1rem;
  text-align: left;
  border-radius: 12px;
  height: 100%;
}

.quick-links .btn svg {
  flex-shrink: 0;
  opacity: 0.75;
}

/* ==========================================================================
   Toolbar
   ========================================================================== */

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.toolbar .card-title {
  font-size: 1.4rem;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition-base);
  line-height: 1.5;
  white-space: nowrap;
  box-shadow: var(--shadow-xs);
  position: relative;
  user-select: none;
  -webkit-user-select: none;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.btn:active {
  transform: translateY(0);
  box-shadow: var(--shadow-xs);
}

.btn:focus-visible {
  outline: none;
  box-shadow: var(--primary-ring);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: var(--shadow-primary);
}

.btn-primary:hover {
  background: var(--gradient-primary-hover);
  color: #fff;
  box-shadow: 0 16px 32px -10px rgba(99, 102, 241, 0.65);
}

.btn-primary:focus-visible {
  box-shadow: var(--primary-ring);
}

.btn-success {
  background: var(--gradient-success);
  color: #fff;
  box-shadow: var(--shadow-success);
}

.btn-success:hover {
  background: var(--gradient-success-hover);
  color: #fff;
  box-shadow: 0 16px 32px -10px rgba(16, 185, 129, 0.55);
}

.btn-success:focus-visible {
  box-shadow: var(--success-ring);
}

.btn-danger {
  background: var(--gradient-danger);
  color: #fff;
  box-shadow: var(--shadow-danger);
}

.btn-danger:hover {
  background: var(--gradient-danger-hover);
  color: #fff;
  box-shadow: 0 16px 32px -10px rgba(239, 68, 68, 0.5);
}

.btn-danger:focus-visible {
  box-shadow: var(--danger-ring);
}

.btn-warning {
  background: var(--gradient-warning);
  color: #fff;
  box-shadow: var(--shadow-warning);
}

.btn-warning:hover {
  background: var(--gradient-warning-hover);
  box-shadow: 0 16px 32px -10px rgba(245, 158, 11, 0.55);
}

.btn-warning:focus-visible {
  box-shadow: var(--warning-ring);
}

.btn-info {
  background: var(--gradient-info);
  color: #fff;
  box-shadow: var(--shadow-info);
}

.btn-info:hover {
  background: var(--gradient-info-hover);
  box-shadow: 0 16px 32px -10px rgba(6, 182, 212, 0.55);
}

.btn-info:focus-visible {
  box-shadow: var(--info-ring);
}

.btn-secondary {
  background: #fff;
  color: var(--gray-700);
  border-color: var(--gray-300);
  box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
  background: var(--gray-50);
  color: var(--gray-800);
  border-color: var(--gray-400);
  box-shadow: var(--shadow-sm);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary-soft);
}

.btn-outline:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary-dark);
}

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  border-radius: var(--radius-xs);
}

.btn-lg {
  padding: 0.8rem 1.6rem;
  font-size: var(--text-base);
  border-radius: var(--radius-sm);
}

.btn-block {
  width: 100%;
}

.btn-icon {
  padding: 0.5rem;
  width: 36px;
  height: 36px;
}

.btn-icon.btn-sm {
  width: 32px;
  height: 32px;
  padding: 0.375rem;
}

.btn-icon.btn-lg {
  width: 44px;
  height: 44px;
  padding: 0.625rem;
}

.btn[aria-busy="true"] {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.btn[aria-busy="true"]::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  color: inherit;
  filter: drop-shadow(0 0 0 currentColor);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   Alerts / Flash
   ========================================================================== */

.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;
  font-size: var(--text-sm);
  border: 1px solid transparent;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  animation: slideDown var(--transition-slow) cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-sm);
  position: relative;
}

.alert::before {
  content: "";
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.alert-success {
  background: linear-gradient(135deg, var(--success-50) 0%, var(--success-100) 100%);
  color: var(--success-dark);
  border-color: rgba(16, 185, 129, 0.25);
}

.alert-success::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23059669' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 11.08V12a10 10 0 1 1-5.93-9.14'/%3E%3Cpolyline points='22 4 12 14.08 6 10'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}

.alert-error {
  background: linear-gradient(135deg, var(--danger-50) 0%, var(--danger-100) 100%);
  color: var(--danger-dark);
  border-color: rgba(239, 68, 68, 0.25);
}

.alert-error::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23dc2626' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='15' y1='9' x2='9' y2='15'/%3E%3Cline x1='9' y1='9' x2='15' y2='15'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}

.alert-warning {
  background: linear-gradient(135deg, var(--warning-50) 0%, var(--warning-100) 100%);
  color: var(--warning-dark);
  border-color: rgba(245, 158, 11, 0.25);
}

.alert-warning::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23d97706' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z'/%3E%3Cline x1='12' y1='9' x2='12' y2='13'/%3E%3Cline x1='12' y1='17' x2='12.01' y2='17'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}

.alert-info {
  background: linear-gradient(135deg, var(--info-50) 0%, var(--info-100) 100%);
  color: var(--info-dark);
  border-color: rgba(6, 182, 212, 0.25);
}

.alert-info::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%230891b2' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='12' y1='16' x2='12' y2='12'/%3E%3Cline x1='12' y1='8' x2='12.01' y2='8'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}

/* ==========================================================================
   Tables
   ========================================================================== */

.table-responsive {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  margin: -0.25rem;
  padding: 0.25rem;
  -webkit-overflow-scrolling: touch;
}

table.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--text-sm);
}

table.table thead th {
  text-align: left;
  padding: 0.875rem 1rem;
  background: var(--gradient-surface);
  color: var(--gray-500);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  border-bottom: 2px solid var(--gray-200);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}

table.table thead th:first-child {
  border-top-left-radius: var(--radius-sm);
}

table.table thead th:last-child {
  border-top-right-radius: var(--radius-sm);
}

table.table tbody td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
  transition: background var(--transition-fast);
}

table.table tbody tr {
  transition: all var(--transition-fast);
}

table.table tbody tr:hover td {
  background: var(--gray-50);
}

table.table tbody tr:last-child td {
  border-bottom: none;
}

table.table tbody tr:last-child td:first-child {
  border-bottom-left-radius: var(--radius-sm);
}

table.table tbody tr:last-child td:last-child {
  border-bottom-right-radius: var(--radius-sm);
}

table.table tbody td .font-bold {
  font-weight: 600;
  color: var(--gray-800);
}

table.table tbody td .font-bold:hover {
  color: var(--primary);
}

.actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.actions form {
  display: inline;
}

.actions .btn {
  box-shadow: none;
}

.actions .btn:hover {
  box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   Badges
   ========================================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.32rem 0.75rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
  letter-spacing: 0.02em;
  text-transform: capitalize;
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.badge-success { background: var(--success-light); color: var(--success-dark); }
.badge-danger { background: var(--danger-light); color: var(--danger-dark); }
.badge-warning { background: var(--warning-light); color: var(--warning-dark); }
.badge-info { background: var(--info-light); color: var(--info-dark); }
.badge-primary { background: var(--primary-light); color: var(--primary-dark); }
.badge-gray { background: var(--gray-100); color: var(--gray-600); }

/* ==========================================================================
   Forms
   ========================================================================== */

.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--gray-700);
}

.form-label .required {
  color: var(--danger);
  margin-left: 0.15rem;
}

.form-control {
  width: 100%;
  padding: 0.7rem 1rem;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-size: var(--text-base);
  color: var(--gray-800);
  background: #fff;
  transition: all var(--transition-base);
  font-family: var(--font-sans);
}

.form-control:hover {
  border-color: var(--gray-400);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--primary-ring);
  background: #fff;
}

.form-control::placeholder {
  color: var(--gray-400);
  opacity: 1;
}

.form-control:disabled {
  background: var(--gray-50);
  color: var(--gray-500);
  cursor: not-allowed;
  opacity: 0.7;
}

.form-control:read-only {
  background: var(--gray-50);
}

textarea.form-control {
  resize: vertical;
  min-height: 100px;
  line-height: 1.6;
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  padding-right: 2.75rem;
  cursor: pointer;
}

select.form-control:focus {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%236366f1' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
  cursor: pointer;
}

.form-check input[type="checkbox"] {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--primary);
  cursor: pointer;
  border-radius: var(--radius-xs);
}

.form-check input[type="radio"] {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--primary);
  cursor: pointer;
}

.form-check label {
  font-size: var(--text-sm);
  color: var(--gray-700);
  cursor: pointer;
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--gray-100);
  flex-wrap: wrap;
}

.form-hint {
  font-size: var(--text-xs);
  color: var(--gray-500);
  margin-top: 0.4rem;
  line-height: 1.5;
}

.form-error {
  font-size: var(--text-xs);
  color: var(--danger);
  margin-top: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.form-error::before {
  content: "";
  width: 14px;
  height: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23ef4444' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='12' y1='8' x2='12' y2='12'/%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  flex-shrink: 0;
}

.form-control.is-invalid {
  border-color: var(--danger);
}

.form-control.is-invalid:focus {
  box-shadow: var(--danger-ring);
}

.form-control.is-valid {
  border-color: var(--success);
}

.form-control.is-valid:focus {
  box-shadow: var(--success-ring);
}

/* ==========================================================================
   Filters / Toolbar
   ========================================================================== */

.filters {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 1.5rem;
  padding: 1rem 1.25rem;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-xs);
  transition: all var(--transition-base);
}

.filters:focus-within {
  border-color: var(--primary-soft);
  box-shadow: var(--shadow-sm), var(--primary-ring);
}

.filters .form-control {
  width: auto;
  min-width: 180px;
}

.filters input[type="text"].form-control {
  min-width: 260px;
  flex: 1;
}

.filters .btn {
  flex-shrink: 0;
}

.report-filters,
.report-filters:focus-within {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.toolbar .card-title {
  font-size: var(--text-2xl);
}

/* ==========================================================================
   Detail view
   ========================================================================== */

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.detail-grid + .detail-grid {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--gray-100);
}

.detail-item {
  background: linear-gradient(180deg, var(--gray-50) 0%, #fff 100%);
  border: 1px solid var(--gray-200);
  border-radius: 14px;
  padding: 1.1rem 1.25rem;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.detail-item:hover {
  border-color: var(--primary-soft);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.detail-item .label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray-500);
  font-weight: 700;
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.detail-item .label::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0.5;
}

.detail-item .value {
  font-size: 0.95rem;
  color: var(--gray-800);
  font-weight: 500;
  word-break: break-word;
}

.detail-item .value.font-bold {
  font-weight: 700;
  color: var(--gray-900);
}

/* ==========================================================================
   Empty state
   ========================================================================== */

.empty {
  text-align: center;
  color: var(--gray-500);
  padding: 3.5rem 1.5rem;
}

.empty .empty-icon {
  font-size: 4rem;
  margin-bottom: 1.25rem;
  opacity: 0.4;
  display: inline-block;
  filter: grayscale(0.3);
  transition: all var(--transition-slow);
}

.empty:hover .empty-icon {
  transform: scale(1.15) rotate(-3deg);
  opacity: 0.55;
  filter: grayscale(0.1);
}

.empty .empty-title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--gray-700);
  margin-bottom: 0.4rem;
}

.empty .empty-text {
  font-size: var(--text-sm);
  color: var(--gray-500);
}

/* ==========================================================================
   Auth pages
   ========================================================================== */

.auth-body {
  background: var(--gradient-hero);
  display: block;
  min-height: 100vh;
  padding: 0;
  position: relative;
  overflow: hidden;
}

/* Oculta sidebar/topbar nas páginas de autenticação */
.auth-body .sidebar,
.auth-body .topbar,
.auth-body .menu-toggle,
.auth-body .sidebar-overlay {
  display: none !important;
}

.auth-body .layout {
  display: block;
  min-height: 100vh;
}

.auth-body .main {
  margin-left: 0;
  min-height: 100vh;
}

.auth-body .content {
  padding: 0 !important;
  max-width: none;
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-body .auth-wrapper {
  width: 100%;
  min-height: 100vh;
}

.auth-body::before {
  content: "";
  position: absolute;
  top: -25%;
  right: -10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.3) 0%, transparent 70%);
  border-radius: 50%;
  animation: float 8s ease-in-out infinite;
}

.auth-body::after {
  content: "";
  position: absolute;
  bottom: -25%;
  left: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.25) 0%, transparent 70%);
  border-radius: 50%;
  animation: float 10s ease-in-out infinite reverse;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(30px, -30px); }
}

.auth-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 4rem);
  padding: 1.5rem;
  position: relative;
  z-index: 1;
}

.auth-card {
  width: 100%;
  max-width: 460px;
  background: rgba(255, 255, 255, 0.98);
  border-radius: var(--radius-xl);
  box-shadow: 0 32px 64px -16px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1);
  padding: 2.5rem 2.5rem 2rem;
  animation: fadeInUp var(--transition-slower) cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(24px) saturate(180%);
  position: relative;
}

.auth-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 2.5rem;
  right: 2.5rem;
  height: 4px;
  background: var(--gradient-primary);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-logo {
  width: 72px;
  height: 72px;
  background: var(--gradient-primary);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 1.75rem;
  margin: 0 auto 1.5rem;
  box-shadow: var(--shadow-primary);
  position: relative;
}

.auth-logo::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, transparent 0%, rgba(255, 255, 255, 0.3) 100%);
}

.auth-title {
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--gray-900);
  letter-spacing: -0.03em;
  margin-bottom: 0.4rem;
}

.auth-subtitle {
  color: var(--gray-500);
  font-size: var(--text-sm);
  line-height: 1.5;
}

.auth-footer {
  text-align: center;
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--gray-200);
  font-size: var(--text-sm);
  color: var(--gray-500);
}

.auth-footer a {
  font-weight: 600;
  color: var(--primary);
}

.auth-footer a:hover {
  color: var(--primary-dark);
}

/* ==========================================================================
   Misc / Utilities
   ========================================================================== */

.text-muted { color: var(--gray-500); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-primary { color: var(--primary); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.font-bold { font-weight: 700; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.money {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.placa {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* Hover suave em links de tabela */
td a {
  transition: color 0.15s ease;
}

/* Card de formulário centralizado */
.card[style*="max-width"] {
  margin-left: auto;
  margin-right: auto;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

.menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--gray-200);
  font-size: 1.35rem;
  color: var(--gray-700);
  cursor: pointer;
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-xs);
  transition: all var(--transition-base);
  align-items: center;
  justify-content: center;
}

.menu-toggle:hover {
  background: var(--gray-50);
  border-color: var(--gray-300);
  color: var(--gray-900);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.65);
  backdrop-filter: blur(6px);
  z-index: calc(var(--z-fixed) - 1);
}

/* Tablet breakpoint - 768px to 1024px */
@media (max-width: 1024px) {
  .content {
    padding: 1.75rem;
  }

  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
  }
}

/* Mobile breakpoint - up to 768px */
@media (max-width: 992px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform var(--transition-slow);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main {
    margin-left: 0;
  }

  .content {
    padding: 1.5rem;
  }

  .topbar {
    padding: 0.85rem 1.5rem;
  }

  .menu-toggle {
    display: inline-flex !important;
  }

  .sidebar-overlay.show {
    display: block;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .quick-links {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Small mobile - up to 576px */
@media (max-width: 576px) {
  .content {
    padding: 1.25rem;
  }

  .card {
    padding: 1.25rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.25rem;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }

  .stat-card {
    padding: 1rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.65rem;
  }

  .stat-icon {
    width: 48px;
    height: 48px;
    font-size: 1.25rem;
    border-radius: var(--radius-sm);
  }

  .stat-value {
    font-size: 1.65rem;
  }

  .topbar-user .user-name,
  .topbar-user .user-role {
    display: none;
  }

  .topbar-user {
    padding: 0.25rem;
  }

  .page-title {
    font-size: var(--text-2xl);
  }

  .page-subtitle {
    font-size: var(--text-sm);
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .filters {
    padding: 0.875rem;
  }

  .filters .form-control,
  .filters input[type="text"].form-control {
    width: 100%;
    min-width: 0;
    flex: 1 1 100%;
  }

  .auth-card {
    padding: 2rem 1.75rem 1.75rem;
    border-radius: var(--radius-lg);
  }

  .auth-card::before {
    left: 1.75rem;
    right: 1.75rem;
  }

  .auth-logo {
    width: 64px;
    height: 64px;
    font-size: 1.5rem;
    border-radius: var(--radius);
  }

  .auth-title {
    font-size: var(--text-xl);
  }

  .quick-links {
    grid-template-columns: 1fr 1fr;
  }

  .quick-links .btn {
    font-size: 0.82rem;
    padding: 0.65rem 0.8rem;
  }

  .detail-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .detail-item {
    padding: 0.95rem 1rem;
  }

  .actions {
    gap: 0.35rem;
    flex-direction: column;
    align-items: stretch;
  }

  .actions .btn {
    width: 100%;
  }

  .toolbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .toolbar .btn {
    width: 100%;
  }

  table.table {
    font-size: 0.8rem;
  }

  table.table thead th,
  table.table tbody td {
    padding: 0.7rem 0.75rem;
  }
}

/* Extra small devices - up to 375px */
@media (max-width: 375px) {
  .content {
    padding: 1rem;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .stat-card {
    flex-direction: row;
    align-items: center;
  }

  .quick-links {
    grid-template-columns: 1fr;
  }

  .page-title {
    font-size: var(--text-xl);
  }
}

/* Reduced motion accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* High contrast mode */
@media (forced-colors: active) {
  .btn {
    border: 2px solid currentColor;
  }

  .badge {
    border: 1px solid currentColor;
  }
}
