/* ========================================================
   DIGISTORE PRO - BRIGHT, VIBRANT, MODERN SAAS DESIGN
   ======================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Bright & Vibrant Theme Palette */
  --bg-body: #f8fafc;
  --bg-sidebar: #ffffff;
  --bg-header: rgba(255, 255, 255, 0.95);
  --bg-card: #ffffff;
  --bg-card-hover: #fcfcfd;
  --bg-card-secondary: #f8fafc;
  --border-color: #e2e8f0;
  --border-focus: #4f46e5;
  
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #94a3b8;

  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #eef2ff;
  --primary-border: #c7d2fe;
  
  --emerald: #059669;
  --emerald-bg: #ecfdf5;
  --emerald-border: #a7f3d0;

  --amber: #d97706;
  --amber-bg: #fffbeb;
  --amber-border: #fde68a;

  --rose: #e11d48;
  --rose-bg: #fff1f2;
  --rose-border: #fecdd3;

  --sky: #0284c7;
  --sky-bg: #f0f9ff;
  --sky-border: #bae6fd;

  --purple: #7c3aed;
  --purple-bg: #f5f3ff;
  --purple-border: #ddd6fe;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-body);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Bright Cards */
.bright-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 20px 25px -5px rgba(0, 0, 0, 0.02);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.bright-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 12px 24px -6px rgba(0, 0, 0, 0.07), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
  transform: translateY(-2px);
}

/* KPI Card Header Glow */
.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #4f46e5, #06b6d4, #10b981);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.kpi-card:hover::before {
  opacity: 1;
}

/* Badges */
.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.badge-success {
  background-color: var(--emerald-bg);
  color: var(--emerald);
  border: 1px solid var(--emerald-border);
}

.badge-warning {
  background-color: var(--amber-bg);
  color: var(--amber);
  border: 1px solid var(--amber-border);
}

.badge-danger {
  background-color: var(--rose-bg);
  color: var(--rose);
  border: 1px solid var(--rose-border);
}

.badge-info {
  background-color: var(--sky-bg);
  color: var(--sky);
  border: 1px solid var(--sky-border);
}

.badge-purple {
  background-color: var(--purple-bg);
  color: var(--purple);
  border: 1px solid var(--purple-border);
}

.badge-neutral {
  background-color: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

/* Bright Sidebar Link */
/* Sidebar Link Styling - Elegant & Modern */
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: 0.85rem;
  font-size: 0.825rem;
  font-weight: 700;
  color: #64748b;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: left;
  position: relative;
}

.sidebar-link .nav-icon-box {
  width: 2rem;
  height: 2rem;
  border-radius: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.sidebar-link:hover {
  background-color: #f8fafc;
  color: #0f172a;
  border-color: #e2e8f0;
  transform: translateX(2px);
}

.sidebar-link:hover .nav-icon-box {
  transform: scale(1.08);
}

.sidebar-link.active {
  background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
  color: #ffffff !important;
  box-shadow: 0 10px 20px -5px rgba(37, 99, 235, 0.35);
  border-color: rgba(255, 255, 255, 0.2);
}

.sidebar-link.active .nav-icon-box {
  background: rgba(255, 255, 255, 0.2) !important;
  color: #ffffff !important;
}

.sidebar-link.active i {
  color: #ffffff !important;
}

.sidebar-link.active span {
  color: #ffffff !important;
}

/* Neon Glow Alert Widgets for Dashboard */
.dash-alert-card {
  position: relative;
  overflow: hidden;
  border-radius: 1.25rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dash-alert-card:hover {
  transform: translateY(-2px);
}

.dash-alert-amber {
  background: linear-gradient(180deg, #fffbf0 0%, #ffffff 100%);
  border: 2px solid #f59e0b;
  box-shadow: 0 12px 24px -6px rgba(245, 158, 11, 0.22);
}

.dash-alert-blue {
  background: linear-gradient(180deg, #f0f7ff 0%, #ffffff 100%);
  border: 2px solid #3b82f6;
  box-shadow: 0 12px 24px -6px rgba(59, 130, 246, 0.22);
}

.dash-alert-rose {
  background: linear-gradient(180deg, #fff1f2 0%, #ffffff 100%);
  border: 2px solid #f43f5e;
  box-shadow: 0 12px 24px -6px rgba(244, 63, 94, 0.22);
}

/* Official Corporate Invoice Stamp */
.corporate-stamp {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 3.5px double #1d4ed8;
  color: #1d4ed8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  transform: rotate(-12deg);
  position: relative;
  background: rgba(239, 246, 255, 0.45);
  box-shadow: inset 0 0 12px rgba(29, 78, 216, 0.12);
  user-select: none;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
}

.corporate-stamp-inner {
  width: 116px;
  height: 116px;
  border-radius: 50%;
  border: 1.5px dashed #1d4ed8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4px;
}

/* Custom Table */
.custom-table {
  width: 100%;
  text-align: left;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.custom-table thead th {
  padding: 0.95rem 1.25rem;
  background-color: #f8fafc;
  color: #64748b;
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  border-bottom: 1px solid #e2e8f0;
}

.custom-table tbody tr {
  border-bottom: 1px solid #f1f5f9;
  transition: background-color 0.15s ease;
}

.custom-table tbody tr:hover {
  background-color: #f8fafc;
}

.custom-table tbody td {
  padding: 1rem 1.25rem;
  color: #1e293b;
  vertical-align: middle;
}

/* Modal Overlay */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

/* Toast */
.toast-alert {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  animation: toastPop 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes toastPop {
  from {
    transform: translateY(20px) scale(0.95);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

/* Print Invoice Styling */
@media print {
  body * {
    visibility: hidden;
  }
  #invoice-capture-area, #invoice-capture-area *, 
  #public-invoice-capture-area, #public-invoice-capture-area *,
  #printable-receipt, #printable-receipt * {
    visibility: visible;
  }
  #invoice-capture-area, #public-invoice-capture-area, #printable-receipt {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0 !important;
    padding: 16px !important;
    border: none !important;
    box-shadow: none !important;
    background: white !important;
    color: black !important;
  }
}

/* ========================================================
   MOBILE RESPONSIVENESS & TOUCH OPTIMIZATIONS
   ======================================================== */
@media (max-width: 640px) {
  .modal-backdrop {
    padding: 0.75rem;
  }
  .bright-card {
    border-radius: 1rem;
  }
  .custom-table th, 
  .custom-table td {
    padding: 0.75rem 0.85rem;
    font-size: 0.75rem;
  }
  .custom-table {
    min-width: 620px;
  }
}

/* Smooth Horizontal Scrollbar for Mobile Tables */
.overflow-x-auto {
  -webkit-overflow-scrolling: touch;
}

.overflow-x-auto::-webkit-scrollbar {
  height: 5px;
}

.overflow-x-auto::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

.overflow-x-auto::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.overflow-x-auto::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}
