/* ================================================================
   TECHNIX ERP SYSTEM — Professional SaaS Dashboard Stylesheet
   Theme: Dark Green Sidebar | Red Accents | White Content
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --green-900: #064e3b;
  --green-800: #065f46;
  --green-700: #047857;
  --green-600: #059669;
  --green-500: #10b981;
  --green-400: #34d399;
  --green-100: #d1fae5;
  --green-50:  #ecfdf5;

  --red-600:   #dc2626;
  --red-500:   #ef4444;
  --red-100:   #fee2e2;
  --red-50:    #fef2f2;

  --gray-900:  #111827;
  --gray-800:  #1f2937;
  --gray-700:  #374151;
  --gray-600:  #4b5563;
  --gray-500:  #6b7280;
  --gray-400:  #9ca3af;
  --gray-300:  #d1d5db;
  --gray-200:  #e5e7eb;
  --gray-100:  #f3f4f6;
  --gray-50:   #f9fafb;

  --sidebar-w: 256px;
  --sidebar-collapsed: 64px;
  --topbar-h:  60px;
  --radius:    10px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08),0 1px 2px rgba(0,0,0,.06);
  --shadow:    0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -1px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -2px rgba(0,0,0,.05);
}

*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', 'Segoe UI', sans-serif;
  background: var(--gray-100);
  color: var(--gray-900);
  font-size: 14px;
  line-height: 1.5;
}

/* ── SCROLLBAR ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 99px; }

/* ================================================================
   SIDEBAR
   ================================================================ */
.sidebar {
  position: fixed; inset: 0 auto 0 0;
  width: var(--sidebar-w); z-index: 1000;
  background: #0d2b20;
  display: flex; flex-direction: column;
  transition: width .2s ease;
  overflow: hidden;
}
.sidebar.collapsed { width: var(--sidebar-collapsed); }

/* Brand */
.sidebar-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 0 20px; height: var(--topbar-h);
  border-bottom: 1px solid rgba(255,255,255,.07);
  flex-shrink: 0;
}
.brand-icon {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  /* No box, no background — logo image sits clean */
}
.brand-text { overflow: hidden; }
.brand-name {
  font-size: .95rem; font-weight: 700; color: #fff;
  white-space: nowrap; letter-spacing: .3px;
}
.brand-sub {
  font-size: .65rem; color: var(--green-400);
  white-space: nowrap; letter-spacing: .5px; text-transform: uppercase;
}

/* Nav */
.sidebar-nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 12px 0; }
.nav-section {
  padding: 16px 20px 4px; font-size: .65rem; font-weight: 600;
  color: rgba(255,255,255,.3); text-transform: uppercase; letter-spacing: .08em;
  white-space: nowrap;
}
.collapsed .nav-section { opacity: 0; }
.nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 20px; color: rgba(255,255,255,.65);
  text-decoration: none; font-size: .85rem; font-weight: 500;
  transition: all .15s; white-space: nowrap; border-radius: 0;
  position: relative;
}
.nav-link:hover { color: #fff; background: rgba(255,255,255,.06); }
.nav-link.active {
  color: #fff; background: var(--red-600);
  font-weight: 600;
}
.nav-link.active::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: #fff; border-radius: 0 2px 2px 0;
}
.nav-link i { font-size: 1rem; width: 20px; text-align: center; flex-shrink: 0; }
.nav-link span { overflow: hidden; }

/* User footer */
.sidebar-footer {
  border-top: 1px solid rgba(255,255,255,.07);
  padding: 12px 16px; display: flex; align-items: center; gap: 10px; flex-shrink: 0;
}
.sidebar-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--green-700); display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: .85rem; flex-shrink: 0;
}
.sidebar-user-info { overflow: hidden; }
.sidebar-username { font-size: .82rem; font-weight: 600; color: #fff; white-space: nowrap; }
.sidebar-role { font-size: .7rem; color: var(--green-400); white-space: nowrap; text-transform: capitalize; }

/* ================================================================
   MAIN CONTENT
   ================================================================ */
.main-content {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex; flex-direction: column;
  transition: margin-left .2s ease;
}
.main-content.collapsed { margin-left: var(--sidebar-collapsed); }

/* ── TOPBAR ──────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h); background: #fff;
  border-bottom: 1px solid var(--gray-200);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; position: sticky; top: 0; z-index: 500;
  box-shadow: var(--shadow-sm);
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.sidebar-toggle {
  background: none; border: none; cursor: pointer;
  width: 36px; height: 36px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--gray-500); transition: all .15s;
}
.sidebar-toggle:hover { background: var(--gray-100); color: var(--gray-700); }
.topbar-breadcrumb { font-size: .83rem; color: var(--gray-500); }
.topbar-breadcrumb strong { color: var(--gray-900); }
.topbar-search { flex:1; max-width:380px; position:relative; }
.topbar-search input:focus { border-color:var(--green-500)!important; background:#fff!important; box-shadow:0 0 0 3px rgba(16,185,129,.1); }

.topbar-right { display: flex; align-items: center; gap: 8px; }
.topbar-btn {
  background: none; border: 1px solid var(--gray-200); border-radius: 8px;
  padding: 6px 14px; font-size: .82rem; font-weight: 500; cursor: pointer;
  color: var(--gray-700); text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
  transition: all .15s;
}
.topbar-btn:hover { border-color: var(--green-500); color: var(--green-600); }
.topbar-btn.danger { border-color: var(--red-100); color: var(--red-600); }
.topbar-btn.danger:hover { background: var(--red-50); border-color: var(--red-600); }
.role-badge {
  padding: 3px 10px; border-radius: 99px; font-size: .7rem; font-weight: 600;
  background: var(--green-100); color: var(--green-800); text-transform: capitalize;
}
.role-badge.admin { background: var(--red-100); color: var(--red-600); }

/* ── PAGE CONTENT ────────────────────────────────────────── */
.page-content { padding: 24px; flex: 1; }

/* Page header */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
}
.page-header-left h2 {
  font-size: 1.3rem; font-weight: 700; color: var(--gray-900); margin: 0;
}
.page-header-left .subtitle { font-size: .82rem; color: var(--gray-500); margin-top: 2px; }
.page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ================================================================
   STAT CARDS
   ================================================================ */
.stat-card {
  background: #fff; border-radius: var(--radius);
  padding: 20px; border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  display: flex; align-items: center; gap: 16px;
  transition: transform .15s, box-shadow .15s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-icon {
  width: 52px; height: 52px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem; flex-shrink: 0;
}
.stat-value { font-size: 1.6rem; font-weight: 800; color: var(--gray-900); line-height: 1; }
.stat-label { font-size: .75rem; color: var(--gray-500); margin-top: 4px; font-weight: 500; text-transform: uppercase; letter-spacing: .03em; }
.stat-delta { font-size: .75rem; margin-top: 4px; }
.stat-delta.up { color: var(--green-600); }
.stat-delta.down { color: var(--red-500); }

/* ================================================================
   CARDS
   ================================================================ */
.card {
  background: #fff; border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm); overflow: hidden;
}
.card-header {
  background: #fff; padding: 16px 20px;
  border-bottom: 1px solid var(--gray-100);
  display: flex; align-items: center; justify-content: space-between;
  font-weight: 600; color: var(--gray-900); font-size: .9rem;
}
.card-header-icon { font-size: .9rem; color: var(--green-600); margin-right: 8px; }
.card-body { padding: 20px; }
.card-footer { background: var(--gray-50); padding: 12px 20px; border-top: 1px solid var(--gray-100); }

/* ================================================================
   TABLES
   ================================================================ */
.table-card { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--gray-200); }
.table { width: 100%; border-collapse: collapse; }
.table thead th {
  background: var(--gray-50); padding: 11px 16px;
  font-size: .72rem; font-weight: 600; color: var(--gray-500);
  text-transform: uppercase; letter-spacing: .06em;
  border-bottom: 1px solid var(--gray-200); white-space: nowrap;
  position: sticky; top: 0;
}
.table tbody td { padding: 12px 16px; border-bottom: 1px solid var(--gray-100); font-size: .88rem; vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background .1s; }
.table tbody tr:hover { background: var(--gray-50); }
.table-striped tbody tr:nth-child(even) { background: var(--gray-50); }

/* ================================================================
   FORMS
   ================================================================ */
.form-label { font-size: .82rem; font-weight: 600; color: var(--gray-700); margin-bottom: 6px; display: block; }
.form-control, .form-select {
  width: 100%; padding: 9px 12px; font-size: .88rem;
  border: 1.5px solid var(--gray-300); border-radius: 8px;
  background: #fff; color: var(--gray-900);
  transition: border-color .15s, box-shadow .15s;
  appearance: none;
}
.form-control:focus, .form-select:focus {
  outline: none; border-color: var(--green-500);
  box-shadow: 0 0 0 3px rgba(16,185,129,.15);
}
.form-control::placeholder { color: var(--gray-400); }
.input-group { display: flex; }
.input-group .input-icon {
  background: var(--gray-100); border: 1.5px solid var(--gray-300); border-right: none;
  padding: 0 12px; border-radius: 8px 0 0 8px;
  display: flex; align-items: center; color: var(--gray-500);
}
.input-group .form-control { border-radius: 0 8px 8px 0; }
textarea.form-control { resize: vertical; min-height: 80px; }

/* ================================================================
   BUTTONS
   ================================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 16px; border-radius: 8px; font-size: .85rem; font-weight: 600;
  cursor: pointer; border: 1.5px solid transparent; text-decoration: none;
  transition: all .15s; white-space: nowrap;
}
.btn-sm { padding: 5px 12px; font-size: .8rem; border-radius: 6px; }
.btn-xs { padding: 3px 8px; font-size: .75rem; border-radius: 5px; }
.btn-lg { padding: 11px 22px; font-size: .95rem; }

.btn-primary   { background: var(--green-600); color: #fff; border-color: var(--green-600); }
.btn-primary:hover { background: var(--green-700); border-color: var(--green-700); color: #fff; }
.btn-danger    { background: var(--red-600); color: #fff; border-color: var(--red-600); }
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; color: #fff; }
.btn-success   { background: var(--green-500); color: #fff; border-color: var(--green-500); }
.btn-secondary { background: var(--gray-600); color: #fff; border-color: var(--gray-600); }
.btn-outline-primary { background: transparent; color: var(--green-600); border-color: var(--green-300); }
.btn-outline-primary:hover { background: var(--green-50); color: var(--green-700); }
.btn-outline-danger  { background: transparent; color: var(--red-600); border-color: var(--red-200); }
.btn-outline-danger:hover { background: var(--red-50); }
.btn-outline-secondary { background: transparent; color: var(--gray-600); border-color: var(--gray-300); }
.btn-outline-secondary:hover { background: var(--gray-100); }
.btn-outline-info { background: transparent; color: #0284c7; border-color: #bae6fd; }
.btn-outline-info:hover { background: #f0f9ff; }
.btn-light { background: var(--gray-100); color: var(--gray-700); border-color: var(--gray-200); }
.btn-light:hover { background: var(--gray-200); }

/* ================================================================
   BADGES
   ================================================================ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 99px; font-size: .7rem; font-weight: 600;
}
.bg-success   { background: var(--green-100); color: var(--green-800); }
.bg-danger    { background: var(--red-100); color: var(--red-700); }
.bg-warning   { background: #fef3c7; color: #92400e; }
.bg-info      { background: #dbeafe; color: #1e40af; }
.bg-secondary { background: var(--gray-100); color: var(--gray-700); }
.bg-primary   { background: var(--green-100); color: var(--green-800); }
.bg-dark      { background: var(--gray-800); color: #fff; }

/* Repair/Service status badges */
.badge-Pending      { background:#fef9c3; color:#713f12; }
.badge-Diagnosing   { background:#dbeafe; color:#1e3a8a; }
.badge-Repairing    { background:#fce7f3; color:#831843; }
.badge-Completed    { background:var(--green-100); color:var(--green-800); }
.badge-Collected    { background:#ede9fe; color:#4c1d95; }
.badge-In-Progress  { background:#fef3c7; color:#92400e; }

/* ================================================================
   ALERTS
   ================================================================ */
.alert {
  border-radius: var(--radius); padding: 12px 16px;
  font-size: .88rem; border: none; display: flex; align-items: flex-start; gap: 10px;
}
.alert-success { background: var(--green-50); color: var(--green-800); border-left: 3px solid var(--green-500); }
.alert-danger  { background: var(--red-50); color: var(--red-700); border-left: 3px solid var(--red-500); }
.alert-warning { background: #fffbeb; color: #92400e; border-left: 3px solid #f59e0b; }
.alert-info    { background: #eff6ff; color: #1e40af; border-left: 3px solid #3b82f6; }

/* ================================================================
   LOGIN PAGE
   ================================================================ */
.login-page {
  min-height: 100vh;
  background: #eef1f5;
  display: flex; align-items: center; justify-content: center;
  padding: 24px; position: relative; overflow: hidden;
}
/* Subtle large circle decorations */
.login-page::before {
  content: ''; position: fixed;
  width: 600px; height: 600px; border-radius: 50%;
  background: radial-gradient(circle, rgba(15,43,33,.08) 0%, transparent 70%);
  top: -160px; right: -120px; pointer-events: none;
}
.login-page::after {
  content: ''; position: fixed;
  width: 400px; height: 400px; border-radius: 50%;
  background: radial-gradient(circle, rgba(15,43,33,.06) 0%, transparent 70%);
  bottom: -100px; left: -80px; pointer-events: none;
}
/* Two-column card */
.login-container {
  width: 100%; max-width: 860px;
  display: grid; grid-template-columns: 1fr 1fr;
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,.10), 0 4px 16px rgba(0,0,0,.06);
  position: relative; z-index: 1;
}
/* Left branding panel */
.login-left {
  background: linear-gradient(150deg, #0f2b21 0%, #1a3d2b 60%, #1e4a34 100%);
  padding: 52px 40px;
  display: flex; flex-direction: column; justify-content: center;
  position: relative; overflow: hidden;
}
.login-left::before {
  content: ''; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.04) 1.5px, transparent 1.5px);
  background-size: 24px 24px;
}
.login-left-content { position: relative; z-index: 1; }
.login-tagline {
  color: rgba(255,255,255,.6); font-size: .85rem; line-height: 1.75;
  border-left: 3px solid rgba(52,211,153,.45);
  padding-left: 14px; margin-top: 32px;
}
.login-tagline strong { color: rgba(255,255,255,.85); display: block; margin-bottom: 4px; font-size: .88rem; }
/* Right form panel */
.login-right {
  padding: 52px 44px;
  display: flex; flex-direction: column; justify-content: center;
  background: #fff;
}
/* Logo icon wrapper — no box, no border, just the image */
.login-logo { margin-bottom: 28px; }
.login-logo-icon { display: block; margin-bottom: 16px; }
.login-logo-icon img { display: block; }
.login-logo h1 { font-size: 1.45rem; font-weight: 800; color: #fff; letter-spacing: -.2px; margin-bottom: 4px; }
.login-logo p { color: rgba(255,255,255,.45); font-size: .82rem; }
.login-card {
  background: transparent; border-radius: 0; padding: 0; box-shadow: none;
}
.login-card h2 { font-size: 1.25rem; font-weight: 800; color: var(--gray-900); margin-bottom: 6px; }
.login-card p { color: var(--gray-500); font-size: .85rem; margin-bottom: 28px; }
.demo-creds {
  background: var(--gray-50); border: 1px solid var(--gray-200);
  border-radius: 8px; padding: 12px 16px; font-size: .8rem; margin-top: 20px;
}
.demo-creds strong { display: block; color: var(--gray-700); margin-bottom: 4px; }
.demo-creds code { background: var(--gray-200); padding: 1px 6px; border-radius: 4px; font-size: .78rem; }

/* ================================================================
   CHARTS
   ================================================================ */
.chart-container { position: relative; height: 240px; }

/* ================================================================
   SEARCH BAR
   ================================================================ */
.search-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: #fff; border: 1px solid var(--gray-200); border-radius: 10px;
  padding: 12px 16px; margin-bottom: 0;
}

/* ================================================================
   PAGINATION
   ================================================================ */
.pagination { display: flex; gap: 4px; justify-content: center; margin-top: 16px; }
.page-item a, .page-item span {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 6px; font-size: .82rem; font-weight: 500;
  text-decoration: none; color: var(--gray-600);
  border: 1px solid var(--gray-200); background: #fff;
  transition: all .15s;
}
.page-item a:hover { border-color: var(--green-400); color: var(--green-600); background: var(--green-50); }
.page-item.active span { background: var(--green-600); color: #fff; border-color: var(--green-600); }
.page-item.disabled span { opacity: .4; cursor: not-allowed; }

/* ================================================================
   RECEIPT / PRINT
   ================================================================ */
.receipt-wrapper { max-width: 500px; margin: 0 auto; }
.receipt-card {
  background: #fff; border-radius: 12px; padding: 36px;
  border: 1px solid var(--gray-200); box-shadow: var(--shadow);
}
.receipt-header { text-align: center; padding-bottom: 20px; border-bottom: 2px dashed var(--gray-200); margin-bottom: 20px; }
.receipt-logo-text { font-size: 1.3rem; font-weight: 800; color: var(--green-800); }
.receipt-divider { border: none; border-top: 1px dashed var(--gray-300); margin: 16px 0; }

/* ================================================================
   COLOR UTILITIES
   ================================================================ */
.bg-green-soft { background: var(--green-50); }
.bg-red-soft   { background: var(--red-50); }
.bg-blue-soft  { background: #eff6ff; }
.bg-yellow-soft{ background: #fefce8; }
.bg-purple-soft{ background: #f5f3ff; }
.bg-gray-soft  { background: var(--gray-100); }
.text-green  { color: var(--green-600); }
.text-red    { color: var(--red-600); }
.text-blue   { color: #2563eb; }
.text-yellow { color: #d97706; }
.text-purple { color: #7c3aed; }
.text-gray   { color: var(--gray-500); }
.text-success{ color: var(--green-600); }
.text-danger { color: var(--red-600); }
.text-muted  { color: var(--gray-400); }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }

/* ================================================================
   MISC COMPONENTS
   ================================================================ */
.divider { border: none; border-top: 1px solid var(--gray-200); margin: 20px 0; }
.section-title { font-size: .7rem; font-weight: 700; color: var(--gray-400); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 12px; }
.empty-state { text-align: center; padding: 48px 24px; color: var(--gray-400); }
.empty-state i { font-size: 2.5rem; margin-bottom: 12px; display: block; }
.empty-state p { font-size: .9rem; }
.kv-table { padding: 0 4px; }
.kv-table td { padding: 9px 16px; border-bottom: 1px solid var(--gray-100); font-size: .88rem; }
.kv-table td:first-child { color: var(--gray-500); width: 42%; font-weight: 500; }
.kv-table tr:last-child td { border: none; }

/* ================================================================
   TOAST NOTIFICATIONS
   ================================================================ */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: #fff; border-radius: 10px; padding: 14px 18px;
  box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 12px;
  min-width: 280px; max-width: 380px; border-left: 4px solid var(--green-500);
  animation: slideIn .25s ease;
}
.toast.danger { border-left-color: var(--red-500); }
.toast.warning { border-left-color: #f59e0b; }
.toast.info { border-left-color: #3b82f6; }
@keyframes slideIn { from { transform: translateX(120%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s, width .25s; }
  .sidebar.mobile-open { transform: translateX(0); }
  .main-content { margin-left: 0 !important; }
  .page-content { padding: 16px; }
  .stat-card { padding: 16px; }
}




/* ── Breadcrumb ─────────────────────────────────────────── */
.topbar-breadcrumb { display:flex; align-items:center; gap:6px; font-size:.82rem; color:var(--gray-500); }
.bc-home { color:var(--gray-400); text-decoration:none; }
.bc-home:hover { color:var(--green-600); }
.bc-sep { color:var(--gray-300); font-size:.7rem; }
.bc-link { color:var(--gray-500); text-decoration:none; }
.bc-link:hover { color:var(--green-600); }
.bc-current { color:var(--gray-700); font-weight:600; }

/* ── Invoice status badges ──────────────────────────────── */
.badge-Unpaid          { background:#fef9c3; color:#713f12; }
.badge-Partially-Paid  { background:#fce7f3; color:#831843; }
.badge-Paid            { background:var(--green-100); color:var(--green-800); }
.badge-Overdue         { background:var(--red-100); color:var(--red-700); }
.badge-Draft           { background:var(--gray-100); color:var(--gray-600); }
.badge-Sent            { background:#dbeafe; color:#1e40af; }
.badge-Approved        { background:var(--green-100); color:var(--green-800); }
.badge-Rejected        { background:var(--red-100); color:var(--red-700); }

/* ── Invoice / Quote print ──────────────────────────────── */
.invoice-doc { max-width:720px; margin:0 auto; background:#fff; border-radius:12px; border:1px solid var(--gray-200); overflow:hidden; box-shadow:var(--shadow); }
.invoice-header { background:var(--green-900); color:#fff; padding:32px 36px; display:flex; justify-content:space-between; align-items:flex-start; }
.invoice-body { padding:32px 36px; }
.invoice-meta { display:flex; gap:0; border-bottom:1px solid var(--gray-100); }
.invoice-meta-box { flex:1; padding:20px 24px; border-right:1px solid var(--gray-100); }
.invoice-meta-box:last-child { border-right:none; }
.invoice-meta-label { font-size:.72rem; text-transform:uppercase; letter-spacing:.08em; color:var(--gray-400); margin-bottom:4px; }
.invoice-meta-value { font-size:.95rem; font-weight:700; color:var(--gray-800); }
.invoice-totals { margin-left:auto; width:340px; margin-top:24px; }
.invoice-total-row { display:flex; justify-content:space-between; padding:7px 0; font-size:.9rem; border-bottom:1px solid var(--gray-100); }
.invoice-total-row:last-child { border:none; }
.invoice-grand-total { font-size:1.1rem!important; font-weight:800; color:var(--green-700); padding-top:12px!important; }
.invoice-table th { background:var(--gray-50); font-size:.72rem; font-weight:600; color:var(--gray-500); text-transform:uppercase; letter-spacing:.06em; padding:10px 14px; border-bottom:1px solid var(--gray-200); }
.invoice-table td { padding:12px 14px; border-bottom:1px solid var(--gray-100); font-size:.88rem; }
.invoice-totals td { padding:8px 14px; font-size:.9rem; }
.invoice-totals .grand-total td { font-size:1.1rem; font-weight:800; background:var(--green-50); }

/* ── Delivery Note print tweaks ───────────────────────────── */
.dn-header { background: var(--green-900); }



/* ================================================================
   GLOBAL PRINT — preserves all colors, backgrounds, logos exactly
   ================================================================ */
@media print {

  /* ── Hide UI chrome ── */
  .sidebar, .topbar, .no-print, .btn, .page-actions,
  .toast-container, .modal, .dropdown,
  .breadcrumb, .topbar-breadcrumb, .page-header { display:none !important; }

  /* ── Reset layout ── */
  body, html {
    background: #fff !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .main-content {
    margin-left: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
  }
  .page-content { padding: 0 !important; }

  /* ── Document container ── */
  .invoice-doc {
    box-shadow: none !important;
    border: 1px solid #e5e7eb !important;
    max-width: 100% !important;
    margin: 0 !important;
    border-radius: 0 !important;
  }

  /* ── CRITICAL: Force ALL colors and backgrounds to print exactly as on screen ── */
  * {
    -webkit-print-color-adjust: exact !important;
    color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* ── Ensure images print at full quality with original colors ── */
  img {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    max-width: 100% !important;
  }

  /* ── Tables ── */
  .invoice-table th, .invoice-table td { border-color: #ccc !important; }
  table { page-break-inside: auto; }
  tr { page-break-inside: avoid; page-break-after: auto; }
  .invoice-doc { page-break-inside: avoid; }

  /* ── DN layout preservation ── */
  .dn-address-row { display: flex !important; gap: 12px !important; }
  .dn-address-col { flex: 1 1 0 !important; width: 50% !important; }
  .dn-meta-row { display: flex !important; gap: 12px !important; }
  .dn-meta-col { flex: 1 1 0 !important; width: 25% !important; }

  /* ── PO Vendor/Ship-to side by side on print ── */
  .po-address-row { display: flex !important; gap: 12px !important; flex-wrap: nowrap !important; }
  .po-address-col { flex: 1 1 0 !important; width: 50% !important; min-width: 0 !important; }

  /* ── Bootstrap col overrides for print ── */
  .col-md-6 { width: 50% !important; flex: 0 0 50% !important; max-width: 50% !important; }
  .row { display: flex !important; flex-wrap: wrap !important; }

  /* ── Page setup ── */
  @page {
    size: A4 portrait;
    margin: 10mm 12mm;
  }
}

/* ================================================================
   ANIMATIONS & TRANSITIONS (v5)
   ================================================================ */

/* Fade in on page load */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
.card { animation: fadeInUp .3s ease both; }
.card:nth-child(2) { animation-delay: .05s; }
.card:nth-child(3) { animation-delay: .10s; }
.card:nth-child(4) { animation-delay: .15s; }

/* Button hover lift */
.btn { transition: transform .15s ease, box-shadow .15s ease; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,.12); }
.btn:active { transform: translateY(0); }

/* Card hover lift */
.card-hover, .table tbody tr { transition: transform .15s ease, box-shadow .15s ease; }
.card-hover:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); cursor: pointer; }
.table tbody tr:hover { background: var(--green-50); }

/* Nav link slide */
.nav-link { transition: all .18s ease; }

/* Badge pulse for alerts */
@keyframes pulse {
  0%,100% { opacity:1; } 50% { opacity:.6; }
}
.badge-pulse { animation: pulse 2s infinite; }

/* Spinner */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner { animation: spin .8s linear infinite; display:inline-block; }

/* Slide in sidebar */
.sidebar { animation: none; }

/* Stats card count-up feel */
.stat-value { transition: all .4s ease; }

/* Form focus glow */
.form-control:focus, .form-select:focus {
  border-color: var(--green-500);
  box-shadow: 0 0 0 3px rgba(16,185,129,.15);
  transition: all .2s ease;
}

/* Alert slide in */
.alert { animation: fadeInUp .25s ease; }

/* Table row click feedback */
.table tbody tr { cursor: default; }
.table tbody tr:active { background: var(--green-100) !important; }

/* Progress bar animation */
.progress-bar { transition: width 1s ease; }

/* Login page smooth */
.login-container { animation: fadeInUp .4s ease; }

/* Modal fade */
.modal.fade .modal-dialog { transition: transform .25s ease; }

/* ── Notification nav badge ─────────────────────────── */
.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--red-500, #ef4444);
  color: #fff;
  font-size: .6rem;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  padding: 0 4px;
  margin-left: auto;
}
