/* ══════════════════════════════════════════════
   GESA — BASE & GLOBAL LAYOUT STYLES
   ══════════════════════════════════════════════ */

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

html {
  font-size: 14px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-bg-base);
  color: var(--color-text-primary);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
  height: 100vh;
  height: 100dvh;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover {
  color: var(--color-primary-dark);
}

img {
  max-width: 100%;
  display: block;
}

input, select, textarea, button {
  font-family: inherit;
  font-size: inherit;
}

/* ─── MODERN SCROLLBARS ─── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: #94A3B8;
}

/* Dark scrollbar for deep navy sidebar */
.sidebar ::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
}
.sidebar ::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.28);
}

::selection {
  background: var(--color-primary-light);
  color: #FFFFFF;
}

/* ─── UTILITY CLASSES ─── */
.hidden { display: none !important; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.flex-1 { flex: 1; min-width: 0; }
.flex-wrap { flex-wrap: wrap; }

.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-5 { gap: var(--space-5); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.text-primary { color: var(--color-text-primary); }
.text-secondary { color: var(--color-text-secondary); }
.text-muted { color: var(--color-text-muted); }
.text-accent { color: var(--color-primary); }
.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }
.text-danger { color: var(--color-danger); }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.w-full { width: 100%; }
.h-full { height: 100%; }

.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mt-8 { margin-top: 32px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mb-8 { margin-bottom: 32px; }

/* ─── APP LAYOUT STRUCTURE ─── */
.app {
  display: flex;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background-color: var(--color-bg-base);
}

.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin-left: var(--sidebar-width);
  transition: margin-left var(--transition-smooth);
}

.sidebar.collapsed ~ .main-wrapper {
  margin-left: var(--sidebar-width-collapsed);
}

.content-area {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-6) var(--space-8);
  padding-bottom: var(--space-16);
  background-color: var(--color-bg-base);
}

/* ─── SKELETON LOADERS ─── */
.skeleton {
  background: linear-gradient(90deg, #F1F5F9 25%, #E2E8F0 50%, #F1F5F9 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─── ANIMATIONS ─── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes pulseGlow {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.15); opacity: 0.7; }
}

.animate-fade-in {
  animation: fadeIn var(--transition-smooth) forwards;
}

.animate-slide-up {
  animation: slideUp var(--transition-smooth) forwards;
}

/* ─── EMPTY STATE ─── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  background: var(--color-bg-surface);
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius-xl);
  margin: 20px 0;
}
.empty-state svg {
  width: 48px;
  height: 48px;
  color: var(--color-text-muted);
  margin-bottom: 16px;
}
.empty-state-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: 6px;
}
.empty-state-desc {
  font-size: 13px;
  color: var(--color-text-muted);
  max-width: 360px;
}

/* ─── PAYMENT STEPPER / TIMELINE ─── */
.payment-stepper {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 16px 0;
  padding: 16px;
  background: #F8FAFC;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
}

.step-item {
  display: flex;
  gap: 14px;
  position: relative;
}

.step-item:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 13px;
  top: 28px;
  bottom: -12px;
  width: 2px;
  background: var(--color-border);
}

.step-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 2px solid var(--color-border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 700;
  transition: all var(--transition-fast);
}

.step-item.active .step-icon {
  border-color: var(--color-primary);
  color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.step-item.completed .step-icon {
  background: var(--color-success);
  border-color: var(--color-success);
  color: #FFFFFF;
}

.step-content {
  flex: 1;
  padding-bottom: 4px;
}

.step-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text-primary);
}

.step-desc {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.step-actions {
  margin-top: 8px;
  display: flex;
  gap: 8px;
}

/* ─── RESPONSIVE RULES ─── */
@media (max-width: 1024px) {
  .content-area {
    padding: var(--space-5) var(--space-6);
  }
}

@media (max-width: 768px) {
  .main-wrapper {
    margin-left: 0 !important;
  }
  .content-area {
    padding: var(--space-4);
  }
}
