/* ============================================
   MEBEL JEPARA PRO — Design System
   Premium Furniture Business Management App
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Playfair+Display:wght@400;500;600;700&display=swap');

/* ---- CSS Custom Properties ---- */
:root {
  /* Primary - Warm Wood Tones */
  --primary-50: #fdf8f0;
  --primary-100: #f5e6d0;
  --primary-200: #e8c89c;
  --primary-300: #d4a574;
  --primary-400: #c9956b;
  --primary-500: #b07d4f;
  --primary-600: #8B4513;
  --primary-700: #6d360f;
  --primary-800: #4a250a;
  --primary-900: #2d1606;

  /* Accent - Gold */
  --accent-300: #ffd97d;
  --accent-400: #f0c75e;
  --accent-500: #d4a843;
  --accent-600: #b8922e;

  /* Neutral - Warm Grays */
  --neutral-50: #faf9f7;
  --neutral-100: #f0ede8;
  --neutral-200: #e0dbd3;
  --neutral-300: #c7bfb3;
  --neutral-400: #a89d8f;
  --neutral-500: #8a7e6e;
  --neutral-600: #6b6155;
  --neutral-700: #4d453c;
  --neutral-800: #302a24;
  --neutral-900: #1a1612;
  --neutral-950: #0f0d0a;

  /* Status Colors */
  --success: #22c55e;
  --success-bg: rgba(34, 197, 94, 0.12);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.12);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.12);
  --info: #3b82f6;
  --info-bg: rgba(59, 130, 246, 0.12);

  /* Glass */
  --glass-bg: rgba(30, 26, 22, 0.65);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);

  /* Layout */
  --sidebar-width: 260px;
  --sidebar-collapsed: 72px;
  --header-height: 70px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: 0.2s var(--ease-out);
  --transition-normal: 0.35s var(--ease-out);
  --transition-slow: 0.5s var(--ease-out);
}

/* ============================================
   LOGIN SCREEN
   ============================================ */

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(139, 69, 19, 0.25) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 80%, rgba(212, 168, 67, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, #0f0d0a 0%, #1a1612 100%);
  animation: loginBgPulse 8s ease-in-out infinite alternate;
}

@keyframes loginBgPulse {
  0% {
    opacity: 1;
  }

  100% {
    opacity: 0.85;
  }
}

.login-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: rgba(28, 24, 20, 0.85);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-xl);
  padding: 48px 40px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.04);
  animation: loginCardIn 0.6s var(--ease-out);
}

@keyframes loginCardIn {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.login-logo {
  text-align: center;
  margin-bottom: 36px;
}

.login-logo-icon {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, var(--primary-500), var(--accent-500));
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  margin: 0 auto 16px;
  box-shadow: 0 8px 24px rgba(139, 69, 19, 0.3);
}

.login-logo h1 {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  background: linear-gradient(135deg, var(--primary-200), var(--accent-400));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-logo p {
  font-size: 0.72rem;
  letter-spacing: 3px;
  color: var(--neutral-500);
  font-weight: 600;
}

.login-form h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--neutral-100);
  text-align: center;
  margin-bottom: 8px;
  font-family: 'Inter', sans-serif;
}

.login-subtitle {
  font-size: 0.82rem;
  color: var(--neutral-500);
  text-align: center;
  margin-bottom: 28px;
}

.pin-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--neutral-400);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  text-align: center;
}

.pin-input-group {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 20px;
}

.pin-box {
  width: 48px;
  height: 56px;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--neutral-100);
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  font-family: 'Inter', sans-serif;
  transition: all var(--transition-fast);
  caret-color: var(--primary-400);
}

.pin-box:focus {
  border-color: var(--primary-400);
  background: rgba(139, 69, 19, 0.1);
  box-shadow: 0 0 0 3px rgba(139, 69, 19, 0.2);
  outline: none;
}

.pin-box.filled {
  border-color: var(--primary-500);
  background: rgba(139, 69, 19, 0.08);
}

.login-error {
  color: var(--danger);
  font-size: 0.8rem;
  text-align: center;
  min-height: 20px;
  margin-bottom: 8px;
  font-weight: 500;
}

.login-btn {
  width: 100%;
  justify-content: center;
  padding: 14px;
  font-size: 1rem;
}

/* Shake animation for wrong PIN */
@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  20% {
    transform: translateX(-12px);
  }

  40% {
    transform: translateX(10px);
  }

  60% {
    transform: translateX(-8px);
  }

  80% {
    transform: translateX(6px);
  }
}

.login-card.shake {
  animation: shake 0.4s ease-out;
}

.pin-box.error {
  border-color: var(--danger);
  background: rgba(239, 68, 68, 0.08);
}

/* Logout button */
.logout-btn {
  width: 100%;
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.15);
  border-radius: var(--radius-md);
  color: var(--neutral-400);
  font-size: 0.82rem;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.logout-btn svg {
  flex-shrink: 0;
  opacity: 0.7;
  transition: opacity var(--transition-fast);
}

.logout-btn:hover {
  color: #ff6b6b;
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.35);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.15);
}

.logout-btn:hover svg {
  opacity: 1;
}

/* Forgot PIN link */
.forgot-pin-link {
  display: block;
  width: 100%;
  text-align: center;
  margin-top: 16px;
  background: none;
  border: none;
  color: var(--neutral-500);
  font-size: 0.82rem;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  font-family: 'Inter', sans-serif;
}

.forgot-pin-link:hover {
  color: var(--primary-300);
  background: rgba(255, 255, 255, 0.03);
}

/* Recovery Code Display */
.recovery-code-box {
  background: rgba(212, 168, 67, 0.08);
  border: 2px dashed var(--accent-500);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  margin: 20px 0;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.recovery-code-box:hover {
  background: rgba(212, 168, 67, 0.12);
  border-color: var(--accent-400);
}

.recovery-code-box .recovery-code-value {
  font-family: 'Courier New', monospace;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 6px;
  color: var(--accent-400);
  user-select: all;
  margin-bottom: 8px;
}

.recovery-code-box .recovery-code-hint {
  font-size: 0.72rem;
  color: var(--neutral-500);
}

.recovery-warning {
  font-size: 0.78rem;
  color: var(--warning);
  text-align: center;
  margin-bottom: 20px;
  padding: 8px;
  background: var(--warning-bg);
  border-radius: var(--radius-md);
  font-weight: 500;
}

/* Logout Confirmation Modal */
.logout-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.logout-overlay.active {
  display: flex;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.logout-modal {
  background: rgba(28, 24, 20, 0.95);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-xl);
  padding: 32px;
  max-width: 420px;
  width: 90%;
  text-align: center;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
  animation: slideUp 0.3s var(--ease-out);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.logout-modal-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  background: rgba(239, 68, 68, 0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }
}

.logout-modal h3 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--neutral-100);
  margin-bottom: 12px;
  font-family: 'Inter', sans-serif;
}

.logout-modal p {
  font-size: 0.9rem;
  color: var(--neutral-400);
  margin-bottom: 28px;
  line-height: 1.6;
}

.logout-modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.btn-logout-cancel,
.btn-logout-confirm {
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
}

.btn-logout-cancel {
  background: rgba(255, 255, 255, 0.05);
  color: var(--neutral-300);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-logout-cancel:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--neutral-100);
}

.btn-logout-confirm {
  background: var(--danger);
  color: white;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-logout-confirm:hover {
  background: #ff5252;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.4);
}

/* ---- Reset & Base ---- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--neutral-950);
  color: var(--neutral-100);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Background Gradient */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(139, 69, 19, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(212, 168, 67, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(26, 22, 18, 1) 0%, var(--neutral-950) 100%);
  z-index: -1;
  pointer-events: none;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: 'Playfair Display', serif;
  font-weight: 600;
  line-height: 1.3;
}

a {
  color: var(--primary-300);
  text-decoration: none;
}

a:hover {
  color: var(--primary-200);
}

img {
  max-width: 100%;
  height: auto;
}

button {
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  border: none;
  outline: none;
}

input,
select,
textarea {
  font-family: 'Inter', sans-serif;
  outline: none;
}

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--neutral-700);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--neutral-600);
}

/* ============================================
   LAYOUT
   ============================================ */

.app-container {
  display: flex;
  min-height: 100vh;
}

/* ---- Sidebar ---- */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: rgba(20, 17, 14, 0.9);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform var(--transition-normal);
}

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid var(--glass-border);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo .logo-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--primary-500), var(--accent-500));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: 0 4px 12px rgba(139, 69, 19, 0.3);
}

.sidebar-logo .logo-text {
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary-200), var(--accent-400));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-logo .logo-sub {
  font-size: 0.7rem;
  color: var(--neutral-500);
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 500;
}

/* Navigation */
.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}

.nav-section-title {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--neutral-500);
  padding: 16px 12px 8px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  color: var(--neutral-400);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  cursor: pointer;
  margin-bottom: 2px;
  position: relative;
  overflow: hidden;
}

.nav-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%) scaleY(0);
  width: 3px;
  height: 60%;
  background: linear-gradient(to bottom, var(--primary-400), var(--accent-500));
  border-radius: 0 3px 3px 0;
  transition: transform var(--transition-fast);
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--neutral-200);
}

.nav-item.active {
  background: rgba(139, 69, 19, 0.15);
  color: var(--primary-200);
}

.nav-item.active::before {
  transform: translateY(-50%) scaleY(1);
}

.nav-item .nav-icon {
  font-size: 1.15rem;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.nav-item .nav-badge {
  margin-left: auto;
  background: var(--primary-600);
  color: white;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-weight: 600;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--glass-border);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border-radius: var(--radius-md);
  transition: background var(--transition-fast);
}

.sidebar-user:hover {
  background: rgba(255, 255, 255, 0.04);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary-500), var(--accent-500));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: white;
  flex-shrink: 0;
}

.user-info .user-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--neutral-200);
}

.user-info .user-role {
  font-size: 0.7rem;
  color: var(--neutral-500);
}

/* ---- Main Content ---- */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
}

/* Header */
.main-header {
  position: sticky;
  top: 0;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  background: rgba(15, 13, 10, 0.8);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--glass-border);
  z-index: 50;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.mobile-menu-btn {
  display: none;
  background: none;
  color: var(--neutral-300);
  font-size: 1.4rem;
  padding: 8px;
  border-radius: var(--radius-sm);
}

.mobile-menu-btn:hover {
  background: rgba(255, 255, 255, 0.05);
}

.page-title-section h1 {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--neutral-100);
}

.page-title-section .page-subtitle {
  font-size: 0.78rem;
  color: var(--neutral-500);
  font-family: 'Inter', sans-serif;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Search Bar */
.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  padding: 8px 16px;
  min-width: 240px;
  transition: all var(--transition-fast);
}

.search-bar:focus-within {
  border-color: var(--primary-500);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(139, 69, 19, 0.15);
}

.search-bar input {
  background: none;
  border: none;
  color: var(--neutral-200);
  font-size: 0.85rem;
  width: 100%;
}

.search-bar input::placeholder {
  color: var(--neutral-600);
}

.search-bar .search-icon {
  color: var(--neutral-500);
  font-size: 0.9rem;
}

/* Header Buttons */
.header-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  color: var(--neutral-400);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all var(--transition-fast);
  position: relative;
}

.header-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--neutral-200);
}


/* Notification Wrapper */
.notif-wrapper {
  position: relative;
}

.notif-badge {
  position: absolute;
  top: 4px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  background: var(--danger);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid rgba(15, 13, 10, 0.9);
  animation: notifPulse 2s ease-in-out infinite;
  z-index: 2;
  pointer-events: none;
}

@keyframes notifPulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.15);
  }
}

/* Notification Panel */
.notif-panel {
  position: absolute;
  top: calc(100% + 12px);
  right: -12px;
  width: 380px;
  max-height: 480px;
  background: rgba(28, 24, 20, 0.97);
  backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.04);
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.97);
  transform-origin: top right;
  transition: all 0.25s var(--ease-out);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.notif-panel.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.notif-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--glass-border);
}

.notif-panel-header h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--neutral-100);
  font-family: 'Inter', sans-serif;
}

.notif-panel-body {
  flex: 1;
  overflow-y: auto;
  max-height: 360px;
}

.notif-panel-footer {
  padding: 10px 20px;
  border-top: 1px solid var(--glass-border);
  text-align: center;
}

.notif-panel-footer small {
  font-size: 0.7rem;
  color: var(--neutral-600);
}

/* Notification Items */
.notif-item {
  display: flex;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: background var(--transition-fast);
  position: relative;
}

.notif-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.notif-item.unread {
  background: rgba(139, 69, 19, 0.06);
}

.notif-item.unread::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  background: var(--primary-400);
  border-radius: 50%;
}

.notif-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.notif-icon.warning {
  background: var(--warning-bg);
}

.notif-icon.danger {
  background: var(--danger-bg);
}

.notif-icon.info {
  background: var(--info-bg);
}

.notif-icon.success {
  background: var(--success-bg);
}

.notif-content {
  flex: 1;
  min-width: 0;
}

.notif-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--neutral-200);
  margin-bottom: 2px;
  line-height: 1.4;
}

.notif-desc {
  font-size: 0.75rem;
  color: var(--neutral-500);
  line-height: 1.4;
}

.notif-time {
  font-size: 0.68rem;
  color: var(--neutral-600);
  margin-top: 4px;
}

.notif-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--neutral-500);
}

.notif-empty .notif-empty-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  opacity: 0.5;
}

.notif-empty p {
  font-size: 0.85rem;
  color: var(--neutral-500);
}


/* ---- Page Content ---- */
.page-content {
  padding: 28px 32px;
}

.page-section {
  display: none;
  animation: fadeInUp 0.4s var(--ease-out);
}

.page-section.active {
  display: block;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   COMPONENTS
   ============================================ */

/* ---- Glass Card ---- */
.card {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
  transition: all var(--transition-normal);
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--glass-border);
}

.card-header h3 {
  font-size: 1.05rem;
  font-weight: 600;
}

.card-body {
  padding: 24px;
}

/* ---- Stat Cards ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-normal);
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  opacity: 0.06;
  transition: opacity var(--transition-normal);
}

.stat-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.stat-card:hover::after {
  opacity: 0.1;
}

.stat-card.revenue::after {
  background: var(--accent-400);
}

.stat-card.orders::after {
  background: var(--info);
}

.stat-card.products::after {
  background: var(--success);
}

.stat-card.customers::after {
  background: var(--primary-400);
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 16px;
}

.stat-card.revenue .stat-icon {
  background: rgba(212, 168, 67, 0.15);
}

.stat-card.orders .stat-icon {
  background: var(--info-bg);
}

.stat-card.products .stat-icon {
  background: var(--success-bg);
}

.stat-card.customers .stat-icon {
  background: rgba(176, 125, 79, 0.15);
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--neutral-50);
  margin-bottom: 4px;
  font-family: 'Inter', sans-serif;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--neutral-500);
  font-weight: 500;
}

.stat-change {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  margin-top: 10px;
}

.stat-change.up {
  background: var(--success-bg);
  color: var(--success);
}

.stat-change.down {
  background: var(--danger-bg);
  color: var(--danger);
}

/* ---- Grid Layouts ---- */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  transition: all var(--transition-fast);
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-600), var(--primary-500));
  color: white;
  box-shadow: 0 4px 12px rgba(139, 69, 19, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(139, 69, 19, 0.4);
  transform: translateY(-1px);
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent-500), var(--accent-400));
  color: var(--neutral-900);
  box-shadow: 0 4px 12px rgba(212, 168, 67, 0.3);
}

.btn-accent:hover {
  box-shadow: 0 6px 20px rgba(212, 168, 67, 0.4);
  transform: translateY(-1px);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.05);
  color: var(--neutral-300);
  border: 1px solid var(--glass-border);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.78rem;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 0.95rem;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
}

/* ---- Form Elements ---- */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--neutral-400);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 11px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--neutral-200);
  font-size: 0.9rem;
  transition: all var(--transition-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--primary-500);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 3px rgba(139, 69, 19, 0.15);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23a89d8f' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ---- Tables ---- */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  text-align: left;
  padding: 14px 16px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--neutral-500);
  border-bottom: 1px solid var(--glass-border);
  font-family: 'Inter', sans-serif;
}

tbody td {
  padding: 14px 16px;
  font-size: 0.875rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  color: var(--neutral-300);
}

tbody tr {
  transition: background var(--transition-fast);
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

/* ---- Badges/Tags ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-success {
  background: var(--success-bg);
  color: var(--success);
}

.badge-warning {
  background: var(--warning-bg);
  color: var(--warning);
}

.badge-danger {
  background: var(--danger-bg);
  color: var(--danger);
}

.badge-info {
  background: var(--info-bg);
  color: var(--info);
}

.badge-neutral {
  background: rgba(255, 255, 255, 0.06);
  color: var(--neutral-400);
}

.badge-primary {
  background: rgba(176, 125, 79, 0.15);
  color: var(--primary-300);
}

/* ---- Product Card ---- */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.product-card {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition-normal);
}

.product-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
}

.product-img {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, var(--neutral-800), var(--neutral-700));
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.product-img svg {
  width: 80px;
  height: 80px;
  opacity: 0.3;
}

.product-img .product-badge {
  position: absolute;
  top: 12px;
  right: 12px;
}

.product-info {
  padding: 18px;
}

.product-info .product-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--neutral-100);
  margin-bottom: 6px;
}

.product-info .product-material {
  font-size: 0.78rem;
  color: var(--neutral-500);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.product-info .product-price {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent-400);
  font-family: 'Inter', sans-serif;
}

.product-info .product-price small {
  font-size: 0.7rem;
  color: var(--neutral-500);
  font-weight: 400;
}

.product-actions {
  display: flex;
  gap: 8px;
  padding: 0 18px 18px;
}

.product-actions .btn {
  flex: 1;
  justify-content: center;
}

/* ---- Modal ---- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--neutral-900);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.9) translateY(20px);
  transition: transform var(--transition-normal);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}

.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px;
  border-bottom: 1px solid var(--glass-border);
}

.modal-header h2 {
  font-size: 1.2rem;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.05);
  color: var(--neutral-400);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--neutral-200);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--glass-border);
}

/* ---- Calculator ---- */
.calc-result {
  background: linear-gradient(135deg, rgba(139, 69, 19, 0.2), rgba(212, 168, 67, 0.1));
  border: 1px solid rgba(212, 168, 67, 0.2);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
  margin-top: 24px;
}

.calc-result .calc-label {
  font-size: 0.85rem;
  color: var(--neutral-400);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 8px;
}

.calc-result .calc-price {
  font-family: 'Inter', sans-serif;
  font-size: 2.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent-300), var(--primary-300));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.calc-result .calc-breakdown {
  margin-top: 16px;
  text-align: left;
}

.calc-breakdown-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--neutral-400);
}

.calc-breakdown-item span:last-child {
  color: var(--neutral-200);
  font-weight: 500;
}

/* ---- Invoice ---- */
.invoice-preview {
  background: #fff;
  color: #1a1a1a;
  border-radius: var(--radius-lg);
  padding: 48px;
  max-width: 800px;
  margin: 0 auto;
}

.invoice-preview h2 {
  color: var(--primary-600);
}

.invoice-preview .invoice-header-grid {
  display: flex;
  justify-content: space-between;
  margin-bottom: 40px;
}

.invoice-preview .invoice-logo h2 {
  font-size: 1.5rem;
  margin-bottom: 4px;
}

.invoice-preview .invoice-logo p {
  font-size: 0.8rem;
  color: #666;
}

.invoice-preview .invoice-meta {
  text-align: right;
}

.invoice-preview .invoice-meta p {
  font-size: 0.85rem;
  margin-bottom: 4px;
}

.invoice-preview .invoice-meta strong {
  color: var(--primary-600);
}

.invoice-preview .invoice-parties {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.invoice-preview .party-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #999;
  margin-bottom: 8px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
}

.invoice-preview .party-name {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.invoice-preview .party-info {
  font-size: 0.85rem;
  color: #666;
  line-height: 1.6;
}

.invoice-preview table {
  margin-bottom: 24px;
}

.invoice-preview thead th {
  color: #999;
  border-bottom: 2px solid #eee;
  padding: 12px 16px;
}

.invoice-preview tbody td {
  color: #333;
  border-bottom: 1px solid #f0f0f0;
  padding: 12px 16px;
}

.invoice-preview .invoice-total {
  text-align: right;
  padding-top: 16px;
  border-top: 2px solid var(--primary-600);
}

.invoice-preview .invoice-total .total-label {
  font-size: 0.85rem;
  color: #666;
}

.invoice-preview .invoice-total .total-value {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--primary-600);
  font-family: 'Inter', sans-serif;
}

.invoice-preview .invoice-footer-note {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid #eee;
  font-size: 0.8rem;
  color: #999;
  text-align: center;
}

/* ---- Empty State ---- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  text-align: center;
}

.empty-state .empty-icon {
  font-size: 3.5rem;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 1.2rem;
  color: var(--neutral-300);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 0.85rem;
  color: var(--neutral-500);
  max-width: 400px;
  margin-bottom: 20px;
}

/* ---- Charts placeholder ---- */
.chart-container {
  position: relative;
  height: 250px;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 20px 0;
}

.chart-bar {
  flex: 1;
  border-radius: 6px 6px 0 0;
  background: linear-gradient(to top, var(--primary-600), var(--primary-400));
  position: relative;
  transition: all var(--transition-normal);
  min-height: 20px;
  cursor: pointer;
}

.chart-bar:hover {
  background: linear-gradient(to top, var(--accent-600), var(--accent-400));
  transform: scaleY(1.02);
  transform-origin: bottom;
}

.chart-bar .chart-tooltip {
  position: absolute;
  top: -32px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--neutral-800);
  color: white;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  transition: opacity var(--transition-fast);
  pointer-events: none;
}

.chart-bar:hover .chart-tooltip {
  opacity: 1;
}

.chart-labels {
  display: flex;
  gap: 8px;
  padding-top: 8px;
}

.chart-labels span {
  flex: 1;
  text-align: center;
  font-size: 0.68rem;
  color: var(--neutral-500);
}

/* ---- WhatsApp Button ---- */
.wa-float {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 56px;
  height: 56px;
  background: #25D366;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: white;
  box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
  z-index: 200;
  transition: all var(--transition-fast);
  animation: waFloat 3s ease-in-out infinite;
  text-decoration: none;
}

.wa-float:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(37, 211, 102, 0.5);
  color: white;
}

@keyframes waFloat {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-6px);
  }
}

/* ---- Toast Notification ---- */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.toast {
  background: var(--neutral-800);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 300px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  animation: toastIn 0.4s var(--ease-out);
  font-size: 0.85rem;
}

.toast.toast-out {
  animation: toastOut 0.3s var(--ease-out) forwards;
}

.toast-success {
  border-left: 3px solid var(--success);
}

.toast-warning {
  border-left: 3px solid var(--warning);
}

.toast-error {
  border-left: 3px solid var(--danger);
}

.toast-info {
  border-left: 3px solid var(--info);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(40px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }

  to {
    opacity: 0;
    transform: translateX(40px);
  }
}

/* ---- Customer Card ---- */
.customer-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  transition: background var(--transition-fast);
}

.customer-card:hover {
  background: rgba(255, 255, 255, 0.03);
}

.customer-card:last-child {
  border-bottom: none;
}

.customer-avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary-500), var(--accent-500));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  color: white;
  flex-shrink: 0;
}

.customer-details {
  flex: 1;
}

.customer-details .customer-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--neutral-200);
}

.customer-details .customer-location {
  font-size: 0.78rem;
  color: var(--neutral-500);
}

.customer-stats {
  text-align: right;
}

.customer-stats .total-spent {
  font-weight: 700;
  color: var(--accent-400);
  font-size: 0.9rem;
}

.customer-stats .order-count {
  font-size: 0.75rem;
  color: var(--neutral-500);
}

/* ---- Tabs ---- */
.tabs {
  display: flex;
  gap: 4px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 24px;
}

.tab {
  flex: 1;
  padding: 10px 16px;
  text-align: center;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--neutral-500);
  background: none;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.tab:hover {
  color: var(--neutral-300);
}

.tab.active {
  background: rgba(139, 69, 19, 0.2);
  color: var(--primary-200);
}

/* ---- Recent Activity ---- */
.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}

.activity-dot.green {
  background: var(--success);
}

.activity-dot.blue {
  background: var(--info);
}

.activity-dot.orange {
  background: var(--warning);
}

.activity-dot.red {
  background: var(--danger);
}

.activity-text {
  font-size: 0.85rem;
  color: var(--neutral-300);
}

.activity-time {
  font-size: 0.72rem;
  color: var(--neutral-600);
  margin-top: 2px;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1024px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }

  .grid-3 {
    grid-template-columns: 1fr 1fr;
  }

  .grid-4 {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .mobile-menu-btn {
    display: flex;
  }

  .main-header {
    padding: 0 16px;
  }

  .search-bar {
    min-width: 160px;
  }

  .page-content {
    padding: 20px 16px;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .products-grid {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .invoice-preview {
    padding: 24px;
  }

  .invoice-preview .invoice-header-grid {
    flex-direction: column;
    gap: 16px;
  }

  .invoice-preview .invoice-meta {
    text-align: left;
  }

  .invoice-preview .invoice-parties {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .modal {
    width: 95%;
    margin: 16px;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .header-right .search-bar {
    display: none;
  }

  .page-title-section h1 {
    font-size: 1.1rem;
  }
}

/* ---- Mobile Overlay ---- */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
  backdrop-filter: blur(2px);
}

/* MOBILE RESPONSIVE DESIGN */
@media (max-width: 768px) {

  /* Sidebar Drawer Logic */
  /* Sidebar Drawer Logic */
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 280px;
    transform: translateX(-100%);
    /* Hidden by default */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.5);
    z-index: 1001;
  }

  /* STATE 1: OPEN FULL (Active) */
  .sidebar.active {
    transform: translateX(0);
    width: 280px;
  }

  /* STATE 2: MINIMIZED (Rail Mode - User clicked <<) */
  .sidebar.active.minimized {
    width: 65px;
    transform: translateX(0);
  }

  /* Hide Texts in Minimized Mode */
  .sidebar.active.minimized .logo-text,
  .sidebar.active.minimized .logo-sub,
  .sidebar.active.minimized .nav-link span,
  .sidebar.active.minimized .sidebar-footer {
    display: none;
  }

  /* Adjust Icons in Minimized Mode */
  .sidebar.active.minimized .nav-link {
    justify-content: center;
    padding: 15px 0;
  }

  .sidebar.active.minimized .logo-icon {
    margin-right: 0;
    font-size: 1.5rem;
  }

  .sidebar.active.minimized .sidebar-header {
    padding: 15px 10px;
    justify-content: center;
  }

  /* Overlay Logic */
  .sidebar-overlay {
    z-index: 1000 !important;
  }

  .sidebar-overlay.active {
    display: block;
  }

  /* KEY: HIDE OVERLAY WHEN MINIMIZED SO USER CAN INTERACT */
  body.sidebar-minimized .sidebar-overlay {
    display: none !important;
  }

  /* Main Content Full Width */
  .main-content {
    margin-left: 0;
    width: 100%;
    padding-top: 60px;
    /* Space for fixed header if needed */
  }

  /* Header Adjustments */
  .main-header {
    padding: 12px 16px;
  }

  .page-title-section h1 {
    font-size: 1.25rem;
  }

  .search-bar {
    display: none;
    /* Hide global search on mobile to save space, or move it */
  }

  /* Grid Stacking */
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr !important;
    gap: 16px;
  }

  /* Touch Friendly Targets */
  .btn,
  .form-input,
  .form-select,
  .nav-item {
    min-height: 48px;
  }

  /* Horizontal Scroll for Tables */
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
    border-radius: 8px;
    border: 1px solid var(--neutral-200);
  }

  /* Adjust Modal Width */
  .modal {
    width: 95%;
    margin: 10px;
    max-height: 90vh;
  }

  /* Dashboard Stats Grid */
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    /* 2 columns on mobile */
  }

  .stat-card {
    padding: 16px;
  }

  .stat-value {
    font-size: 1.5rem;
  }
}

/* Print Styles */
@media print {

  .sidebar,
  .main-header,
  .wa-float,
  .toast-container,
  .btn {
    display: none !important;
  }

  .main-content {
    margin-left: 0 !important;
  }

  .page-content {
    padding: 0 !important;
  }

  .invoice-preview {
    box-shadow: none;
    border: none;
  }
}

/* =========================================
   PRINT STYLES (INVOICE & A4)
   ========================================= */
@media print {

  /* HIDE EVERYTHING by default */
  .sidebar,
  .mobile-header,
  .wa-float,
  .toast-container,
  .modal-overlay,
  .logout-overlay,
  button,
  .empty-state,
  .main-header,
  .nav-item,
  .notif-wrapper,
  #waFloat {
    display: none !important;
  }

  /* Reset body and container */
  body {
    background: white !important;
    color: black !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 210mm;
    /* A4 width */
    height: auto;
    overflow: visible !important;
  }

  /* Reset layout containers */
  .app-container,
  .main-content,
  .page-content {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    height: auto !important;
    overflow: visible !important;
    position: static !important;
    background: white !important;
  }

  /* Hide all sections */
  .page-section {
    display: none !important;
  }

  /* SHOW ONLY Invoice Section */
  #section-invoice {
    display: block !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    padding: 20px !important;
  }

  /* Hide the invoice form (first card in grid-2) */
  #section-invoice .grid-2>.card:first-child {
    display: none !important;
  }

  /* Style the Invoice Preview Container */
  #invoicePreviewContainer {
    display: block !important;
    width: 100% !important;
    background: white !important;
    border: none !important;
    box-shadow: none !important;
  }

  /* Force print background colors (for table headers etc) */
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Typography */
  .invoice-box,
  h1,
  h2,
  h3,
  p,
  td,
  th {
    font-family: 'Times New Roman', serif !important;
    color: black !important;
  }

  .invoice-header h1 {
    font-size: 24pt !important;
    color: #333 !important;
  }

  /* Ensure table borders are crisp */
  table {
    border-collapse: collapse !important;
    width: 100% !important;
  }

  th,
  td {
    border-color: #ddd !important;
  }

  /* Signature section spacing */
  .invoice-footer {
    margin-top: 50mm !important;
    page-break-inside: avoid;
  }
}