/* ══════════════════════════════════════════
   BILLPRO – CLASSIC PROFESSIONAL THEME
   Professional Business UI
══════════════════════════════════════════ */

:root {
  --sidebar-width: 260px;
  --topbar-height: 70px;
  --primary: #1e1b4b;
  --primary-light: #312e81;
  --primary-dark: #0f172a;
  --accent: #6366f1;
  --accent-light: #818cf8;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  --light-bg: #f8fafc;
  --border-color: #e2e8f0;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  --card-shadow-hover: 0 14px 40px rgba(99, 102, 241, 0.12);
  --radius: 16px;
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

html, body {
  height: 100%;
  overflow-x: hidden;
}

body {
  font-family: 'Segoe UI', 'Tahoma', 'Geneva', sans-serif;
  background: #f5f6fa;
  color: var(--text-primary);
  font-size: 0.95rem;
  line-height: 1.5;
  animation: fadeInBody 0.6s ease-out;
}

@keyframes fadeInBody {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ══════════════════════════════════════════
   LAYOUT WRAPPER
══════════════════════════════════════════ */
#wrapper {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* ══════════════════════════════════════════
   SIDEBAR – CLASSIC BUSINESS STYLE
══════════════════════════════════════════ */
#sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  height: 100%;
  background: var(--primary);
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1050;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  box-shadow: 2px 0 6px rgba(0, 0, 0, 0.1);
  overflow-y: auto;
  overflow-x: hidden;
  border-right: 1px solid var(--primary-light);
}

#sidebar::-webkit-scrollbar {
  width: 6px;
}

#sidebar::-webkit-scrollbar-track {
  background: transparent;
}

#sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

#sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

#sidebar.collapsed {
  width: 0;
  overflow: hidden;
  box-shadow: none;
}

/* Brand */
.sidebar-brand {
  color: #fff;
  font-size: 1.3rem;
  font-weight: 700;
  padding: 1.5rem 1.3rem;
  letter-spacing: 0.3px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-brand i {
  font-size: 1.5rem;
}

.sidebar-divider {
  border-color: rgba(255, 255, 255, 0.15);
  margin: 0.5rem 0;
  flex-shrink: 0;
}

/* Section Label */
.sidebar-section-label {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 1px;
  padding: 1rem 1.3rem 0.6rem;
  margin: 0;
  white-space: nowrap;
  text-transform: uppercase;
}

/* Nav Links */
#sidebar .nav {
  flex: 1;
  padding: 0.5rem 0;
}

#sidebar .nav-link {
  color: rgba(255, 255, 255, 0.8);
  padding: 0.75rem 1.3rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 0.95rem;
  white-space: nowrap;
  transition: var(--transition);
  text-decoration: none;
  border-left: 3px solid transparent;
  margin: 0;
  animation: slideInLeft 0.4s ease-out;
}

#sidebar .nav-link i {
  font-size: 1.1rem;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

#sidebar .nav-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-left-color: var(--accent);
  padding-left: 1.5rem;
}

#sidebar .nav-link:hover i {
  transform: translateX(4px);
}

#sidebar .nav-link.active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-weight: 600;
  border-left-color: var(--accent);
  animation: slideInLeft 0.3s ease-out;
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Footer */
.sidebar-footer {
  padding: 1rem 1.3rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-name {
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.75rem;
}

/* ══════════════════════════════════════════
   PAGE CONTENT
══════════════════════════════════════════ */
#page-content {
  flex: 1;
  min-width: 0;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: var(--transition);
}

#page-content.full-width {
  margin-left: 0;
}

/* ── Top Navbar ── */
.top-navbar {
  height: var(--topbar-height);
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  gap: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-toggle-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--primary);
  padding: 0.4rem 0.7rem;
  transition: var(--transition);
  flex-shrink: 0;
  cursor: pointer;
  font-size: 1.1rem;
}

.sidebar-toggle-btn:hover {
  background: var(--light-bg);
  color: var(--accent);
  border-color: var(--accent);
}

/* Breadcrumb */
.breadcrumb {
  margin: 0;
  padding: 0;
  background: none;
}

.breadcrumb-item {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.breadcrumb-item.active {
  color: var(--text-primary);
  font-weight: 600;
}

.breadcrumb-item + .breadcrumb-item::before {
  color: var(--border-color);
}

/* Top user badge */
.top-user-badge {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}

.top-avatar {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
  background: var(--accent);
}

/* ── Main Content ── */
.main-content {
  padding: 2rem;
  flex: 1;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

/* Page Title */
.page-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 0.75rem;
}

/* ══════════════════════════════════════════
   STAT CARDS – CLASSIC STYLE
══════════════════════════════════════════ */
.stat-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--card-shadow);
  border-left: 4px solid var(--accent);
  transition: var(--transition);
  height: 100%;
  border: 1px solid var(--border-color);
  animation: fadeInUp 0.5s ease-out;
  animation-fill-mode: both;
}

.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.3s; }
.stat-card:nth-child(4) { animation-delay: 0.4s; }

.stat-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
  border-left-color: var(--accent);
}

.stat-card:hover .stat-value {
  animation: pulse 0.6s ease-in-out;
}

.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.stat-card:hover .stat-icon {
  transform: rotate(10deg) scale(1.1);
}

.icon-purple {
  background: #e8f0ff;
  color: var(--accent);
}

.icon-green {
  background: #e8f8f5;
  color: var(--success);
}

.icon-orange {
  background: #fef5e7;
  color: var(--warning);
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
  transition: color 0.3s ease;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: color 0.3s ease;
}

.stat-footer {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

.stat-card:hover .stat-footer {
  opacity: 1;
}

.stat-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.stat-link:hover {
  color: var(--primary);
  gap: 0.7rem;
}

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

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.08);
  }
}

/* ══════════════════════════════════════════
   WELCOME BANNER
══════════════════════════════════════════ */
.welcome-banner {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: var(--radius);
  padding: 2rem;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  box-shadow: var(--card-shadow);
  margin-bottom: 2rem;
  animation: slideInDown 0.6s ease-out;
}

.welcome-banner.mb-4 {
  margin-bottom: 2rem !important;
}

.wb-left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex: 1;
  animation: slideInLeft 0.7s ease-out;
}

.wb-avatar {
  width: 60px;
  height: 60px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 1.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.4s ease;
}

.welcome-banner:hover .wb-avatar {
  transform: scale(1.15) rotate(5deg);
}

.wb-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  animation: fadeIn 0.8s ease-out 0.2s both;
}

.wb-sub {
  font-size: 0.9rem;
  opacity: 0.9;
  margin: 0;
  animation: fadeIn 0.8s ease-out 0.4s both;
}

.wb-right {
  flex-shrink: 0;
  animation: slideInRight 0.7s ease-out;
}

.wb-right .btn {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  font-weight: 600;
  padding: 0.5rem 1rem;
  transition: all 0.3s ease;
}

.wb-right .btn:hover {
  background: rgba(255, 255, 255, 0.35);
  border-color: rgba(255, 255, 255, 0.6);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

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

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ══════════════════════════════════════════
   CARDS
══════════════════════════════════════════ */
.card {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  transition: var(--transition);
  animation: fadeInUp 0.5s ease-out;
}

.card:hover {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  transform: translateY(-4px);
}

.card-header {
  background: #f8f9fa;
  border-bottom: 1px solid var(--border-color);
  padding: 1.25rem 1.5rem;
  font-weight: 600;
  color: var(--primary);
  border-radius: var(--radius) var(--radius) 0 0;
  transition: background 0.3s ease;
}

.card:hover .card-header {
  background: #eff1f5;
}

.card-body {
  padding: 1.5rem;
  color: var(--text-primary);
  animation: fadeIn 0.6s ease-out 0.2s both;
}

.card-footer {
  background: #f8f9fa;
  border-top: 1px solid var(--border-color);
  padding: 1.25rem 1.5rem;
  border-radius: 0 0 var(--radius) var(--radius);
  transition: background 0.3s ease;
}

.card:hover .card-footer {
  background: #eff1f5;
}

/* ══════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════ */
.btn {
  border-radius: var(--radius);
  padding: 0.6rem 1.2rem;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 0.95rem;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:active::before {
  width: 300px;
  height: 300px;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(41, 128, 185, 0.2);
}

.btn-primary:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(41, 128, 185, 0.3);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(41, 128, 185, 0.2);
}

.btn-secondary {
  background: var(--light-bg);
  color: var(--text-primary);
  border-color: var(--border-color);
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  background: var(--border-color);
  color: var(--text-primary);
  transform: translateY(-2px);
}

.btn-success {
  background: var(--success);
  color: #fff;
  border-color: var(--success);
  box-shadow: 0 2px 8px rgba(39, 174, 96, 0.2);
}

.btn-success:hover {
  background: #229954;
  border-color: #229954;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(39, 174, 96, 0.3);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
  box-shadow: 0 2px 8px rgba(231, 76, 60, 0.2);
}

.btn-danger:hover {
  background: #c0392b;
  border-color: #c0392b;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(231, 76, 60, 0.3);
}

.btn-warning {
  background: var(--warning);
  color: #fff;
  border-color: var(--warning);
}

.btn-warning:hover {
  background: #d35400;
  border-color: #d35400;
  transform: translateY(-2px);
}

.btn-light {
  background: #fff;
  color: var(--text-primary);
  border-color: var(--border-color);
}

.btn-light:hover {
  background: var(--light-bg);
  border-color: var(--border-color);
  transform: translateY(-2px);
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
}

.btn-outline-secondary {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border-color);
}

.btn-outline-secondary:hover {
  background: var(--light-bg);
  color: var(--primary);
  border-color: var(--accent);
  transform: translateY(-1px);
}

/* ══════════════════════════════════════════
   FORMS
══════════════════════════════════════════ */
.form-control,
.form-select {
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 0.6rem 0.9rem;
  font-size: 0.95rem;
  color: var(--text-primary);
  background: #fff;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 0.2rem rgba(41, 128, 185, 0.15), inset 0 0 0 0.75px var(--accent);
  outline: none;
  transform: scale(1.01);
}

.form-control::placeholder {
  color: var(--text-secondary);
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.form-control:focus::placeholder {
  opacity: 0.5;
}

.form-label {
  color: var(--primary);
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  transition: color 0.3s ease;
}

.form-control:focus ~ .form-label,
.form-select:focus ~ .form-label {
  color: var(--accent);
}

.input-group-text {
  background: var(--light-bg);
  border-color: var(--border-color);
  color: var(--text-secondary);
  transition: all 0.3s ease;
}

.input-group:has(.form-control:focus) .input-group-text {
  border-color: var(--accent);
  background: #fff;
  color: var(--accent);
}

/* ══════════════════════════════════════════
   TABLES
══════════════════════════════════════════ */
.table {
  color: var(--text-primary);
  border-color: var(--border-color);
}

.table thead th {
  background: #f8f9fa;
  color: var(--primary);
  font-weight: 700;
  border-color: var(--border-color);
  padding: 1rem;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  transition: background 0.3s ease;
}

.table tbody td {
  border-color: var(--border-color);
  padding: 0.9rem 1rem;
  vertical-align: middle;
  transition: background 0.3s ease;
}

.table tbody tr {
  transition: all 0.3s ease;
}

.table tbody tr:hover {
  background-color: #f0f3f8;
  transform: scale(1.01);
  box-shadow: inset 0 0 8px rgba(41, 128, 185, 0.08);
}

.table tbody tr:nth-child(even) {
  background-color: #fafbfc;
}

/* ══════════════════════════════════════════
   ALERTS
══════════════════════════════════════════ */
.alert {
  border-radius: var(--radius);
  border: 1px solid;
  padding: 1rem;
  margin-bottom: 1rem;
  animation: slideInDown 0.4s ease-out;
}

.alert-success {
  background-color: #d4edda;
  color: #155724;
  border-color: #c3e6cb;
}

.alert-danger {
  background-color: #f8d7da;
  color: #721c24;
  border-color: #f5c6cb;
}

.alert-warning {
  background-color: #fff3cd;
  color: #856404;
  border-color: #ffeaa7;
}

.alert-info {
  background-color: #d1ecf1;
  color: #0c5460;
  border-color: #bee5eb;
}

/* ══════════════════════════════════════════
   LOGIN PAGE
══════════════════════════════════════════ */
.login-wrapper {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeInBody 0.6s ease-out;
}

.login-card {
  background: #fff;
  border-radius: 4px;
  padding: 2.5rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 380px;
  animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.login-logo {
  width: 60px;
  height: 60px;
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  font-size: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  animation: bounce 0.6s ease-out;
}

.login-card h4 {
  color: var(--primary);
  font-weight: 700;
  animation: fadeIn 0.6s ease-out 0.2s both;
}

.login-card p {
  color: var(--text-secondary);
  animation: fadeIn 0.6s ease-out 0.3s both;
}

.login-card .mb-3 {
  animation: slideInLeft 0.4s ease-out;
}

.login-card .mb-3:nth-of-type(1) { animation-delay: 0.4s; }
.login-card .mb-3:nth-of-type(2) { animation-delay: 0.5s; }
.login-card .form-check { animation: slideInLeft 0.4s ease-out 0.6s both; }
.login-card .btn { animation: slideInUp 0.4s ease-out 0.7s both; }

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

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

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

/* ══════════════════════════════════════════
   INVOICE
══════════════════════════════════════════ */
.invoice-box {
  background: #fff;
  border-radius: var(--radius);
  padding: 2.5rem;
  box-shadow: var(--card-shadow);
  max-width: 820px;
  margin: 0 auto;
  animation: fadeInUp 0.6s ease-out;
}

.invoice-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 1.5rem 2rem;
  margin-bottom: 1.5rem;
  animation: slideInDown 0.5s ease-out;
}

/* ══════════════════════════════════════════
   STOCK BADGES
══════════════════════════════════════════ */
.stock-ok   { 
  color: var(--success); 
  font-weight: 600;
  animation: pulse 1s ease-in-out infinite;
}

.stock-low  { 
  color: var(--warning); 
  font-weight: 600; 
  animation: pulse 0.8s ease-in-out infinite;
}

.stock-zero { 
  color: var(--danger); 
  font-weight: 600;
  animation: pulse 0.6s ease-in-out infinite;
}

/* ══════════════════════════════════════════
   BILL BUILDER
══════════════════════════════════════════ */
.bill-item-row {
  background: #f8f9fa;
  border-radius: var(--radius);
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
  animation: slideInLeft 0.3s ease-out;
}

.bill-item-row:hover {
  background: #f0f3f8;
  border-color: var(--accent);
  transform: translateX(4px);
  box-shadow: 0 2px 8px rgba(41, 128, 185, 0.1);
}

.bill-summary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 1.4rem;
  animation: fadeInUp 0.5s ease-out 0.2s both;
}

/* ══════════════════════════════════════════
   BADGE ROLE
══════════════════════════════════════════ */
.badge-role {
  padding: 0.3rem 0.7rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.3s ease;
  display: inline-block;
}

.role-admin { 
  background: rgba(41, 128, 185, 0.12); 
  color: var(--accent);
}

.role-staff { 
  background: rgba(39, 174, 96, 0.12);  
  color: var(--success);
}

.badge-role:hover {
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ══════════════════════════════════════════
   MODALS
══════════════════════════════════════════ */
.modal-content {
  border: 1px solid var(--border-color) !important;
  border-radius: var(--radius) !important;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
  animation: popIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-header {
  padding: 1.25rem 1.5rem !important;
  background: #f8f9fa;
  border-bottom: 1px solid var(--border-color) !important;
  color: var(--primary);
  font-weight: 600;
  transition: background 0.3s ease;
}

.modal-content:hover .modal-header {
  background: #eff1f5;
}

.modal-footer {
  background: #f8f9fa;
  border-top: 1px solid var(--border-color) !important;
  padding: 1rem 1.5rem !important;
  transition: background 0.3s ease;
}

.modal-content:hover .modal-footer {
  background: #eff1f5;
}

/* ══════════════════════════════════════════
   PAGINATION
══════════════════════════════════════════ */
.page-link {
  border-radius: var(--radius) !important;
  margin: 0 2px;
  color: var(--accent);
  border-color: var(--border-color);
  transition: all 0.3s ease;
}

.page-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(41, 128, 185, 0.15);
}

.page-item.active .page-link {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  animation: pulse 0.3s ease-out;
}

/* ══════════════════════════════════════════
   MINI STATS
══════════════════════════════════════════ */
.mini-stat {
  padding: 0.75rem;
  border-radius: var(--radius);
  background: #f8f9fa;
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
  animation: fadeInUp 0.4s ease-out;
}

.mini-stat:hover {
  background: #f0f3f8;
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(41, 128, 185, 0.1);
}

.mini-val {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent);
  transition: transform 0.3s ease;
}

.mini-stat:hover .mini-val {
  transform: scale(1.1);
}

.mini-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  margin-top: 0.25rem;
  letter-spacing: 0.5px;
  transition: color 0.3s ease;
}

.mini-stat:hover .mini-label {
  color: var(--primary);
}

/* ══════════════════════════════════════════
   CHART TOGGLE BUTTONS
══════════════════════════════════════════ */
.chart-toggle-btn {
  background: #f8f9fa;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 0.85rem;
  font-weight: 600;
  position: relative;
  overflow: hidden;
}

.chart-toggle-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.chart-toggle-btn:hover::before {
  left: 100%;
}

.chart-toggle-btn:hover {
  background: var(--light-bg);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

.chart-toggle-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(41, 128, 185, 0.3);
  animation: pulse 0.4s ease-out;
}

/* ══════════════════════════════════════════
   SIDEBAR TOGGLE
══════════════════════════════════════════ */
.sidebar-toggle-btn {
  transition: all 0.3s ease;
}

.sidebar-toggle-btn:hover {
  animation: wiggle 0.4s ease;
}

@keyframes wiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-2deg); }
  75% { transform: rotate(2deg); }
}

/* ══════════════════════════════════════════
   LOADING ANIMATION
══════════════════════════════════════════ */
.spinner {
  display: inline-block;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* ══════════════════════════════════════════
   FADE & SCALE UTILITIES
══════════════════════════════════════════ */
.fade-in {
  animation: fadeIn 0.6s ease-out;
}

.slide-in-left {
  animation: slideInLeft 0.4s ease-out;
}

.slide-in-right {
  animation: slideInRight 0.4s ease-out;
}

.slide-in-up {
  animation: slideInUp 0.4s ease-out;
}

.slide-in-down {
  animation: slideInDown 0.4s ease-out;
}

.pop-in {
  animation: popIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ══════════════════════════════════════════
   HOVER SCALE EFFECT
══════════════════════════════════════════ */
.hover-scale {
  transition: transform 0.3s ease;
}

.hover-scale:hover {
  transform: scale(1.05);
}

.hover-lift {
  transition: all 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* ══════════════════════════════════════════
   TEXT ANIMATIONS
══════════════════════════════════════════ */
a {
  transition: color 0.3s ease;
  position: relative;
}

a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.3s ease;
}

a:hover::after {
  width: 100%;
}

/* ══════════════════════════════════════════
   PRINT
══════════════════════════════════════════ */
@media print {
  #sidebar,
  .top-navbar,
  .no-print,
  .flash-container { display: none !important; }

  #page-content {
    margin-left: 0 !important;
  }

  body { background: #fff !important; }

  .invoice-box {
    box-shadow: none !important;
    padding: 1rem !important;
  }
}

/* ══════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════ */
@media (max-width: 991.98px) {
  :root {
    --sidebar-width: 260px;
  }

  #sidebar {
    transform: translateX(-100%);
    position: fixed;
    z-index: 1060;
  }

  #sidebar.open {
    transform: translateX(0);
  }

  #page-content,
  #page-content.full-width {
    margin-left: 0;
  }

  .welcome-banner {
    flex-direction: column;
    text-align: center;
    padding: 1.5rem;
  }

  .wb-left {
    flex-direction: column;
    width: 100%;
  }

  .main-content {
    padding: 1rem;
  }

  .page-title {
    font-size: 1.4rem;
  }
}

@media (max-width: 575px) {
  .stat-value { font-size: 1.5rem; }
  .main-content { padding: 0.85rem; }
  .invoice-box { padding: 1.25rem; }
}
