/* MesaFácil - CSS Puro para Spring Boot */
/* Cores e Variáveis */
:root {
  /* Core brand */
  --primary: #c9a050;
  --primary-light: rgba(201, 160, 80, 0.15);
  --primary-dark: #a88535;
  --destructive-light: rgba(239, 68, 68, 0.1);

  --accent: #FFEDD5;
  --accent-light: rgba(45, 90, 71, 0.12);

  /* Backgrounds */
  --background: #faf8f5;
  --background-secondary: #f3efe9;
  --card: #ffffff;

  /* Text */
  --foreground: #1a1714;
  --muted: #6b635a;

  /* Borders */
  --border: #e8e4de;

  /* Status */
  --destructive: #c45c5c;
  --green: #2d5a47;
  --green-light: rgba(45, 90, 71, 0.12);

  /* Mantendo consistência com primary */
  --orange: #d97706;
  --orange-light: rgba(217, 119, 6, 0.12);

  /* Neutral */
  --gray: #6b635a;
  --gray-light: rgba(107, 99, 90, 0.1);

  /* Shadows (mais suaves e elegantes) */
  --shadow: 0 2px 8px rgba(26, 23, 20, 0.06);
  --shadow-lg: 0 12px 40px rgba(26, 23, 20, 0.12);
  --shadow-xl: 0 20px 60px rgba(26, 23, 20, 0.18);

  /* Radius */
  --radius: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;

  /* Typography */
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--background);
  color: var(--foreground);
  line-height: 1.6;
  min-height: 100vh;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

@media (min-width: 768px) {
  h1 { font-size: 3.5rem; }
  h2 { font-size: 2.5rem; }
}

a {
  color: inherit;
  text-decoration: none;
}

/* Utilities */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 640px) {
  .container { padding: 0 1.5rem; }
}

@media (min-width: 1024px) {
  .container { padding: 0 2rem; }
}

.text-center { text-align: center; }
.text-muted { color: var(--muted); }
.text-primary { color: var(--primary); }
.text-accent { color: var(--accent); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

.grid { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (min-width: 768px) {
  .md-grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md-grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  .lg-grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lg-grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lg-grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .lg-grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

.hidden { display: none; }
@media (min-width: 768px) {
  .md-flex { display: flex; }
  .md-hidden { display: none; }
}
@media (min-width: 1024px) {
  .lg-flex { display: flex; }
  .lg-block { display: block; }
  .lg-hidden { display: none; }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  box-shadow: 0 4px 14px rgba(249, 115, 22, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(249, 115, 22, 0.4);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--foreground);
}

.btn-outline:hover {
  background: var(--background-secondary);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
}

.btn-ghost:hover {
  background: var(--background-secondary);
  color: var(--foreground);
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
}

.btn-lg {
  padding: 0.875rem 2rem;
  font-size: 1rem;
}

.btn-icon {
  padding: 0.5rem;
  width: 2.5rem;
  height: 2.5rem;
}

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.card:hover {
  border-color: rgba(249, 115, 22, 0.3);
  box-shadow: var(--shadow-lg);
}

.card-body {
  padding: 1.5rem;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(249, 115, 22, 0.25);
}

.logo-icon svg {
  width: 1.25rem;
  height: 1.25rem;
  color: white;
}

.logo-text {
  font-size: 1.25rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav {
  display: none;
  align-items: center;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .nav { display: flex; }
}

.nav a {
  color: var(--muted);
  font-size: 0.875rem;
  transition: color 0.2s;
}

.nav a:hover {
  color: var(--foreground);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Hero Section */
.hero {
  position: relative;
  overflow: hidden;
  padding: 5rem 0 8rem;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--primary-light), transparent, var(--accent-light));
}

.hero-blob-1 {
  position: absolute;
  top: 5rem;
  left: 2.5rem;
  width: 18rem;
  height: 18rem;
  background: var(--primary-light);
  border-radius: 50%;
  filter: blur(60px);
}

.hero-blob-2 {
  position: absolute;
  bottom: 5rem;
  right: 2.5rem;
  width: 24rem;
  height: 24rem;
  background: var(--accent-light);
  border-radius: 50%;
  filter: blur(60px);
}

.hero-content {
  position: relative;
  max-width: 56rem;
  margin: 0 auto;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
}

.hero-title {
  margin-bottom: 1.5rem;
}

.hero-title .gradient {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.125rem;
  color: var(--muted);
  max-width: 42rem;
  margin: 0 auto 2.5rem;
}

@media (min-width: 640px) {
  .hero-subtitle { font-size: 1.25rem; }
}

.hero-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

@media (min-width: 640px) {
  .hero-actions { flex-direction: row; justify-content: center; }
}

/* Preview Cards */
.preview-container {
  margin-top: 4rem;
  max-width: 64rem;
  margin-left: auto;
  margin-right: auto;
}

.preview-card {
  position: relative;
  background: var(--card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border);
  overflow: hidden;
}

.preview-card-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--primary-light), var(--accent-light));
}

.preview-card-content {
  position: relative;
  padding: 2rem 3rem;
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 2rem;
}

@media (min-width: 768px) {
  .preview-card-content {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.preview-item {
  text-align: center;
}

.preview-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 4rem;
  height: 4rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  margin-bottom: 1rem;
  box-shadow: 0 4px 14px rgba(249, 115, 22, 0.25);
}

.preview-icon svg {
  width: 2rem;
  height: 2rem;
}

.preview-step {
  position: absolute;
  top: -0.5rem;
  right: -0.5rem;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
}

.preview-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.preview-desc {
  font-size: 0.875rem;
  color: var(--muted);
}

/* Features Section */
.features {
  padding: 5rem 0 8rem;
  background: var(--background-secondary);
}

.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-header h2 {
  margin-bottom: 1rem;
}

.section-header p {
  color: var(--muted);
  max-width: 42rem;
  margin: 0 auto;
  font-size: 1.125rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .features-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  .features-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.feature-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: all 0.3s;
}

.feature-card:hover {
  border-color: rgba(249, 115, 22, 0.3);
  box-shadow: 0 10px 30px rgba(249, 115, 22, 0.05);
}

.feature-icon {
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--primary-light), rgba(249, 115, 22, 0.05));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  margin-bottom: 1rem;
}

.feature-icon svg {
  width: 1.5rem;
  height: 1.5rem;
}

.feature-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.feature-desc {
  color: var(--muted);
}

/* How it Works Section */
.how-it-works {
  padding: 5rem 0 8rem;
}

.how-grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 3rem;
}

@media (min-width: 1024px) {
  .how-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.how-column h3 {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
}

.how-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
}

.how-icon.primary {
  background: var(--primary-light);
  color: var(--primary);
}

.how-icon.accent {
  background: var(--accent-light);
  color: var(--accent);
}

.how-icon svg {
  width: 1.25rem;
  height: 1.25rem;
}

.steps {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.step {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.step-number {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 700;
  flex-shrink: 0;
}

.step-text {
  padding-top: 0.25rem;
}

/* Benefits Section */
.benefits {
  padding: 5rem 0 8rem;
  background: linear-gradient(135deg, var(--primary-light), var(--accent-light));
}

.benefits-grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .benefits-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  .benefits-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.benefit-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
}

.benefit-icon {
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.benefit-icon svg {
  width: 1.5rem;
  height: 1.5rem;
  margin: 0 auto;
}

.benefit-title {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.benefit-desc {
  font-size: 0.875rem;
  color: var(--muted);
}

/* CTA Section */
.cta {
  padding: 5rem 0 8rem;
  text-align: center;
}

.cta h2 {
  margin-bottom: 1.5rem;
}

.cta p {
  color: var(--muted);
  font-size: 1.125rem;
  margin-bottom: 2.5rem;
}

/* Footer */
.footer {
  background: var(--background-secondary);
  border-top: 1px solid var(--border);
  padding: 3rem 0;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .footer-content {
    flex-direction: row;
    justify-content: space-between;
  }
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-logo-icon {
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  display: flex;
  align-items: center;
  justify-content: center;
}

.footer-logo-icon svg {
  width: 1rem;
  height: 1rem;
  color: white;
}

.footer-logo span {
  font-weight: 700;
}

.footer-copy {
  font-size: 0.875rem;
  color: var(--muted);
}

/* ============================================ */
/* DASHBOARD STYLES */
/* ============================================ */

/* Sidebar */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 16rem;
  background: var(--card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transform: translateX(-100%);
  transition: transform 0.3s ease, width 0.3s ease;
}

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

@media (min-width: 1024px) {
  .sidebar {
    transform: translateX(0);
  }
}

/* Sidebar Collapsed State */
@media (min-width: 1024px) {
  .sidebar.collapsed {
    width: 4.5rem;
    overflow: visible !important;
  }

  .sidebar.collapsed .sidebar-nav {
    overflow: visible;
  }

  .sidebar.collapsed .sidebar-nav ul {
    overflow: visible;
  }

  .sidebar.collapsed .sidebar-nav li {
    overflow: visible;
  }

  .sidebar.collapsed .logo-text,
  .sidebar.collapsed .nav-item > span:not(.nav-tooltip),
  .sidebar.collapsed .nav-badge,
  .sidebar.collapsed .sidebar-footer-info {
    display: none;
  }

  .sidebar.collapsed .sidebar-header {
    padding: 1rem;
    justify-content: center;
  }

  .sidebar.collapsed .logo {
    justify-content: center;
  }

  .sidebar.collapsed .sidebar-close {
    display: none;
  }

  .sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 0.75rem;
    overflow: visible;
  }

  .sidebar.collapsed .nav-item svg {
    width: 1.5rem;
    height: 1.5rem;
    flex-shrink: 0;
    display: block !important;
  }

  .sidebar.collapsed .nav-item > span:first-of-type {
    display: none !important;
  }

  .sidebar.collapsed .nav-tooltip {
    display: block;
  }

  .sidebar.collapsed .sidebar-footer {
    padding: 0.75rem;
  }

  .sidebar.collapsed .sidebar-footer-content {
    justify-content: center;
  }

  /* Main content adjustment when sidebar is collapsed */
  .main-content.sidebar-collapsed {
    margin-left: 4.5rem;
  }
}

/* Sidebar Toggle Button */
.sidebar-toggle {
  position: absolute;
  right: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--border);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  box-shadow: var(--shadow);
  transition: all 0.2s;
  z-index: 10;
}

.sidebar-toggle:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

.sidebar-toggle svg {
  width: 14px;
  height: 14px;
  transition: transform 0.3s ease;
}

.sidebar.collapsed .sidebar-toggle svg {
  transform: rotate(180deg);
}

@media (min-width: 1024px) {
  .sidebar-toggle {
    display: flex;
  }
}

/* Tooltip for collapsed sidebar */
.nav-item {
  position: relative;
}

.nav-tooltip {
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  margin-left: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: var(--foreground);
  color: var(--background);
  font-size: 0.8125rem;
  font-weight: 500;
  border-radius: var(--radius);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all 0.2s;
  z-index: 9999;
}

.nav-tooltip::before {
  content: '';
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-right-color: var(--foreground);
}

@media (min-width: 1024px) {
  .sidebar.collapsed .nav-item:hover .nav-tooltip {
    opacity: 1;
    visibility: visible;
  }
}

/* Mobile Sidebar Overlay */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 55;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}

@media (min-width: 1024px) {
  .sidebar-overlay { display: none; }
}

/* Hamburger Button */
.hamburger-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  background: var(--background-secondary);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
}

.hamburger-btn:hover {
  background: var(--border);
}

.hamburger-btn svg {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--foreground);
}

@media (min-width: 1024px) {
  .hamburger-btn { display: none; }
}

/* Mobile Sidebar Close Button */
.sidebar-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: none;
  background: var(--background-secondary);
  border-radius: var(--radius);
  cursor: pointer;
  margin-left: auto;
}

.sidebar-close:hover {
  background: var(--border);
}

.sidebar-close svg {
  width: 1rem;
  height: 1rem;
  color: var(--muted);
}

@media (min-width: 1024px) {
  .sidebar-close { display: none; }
}

.sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.sidebar-nav {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar.collapsed .sidebar-nav {
  overflow: visible !important;
}

.sidebar-nav ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  border-radius: var(--radius);
  color: var(--muted);
  transition: all 0.2s;
  cursor: pointer;
}

.nav-item:hover {
  background: var(--background-secondary);
  color: var(--foreground);
}

.nav-item.active {
  background: var(--primary-light);
  color: var(--primary);
}

.nav-item svg {
  width: 1.25rem;
  height: 1.25rem;
}

.nav-item span {
  flex: 1;
}

.nav-badge {
  background: var(--destructive);
  color: white;
  font-size: 0.75rem;
  padding: 0.125rem 0.375rem;
  border-radius: 9999px;
  min-width: 1.25rem;
  text-align: center;
}

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid var(--border);
}

/* Main Content Area */
.main-content {
  min-height: 100vh;
}

@media (min-width: 1024px) {
  .main-content { margin-left: 16rem; }
}

.dashboard-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.dashboard-header-content {
  padding: 0 1.5rem;
  height: 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dashboard-body {
  padding: 1.5rem;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

@media (min-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem;
}

.stat-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
}

.stat-icon.primary { background: var(--primary-light); color: var(--primary); }
.stat-icon.green { background: var(--green-light); color: var(--green); }
.stat-icon.orange { background: var(--orange-light); color: var(--orange); }
.stat-icon.gray { background: var(--gray-light); color: var(--gray); }

.stat-icon svg {
  width: 1.25rem;
  height: 1.25rem;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--muted);
}

/* Tables Section */
.section-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.section-header-row {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-title h2 {
  font-family: var(--font-display);
  font-size: 1.125rem;
}

.section-title p {
  font-family: var(--font-display);
  font-size: 0.875rem;
  color: var(--muted);
}

.tables-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  padding: 1.5rem;
}

@media (min-width: 768px) {
  .tables-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  .tables-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 1280px) {
  .tables-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

.table-card {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  transition: all 0.3s;
}

.table-card:hover {
  border-color: rgba(249, 115, 22, 0.3);
  box-shadow: 0 10px 30px rgba(249, 115, 22, 0.05);
}

.table-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.table-number {
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--primary-light), rgba(249, 115, 22, 0.05));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--primary);
}

.table-actions {
  opacity: 0;
  transition: opacity 0.2s;
}

.table-card:hover .table-actions {
  opacity: 1;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.status-badge svg {
  width: 1rem;
  height: 1rem;
}

.status-pending {
  background: var(--gray); /* claro, suave */
  color: var(--accent);             /* cor principal de destaque, laranja #f97316 */
  border: 1px solid rgba(249, 115, 22, 0.2);
}

.status-preparing {
  background: var(--info-light);    /* azul suave */
  color: var(--info);               /* azul principal #3b82f6 */
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.status-ready {
  background: var(--success-light); /* verde suave */
  color: var(--success);            /* verde principal #16a34a */
  border: 1px solid rgba(22, 163, 74, 0.2);
}

.status-cancelled {
  background: var(--destructive-light); /* vermelho suave */
  color: var(--destructive);            /* vermelho principal #ef4444 */
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.status-free {
  background: var(--green-light);
  color: var(--green);
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.status-occupied {
  background: var(--orange-light);
  color: var(--orange);
  border: 1px solid rgba(249, 115, 22, 0.2);
}

.status-closed {
  background: var(--gray-light);
  color: var(--gray);
  border: 1px solid rgba(107, 114, 128, 0.2);
}

.table-code {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.table-code span {
  font-family: monospace;
  font-weight: 500;
}

.table-buttons {
  display: flex;
  gap: 0.5rem;
  margin-top: auto;
}

.table-buttons .btn {
  flex: 1;
}

/* Empty State */
.empty-state {
  padding: 3rem;
  text-align: center;
}

.empty-icon {
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  background: var(--background-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}

.empty-icon svg {
  width: 2rem;
  height: 2rem;
  color: var(--muted);
}

.empty-state h3 {
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.empty-state p {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

/* ============================================ */
/* MENU PAGE STYLES */
/* ============================================ */

.menu-layout {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

@media (min-width: 1024px) {
  .menu-layout { flex-direction: row; }
}

/* Categories Sidebar */
.categories-sidebar {
  flex-shrink: 0;
}

@media (min-width: 1024px) {
  .categories-sidebar { width: 16rem; }
}

.categories-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.categories-header {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.categories-header h2 {
  font-size: 1rem;
}

.categories-list {
  padding: 0.5rem;
}

.category-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  border-radius: var(--radius);
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
  background: none;
  border: none;
  font: inherit;
  color: var(--muted);
  position: relative;
}

.category-item:hover {
  background: var(--background-secondary);
}

.category-item.active {
  background: var(--primary-light);
  color: var(--primary);
}

.category-item svg {
  width: 1rem;
  height: 1rem;
}

.category-name {
  flex: 1;
}

.category-count {
  font-size: 0.75rem;
}

.category-actions {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 0.25rem;
  opacity: 0;
  transition: opacity 0.2s;
}

.category-item:hover .category-actions {
  opacity: 1;
}

.category-actions button {
  padding: 0.25rem;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
}

.category-actions button:hover {
  color: var(--foreground);
}

.category-actions button.delete:hover {
  color: var(--destructive);
}

/* Menu Items Grid */
.menu-items-section {
  flex: 1;
}

.menu-items-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.menu-items-header {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
}

.menu-items-header h2 {
  font-size: 1rem;
}

.menu-items-header p {
  font-size: 0.875rem;
  color: var(--muted);
}

.menu-items-grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 1rem;
  padding: 1rem;
}

@media (min-width: 640px) {
  .menu-items-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1280px) {
  .menu-items-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.menu-item-card {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.3s;
}

.menu-item-card:hover {
  border-color: rgba(249, 115, 22, 0.3);
  box-shadow: var(--shadow-lg);
}

.menu-item-card.unavailable {
  opacity: 0.6;
}

.menu-item-image {
  height: 8rem;
  background: linear-gradient(135deg, var(--primary-light), rgba(249, 115, 22, 0.1));
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.menu-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.menu-item-image svg {
  width: 2rem;
  height: 2rem;
  color: var(--muted);
}

.unavailable-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
}

.unavailable-badge {
  background: var(--background-secondary);
  border: 1px solid var(--border);
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius);
  font-size: 0.75rem;
  color: var(--muted);
}

.menu-item-content {
  padding: 1rem;
}

.menu-item-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.menu-item-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu-item-price {
  color: var(--primary);
  font-weight: 700;
  white-space: nowrap;
}

.menu-item-desc {
  font-size: 0.875rem;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.menu-item-category {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.menu-item-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.menu-item-actions .btn {
  flex: 1;
}

/* Modal / Dialog */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--card);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 28rem;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95);
  transition: transform 0.2s;
}

.modal-overlay.active .modal {
  transform: scale(1);
}

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-size: 1.125rem;
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Form Elements */
.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.form-input {
  width: 100%;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font: inherit;
  background: var(--background);
  transition: border-color 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
}

.form-textarea {
  width: 100%;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font: inherit;
  background: var(--background);
  resize: vertical;
  min-height: 5rem;
}

.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.form-select {
  width: 100%;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font: inherit;
  background: var(--background);
  cursor: pointer;
}

.form-select:focus {
  outline: none;
  border-color: var(--primary);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.form-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem;
  background: var(--background-secondary);
  border-radius: var(--radius);
}

.form-switch-label p {
  font-size: 0.75rem;
  color: var(--muted);
}

.switch {
  position: relative;
  width: 2.5rem;
  height: 1.25rem;
  background: var(--border);
  border-radius: 9999px;
  cursor: pointer;
  transition: background 0.2s;
}

.switch.active {
  background: var(--primary);
}

.switch::after {
  content: '';
  position: absolute;
  top: 0.125rem;
  left: 0.125rem;
  width: 1rem;
  height: 1rem;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: var(--shadow);
}

.switch.active::after {
  transform: translateX(1.25rem);
}

/* SVG Icons - Inline */
.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon svg {
  width: 1em;
  height: 1em;
}

/* User Menu in Sidebar */
.user-menu-container {
  position: relative;
}

.user-menu-trigger {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  width: 100%;
  background: var(--background-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}

.user-menu-trigger:hover {
  background: var(--primary-light);
  border-color: var(--primary);
}

.user-avatar {
  width: 36px;
  height: 36px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 600;
  flex-shrink: 0;
}

.user-details {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--foreground);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-email {
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-menu-arrow {
  color: var(--muted);
  transition: transform 0.2s;
}

.user-menu-container.open .user-menu-arrow {
  transform: rotate(180deg);
}

.user-submenu {
  position: absolute;
  bottom: calc(100% + 0.5rem);
  left: 0;
  right: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.2s;
  z-index: 100;
}

.user-menu-container.open .user-submenu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.user-submenu-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: var(--foreground);
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: none;
}

.user-submenu-item:first-child {
  border-radius: var(--radius) var(--radius) 0 0;
}

.user-submenu-item:last-child {
  border-radius: 0 0 var(--radius) var(--radius);
}

.user-submenu-item:hover {
  background: var(--background-secondary);
}

.user-submenu-item.danger {
  color: var(--destructive);
}

.user-submenu-item.danger:hover {
  background: rgba(239, 68, 68, 0.1);
}

.user-submenu-item svg {
  width: 18px;
  height: 18px;
}

.user-submenu-divider {
  height: 1px;
  background: var(--border);
  margin: 0.25rem 0;
}

/* Collapsed sidebar - show only avatar */
.sidebar.collapsed .user-menu-trigger {
  justify-content: center;
  padding: 0.5rem;
}

.sidebar.collapsed .user-details,
.sidebar.collapsed .user-menu-arrow {
  display: none;
}

.sidebar.collapsed .user-submenu {
  left: 100%;
  bottom: 0;
  right: auto;
  min-width: 180px;
  margin-left: 0.5rem;
}

/* Validation Errors */
.form-input.error,
.language-option.error {
  border-color: var(--destructive) !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.form-error {
  font-size: 0.75rem;
  color: var(--destructive);
  margin-top: 0.375rem;
  display: block;
}


.form-label .required {
  color: var(--destructive);
  margin-left: 0.25rem;
}

/* ========================================
   Loading Overlay
   ======================================== */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.loading-overlay.active {
  opacity: 1;
  visibility: visible;
}

.loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 5rem;
  height: 5rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: 1.25rem;
  box-shadow: 0 8px 32px rgba(249, 115, 22, 0.4);
  animation: loading-pulse 1.5s ease-in-out infinite;
}

.loading-spinner svg {
  width: 2.5rem;
  height: 2.5rem;
  color: white;
  animation: loading-bounce 1s ease-in-out infinite;
}

.loading-text {
  margin-top: 1.25rem;
  color: white;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.025em;
}

.loading-dots {
  display: inline-flex;
  gap: 0.25rem;
  margin-left: 0.25rem;
}

.loading-dots span {
  width: 0.375rem;
  height: 0.375rem;
  background: white;
  border-radius: 50%;
  animation: loading-dot 1.4s ease-in-out infinite;
}

.loading-dots span:nth-child(1) { animation-delay: 0s; }
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes loading-pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 8px 32px rgba(249, 115, 22, 0.4);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 12px 40px rgba(249, 115, 22, 0.6);
  }
}

@keyframes loading-bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

@keyframes loading-dot {
  0%, 80%, 100% {
    transform: scale(0.6);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}