:root {
  --primary: #6366f1;
  --primary-dark: #4338ca;
  --primary-light: #818cf8;
  --secondary: #8b5cf6;
  --dark: #0f172a;
  --dark-900: #020617;
  --gray: #64748b;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --light: #f8fafc;
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --border: #e2e8f0;
  --sidebar-width: 260px;
  --header-height: 64px;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;
}

html, body {
  height: 100%;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family: 'Inter', sans-serif;
  background: 
    radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(16, 185, 129, 0.05) 0%, transparent 40%),
    linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: clip;
}
html {
  overflow-x: clip;
}

@media (min-width: 992px) {
  body {
    zoom: 0.8;
  }
}

img,
svg,
canvas {
  max-width: 100%;
}

/* ==================== UTILITY CLASSES ==================== */
.me-2 { margin-right: 0.5rem !important; }
.me-1 { margin-right: 0.25rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.text-danger { color: var(--danger) !important; }
.text-success { color: var(--success) !important; }
.text-primary { color: var(--primary) !important; }

/* ==================== AUTH PAGES ==================== */
.auth-page {
  min-height: 100%;
  display: none;
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
}

.auth-page.active {
  display: flex;
}

/* Background overlay */
.auth-bg-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.92) 0%, rgba(139, 92, 246, 0.88) 50%, rgba(16, 185, 129, 0.85) 100%);
  z-index: 0;
}

/* Decorative shapes */
.auth-shapes {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

.shape {
  position: absolute;
  border-radius: 50%;
  opacity: 0.08;
  background: white;
}

.shape-1 {
  width: 600px;
  height: 600px;
  top: -200px;
  right: -100px;
}

.shape-2 {
  width: 400px;
  height: 400px;
  bottom: -100px;
  left: -100px;
}

.shape-3 {
  width: 300px;
  height: 300px;
  top: 50%;
  left: 30%;
  background: #fbbf24;
}

/* Auth panels */
.auth-brand-panel,
.auth-form-panel {
  display: flex;
  align-items: center;
  padding: 24px;
  position: relative;
  z-index: 2;
}

.auth-brand-panel {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.95) 0%, rgba(139, 92, 246, 0.92) 100%);
  color: white;
  min-height: 100%;
  justify-content: center;
}

.brand-content {
  max-width: 400px;
}

.brand-logo {
  width: 72px;
  height: 72px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  margin-bottom: 24px;
  backdrop-filter: blur(10px);
}

.brand-logo img {
  width: 58px;
  height: 58px;
  object-fit: contain;
}

.brand-content h1 {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}

.brand-tagline {
  font-size: 1.1rem;
  opacity: 0.85;
  font-weight: 400;
  margin-bottom: 20px;
}

.brand-divider {
  width: 60px;
  height: 4px;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 2px;
  margin-bottom: 24px;
}

.brand-description {
  font-size: 0.95rem;
  line-height: 1.7;
  opacity: 0.8;
  margin-bottom: 30px;
}

.brand-features {
  list-style: none;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 0;
  font-size: 0.95rem;
  opacity: 0.9;
}

.feature-item i {
  font-size: 1.2rem;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 8px;
}

.auth-form-panel {
   justify-content: center;
   background: white;
}

.auth-form-wrapper {
  width: 100%;
  max-width: 460px;
  min-width: 0;
}

.auth-form-card {
  padding: 16px 24px;
}

@media (max-width: 575.98px) {
  .auth-page.active {
    display: block;
  }

  .auth-form-panel {
    padding: 16px 16px;
    align-items: flex-start;
    min-height: 100%;
  }

  .auth-form-card {
    padding: 12px 16px;
  }

  .auth-form-header {
    margin-bottom: 12px;
  }

  .auth-form-header h2 {
    font-size: 1.25rem;
  }

  .form-group {
    margin-bottom: 10px;
  }

  .form-group label {
    margin-bottom: 4px;
    font-size: 0.85rem;
  }

  .btn-auth {
    height: 42px;
    font-size: 0.9rem;
    margin-top: 4px;
  }

  .form-options {
    align-items: flex-start;
  }
}

/* Mobile logo (hidden on desktop) */
.mobile-logo {
  display: none;
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 12px;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: white;
  margin: 0 auto 12px;
}

.mobile-logo img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

@media (max-width: 991.98px) {
  .mobile-logo {
    display: flex;
  }
}

/* Form header */
.auth-form-header {
  text-align: center;
  margin-bottom: 12px;
}

.auth-form-header h2 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 6px;
}

.auth-form-header p {
  color: var(--gray);
  font-size: 0.95rem;
}

/* Form groups */
.form-group {
  margin-bottom: 10px;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--dark);
  margin-bottom: 4px;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.input-group {
  position: relative;
}

.input-group-text {
   background: var(--gray-100);
   border: 1px solid var(--gray-200);
   border-right: none;
   color: var(--gray);
   padding: 0.65rem 0.75rem;
   font-size: 0.95rem;
}

.form-control {
   height: 40px;
   border: 1px solid var(--gray-200);
   border-radius: var(--radius);
   padding: 0.45rem 0.75rem;
   font-size: 0.9rem;
   transition: all 0.2s;
   background: white;
   color: var(--dark);
   min-width: 0;
}

.form-control:focus {
   border-color: var(--primary);
   box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
   outline: none;
}

.input-group .form-control {
   border-left: none;
   border-radius: 0 var(--radius) var(--radius) 0;
}

.input-group > .btn {
   border-radius: 0 var(--radius) var(--radius) 0;
   border-left: none;
   border-color: var(--gray-200);
   background: var(--gray-100);
   color: var(--gray);
}

.input-group > .btn:hover {
   background: var(--gray-200);
   color: var(--dark);
}

.form-select {
   height: 40px;
   border: 1px solid var(--gray-200);
   border-radius: var(--radius);
   padding: 0.45rem 0.75rem;
   font-size: 0.9rem;
   transition: all 0.2s;
   cursor: pointer;
   background: white;
   color: var(--dark);
   min-width: 0;
}

.form-select:focus {
   border-color: var(--primary);
   box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
   outline: none;
}

.form-text {
  font-size: 0.8rem;
  color: var(--gray);
  margin-top: 4px;
}

.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.form-check-input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

.form-check-label {
  font-size: 0.875rem;
  color: var(--gray);
  cursor: pointer;
}

.login-status {
  font-size: 0.8rem;
  color: var(--gray);
}

/* Auth button */
.btn-auth {
  width: 100%;
  height: 42px;
  border: none;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
  margin-top: 2px;
}

.btn-auth:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
  color: white;
}

.btn-auth:active {
  transform: translateY(0);
  box-shadow: var(--shadow);
}

.btn-auth:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

/* Auth footer */
.auth-footer {
  text-align: center;
  margin-top: 12px;
  font-size: 0.9rem;
  color: var(--gray);
}

.auth-footer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}

.auth-footer a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* Forgot password link */
.forgot-link {
  font-size: 0.85rem;
  color: var(--primary) !important;
  text-decoration: none;
  font-weight: 500;
}

.forgot-link:hover {
  text-decoration: underline;
  color: var(--primary-dark) !important;
}

/* Alert styling */
.alert {
  border-radius: var(--radius);
  font-size: 0.875rem;
  border: none;
  padding: 0.75rem 1rem;
}

.alert-danger {
   background: rgba(239, 68, 68, 0.15);
   color: #fca5a5;
}

.alert-success {
   background: rgba(16, 185, 129, 0.15);
   color: #86efac;
}

/* ==================== MAIN APP LAYOUT ==================== */

/* Layout */
.app {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
   background: linear-gradient(180deg, var(--dark) 0%, var(--dark-900) 100%);
   border-right: none;
   position: sticky;
   top: 0;
   height: 100%;
   z-index: 100;
   box-shadow: 4px 0 24px rgba(0, 0, 0, 0.05);
   padding: 0;
   overflow: hidden; /* Contain the wave animation */
}

.sidebar-scroller {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

.sidebar-scroller .user-card {
  margin-top: auto;
}

.logo {
   display: flex;
   align-items: center;
   gap: 12px;
   padding: 0 12px 32px;
   font-size: 1.4rem;
   font-weight: 700;
   color: white;
   letter-spacing: -0.5px;
   min-width: 0;
}

.logo span,
.nav-item span:last-child,
.user-name,
.user-role {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
  color: white;
}

.logo-img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  flex-shrink: 0;
}

.nav-section {
  margin-bottom: 24px;
}

.nav-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--gray-400);
  padding: 0 12px;
  margin-bottom: 8px;
  font-weight: 700;
}

.nav-item {
   display: flex;
   align-items: center;
   gap: 12px;
   padding: 10px 12px;
   border-radius: 10px;
   color: var(--gray-300);
   text-decoration: none;
   font-size: 0.9rem;
   font-weight: 500;
   transition: all 0.2s ease;
   cursor: pointer;
   margin-bottom: 2px;
   border: none;
}

.nav-item:hover {
   background: rgba(255, 255, 255, 0.05);
   color: white;
   transform: translateX(4px);
}

.nav-item.active {
   background: linear-gradient(135deg, var(--primary), var(--secondary));
   color: white;
   box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

.nav-item .icon {
  font-size: 1.1rem;
  width: 24px;
  text-align: center;
}

.user-card {
   padding: 16px;
   background: rgba(0, 0, 0, 0.2);
   border-radius: 14px;
   display: flex;
   align-items: center;
   gap: 12px;
   border: 1px solid rgba(255, 255, 255, 0.05);
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  color: white;
}

.user-info {
  flex: 1;
  min-width: 0;
}

.user-name {
   font-weight: 600;
   font-size: 0.9rem;
   color: white;
}

.user-role {
   font-size: 0.75rem;
   color: var(--gray-400);
}

.sidebar .btn-icon {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--gray-400);
}

.sidebar .btn-icon:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border-color: rgba(255, 255, 255, 0.2);
}

/* Main Content */
.main {
  padding: 24px 32px;
  overflow-y: auto;
  overflow-x: hidden;
  min-width: 0;
  min-height: 0;
  height: 100%;
  transition: grid-template-columns 0.3s ease;
}

/* Header */
.header {
   display: flex;
   align-items: center;
   justify-content: space-between;
   margin-bottom: 32px;
   gap: 16px;
   min-width: 0;
}

.header-left {
  min-width: 0;
}

.header-left h1 {
   font-size: 1.8rem;
   font-weight: 700;
   letter-spacing: -0.5px;
   margin-bottom: 4px;
   color: var(--dark);
   overflow-wrap: anywhere;
}

.header-left p {
   color: var(--gray);
   font-size: 0.9rem;
}

.header-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-shrink: 0;
}

.search-box {
  position: relative;
}

.search-box input {
   background: white;
   border: 1px solid var(--gray-200);
   border-radius: 12px;
   padding: 10px 16px 10px 40px;
   color: var(--dark);
   font-size: 0.9rem;
   width: 280px;
   max-width: 100%;
   outline: none;
   transition: all 0.2s;
}

.search-box input:focus {
   border-color: var(--primary);
   box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.search-box .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray);
  font-size: 0.9rem;
}

.btn-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: white;
  border: 1px solid var(--gray-200);
  color: var(--gray);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  font-size: 1.1rem;
}

.btn-icon:hover {
  background: var(--gray-100);
  color: var(--dark);
  border-color: var(--primary);
}

.notification-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid white;
}

.header-user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  color: white;
  border: 1px solid var(--gray-200);
  flex-shrink: 0;
}

.page-content {
  flex: 1;
  min-width: 0;
}

/* Cards and Containers */
.card {
   background: white;
   border: 1px solid var(--gray-200);
   border-radius: var(--radius-lg);
   padding: 24px;
   margin-bottom: 24px;
   box-shadow: var(--shadow);
   min-width: 0;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--dark);
  margin: 0;
}

/* Tables */
.table-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

th, td {
   padding: 12px 16px;
   text-align: left;
   border-bottom: 1px solid var(--gray-200);
   white-space: nowrap;
   vertical-align: middle;
}

th {
   font-size: 0.75rem;
   font-weight: 600;
   text-transform: uppercase;
   color: var(--gray);
   letter-spacing: 0.5px;
}

tr:hover td {
   background: rgba(99, 102, 241, 0.1);
}

/* Badges */
.badge {
  display: inline-block;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 20px;
  text-transform: uppercase;
}

.badge-success { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.badge-danger { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.badge-info { background: rgba(37, 99, 235, 0.15); color: var(--primary-light); }
.badge-primary { background: rgba(99, 102, 241, 0.15); color: var(--primary); }

/* Buttons */
.btn-sm {
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
  
/* Action Buttons */
.btn-outline-danger {
  border: 1px solid rgba(239, 68, 68, 0.3);
  background: transparent;
}
.btn-outline-danger:hover {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
}

.btn-outline-primary {
  color: var(--primary);
  border: 1px solid rgba(99, 102, 241, 0.3);
  background: transparent;
}
.btn-outline-primary:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.btn-outline-secondary {
  color: var(--text-secondary);
  border: 1px solid var(--border);
  background: transparent;
}
.btn-outline-secondary:hover {
  background: var(--gray-200);
  color: var(--text-primary);
  border-color: var(--gray-300);
}

.btn-outline-warning {
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
  background: transparent;
}
.btn-outline-warning:hover {
  background: var(--warning);
  color: white;
  border-color: var(--warning);
}

.btn-sm.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: var(--gray-200);
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  background: var(--primary);
  color: white;
  justify-content: center;
  max-width: 100%;
  white-space: normal;
  line-height: 1.2;
}

.btn:hover {
  background: var(--primary-dark);
}

/* Form controls in dashboard */
.form-control, .form-select {
   border: 1px solid var(--gray-300);
   background: white;
   color: var(--dark);
   border-radius: var(--radius);
   padding: 0.5rem 0.75rem;
   width: 100%;
   max-width: 100%;
   font-size: 0.9rem;
}

.form-control:focus, .form-select:focus {
   border-color: var(--primary);
   box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
   outline: none;
}

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

/* Dashboard Row (two column) */
.dashboard-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
  min-width: 0;
}

/* Quick Actions */
.quick-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.quick-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Section Header */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.section-title {
  font-size: 20px;
  font-weight: 600;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.view-all-btn {
  font-size: 0.9rem;
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.view-all-btn:hover {
  text-decoration: underline;
}

/* Stock status */
.stock-low { color: var(--danger); font-weight: 600; }
.stock-ok { color: var(--success); font-weight: 600; }

/* Low Stock Alert Badge */
.low-stock-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #fee2e2;
  color: var(--danger);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--gray);
}

.empty-state i {
  font-size: 48px;
  margin-bottom: 15px;
  opacity: 0.5;
}

/* Loading State */
.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
  color: var(--gray);
}

.loading-state i {
  margin-right: 10px;
  animation: spin 1s linear infinite;
}

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

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 14px 22px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 1050;
  animation: slideIn 0.3s ease;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  max-width: calc(100% - 32px);
}

.toast.success {
  background: var(--success);
  color: white;
}

.toast.error {
  background: var(--danger);
  color: white;
}

.toast.hide {
  display: none;
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Modal Customization */
.modal-content {
  border-radius: var(--radius-lg);
  border: none;
  box-shadow: var(--shadow-xl);
  background: var(--bg-card);
  color: var(--text-primary);
  max-width: 100%;
}

.modal-dialog {
  max-width: min(var(--bs-modal-width), calc(100% - 24px));
  margin-left: auto;
  margin-right: auto;
}

.modal-dialog-scrollable .modal-content {
  max-height: calc(100% - 32px);
}

.modal-header {
  border-bottom: 1px solid var(--border);
  padding: 20px 24px;
}

.modal-body {
  padding: 24px;
  overflow-x: hidden;
}

.modal-footer {
  border-top: 1px solid var(--border);
  padding: 16px 24px;
}

.product-modal-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  background: var(--light);
  flex-wrap: wrap;
}

.product-modal-intro > * {
  min-width: 0;
}

.product-modal-intro h6 {
  margin: 0 0 6px;
  font-weight: 700;
  color: var(--dark);
}

.product-modal-intro p {
  margin: 0;
  color: var(--gray);
  line-height: 1.5;
}

.ai-accountability-content {
  min-height: 260px;
}

.ai-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.ai-summary-card {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 14px;
  background: white;
}

.ai-summary-card span {
  display: block;
  color: var(--gray);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.ai-summary-card strong {
  display: block;
  color: var(--dark);
  font-size: 20px;
}

.ai-summary-card.success {
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.08);
}

.ai-summary-card.warning {
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.1);
}

.ai-insight-panel,
.ai-table-card {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  background: white;
  padding: 16px;
  margin-bottom: 16px;
}

.ai-insight-panel h6,
.ai-table-card h6 {
  font-weight: 700;
  margin: 0 0 12px;
}

.ai-insight-panel ul {
  margin: 0;
  padding-left: 20px;
}

.ai-insight-panel li {
  margin-bottom: 8px;
}

.ai-period-note {
  border-top: 1px solid var(--gray-200);
  color: var(--gray);
  margin-top: 12px;
  padding-top: 12px;
}

/* Sidebar Toggle Button (mobile only) */
.sidebar-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--gray-300);
  color: var(--gray);
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  margin-right: 8px;
}

.sidebar-toggle:hover {
  background: var(--gray-100);
  color: var(--dark);
}

.menu-toggle {
  display: inline-flex;
  background: white;
  border: 1px solid var(--gray-200);
  color: var(--gray);
  width: 40px;
  height: 40px;
  border-radius: 12px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.menu-toggle:hover {
  background: var(--gray-100);
  color: var(--dark);
  border-color: var(--primary);
}

/* Sidebar Overlay (mobile) */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
  display: block;
  opacity: 1;
}

/* Sidebar Collapsed State (Desktop) */
@media (min-width: 769px) {
  .app.sidebar-collapsed {
    grid-template-columns: 80px minmax(0, 1fr);
  }
  .app.sidebar-collapsed .sidebar .logo span,
  .app.sidebar-collapsed .sidebar .nav-item span:last-child,
  .app.sidebar-collapsed .sidebar .nav-label,
  .app.sidebar-collapsed .sidebar .user-info {
    display: none;
  }
  .app.sidebar-collapsed .sidebar .logo {
    padding: 0 0 32px 0;
    justify-content: center;
  }
  .app.sidebar-collapsed .sidebar .nav-item {
    justify-content: center;
    padding: 10px 0;
  }
  .app.sidebar-collapsed .sidebar .nav-item .icon {
    margin: 0;
    width: auto;
    font-size: 1.3rem;
  }
  .app.sidebar-collapsed .sidebar .user-card {
    padding: 16px 0;
    justify-content: center;
    background: transparent;
    border: none;
  }
  .app.sidebar-collapsed .sidebar .user-card .btn-icon {
    display: none;
  }
}

/* Responsive Dashboard Grid */
/* Extra small devices */
@media (max-width: 575.98px) {
  .card {
    padding: 14px 12px;
  }

  .card-header {
    align-items: flex-start;
  }
  
  .chart-container {
    height: 220px;
  }
  
  .dashboard-row {
    gap: 12px;
  }
  
  .card-title {
    font-size: 15px;
  }
  
  .section-header {
    margin-bottom: 12px;
  }
  
  .section-title {
    font-size: 18px;
  }
}

@media (max-width: 1199.98px) {
  .dashboard-row {
    grid-template-columns: 1fr;
  }

  .ai-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Ensure charts are responsive */
@supports (aspect-ratio: 16/9) {
  .chart-container {
    aspect-ratio: 16/9;
    height: auto;
    min-height: 250px;
  }
}

/* ==================== RESPONSIVE - MOBILE ==================== */
@media (max-width: 768px) {
  .app {
      grid-template-columns: minmax(0, 1fr);
      overflow: visible;
      height: auto;
      min-height: 100%;
  }
  .sidebar {
      position: fixed;
      left: -260px;
      transition: left 0.3s ease;
  }
  .sidebar.open {
      left: 0;
  }
  .nx-stats-grid {
      grid-template-columns: 1fr;
  }
  .header {
      flex-wrap: wrap;
      gap: 16px;
      align-items: flex-start;
      margin-bottom: 20px;
  }

  .header-actions {
      width: 100%;
      justify-content: flex-end;
   }

  .search-box input {
      width: 200px;
  }
  .main {
      padding: 16px;
      height: auto;
      min-height: 100%;
      overflow: visible;
  }

  table {
      min-width: 640px;
   }

  .modal-dialog {
      max-width: calc(100% - 16px);
      margin: 8px auto;
   }

  .modal-header,
  .modal-body,
  .modal-footer {
      padding: 16px;
   }

  .modal-footer {
      gap: 10px;
   }

  .modal-footer .btn {
      flex: 1 1 160px;
   }
}


/* ==================== ECO-FRIENDLY THEME ==================== */
.eco-modal {
  border-radius: 24px !important;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(46, 125, 50, 0.15), 0 0 0 1px rgba(255,255,255,0.5) !important;
}

.eco-checkout-panel {
  background: white !important;
}

.eco-card {
  transition: all 0.3s ease;
  background-color: white !important;
  border: 2px solid #e8f5e9 !important;
  border-radius: 16px !important;
}

.eco-card:hover {
  transform: translateY(-4px);
  border-color: #81c784 !important;
  box-shadow: 0 8px 24px rgba(67, 160, 71, 0.12) !important;
}

.eco-total-card {
  border: 2px solid #81c784 !important;
  background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%) !important;
  border-radius: 16px !important;
}

.btn-eco {
  background: linear-gradient(135deg, #43a047 0%, #66bb6a 100%) !important;
  border: none;
  color: white !important;
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px rgba(67, 160, 71, 0.3) !important;
}

.btn-eco:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(67, 160, 71, 0.4) !important;
}

.text-eco { color: #2e7d32 !important; }
.bg-eco { background: linear-gradient(135deg, #43a047 0%, #2e7d32 100%) !important; color: #ffffff !important; }
.bg-eco * { color: #ffffff !important; }
.bg-eco-subtle { background-color: #e8f5e9 !important; }
.bg-eco-subtle,
.bg-eco-subtle .text-eco,
.bg-eco-subtle .text-secondary,
.bg-eco-subtle .fw-bold,
.bg-eco-subtle small,
.bg-eco-subtle div { color: #1b5e20 !important; }
.border-eco-subtle { border-color: #81c784 !important; }
.text-eco-dark { color: #1b5e20 !important; }
.text-secondary-dark { color: #334155 !important; }
#purchase-current-total { color: #1b5e20 !important; font-weight: 700 !important; }
#purchase-all-total { color: #334155 !important; font-weight: 700 !important; }
/* Accountability totals card - force dark text */
.purchase-totals-card,
.purchase-totals-card * { color: #1b5e20 !important; }
.purchase-totals-card .text-secondary,
.purchase-totals-card .text-secondary-label { color: #546e7a !important; }

.btn-outline-eco {
  color: #43a047 !important;
  border: 2px solid #81c784 !important;
  background: white !important;
  transition: all 0.2s;
}

.btn-outline-eco:hover {
  background-color: #e8f5e9 !important;
}

@media (min-width: 992px) {
  .eco-border-end { border-right: 1px solid var(--border) !important; }
  .eco-body { overflow: hidden !important; }
  .eco-panel {
    height: 100%;
    overflow-y: auto;
  }
  #sale-items-container {
    overflow-y: auto;
  }
}

@media (max-width: 991.98px) {
  .eco-border-end { border-bottom: 1px solid var(--border) !important; }
  .eco-body {
    overflow-y: auto !important;
  }
}

.eco-header-rich {
  background: linear-gradient(135deg, #43a047 0%, #66bb6a 50%, #81c784 100%) !important;
  color: white !important;
  overflow: hidden;
  border-bottom: none !important;
}

.eco-header-rich * {
  color: white !important;
}

.eco-header-blur-1 {
  position: absolute;
  top: -50px;
  right: -50px;
  width: 150px;
  height: 150px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  filter: blur(30px);
}

.eco-header-blur-2 {
  position: absolute;
  bottom: -50px;
  left: -50px;
  width: 200px;
  height: 200px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  filter: blur(30px);
}

.eco-impact-card {
  background: white;
  border: 1px solid #e8f5e9;
  border-radius: 20px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.eco-modal .form-control,
.eco-modal .form-select {
   border-radius: 12px !important;
   padding: 0.5rem 0.75rem !important;
   border: 2px solid #e8f5e9 !important;
   background-color: #fafafa !important;
   color: #333 !important;
   transition: all 0.3s ease;
   width: 100% !important;
   max-width: 100% !important;
   font-size: 0.9rem !important;
}

.eco-modal .form-control:focus,
.eco-modal .form-select:focus {
   box-shadow: 0 0 0 4px rgba(102, 187, 106, 0.1) !important;
   border-color: #66bb6a !important;
   background-color: white !important;
}

.eco-modal .input-group-text {
   border-radius: 14px 0 0 14px !important;
   border: 2px solid #e8f5e9 !important;
   border-right: none !important;
   background-color: #fafafa !important;
   color: #81c784 !important;
}

.eco-modal .input-group .form-control {
   border-radius: 0 14px 14px 0 !important;
   border-left: 0 !important;
}

.eco-modal .sale-item-total {
   background-color: #f1f8e9 !important;
   color: #2e7d32 !important;
   font-weight: 700 !important;
}

.sale-item-row .card-body .row.g-2 > div {
  align-self: stretch; /* Ensure all columns stretch to fill height */
}

/* ==================== BOOTSTRAP DARK MODE OVERRIDES ==================== */
.bg-light { background-color: var(--light) !important; }
.bg-white { background-color: white !important; }
.text-dark { color: var(--dark) !important; }
.text-muted { color: var(--gray) !important; }
.text-secondary { color: var(--gray) !important; }
.border { border-color: var(--gray-200) !important; }
.border-top { border-color: var(--gray-200) !important; }

/* ==================== DASHBOARD ==================== */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-bottom: 24px;
}

.stat-card {
   background: white;
   border-radius: var(--radius-lg);
   padding: 24px;
   display: flex;
   align-items: center;
   gap: 16px;
   box-shadow: var(--shadow);
   border: 1px solid var(--gray-200);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.stat-icon.blue { background: #e0e7ff; color: #4f46e5; }
.stat-icon.green { background: #d1fae5; color: #059669; }
.stat-icon.orange { background: #fef3c7; color: #d97706; }
.stat-icon.purple { background: #f3e8ff; color: #7c3aed; }
.stat-icon.red { background: #fee2e2; color: #dc2626; }

.stat-content {
  flex: 1;
  min-width: 0;
}

.stat-content h3 {
   font-size: 24px;
   font-weight: 700;
   margin: 0 0 4px 0;
   color: var(--dark);
}

.stat-content p {
   margin: 0;
   color: var(--gray);
   font-size: 14px;
   font-weight: 500;
}

.stat-content small {
   color: var(--gray-400);
   font-size: 12px;
}

.chart-card {
   background: white;
   border-radius: var(--radius-lg);
   padding: 24px;
   box-shadow: var(--shadow);
   border: 1px solid var(--gray-200);
   height: 100%;
}

.activity-feed {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.activity-item {
   display: flex;
   gap: 16px;
   padding-bottom: 16px;
   border-bottom: 1px solid var(--gray-100);
}

.activity-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.activity-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.activity-icon.sale { background: #e0e7ff; color: #4f46e5; }
.activity-icon.appointment { background: #d1fae5; color: #059669; }
.activity-icon.product { background: #fef3c7; color: #d97706; }
.activity-icon.user { background: #f3e8ff; color: #7c3aed; }
.activity-icon.purchase { background: #e0f2fe; color: #0891b2; }
.activity-icon.default { background: var(--gray-100); color: var(--gray); }

.activity-content {
   flex: 1;
   min-width: 0;
}

.activity-content h5 {
   margin: 0 0 4px 0;
   font-size: 15px;
   font-weight: 600;
   color: var(--dark);
   text-transform: capitalize;
}

.activity-content p {
   margin: 0;
   font-size: 13px;
   color: var(--gray);
}

.activity-time {
  font-size: 12px;
  color: var(--gray-400);
  white-space: nowrap;
  margin-left: auto;
}

@media (max-width: 575.98px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .stat-card {
    padding: 16px;
  }

  .stat-content h3 {
    font-size: 20px;
  }

  .chart-card {
    padding: 16px 12px;
  }

  .activity-item {
    align-items: flex-start;
  }

  .activity-time {
    white-space: normal;
    text-align: right;
  }

  .ai-summary-grid {
    grid-template-columns: 1fr;
  }

  .product-modal-intro {
    display: block !important;
    padding: 16px !important;
  }

  .product-modal-intro .btn {
    width: 100%;
    margin-top: 12px;
  }

  .eco-modal {
    border-radius: 14px !important;
  }

  .eco-header-rich {
    padding: 16px !important;
  }

  .eco-modal .card-body {
    padding: 16px !important;
  }

  .eco-panel {
    padding: 16px !important;
  }

  .sale-item-row .row > [class*="col-"] {
    margin-bottom: 8px;
  }
}

/* ==================== ACCOUNTING MODULE STYLES ==================== */
.nav-item-dropdown {
  position: relative;
}

.dropdown-toggle-custom {
  display: flex !important;
  align-items: center;
  width: 100%;
}

.chevron-icon {
  font-size: 0.75rem;
  transition: transform 0.2s ease;
}

.dropdown-toggle-custom.open .chevron-icon {
  transform: rotate(180deg);
}

.dropdown-submenu-custom {
  padding-left: 20px;
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  margin-left: 24px;
}

.submenu-item {
  color: var(--gray-400);
  text-decoration: none;
  font-size: 0.85rem;
  padding: 6px 12px;
  border-radius: 6px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.submenu-item:hover, .submenu-item.active {
  color: white;
  background: rgba(255, 255, 255, 0.05);
}

.submenu-item.active {
  background: rgba(99, 102, 241, 0.2);
  font-weight: 600;
}

/* Report Styles */
.accounting-report-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 24px;
  margin-bottom: 24px;
  border: 1px solid var(--border);
}

.report-header {
  border-bottom: 2px solid var(--border);
  padding-bottom: 16px;
  margin-bottom: 24px;
  text-align: center;
}

.report-header h2 {
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 4px;
}

.report-header .report-subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
}

.report-table th {
  background: var(--gray-100);
  color: var(--text-primary);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
  padding: 12px 16px;
  border-bottom: 2px solid var(--border);
}

.report-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.report-table tr:hover {
  background-color: var(--gray-100);
}

.report-table .text-amount {
  text-align: right;
  font-family: monospace;
  font-size: 0.95rem;
}

.report-table .total-row td {
  font-weight: 700;
  background: var(--gray-100);
  border-top: 2px solid var(--dark);
  border-bottom: 2px solid var(--dark);
}

.report-table .subtotal-row td {
  font-weight: 600;
  border-top: 1px solid var(--dark);
  border-bottom: 1px solid var(--dark);
}

.report-table .indent-1 {
  padding-left: 32px;
}

.report-table .indent-2 {
  padding-left: 48px;
}

.report-controls {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
  background: white;
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.report-controls label {
  font-weight: 600;
  font-size: 0.85rem;
  margin-right: 8px;
}

/* ═══════════════════════════════════════════════════════════════
   WELCOME NOTE OVERLAY  —  Logo Colors: Cyan #00D4E8 · Purple #8B2FC9 · Deep Blue #3D2B9E
   ═══════════════════════════════════════════════════════════════ */

/* Dashboard blur when welcome note is active */
#app-container.dashboard-blurred {
  filter: blur(6px) brightness(0.6);
  transition: filter 0.4s ease;
  pointer-events: none;
  user-select: none;
}

/* Full-screen overlay */
.welcome-note-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(
    135deg,
    rgba(0,   212, 232, 0.15) 0%,
    rgba(61,  43,  158, 0.55) 40%,
    rgba(139, 47,  201, 0.65) 100%
  );
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.55s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.welcome-note-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* ── Decorative floating orbs ── */
.wn-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.45;
  animation: orb-drift 8s ease-in-out infinite alternate;
}
.wn-orb-1 {
  width: 320px; height: 320px;
  background: radial-gradient(circle, #00D4E8, transparent 70%);
  top: -80px; left: -80px;
  animation-duration: 9s;
}
.wn-orb-2 {
  width: 280px; height: 280px;
  background: radial-gradient(circle, #8B2FC9, transparent 70%);
  bottom: -60px; right: -60px;
  animation-duration: 11s;
  animation-direction: alternate-reverse;
}
.wn-orb-3 {
  width: 200px; height: 200px;
  background: radial-gradient(circle, #6A3FBF, transparent 70%);
  top: 50%; left: 70%;
  animation-duration: 7s;
}

@keyframes orb-drift {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(30px, 20px) scale(1.12); }
}

/* ── Card ── */
.welcome-note-card {
  position: relative;
  z-index: 1;
  width: 92%;
  max-width: 520px;
  background: linear-gradient(
    145deg,
    rgba(0,   212, 232, 0.12) 0%,
    rgba(61,  43,  158, 0.65) 35%,
    rgba(139, 47,  201, 0.70) 70%,
    rgba(26,  12,  80,  0.85) 100%
  );
  border: 1.5px solid rgba(0, 212, 232, 0.35);
  border-radius: 32px;
  padding: 44px 40px 38px;
  text-align: center;
  box-shadow:
    0 40px 80px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.06) inset,
    0 0 80px rgba(0, 212, 232, 0.12) inset;
  transform: scale(0.88) translateY(24px);
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  color: #fff;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.welcome-note-overlay.active .welcome-note-card {
  transform: scale(1) translateY(0);
}

/* ── Logo Ring ── */
.welcome-note-header-logo {
  margin-bottom: 22px;
}

.wn-logo-ring {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #00D4E8, #8B2FC9, #3D2B9E, #00D4E8);
  animation: logo-spin-ring 6s linear infinite;
  box-shadow: 0 0 30px rgba(0, 212, 232, 0.5), 0 0 60px rgba(139, 47, 201, 0.3);
}

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

.welcome-logo-img {
  width: 100px;
  height: 100px;
  object-fit: contain;
  border-radius: 50%;
  background: #fff;
  padding: 10px;
  animation: logo-float 3.5s ease-in-out infinite alternate;
  display: block;
}

@keyframes logo-float {
  0%   { transform: translateY(0) rotate(0deg); }
  100% { transform: translateY(-7px) rotate(1.5deg); }
}

/* ── Subtitle tag ── */
.welcome-note-subtitle {
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #00D4E8;
  margin-bottom: 8px;
  opacity: 0.9;
}

/* ── Brand name ── */
.welcome-note-brand {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.45rem;
  font-weight: 800;
  font-style: normal;
  line-height: 1.25;
  background: linear-gradient(135deg, #00D4E8 0%, #C084FC 50%, #fff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 20px;
  letter-spacing: 0.5px;
}

/* ── Main greeting — BOLD, ITALIC, 36px ── */
.welcome-note-greeting {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 36px;
  font-weight: 700;
  font-style: italic;
  line-height: 1.35;
  color: #ffffff;
  margin-bottom: 18px;
  text-shadow: 0 2px 20px rgba(0, 212, 232, 0.35);
}

.welcome-note-greeting em,
#welcome-note-name {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-weight: 900;
  background: linear-gradient(90deg, #00D4E8, #C084FC);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Body text ── */
.welcome-note-text {
  font-family: 'Inter', sans-serif;
  font-size: 0.92rem;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.78);
  margin-bottom: 0;
  font-weight: 400;
}

/* ── Divider ── */
.wn-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 212, 232, 0.5), rgba(139, 47, 201, 0.5), transparent);
  margin: 28px 0;
}

/* ── Enter Button ── */
.welcome-enter-btn {
  font-family: 'Inter', sans-serif;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 36px;
  border: none;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, #00D4E8 0%, #8B2FC9 60%, #3D2B9E 100%);
  box-shadow: 0 6px 28px rgba(0, 212, 232, 0.4), 0 2px 8px rgba(139, 47, 201, 0.3);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}

.welcome-enter-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.25), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.welcome-enter-btn:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 12px 40px rgba(0, 212, 232, 0.55), 0 4px 16px rgba(139, 47, 201, 0.4);
}

.welcome-enter-btn:hover::before {
  opacity: 1;
}

.welcome-enter-btn:active {
  transform: translateY(0) scale(0.98);
}

/* ── Live Clock & Date ── */
.welcome-note-time-container {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(0, 212, 232, 0.2);
  border-radius: 20px;
  padding: 16px 24px;
  margin: 22px auto 26px;
  max-width: 320px;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

.welcome-note-time-container:hover {
  border-color: rgba(192, 132, 252, 0.45);
  box-shadow: 0 8px 32px 0 rgba(0, 212, 232, 0.15), 0 0 15px rgba(0, 212, 232, 0.2);
  transform: translateY(-2px);
}

.welcome-note-time {
  font-family: 'Inter', sans-serif;
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: #ffffff;
  text-shadow: 0 0 10px rgba(0, 212, 232, 0.4);
  line-height: 1.1;
  margin-bottom: 4px;
}

.welcome-note-date {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 0.5px;
}

/* Offline Sync Status Badge in Header */
.sync-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.3s ease;
  margin-right: 8px;
  border: 1px solid transparent;
}

.sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  position: relative;
  transition: all 0.3s ease;
}

.sync-status.online {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.2);
}
.sync-status.online .sync-dot {
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
  animation: pulse-green 2s infinite;
}

.sync-status.offline {
  background: rgba(245, 158, 11, 0.1);
  color: #d97706;
  border-color: rgba(245, 158, 11, 0.2);
}
.sync-status.offline .sync-dot {
  background: #f59e0b;
  box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4);
  animation: pulse-amber 2s infinite;
}

.sync-status.syncing {
  background: rgba(59, 130, 246, 0.1);
  color: #2563eb;
  border-color: rgba(59, 130, 246, 0.2);
}
.sync-status.syncing .sync-dot {
  background: #3b82f6;
  box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4);
  animation: pulse-blue 1.5s infinite;
}

@keyframes pulse-green {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

@keyframes pulse-amber {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(245, 158, 11, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
  }
}

@keyframes pulse-blue {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(59, 130, 246, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
  }
}

/* ==================== ID CARD PREVIEW & PRINT STYLES ==================== */
.id-card-scene {
  perspective: 1200px;
  width: 270px;
  height: 420px;
  margin: 15px auto;
  cursor: pointer;
}

.id-card-3d {
  width: 100%;
  height: 100%;
  position: relative;
  transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transform-style: preserve-3d;
}

.id-card-3d.flipped {
  transform: rotateY(180deg);
}

.id-card-side h4,
.id-card-side p {
  margin: 0;
  padding: 0;
}

.id-card-side {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 18px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Front Side Style (Staff - Purple/Indigo/Cyan Logo theme) */
.id-card-front {
  background: linear-gradient(135deg, #1e1b4b 0%, #7c3aed 55%, #00d2ff 100%);
  color: #ffffff;
}

/* Front Side Style (Non-Staff - Navy/Cyan Logo theme) */
.id-card-front.category-non-staff {
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 60%, #00d2ff 100%);
}

/* Hologram accent lines */
.id-card-front::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 100% 0%, rgba(255, 255, 255, 0.08) 0%, transparent 60%);
  pointer-events: none;
  z-index: 1;
}

.id-card-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 12px;
  z-index: 2;
}

.id-card-logo {
  height: 34px;
  width: auto;
  margin-bottom: 6px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.id-card-company-name {
  font-family: 'Playfair Display', serif;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 1px;
  line-height: 1.1;
  background: linear-gradient(90deg, #00d2ff, #7c3aed);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.id-card-company-sub {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 600;
  margin-top: 1px;
}

.id-card-profile-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 8px 0;
  position: relative;
  z-index: 2;
}

.id-card-avatar {
  width: 100px;
  height: 100px;
  border-radius: 4px;
  background: #f1f5f9;
  border: 3px solid #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  font-weight: 700;
  color: #1e1b4b;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
  text-transform: uppercase;
  margin-bottom: 10px;
  overflow: hidden;
  position: relative;
}

/* Avatar glow variations */
.id-card-front .id-card-avatar {
  border-color: rgba(124, 58, 237, 0.7);
  box-shadow: 0 0 15px rgba(124, 58, 237, 0.3), 0 8px 16px rgba(0, 0, 0, 0.3);
}
.id-card-front.category-non-staff .id-card-avatar {
  border-color: rgba(0, 210, 255, 0.7);
  box-shadow: 0 0 15px rgba(0, 210, 255, 0.3), 0 8px 16px rgba(0, 0, 0, 0.3);
}

.id-card-category-badge {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  padding: 4px 14px;
  border-radius: 50px;
  text-transform: uppercase;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
}

/* Category colors matching logo */
.category-staff .id-card-category-badge {
  background-color: #7c3aed;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.category-non-staff .id-card-category-badge {
  background-color: #00bcd4;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.id-card-info {
  text-align: center;
  z-index: 2;
  margin-bottom: 6px;
}

.id-card-name {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 2px;
  letter-spacing: 0.5px;
}

.id-card-position {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.id-card-footer-details {
  display: flex;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  z-index: 2;
}

.id-card-detail-item {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.id-card-detail-item:last-child {
  text-align: right;
}

.id-card-detail-item .label {
  font-size: 0.55rem;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 600;
  letter-spacing: 0.8px;
  margin-bottom: 1px;
}

.id-card-detail-item .value {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* Back Side Style */
.id-card-back {
  background: linear-gradient(135deg, #0b0f19 0%, #1e1b4b 100%);
  color: #ffffff;
  transform: rotateY(180deg);
  align-items: center;
  text-align: center;
}

.id-card-header-back {
  width: 100%;
  margin-bottom: 10px;
}

.id-card-header-back .title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 700;
}

.id-card-header-back .divider {
  width: 40px;
  height: 2px;
  background: #34e89e;
  margin: 6px auto 0;
}

.id-card-qr-container {
  background: #ffffff;
  padding: 10px;
  border-radius: 12px;
  display: inline-block;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  margin: 5px 0;
  position: relative;
}

/* Scan boundary marks */
.id-card-qr-container::before {
  content: "";
  position: absolute;
  inset: 4px;
  border: 2px solid rgba(52, 232, 158, 0.3);
  border-radius: 10px;
  pointer-events: none;
}

#id-card-qr-canvas {
  display: block;
  width: 130px;
  height: 130px;
}

.scan-instructions {
  margin-top: 10px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #34e89e;
  animation: qrPulse 2s infinite ease-in-out;
}

@keyframes qrPulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

.id-card-disclaimer {
  font-size: 0.6rem;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.35;
  margin: 8px 0;
  padding: 0 10px;
}

.id-card-footer-back {
  width: 100%;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 8px;
  font-size: 0.58rem;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 500;
}

.id-card-footer-back .website {
  color: #00d2ff;
  font-weight: 600;
  margin-top: 2px;
}

/* ==================== PRINT MEDIA OVERRIDES ==================== */
@media print {
  /* Hide all main elements, sidebar, modal backgrounds, and layout */
  body * {
    visibility: hidden;
  }
  
  /* Make only the ID Card scene and its contents visible */
  #idCardModal,
  #idCardModal .modal-dialog,
  #idCardModal .modal-content,
  #idCardModal .modal-body,
  .id-card-scene,
  .id-card-scene * {
    visibility: visible;
  }

  body {
    background: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Reposition modal overlay for pure print view */
  #idCardModal {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    height: auto !important;
    background: none !important;
    opacity: 1 !important;
    display: block !important;
  }

  .modal-dialog {
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
  }

  .modal-content {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  /* Hide closing UI elements */
  .modal-header,
  .modal-footer,
  .modal-body > p.text-muted {
    display: none !important;
  }

  /* Disable 3D flip transform and display both front and back on the page side-by-side */
  .id-card-scene {
    perspective: none !important;
    cursor: default !important;
    width: 100% !important;
    height: auto !important;
    display: flex !important;
    justify-content: center !important;
    margin: 40px 0 !important;
    background: none !important;
  }

  .id-card-3d {
    transform: none !important;
    transform-style: flat !important;
    width: 580px !important; /* Sufficient width for side-by-side cards */
    height: 420px !important;
    display: flex !important;
    flex-direction: row !important;
    gap: 30px !important;
    justify-content: center !important;
  }

  .id-card-side {
    position: relative !important;
    width: 270px !important;
    height: 420px !important;
    box-shadow: none !important;
    border: 1px solid #94a3b8 !important;
    margin: 0 !important;
    page-break-inside: avoid;
    -webkit-print-color-adjust: exact; /* Force Chrome/Safari to print background gradients */
    print-color-adjust: exact;         /* Standard property */
  }

  /* Flatten the back card rotation so it faces forward in printing */
  .id-card-back {
    transform: none !important;
    display: flex !important;
  }
}

/* ==================== OFFICE NOTES SYSTEM STYLES ==================== */
/* Edge-to-Edge True Fullscreen Modal Override */
#notesModal {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  margin: 0 !important;
  padding: 0 !important;
  z-index: 99999 !important;
}

@media (min-width: 992px) {
  #notesModal {
    zoom: 1.25 !important;
    width: 100vw !important;
    height: 100vh !important;
  }
}

#notesModal .modal-dialog {
  width: 100vw !important;
  max-width: 100vw !important;
  height: 100vh !important;
  max-height: 100vh !important;
  margin: 0 !important;
  padding: 0 !important;
}

#notesModal .modal-content {
  width: 100vw !important;
  height: 100vh !important;
  border-radius: 0 !important;
  border: none !important;
}

.notes-modal-header {
  background: linear-gradient(135deg, #1e293b, #0f172a) !important;
  border-bottom: 2px solid #14795f !important;
}

.notes-sidebar {
  background-color: #f8fafc;
  z-index: 5;
  border-right: 1px solid #e2e8f0;
}

/* Custom rounded search in Notes Sidebar */
.notes-sidebar .input-group {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid #cbd5e1;
  transition: all 0.3s ease;
}

.notes-sidebar .input-group:focus-within {
  border-color: #14795f;
  box-shadow: 0 0 0 3px rgba(20, 121, 95, 0.15);
}

.notes-sidebar .input-group-text {
  border: none;
  background-color: #ffffff;
}

.notes-sidebar .form-control {
  border: none;
  background-color: #ffffff !important;
  font-size: 0.88rem;
  padding: 8px 12px;
}

.notes-sidebar .form-control:focus {
  box-shadow: none;
}

/* Premium Word / Excel Creator buttons */
.btn-outline-primary.btn-sm.fw-semibold {
  border: 2px solid #2b579a;
  color: #2b579a;
  border-radius: 12px;
  transition: all 0.2s ease;
  background-color: #ffffff;
}
.btn-outline-primary.btn-sm.fw-semibold:hover {
  background: linear-gradient(135deg, #2b579a, #1a3a6b);
  color: #ffffff;
  border-color: #1a3a6b;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(43, 87, 154, 0.2);
}

.btn-outline-success.btn-sm.fw-semibold {
  border: 2px solid #107c41;
  color: #107c41;
  border-radius: 12px;
  transition: all 0.2s ease;
  background-color: #ffffff;
}
.btn-outline-success.btn-sm.fw-semibold:hover {
  background: linear-gradient(135deg, #107c41, #0b572d);
  color: #ffffff;
  border-color: #0b572d;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(16, 124, 65, 0.2);
}

/* Notes Cards/List Items in Sidebar */
.notes-list {
  padding: 12px 8px;
}

.notes-list-item {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  box-shadow: var(--shadow-sm);
}

.notes-list-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}

.notes-list-item.active {
  background-color: #f0f7ff;
  border-color: #3b82f6;
  border-left: 6px solid #3b82f6;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.08);
}

.notes-list-item.active-excel {
  background-color: #f0fdf4;
  border-color: #16a34a;
  border-left: 6px solid #16a34a;
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.08);
}

.notes-list-item .note-icon {
  font-size: 1.6rem;
  display: flex;
  align-items: center;
}

.notes-list-item .note-title {
  font-weight: 600;
  font-size: 0.92rem;
  color: #0f172a;
  margin-bottom: 2px;
}

.notes-list-item .note-date {
  font-size: 0.72rem;
  color: #64748b;
  font-weight: 500;
}

.notes-list-item .delete-note-btn {
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.2s ease;
  color: #94a3b8;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #f1f5f9;
  border: none;
}

.notes-list-item:hover .delete-note-btn {
  opacity: 1;
  transform: scale(1);
}

.notes-list-item .delete-note-btn:hover {
  background: #fee2e2;
  color: #ef4444;
}

/* Notes workspace styling */
.notes-workspace {
  background-color: #f1f5f9;
}

/* Modern status dots */
.status-dot-saving {
  width: 8px;
  height: 8px;
  background-color: #f59e0b;
  border-radius: 50%;
  display: inline-block;
  animation: pulse 1.5s infinite;
}

.status-dot-saved {
  width: 8px;
  height: 8px;
  background-color: #10b981;
  border-radius: 50%;
  display: inline-block;
}

/* Toolbars (Word & Excel) */
.word-toolbar, .excel-toolbar {
  background: #ffffff !important;
  border-bottom: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
  padding: 10px 20px !important;
}

/* Toolbar inputs */
.word-toolbar input[type="text"]:focus, .excel-toolbar input[type="text"]:focus {
  background-color: #f8fafc !important;
  border-radius: 8px;
  box-shadow: 0 0 0 2px rgba(20, 121, 95, 0.1) !important;
}

/* Formatting button items style */
.word-toolbar .btn-light, .excel-toolbar .btn-light {
  background-color: #f8fafc;
  border: 1px solid #e2e8f0 !important;
  color: #475569;
  font-weight: 500;
  padding: 4px 10px;
  transition: all 0.15s ease;
}

.word-toolbar .btn-light:hover, .excel-toolbar .btn-light:hover {
  background-color: #f1f5f9;
  color: #0f172a;
  border-color: #cbd5e1 !important;
}

.word-toolbar .btn-light:active, .word-toolbar .btn-light.active,
.excel-toolbar .btn-light:active, .excel-toolbar .btn-light.active {
  background-color: #e2e8f0;
  color: #0f172a;
}

/* Word Editor Paper layout */
.word-paper {
  background-color: #ffffff;
  box-shadow: 0 10px 25px -5px rgba(0,0,0,0.05), 0 8px 10px -6px rgba(0,0,0,0.05) !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 8px !important;
  padding: 60px 80px !important;
  max-width: 800px;
  min-height: 1030px !important; /* Standard Letter aspect ratio */
  outline: none;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: #1e293b;
  line-height: 1.7;
  font-size: 16px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.word-paper:focus {
  border-color: rgba(20, 121, 95, 0.3) !important;
  box-shadow: 0 10px 25px -5px rgba(0,0,0,0.05), 0 8px 10px -6px rgba(0,0,0,0.05), 0 0 0 3px rgba(20, 121, 95, 0.08) !important;
}

/* Excel Spreadsheet Formula Bar styling */
.excel-formula-bar {
  background-color: #f8fafc !important;
  border-bottom: 1px solid #e2e8f0;
  padding: 6px 16px !important;
}

.excel-formula-bar #excel-formula-input {
  background-color: #ffffff;
  border: 1px solid #cbd5e1 !important;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.88rem;
  transition: all 0.2s ease;
}

.excel-formula-bar #excel-formula-input:focus {
  border-color: #16a34a !important;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15);
}

/* Excel Grid Custom Styling */
.excel-grid-container {
  background-color: #cbd5e1;
}

.excel-table {
  border-collapse: separate;
  border-spacing: 0;
  background-color: #cbd5e1;
}

.excel-cell-header {
  background: linear-gradient(to bottom, #f8fafc, #f1f5f9) !important;
  color: #475569;
  border-right: 1px solid #cbd5e1 !important;
  border-bottom: 1px solid #cbd5e1 !important;
  font-size: 0.78rem;
  font-weight: 600;
  text-shadow: 0 1px 0 #ffffff;
  padding: 6px 12px;
  text-align: center;
  box-shadow: inset 0 1px 0 #ffffff;
}

.excel-cell-header-corner {
  background: #e2e8f0 !important;
  box-shadow: none;
}

.excel-cell {
  background-color: #ffffff;
  border-right: 1px solid #cbd5e1 !important;
  border-bottom: 1px solid #cbd5e1 !important;
  padding: 0 !important;
  height: 28px !important;
  transition: background-color 0.15s ease;
}

.excel-cell:hover {
  background-color: #f8fafc;
}

.excel-cell.selected {
  outline: 2px solid #16a34a !important;
  outline-offset: -1px;
  z-index: 5;
}

.excel-cell-input {
  width: 100%;
  height: 100%;
  border: none;
  outline: none;
  padding: 4px 8px !important;
  font-size: 0.82rem;
  font-family: inherit;
  background: transparent;
}

.excel-cell-input:focus {
  background-color: #ffffff;
}

.excel-cell-header-col.active, .excel-cell-header-row.active {
  background: #e2e8f0 !important;
  color: #16a34a !important;
  font-weight: 700;
}

/* Sticky Excel Headers for professional scrolling */
.excel-cell-header-col {
  position: sticky;
  top: 0;
  z-index: 10;
}

.excel-cell-header-row {
  position: sticky;
  left: 0;
  z-index: 9;
}

.excel-cell-header-corner {
  position: sticky;
  top: 0;
  left: 0;
  z-index: 11;
  background: #e2e8f0 !important;
}

/* Mobile responsive Office Notes modal rules */
@media (max-width: 768px) {
  .notes-sidebar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 100;
    transition: transform 0.3s ease;
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.15);
  }
  
  .notes-sidebar.collapsed {
    transform: translateX(-100%);
  }
  
  .word-paper {
    padding: 20px 24px !important;
    min-height: 500px !important;
    max-width: 100% !important;
  }
}

/* Empty State Premium Styling */
#notes-empty-state {
  background: radial-gradient(circle at 50% 50%, #ffffff 0%, #f1f5f9 100%);
}

#notes-empty-state .rounded-circle {
  background-color: #ffffff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05) !important;
  border: 1px solid #e2e8f0 !important;
  animation: float 4s ease-in-out infinite;
}

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

/* Custom animated gradient border wrapper for modern look inside modal empty state */
#notes-empty-state button {
  transition: all 0.3s ease;
}

#notes-empty-state button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1) !important;
}

/* Pulse animation */
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.15); opacity: 0.7; }
}
.animate-pulse {
  animation: pulse 3s infinite ease-in-out;
}

/* ==========================================================================
   AI OVERALL FINANCIAL REPORT STYLES
   ========================================================================== */
.ai-financial-report-content {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: #1e293b;
  line-height: 1.6;
}

.ai-financial-report-content h3,
.ai-financial-report-content h4,
.ai-financial-report-content h5 {
  color: #0f172a;
  font-weight: 700;
  margin-top: 1.25rem;
  margin-bottom: 0.75rem;
}

.ai-financial-report-content .executive-summary-banner {
  box-shadow: 0 4px 15px rgba(20, 121, 95, 0.06);
  transition: all 0.3s ease;
}

.ai-financial-report-content .report-section {
  background: #ffffff;
  padding: 1.25rem;
  border-radius: 1rem;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
  margin-bottom: 1.25rem;
}

.ai-financial-report-content ul {
  padding-left: 1.25rem;
  margin-bottom: 1rem;
}

.ai-financial-report-content li {
  margin-bottom: 0.5rem;
}

.ai-financial-report-content strong {
  color: #0f172a;
  font-weight: 600;
}

.ai-financial-report-content .badge {
  font-weight: 600;
  letter-spacing: 0.02em;
}

#ai-financial-kpi-container .card,
#ai-financial-kpi-container > div > div {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#ai-financial-kpi-container > div > div:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06) !important;
}

#aiFinancialReportModal .modal-dialog {
  max-width: min(1140px, 95vw);
  margin: 1.25rem auto;
}

.ai-kpi-val {
  font-size: clamp(1.15rem, 2.2vw, 1.45rem);
  letter-spacing: -0.02em;
}

.ai-financial-period-pills {
  scrollbar-width: thin;
  scrollbar-color: rgba(20, 121, 95, 0.3) transparent;
}

.ai-financial-period-pills::-webkit-scrollbar {
  height: 4px;
}

.ai-financial-period-pills::-webkit-scrollbar-thumb {
  background: rgba(20, 121, 95, 0.3);
  border-radius: 4px;
}

@media (max-width: 991.98px) {
  #aiFinancialReportModal .modal-dialog {
    max-width: 96vw;
    margin: 0.75rem auto;
  }
}

@media (max-width: 767.98px) {
  #aiFinancialReportModal .modal-dialog {
    max-width: 100vw;
    margin: 0;
    min-height: 100%;
  }

  #aiFinancialReportModal .modal-content {
    border-radius: 0 !important;
    min-height: 100vh;
  }

  #aiFinancialReportModal .modal-header {
    padding: 1rem 1.25rem !important;
  }

  #aiFinancialReportModal .modal-header .modal-title {
    font-size: 1.1rem;
  }

  #aiFinancialReportModal .modal-body {
    padding: 0.85rem !important;
  }

  .ai-financial-period-pills {
    overflow-x: auto;
    flex-wrap: nowrap !important;
    padding-bottom: 0.5rem;
    -webkit-overflow-scrolling: touch;
  }

  .ai-financial-period-pills button {
    flex: 0 0 auto;
  }

  #aiFinancialReportModal .modal-footer {
    padding: 1rem !important;
  }
}

@media print {
  #aiFinancialReportModal .modal-header,
  #aiFinancialReportModal .modal-footer,
  #aiFinancialReportModal .card:first-child,
  #ai-financial-followup-card,
  .btn,
  .header,
  .sidebar {
    display: none !important;
  }
}
