/* ============================================
   CSS VARIABLES & RESET
   SGF26.1 - Funciona Mantenimiento
   ============================================ */
:root {
  /* Brand Colors */
  --color-primary: #fb941c;
  --color-primary-hover: #fc9d2e;
  --color-primary-light: rgba(251, 148, 28, 0.1);

  --color-secondary: #189ca0;
  --color-secondary-hover: #20b0b5;
  --color-secondary-light: rgba(24, 156, 160, 0.1);

  --color-tertiary: #edf1e4;
  --color-background: #f8f9fa;

  /* Accents */
  --color-accent-1: #fbcc5d;
  --color-accent-2: #fb732c;
  --color-accent-3: #dc7645;
  --color-accent-4: #347874;
  --color-accent-5: #eca870;

  /* Surface & Background */
  --color-bg: #fafbfc;
  --color-bg-secondary: #ffffff;
  --color-bg-tertiary: #f1f3f5;
  --color-surface: #ffffff;
  --color-surface-hover: #f8f9fa;
  --color-border: #e1e4e8;

  /* Semantic Colors */
  --color-success: #347874;
  --color-success-light: rgba(52, 120, 116, 0.1);
  --color-warning: #fbcc5d;
  --color-warning-light: rgba(251, 204, 93, 0.1);
  --color-danger: #dc7645;
  --color-danger-light: rgba(220, 118, 69, 0.1);
  --color-info: #189ca0;
  --color-info-light: rgba(24, 156, 160, 0.1);

  /* Text */
  --color-text: #24292e;
  --color-text-secondary: #586069;
  --color-text-muted: #6a737d;

  /* Social */
  --color-whatsapp: #25d366;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;

  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow: 350ms ease;

  /* Z-Index */
  --z-sidebar: 100;
  --z-header: 90;
  --z-modal: 200;
  --z-toast: 300;
  --z-loading: 400;

  /* Layout */
  --header-height: 64px;
  --sidebar-width: 280px;
  --actions-bar-height: 72px;
}

/* Reset & Base Styles */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--color-background);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary-hover);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input,
select,
textarea {
  font-family: inherit;
  font-size: 1rem;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ============================================
   LOGIN SCREEN
   ============================================ */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  background: linear-gradient(135deg, var(--color-tertiary) 0%, var(--color-background) 100%);
  position: relative;
}

.login-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 2px 2px, rgba(251, 148, 28, 0.05) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

.login-container {
  text-align: center;
  max-width: 420px;
  width: 100%;
  background: var(--color-bg-secondary);
  padding: var(--space-2xl);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  position: relative;
  z-index: 1;
}

.login-logo {
  width: 100px;
  height: 100px;
  margin: 0 auto var(--space-xl);
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent-2) 100%);
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: white;
  box-shadow: var(--shadow-lg);
  padding: var(--space-md);
}

.login-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.login-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: var(--space-sm);
  color: var(--color-text);
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent-2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-subtitle {
  font-size: 1.125rem;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-sm);
  font-weight: 500;
}

.login-description {
  color: var(--color-text-muted);
  margin-bottom: var(--space-xl);
  font-size: 0.9375rem;
}

.login-error {
  margin-top: var(--space-md);
  padding: var(--space-md);
  background: var(--color-danger-light);
  color: var(--color-danger);
  border-radius: var(--radius-md);
  border-left: 4px solid var(--color-danger);
  display: none;
  font-size: 0.875rem;
  text-align: left;
}

.login-error.show {
  display: block;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   APP LAYOUT
   ============================================ */
.app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ============================================
   HEADER
   ============================================ */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--color-bg-secondary);
  border-bottom: 2px solid var(--color-primary);
  display: flex;
  align-items: center;
  padding: 0 var(--space-md);
  gap: var(--space-md);
  z-index: var(--z-header);
  box-shadow: var(--shadow-sm);
}

.header-logo {
  display: none;
  height: 40px;
  margin-right: var(--space-sm);
}

.header-logo img {
  height: 100%;
  width: auto;
  object-fit: contain;
}

.header-btn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  transition: all var(--transition-fast);
  font-size: 1.25rem;
}

.header-btn:hover {
  background: var(--color-surface-hover);
  color: var(--color-primary);
}

.header-title {
  flex: 1;
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--color-text);
}

.admin-badge {
  display: none;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-md);
  background: linear-gradient(135deg, var(--color-accent-2) 0%, var(--color-danger) 100%);
  color: white;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: var(--shadow-sm);
  animation: pulse 2s ease-in-out infinite;
}

.admin-badge i {
  font-size: 0.875rem;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.8;
  }
}

.header-user {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: 2px solid var(--color-primary);
  object-fit: cover;
}

.btn-logout {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  background: var(--color-surface-hover);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.btn-logout:hover {
  background: var(--color-danger-light);
  border-color: var(--color-danger);
  color: var(--color-danger);
}

.btn-logout .logout-text {
  display: none;
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--color-bg-secondary);
  border-right: 1px solid var(--color-border);
  transform: translateX(-100%);
  transition: transform var(--transition-normal);
  z-index: var(--z-sidebar);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}

.sidebar.open {
  transform: translateX(0);
}

.sidebar-header {
  padding: var(--space-lg);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, var(--color-primary-light) 0%, transparent 100%);
}

.sidebar-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text);
}

.close-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  transition: all var(--transition-fast);
}

.close-btn:hover {
  background: var(--color-surface-hover);
  color: var(--color-text);
}

.sidebar-content {
  flex: 1;
  padding: var(--space-lg);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.sidebar-content::-webkit-scrollbar {
  width: 6px;
}

.sidebar-content::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-content::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: var(--radius-full);
}

.sidebar-content::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-muted);
}

.sidebar-footer {
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--color-border);
  font-size: 0.675rem;
  color: var(--color-text-muted);
  background: var(--color-tertiary);
}

.sidebar-footer p {
  margin: 0;
}

.version-info {
  margin-top: var(--space-xs);
  font-size: 0.75rem;
  color: var(--color-text-muted);
  opacity: 0.7;
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
  z-index: calc(var(--z-sidebar) - 1);
  backdrop-filter: blur(2px);
}

.sidebar-overlay.show {
  opacity: 1;
  visibility: visible;
}

/* Search Box */
.search-box {
  position: relative;
}

.search-box i {
  position: absolute;
  left: var(--space-md);
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
  font-size: 1rem;
}

.search-box input {
  width: 100%;
  padding: var(--space-md);
  padding-left: 2.75rem;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  transition: all var(--transition-fast);
  font-size: 0.9375rem;
}

.search-box input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

.search-box input::placeholder {
  color: var(--color-text-muted);
}

/* Filter Group */
.filter-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.filter-group label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-group select {
  padding: var(--space-md);
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 0.9375rem;
}

.filter-group select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

.filter-group select:hover {
  border-color: var(--color-primary);
}

/* Toggle View Button */
.toggle-view-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md);
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  font-weight: 600;
  transition: all var(--transition-fast);
}

.toggle-view-btn:hover {
  background: var(--color-primary-light);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.toggle-view-btn i {
  font-size: 1.125rem;
}

/* Refresh Button */
.refresh-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md);
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent-2) 100%);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-weight: 600;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.refresh-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.refresh-btn i {
  font-size: 1.125rem;
}

/* Loading Progress */
.loading-progress {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  background: var(--color-bg-secondary);
  padding: var(--space-md);
  border-bottom: 1px solid var(--color-border);
  z-index: calc(var(--z-header) - 1);
  box-shadow: var(--shadow-sm);
}

.progress-bar {
  height: 6px;
  background: var(--color-border);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: var(--space-sm);
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-accent-2) 100%);
  border-radius: var(--radius-full);
  transition: width var(--transition-normal);
  animation: shimmer 1.5s ease-in-out infinite;
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.loading-progress p {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  text-align: center;
  margin: 0;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
  flex: 1;
  padding: calc(var(--header-height) + var(--space-lg)) var(--space-md) calc(var(--space-lg) + 80px);
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

/* ============================================
   PEDIDOS GRID & CARDS
   ============================================ */
.pedidos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-lg);
  animation: fadeIn 0.3s ease;
  width: 100%;
  max-width: 100%;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.pedido-card {
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.pedido-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--color-primary);
  transform: scaleY(0);
  transition: transform var(--transition-fast);
}

.pedido-card:hover {
  border-color: var(--color-primary);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.pedido-card:hover::before {
  transform: scaleY(1);
}

.pedido-card:active {
  transform: translateY(-2px);
}

.pedido-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-md);
  gap: var(--space-sm);
}

.pedido-id {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-muted);
  font-family: "Courier New", monospace;
}

.pedido-status {
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--color-info-light);
  color: var(--color-info);
  white-space: nowrap;
}

.pedido-status.presupuesto {
  background: var(--color-warning-light);
  color: var(--color-warning);
}

.pedido-status.aprobado {
  background: var(--color-success-light);
  color: var(--color-success);
}

.pedido-status.vencido {
  background: var(--color-danger-light);
  color: var(--color-danger);
}

.pedido-status.agendado {
  background: var(--color-secondary-light);
  color: var(--color-secondary);
}

.pedido-status.completado {
  background: var(--color-success-light);
  color: var(--color-success);
}

.pedido-address {
  font-size: 1.0625rem;
  font-weight: 600;
  margin-bottom: var(--space-sm);
  color: var(--color-text);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

.pedido-tenant {
  font-size: 0.9375rem;
  color: var(--color-text-secondary);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.pedido-tenant i {
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

.pedido-card-footer {
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pedido-rubro {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-muted);
  background: var(--color-bg-tertiary);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pedido-footer-right {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.event-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 var(--space-xs);
  background: var(--color-primary);
  color: white;
  font-size: 0.6875rem;
  font-weight: 700;
  border-radius: var(--radius-full);
}

.pedido-arrow {
  color: var(--color-text-muted);
  transition: all var(--transition-fast);
  font-size: 1.125rem;
}

.pedido-card:hover .pedido-arrow {
  transform: translateX(4px);
  color: var(--color-primary);
}

/* Skeleton Loader */
.pedido-card.skeleton {
  pointer-events: none;
  animation: pulse 1.5s ease-in-out infinite;
}

.skeleton-header,
.skeleton-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-md);
}

.skeleton-line {
  height: 12px;
  background: var(--color-border);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-sm);
}

.skeleton-line.short {
  width: 60%;
}

.skeleton-badge {
  width: 60px;
  height: 20px;
  background: var(--color-border);
  border-radius: var(--radius-full);
}

/* Pedidos Table */
.pedidos-table-container {
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.pedidos-table-container table {
  width: 100%;
  border-collapse: collapse;
}

.pedidos-table-container th,
.pedidos-table-container td {
  padding: var(--space-md) var(--space-lg);
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.pedidos-table-container th {
  background: var(--color-bg-tertiary);
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pedidos-table-container tbody tr {
  transition: background var(--transition-fast);
}

.pedidos-table-container tbody tr:hover {
  background: var(--color-surface-hover);
}

.pedidos-table-container tbody tr:last-child td {
  border-bottom: none;
}

.pedidos-table-container td:last-child {
  text-align: right;
}

.btn-icon {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  background: transparent;
  border: 1px solid var(--color-border);
  transition: all var(--transition-fast);
}

.btn-icon:hover {
  background: var(--color-primary-light);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* Empty & Loading States */
.empty-state {
  text-align: center;
  padding: var(--space-2xl);
  color: var(--color-text-muted);
  background: var(--color-surface);
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-lg);
  margin: var(--space-lg) 0;
}

.empty-state i {
  font-size: 4rem;
  margin-bottom: var(--space-lg);
  color: var(--color-border);
}

.empty-state p {
  font-size: 1.125rem;
  margin: 0;
}

.empty-state-small {
  text-align: center;
  padding: var(--space-xl);
  color: var(--color-text-muted);
}

.empty-state-small i {
  font-size: 2.5rem;
  margin-bottom: var(--space-md);
  color: var(--color-border);
}

.empty-state-small p {
  font-size: 0.9375rem;
  margin: 0;
}

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl);
  gap: var(--space-md);
}

.spinner-small {
  width: 32px;
  height: 32px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-state p {
  color: var(--color-text-secondary);
  font-size: 0.9375rem;
  margin: 0;
}

/* ============================================
   DETAILS PAGE
   ============================================ */
.details-page {
  position: fixed;
  inset: 0;
  background: var(--color-background);
  transform: translateX(100%);
  transition: transform var(--transition-normal);
  z-index: calc(var(--z-header) + 1);
  display: flex;
  flex-direction: column;
}

.details-page.open {
  transform: translateX(0);
}

.details-header {
  height: var(--header-height);
  background: var(--color-bg-secondary);
  border-bottom: 2px solid var(--color-primary);
  display: flex;
  align-items: center;
  padding: 0 var(--space-md);
  gap: var(--space-md);
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.back-btn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  transition: all var(--transition-fast);
  font-size: 1.25rem;
}

.back-btn:hover {
  background: var(--color-surface-hover);
  color: var(--color-primary);
}

.header-pdf-btn {
  width: 44px;
  height: 44px;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  transition: all var(--transition-fast);
  font-size: 1.25rem;
  margin-left: auto;
  margin-right: var(--space-sm);
}

.header-pdf-btn:hover {
  background: var(--color-surface-hover);
  color: var(--color-danger);
}

.header-pdf-btn i {
  color: var(--color-danger);
}

@media (min-width: 768px) {
  .header-pdf-btn {
    display: flex;
  }
}

.details-title {
  flex: 1;
  min-width: 0;
}

.details-title h2 {
  font-size: 1rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--color-text);
  max-width: 200px;
}

.details-title p {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
  max-width: 200px;
}

.details-body {
  flex: 1;
  overflow-y: auto;
  padding-bottom: var(--actions-bar-height);
}

/* Tabs Navigation */
.tabs-nav {
  display: flex;
  background: var(--color-bg-secondary);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.tab-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: var(--space-md);
  color: var(--color-text-muted);
  border-bottom: 3px solid transparent;
  transition: all var(--transition-fast);
  position: relative;
}

.tab-btn:hover {
  color: var(--color-text-secondary);
  background: var(--color-surface-hover);
}

.tab-btn.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  background: var(--color-primary-light);
}

.tab-btn i {
  font-size: 1.25rem;
}

.tab-btn span {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tab-badge {
  position: absolute;
  top: var(--space-xs);
  right: var(--space-xs);
  min-width: 18px;
  height: 18px;
  padding: 0 var(--space-xs);
  background: var(--color-primary);
  color: white;
  font-size: 0.625rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Tab Panels */
.tabs-content {
  padding: var(--space-lg);
}

.tab-panel {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab-panel.active {
  display: block;
}

/* Info Tab */
.info-grid {
  display: grid;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.info-item {
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  transition: all var(--transition-fast);
}

.info-item:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

.info-item label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-text-muted);
  margin-bottom: var(--space-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.info-item p {
  font-size: 1rem;
  color: var(--color-text);
  margin: 0;
  line-height: 1.5;
}

.info-item.full-width {
  grid-column: 1 / -1;
}

.info-item p.description {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--color-text-secondary);
  white-space: pre-wrap;
}

/* Financial Section */
.financial-section {
  margin-top: var(--space-xl);
}

.financial-section h3 {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.financial-section h3 i {
  color: var(--color-primary);
}

.financial-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-md);
  padding: var(--space-lg);
  background: var(--color-tertiary);
  border-radius: var(--radius-lg);
  border: 2px solid var(--color-border);
}

.financial-item {
  text-align: center;
  padding: var(--space-md);
  background: var(--color-surface);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.financial-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.financial-item label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--color-text-muted);
  margin-bottom: var(--space-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.financial-item .value {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-text);
}

.financial-item .value.positive {
  color: var(--color-success);
}

.financial-item .value.negative {
  color: var(--color-danger);
}

/* History Tab */
.history-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.history-list.fade-in .history-item {
  animation: fadeInUp 0.3s ease forwards;
  opacity: 0;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.history-item {
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-left: 4px solid var(--color-primary);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  transition: all var(--transition-fast);
}

.history-item:hover {
  border-left-color: var(--color-accent-2);
  box-shadow: var(--shadow-sm);
}

.history-date {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--color-border);
}

.history-date i {
  color: var(--color-primary);
}

.history-content {
  font-size: 0.9375rem;
  color: var(--color-text-secondary);
  line-height: 1.7;
}

.history-content h2 {
  font-size: 1.0625rem;
  color: var(--color-text);
  margin-bottom: var(--space-md);
  font-weight: 700;
}

.history-content table {
  width: 100%;
  margin: var(--space-md) 0;
  border-collapse: collapse;
}

.history-content td {
  padding: var(--space-sm) 0;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--color-border);
}

.history-content td:first-child {
  font-weight: 600;
  color: var(--color-text-secondary);
  padding-right: var(--space-md);
}

/* Documents Tab */
.docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--space-lg);
}

.doc-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  padding: var(--space-xl) var(--space-lg);
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  color: var(--color-text);
  text-align: center;
  transition: all var(--transition-fast);
  animation: fadeIn 0.3s ease forwards;
  opacity: 0;
}

.doc-item:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.doc-item i {
  font-size: 2rem;
  color: var(--color-primary);
  transition: transform var(--transition-fast);
}

.doc-item:hover i {
  transform: scale(1.1);
}

.doc-item span {
  font-size: 0.8125rem;
  font-weight: 600;
}

/* Photos Tab */
.photos-section {
  margin-bottom: var(--space-2xl);
}

.photos-section:last-child {
  margin-bottom: 0;
}

.photos-section h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--color-text);
}

.photos-section h3 i {
  color: var(--color-primary);
  font-size: 1.125rem;
}

.photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: var(--space-md);
}

.photo-item {
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  position: relative;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  transition: all var(--transition-fast);
  animation: fadeIn 0.3s ease forwards;
  opacity: 0;
}

.photo-item:hover {
  border-color: var(--color-primary);
  transform: scale(1.05);
  box-shadow: var(--shadow-md);
  z-index: 1;
}

.photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-fast);
}

.photo-item:hover img {
  transform: scale(1.1);
}

.photo-item.video::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-item.video .play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2.5rem;
  color: white;
  z-index: 1;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
  transition: transform var(--transition-fast);
}

.photo-item.video:hover .play-icon {
  transform: translate(-50%, -50%) scale(1.2);
}

/* ============================================
   ACTIONS BAR & BUTTONS
   ============================================ */
.actions-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--actions-bar-height);
  background: var(--color-bg-secondary);
  border-top: 2px solid var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 0 var(--space-md);
  z-index: 10;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
}

.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all var(--transition-fast);
  min-width: 70px;
  border: 2px solid var(--color-border);
  background: var(--color-surface);
}

.action-btn i {
  font-size: 1.5rem;
}

.action-btn:hover {
  background: var(--color-surface-hover);
  border-color: var(--color-primary);
  color: var(--color-primary);
  transform: translateY(-2px);
}

.action-btn.primary {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent-2) 100%);
  color: white;
  border-color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

.action-btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.action-btn.whatsapp {
  color: var(--color-whatsapp);
  border-color: var(--color-whatsapp);
}

.action-btn.whatsapp:hover {
  background: rgba(37, 211, 102, 0.1);
  border-color: var(--color-whatsapp);
  transform: translateY(-2px);
}

/* ============================================
   MODALS
   ============================================ */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
  z-index: var(--z-modal);
  backdrop-filter: blur(4px);
}

.modal.open {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--color-bg-secondary);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: scale(0.9) translateY(20px);
  transition: transform var(--transition-normal);
  box-shadow: var(--shadow-xl);
}

.modal.open .modal-content {
  transform: scale(1) translateY(0);
}

.modal-content.modal-lg {
  max-width: 640px;
}

.modal-header {
  padding: var(--space-lg);
  border-bottom: 2px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, var(--color-primary-light) 0%, transparent 100%);
}

.modal-header h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text);
}

.modal-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: var(--color-surface-hover);
  color: var(--color-danger);
}

.modal-body {
  padding: var(--space-lg);
  overflow-y: auto;
  flex: 1;
}

.modal-body::-webkit-scrollbar {
  width: 6px;
}

.modal-body::-webkit-scrollbar-track {
  background: transparent;
}

.modal-body::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: var(--radius-full);
}

/* Form Styles */
.form-group {
  margin-bottom: var(--space-lg);
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: var(--space-sm);
  color: var(--color-text-secondary);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: var(--space-md);
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  transition: all var(--transition-fast);
  font-size: 0.9375rem;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.6;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-xl);
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 600;
  transition: all var(--transition-fast);
  cursor: pointer;
  border: none;
  width: 100%;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent-2) 100%);
  color: white;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-success {
  background: linear-gradient(135deg, var(--color-success) 0%, var(--color-accent-4) 100%);
  color: white;
  box-shadow: var(--shadow-sm);
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Success Modal */
.success-icon {
  text-align: center;
  font-size: 4rem;
  color: var(--color-success);
  margin-bottom: var(--space-lg);
  animation: scaleIn 0.5s ease;
}

@keyframes scaleIn {
  from {
    transform: scale(0);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

#successMessage {
  text-align: center;
  font-size: 1.125rem;
  color: var(--color-text);
  margin-bottom: var(--space-lg);
}

.whatsapp-actions {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}

.whatsapp-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md);
  background: var(--color-whatsapp);
  color: white;
  border-radius: var(--radius-md);
  font-weight: 600;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.whatsapp-btn:hover {
  background: #1da851;
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Lightbox Modal */
.modal-lightbox {
  background: rgba(0, 0, 0, 0.95);
  padding: 0;
}

.lightbox-close {
  position: absolute;
  top: var(--space-lg);
  right: var(--space-lg);
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-full);
  color: white;
  font-size: 1.75rem;
  z-index: 1000;
  transition: all var(--transition-fast);
  border: 3px solid rgba(255, 255, 255, 0.4);
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.4);
  transform: scale(1.15);
  border-color: rgba(255, 255, 255, 0.6);
}

.lightbox-content {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100vh;
  padding: var(--space-2xl);
}

.lightbox-content img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
}

.lightbox-content iframe {
  width: 100%;
  max-width: 900px;
  aspect-ratio: 16 / 9;
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
}

/* Budget Modal */
.budget-header {
  background: var(--color-tertiary);
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-xl);
  border: 2px solid var(--color-border);
}

.budget-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  font-size: 0.9375rem;
}

.budget-info .label {
  color: var(--color-text-muted);
  font-weight: 600;
}

.budget-info .value {
  font-weight: 700;
  color: var(--color-text);
}

.budget-observations {
  margin-top: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-border);
  font-size: 0.9375rem;
  color: var(--color-text-secondary);
  line-height: 1.6;
}

.services-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.service-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-lg);
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.service-item:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

.service-checkbox {
  display: flex;
  align-items: center;
}

.service-checkbox input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--color-primary);
  cursor: pointer;
}

.service-info {
  flex: 1;
  min-width: 150px;
}

.service-name {
  font-weight: 600;
  color: var(--color-text);
  cursor: pointer;
}

.service-price {
  font-size: 0.9375rem;
  color: var(--color-primary);
  font-weight: 700;
  margin-top: var(--space-xs);
}

.service-payer {
  min-width: 150px;
}

.service-payer select {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  background: var(--color-tertiary);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.service-payer select:focus {
  outline: none;
  border-color: var(--color-primary);
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast-container {
  position: fixed;
  bottom: calc(var(--actions-bar-height) + var(--space-lg));
  left: 50%;
  transform: translateX(-50%);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  width: calc(100% - var(--space-lg) * 2);
  max-width: 420px;
  pointer-events: none;
}

.toast {
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-left: 4px solid var(--color-info);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  box-shadow: var(--shadow-xl);
  animation: toastIn 0.3s ease forwards;
  pointer-events: auto;
}

.toast.removing {
  animation: toastOut 0.3s ease forwards;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(20px);
  }
}

.toast i {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.toast.success {
  border-left-color: var(--color-success);
}

.toast.success i {
  color: var(--color-success);
}

.toast.error {
  border-left-color: var(--color-danger);
}

.toast.error i {
  color: var(--color-danger);
}

.toast.warning {
  border-left-color: var(--color-warning);
}

.toast.warning i {
  color: var(--color-warning);
}

.toast.info {
  border-left-color: var(--color-info);
}

.toast.info i {
  color: var(--color-info);
}

.toast-message {
  flex: 1;
  font-size: 0.9375rem;
  color: var(--color-text);
  line-height: 1.5;
}

/* ============================================
   LOADING OVERLAY
   ============================================ */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-lg);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-fast);
  z-index: var(--z-loading);
  backdrop-filter: blur(4px);
}

.loading-overlay.show {
  opacity: 1;
  visibility: visible;
}

.spinner {
  width: 60px;
  height: 60px;
  border: 4px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-text {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin: 0;
}

/* ============================================
   SIMPLIO ATTRIBUTION
   ============================================ */
.simplio-attribution {
  position: fixed;
  bottom: 14px;
  right: 14px;
  background: rgba(255, 255, 255, 0.98);
  padding: 8px 14px;
  border-radius: 24px;
  box-shadow: var(--shadow-md);
  font-size: 11px;
  z-index: 999;
  transition: all 0.3s ease;
  border: 1px solid var(--color-border);
  pointer-events: auto;
}

.simplio-attribution:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
  background: white;
}

.simplio-attribution p {
  margin: 0;
  color: var(--color-text-muted);
  font-weight: 500;
}

.simplio-link {
  color: var(--color-primary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  transition: color var(--transition-fast);
}

.simplio-link:hover {
  color: var(--color-accent-2);
}

.simplio-logo {
  height: 15px;
  width: auto;
  vertical-align: middle;
  transition: transform var(--transition-fast);
}

.simplio-link:hover .simplio-logo {
  transform: scale(1.1);
}

.details-page.open ~ .simplio-attribution {
  display: none !important;
}

/* ============================================
   RESPONSIVE - TABLET (768px+)
   ============================================ */
@media (min-width: 768px) {
  .header-logo {
    display: block;
  }

  .btn-logout .logout-text {
    display: inline;
  }

  .main-content {
    padding-left: var(--space-xl);
    padding-right: var(--space-xl);
  }

  .pedidos-grid {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  }

  .info-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .photos-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }

  .tab-btn {
    flex-direction: row;
    gap: var(--space-sm);
  }

  .tab-btn span {
    font-size: 0.875rem;
  }

  .simplio-attribution {
    bottom: 16px;
    right: 16px;
    padding: 10px 16px;
    font-size: 12px;
  }

  .simplio-logo {
    height: 16px;
  }

  .details-title h2 {
    font-size: 1.125rem;
    max-width: 400px;
  }

  .details-title p {
    font-size: 0.8125rem;
    max-width: 400px;
  }
}

/* ============================================
   RESPONSIVE - DESKTOP (1024px+)
   Sidebar cerrado por defecto, hamburguesa visible
   ============================================ */
@media (min-width: 1024px) {
  /* --- SIDEBAR: Comienza CERRADO por defecto en desktop --- */
  .sidebar {
    /* Sidebar siempre comienza translateX(-100%) = CERRADO */
    transform: translateX(-100%);
    top: var(--header-height);
    height: calc(100vh - var(--header-height));
    transition: transform var(--transition-normal);
  }

  /* Cuando tiene clase .open, desliza desde la izquierda */
  .sidebar.open {
    transform: translateX(0);
  }

  /* --- HEADER: Botón hamburguesa SIEMPRE visible en desktop --- */
  /* Mostrar botón hamburguesa para abrir/cerrar sidebar */
  .header-btn#menuBtn {
    display: flex !important;
  }

  /* --- CONTENIDO PRINCIPAL: Margin dinámico según estado de sidebar --- */
  /* Sin margen cuando sidebar está CERRADA */
  .main-content {
    margin-left: 0;
    transition: margin-left var(--transition-normal);
  }

  /* Agregar margen cuando sidebar tiene clase .open */
  .sidebar.open ~ .main-content {
    margin-left: var(--sidebar-width);
  }

  /* --- SIDEBAR: Estilos en desktop --- */
  .sidebar-header .close-btn {
    /* Ocultar botón de cerrar (usa hamburguesa del header) */
    display: none;
  }

  /* --- GRID: 3 columnas en desktop --- */
  .pedidos-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  /* --- DETALLES: Título con ancho máximo --- */
  .details-title h2 {
    max-width: 600px;
  }

  .details-title p {
    max-width: 600px;
  }
}

/* ============================================
   RESPONSIVE - LARGE DESKTOP (1280px+)
   ============================================ */
@media (min-width: 1280px) {
  .pedidos-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .info-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ============================================
   RESPONSIVE - EXTRA LARGE DESKTOP (1600px+)
   ============================================ */
@media (min-width: 1600px) {
  .pedidos-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ============================================
   UTILITIES
   ============================================ */
.text-center {
  text-align: center;
}

.text-muted {
  color: var(--color-text-muted);
}

.mt-md {
  margin-top: var(--space-md);
}

.mb-md {
  margin-bottom: var(--space-md);
}

.hidden {
  display: none !important;
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
  .app-header,
  .sidebar,
  .actions-bar,
  .simplio-attribution {
    display: none !important;
  }

  .main-content {
    margin-left: 0;
    padding-top: 0;
  }
}
