/* ===================== BMS — GREEN THEME DESIGN SYSTEM ===================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --primary: #16a34a;
  --primary-dark: #15803d;
  --primary-light: #22c55e;
  --primary-gradient: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
  --primary-soft: rgba(22, 163, 74, 0.10);
  --sidebar-bg: #0f1a13;
  --sidebar-active: rgba(22, 163, 74, 0.20);
  --sidebar-hover: rgba(22, 163, 74, 0.10);
  --sidebar-text: #a0b8a8;
  --sidebar-text-active: #ffffff;
  --body-bg: #f0faf3;
  --card-bg: #ffffff;
  --card-border: #e2f0e6;
  --input-bg: #f8fdf9;
  --card-shadow: 0 4px 20px rgba(22, 163, 74, 0.07);
  --hover-shadow: 0 8px 30px rgba(22, 163, 74, 0.14);
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --info: #0284c7;
  --muted: #6b7280;
  --font-main: 'Inter', sans-serif;
  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-muted: #9ca3af;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;
  --topbar-height: 64px;
}

* { font-family: var(--font-main); box-sizing: border-box; }
body { background: var(--body-bg); min-height: 100vh; color: var(--text-primary); }

/* ---- SIDEBAR ---- */
.sidebar {
  background: var(--sidebar-bg);
  height: 100vh; position: fixed; left: 0; top: 0;
  width: 260px; z-index: 1000;
  transition: all 0.3s ease;
  box-shadow: 4px 0 20px rgba(0,0,0,0.1);
  display: flex; flex-direction: column;
  overflow-y: auto;
}
.sidebar-header { padding: 24px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.sidebar-header .logo-icon {
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--primary-gradient);
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 18px;
}
.sidebar-header h4 {
  background: var(--primary-gradient);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; font-weight: 700; letter-spacing: -0.5px;
  margin: 0; display: inline;
}
.sidebar-header small { color: var(--sidebar-text); font-size: 12px; }
.sidebar .nav-link {
  color: var(--sidebar-text); padding: 12px 20px; margin: 2px 12px;
  border-radius: 10px; transition: all 0.25s ease;
  display: flex; align-items: center; gap: 12px; font-size: 14px; font-weight: 500;
  touch-action: manipulation;
}
.sidebar .nav-link:hover { background: var(--sidebar-hover); color: var(--sidebar-text-active); }
.sidebar .nav-link.active {
  background: var(--sidebar-active); color: var(--sidebar-text-active);
  box-shadow: inset 3px 0 0 var(--primary);
}
.sidebar .nav-link .notif-count {
  background: var(--danger); color: #fff; font-size: 10px; font-weight: 700;
  padding: 2px 6px; border-radius: 99px; margin-left: auto; min-width: 20px; text-align: center;
}
/* ---- SIDEBAR BOTTOM (Apex Reference — single row) ---- */
.sidebar-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 14px 16px; margin-top: auto;
  display: flex; align-items: center; gap: 12px;
}
.sidebar-bottom-info {
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; flex: 1; min-width: 0;
  padding: 4px 6px; border-radius: 8px;
  transition: background 0.2s ease;
}
.sidebar-bottom-info:hover { background: rgba(255,255,255,0.06); }
.sidebar-bottom-info .avatar { width: 32px; height: 32px; font-size: 12px; flex-shrink: 0; }
.sidebar-bottom-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.sidebar-bottom-name {
  font-size: 13px; font-weight: 600; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-bottom-role {
  font-size: 11px; color: var(--sidebar-text); opacity: 0.6;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-logout-icon {
  width: 32px; height: 32px; border-radius: 8px;
  border: none; background: transparent;
  color: rgba(255,255,255,0.3); font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.2s ease; flex-shrink: 0;
}
.sidebar-logout-icon:hover { background: rgba(220,38,38,0.15); color: #f87171; }
.sidebar-spacer { flex: 1; }

/* ---- TOPBAR ---- */
.topbar {
  height: var(--topbar-height); background: var(--card-bg);
  border-bottom: 1px solid var(--card-border);
  position: sticky; top: 0; z-index: 990;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; gap: 16px;
}
.topbar .breadcrumb { margin: 0; font-size: 14px; }
.topbar .breadcrumb-item a { color: var(--primary); text-decoration: none; }
.topbar .breadcrumb-item.active { color: var(--text-secondary); }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-bell {
  position: relative; width: 40px; height: 40px;
  border-radius: var(--radius-sm); border: 1px solid var(--card-border);
  background: var(--card-bg); display: inline-flex;
  align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.25s ease; font-size: 18px; color: var(--text-secondary);
  touch-action: manipulation;
}
.topbar-bell:hover { background: var(--primary-soft); color: var(--primary); }
.topbar-bell .bell-badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--danger); color: #fff; font-size: 10px; font-weight: 700;
  padding: 1px 5px; border-radius: 99px; min-width: 18px; text-align: center;
  border: 2px solid var(--card-bg);
}
.topbar-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 14px; color: #fff; cursor: pointer;
  transition: all 0.25s ease; touch-action: manipulation;
}
.topbar-avatar:hover { transform: scale(1.08); }

/* ---- TOPBAR USER TRIGGER & DROPDOWN ---- */
.topbar-user-trigger {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 12px 6px 6px; border-radius: 12px;
  cursor: pointer; transition: all 0.25s ease;
  border: 1px solid var(--card-border); position: relative;
}
.topbar-user-trigger:hover { background: var(--primary-soft); border-color: var(--card-border); }
.topbar-user-trigger .avatar { width: 36px; height: 36px; font-size: 13px; flex-shrink: 0; }
.topbar-user-info { display: flex; flex-direction: column; line-height: 1.2; }
.topbar-user-name { font-size: 13px; font-weight: 600; color: var(--text-primary); white-space: nowrap; }
.topbar-user-email { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.topbar-chevron { font-size: 10px; color: var(--text-muted); transition: transform 0.25s ease; margin-left: 4px; }
.topbar-user-trigger.open .topbar-chevron { transform: rotate(180deg); }

.topbar-user-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  width: 260px; background: var(--card-bg);
  border: 1px solid var(--card-border); border-radius: var(--radius-lg);
  box-shadow: 0 12px 40px rgba(0,0,0,0.12);
  opacity: 0; visibility: hidden; transform: translateY(-8px);
  transition: all 0.2s ease; z-index: 1100;
}
.topbar-user-dropdown.show {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.tud-header {
  padding: 16px; display: flex; align-items: center; gap: 12px;
}
.tud-header .avatar { width: 44px; height: 44px; font-size: 16px; flex-shrink: 0; }
.tud-header-info { display: flex; flex-direction: column; line-height: 1.3; overflow: hidden; }
.tud-header-name { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.tud-header-email { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tud-header-role { font-size: 11px; color: var(--primary); font-weight: 500; margin-top: 2px; }
.tud-divider { height: 1px; background: var(--card-border); margin: 0; }
.tud-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; font-size: 13px; font-weight: 500;
  color: var(--text-secondary); text-decoration: none;
  transition: all 0.2s ease; cursor: pointer;
}
.tud-item i { width: 18px; text-align: center; font-size: 14px; color: var(--text-muted); transition: color 0.2s; }
.tud-item:hover { background: var(--primary-soft); color: var(--primary); }
.tud-item:hover i { color: var(--primary); }
.tud-item-danger:hover { background: rgba(220,38,38,0.06); color: var(--danger); }
.tud-item-danger:hover i { color: var(--danger); }

/* ---- MAIN CONTENT ---- */
.main-content { margin-left: 260px; min-height: 100vh; transition: all 0.3s ease; }
.main-content-inner { padding: 24px; padding-bottom: 80px; }

/* ---- STAT CARDS ---- */
.stat-card {
  background: var(--card-bg); border-radius: var(--radius-lg);
  padding: 24px; box-shadow: var(--card-shadow);
  transition: all 0.25s ease; border: 1px solid var(--card-border);
  position: relative; overflow: hidden;
}
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0;
  width: 4px; height: 100%; background: var(--primary-gradient);
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--hover-shadow); }
.stat-card.no-accent::before { display: none; }
.stat-icon {
  width: 56px; height: 56px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center; font-size: 24px;
}

/* ---- BUTTONS ---- */
.btn-primary {
  background: var(--primary-gradient) !important; border: none !important;
  color: #fff !important; font-weight: 600; border-radius: var(--radius-md);
  transition: all 0.25s ease; touch-action: manipulation;
}
.btn-primary:hover {
  filter: brightness(1.08); box-shadow: 0 4px 16px rgba(22,163,74,0.35);
  transform: translateY(-1px);
}
.btn-primary:active { transform: scale(1.02); }
.btn-outline-primary {
  border: 1.5px solid var(--primary) !important; color: var(--primary) !important;
  background: transparent !important; border-radius: var(--radius-md);
  font-weight: 600; transition: all 0.25s ease; touch-action: manipulation;
}
.btn-outline-primary:hover { background: var(--primary-soft) !important; color: var(--primary) !important; }
.btn-icon {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  border: none; display: inline-flex; align-items: center; justify-content: center;
  transition: all 0.25s ease; touch-action: manipulation;
}
.btn-add {
  width: 48px; height: 48px; border-radius: 14px;
  background: var(--primary-gradient); border: none;
  font-size: 24px; display: flex; align-items: center; justify-content: center;
  transition: all 0.3s ease; box-shadow: 0 4px 15px rgba(22,163,74,0.3);
  color: #fff; touch-action: manipulation;
}
.btn-add:hover { transform: rotate(90deg) scale(1.1); box-shadow: 0 6px 20px rgba(22,163,74,0.5); }

/* ---- STATUS BADGES ---- */
.status-badge {
  padding: 4px 10px; border-radius: var(--radius-full);
  font-size: 11px; font-weight: 600; letter-spacing: 0.4px; text-transform: uppercase;
  display: inline-block;
}
.badge-todo { background: #fef3c7; color: #92400e; }
.badge-progress { background: #dbeafe; color: #1d4ed8; }
.badge-done { background: #d1fae5; color: #065f46; }
.badge-blocked { background: #fee2e2; color: #991b1b; }
.badge-active { background: #d1fae5; color: #065f46; }
.badge-inactive { background: #f3f4f6; color: #6b7280; }
.badge-lead { background: #dbeafe; color: #1d4ed8; }
.badge-paid { background: #d1fae5; color: #065f46; }
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-overdue-status { background: #fee2e2; color: #991b1b; }
.badge-due { background: #fef3c7; color: #92400e; }
.badge-partial { background: #dbeafe; color: #1d4ed8; }
.badge-expired { background: #fee2e2; color: #991b1b; }
.badge-expiring { background: #fff7ed; color: #c2410c; }
.badge-on-hold { background: #fef3c7; color: #92400e; }
.badge-completed { background: #d1fae5; color: #065f46; }
.badge-cancelled { background: #f3f4f6; color: #6b7280; }
.badge-overdue-pill { padding: 4px 8px; border-radius: 12px; font-size: 11px; font-weight: 600; background: #ef4444; color: #fff; }

/* Role badges */
.role-badge-admin { background: #f3e8ff; color: #7c3aed; }
.role-badge-dept-head { background: #dbeafe; color: #2563eb; }
.role-badge-manager { background: #ccfbf1; color: #0d9488; }
.role-badge-employee { background: #f3f4f6; color: #6b7280; }

/* Score Badges */
.score-badge { padding: 8px 16px; border-radius: 20px; font-weight: 700; font-size: 14px; }
.score-s { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #fff; }
.score-a { background: linear-gradient(135deg, #16a34a, #15803d); color: #fff; }
.score-b { background: linear-gradient(135deg, #0284c7, #0369a1); color: #fff; }
.score-c { background: linear-gradient(135deg, #f97316, #ea580c); color: #fff; }
.score-f { background: linear-gradient(135deg, #ef4444, #dc2626); color: #fff; }

/* ---- TASK CARDS ---- */
.task-card {
  background: var(--card-bg); border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow); border: 1px solid var(--card-border);
  transition: all 0.25s ease; overflow: hidden;
}
.task-card:hover { transform: translateY(-2px); box-shadow: var(--hover-shadow); }
.task-priority-high { border-left: 4px solid var(--danger); }
.task-priority-medium { border-left: 4px solid var(--warning); }
.task-priority-low { border-left: 4px solid var(--success); }

/* ---- ENTITY CARDS (Client, Service, Dept, Project) ---- */
.entity-card {
  background: var(--card-bg); border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow); border: 1px solid var(--card-border);
  transition: all 0.25s ease; overflow: hidden; padding: 24px;
}
.entity-card:hover { transform: translateY(-3px); box-shadow: var(--hover-shadow); }

/* ---- FILTER CHIPS ---- */
.filter-chip {
  padding: 8px 16px; border-radius: 20px; border: 1px solid var(--card-border);
  background: var(--card-bg); font-size: 14px; font-weight: 500;
  color: var(--muted); cursor: pointer; transition: all 0.25s ease;
  touch-action: manipulation;
}
.filter-chip:hover, .filter-chip.active {
  background: var(--primary-gradient); color: #fff; border-color: transparent;
}

/* ---- SEARCH ---- */
.search-wrapper { position: relative; }
.search-wrapper input {
  padding-left: 44px; border-radius: 10px;
  border: 1px solid var(--card-border); background: var(--card-bg);
  font-size: 16px; height: 44px;
}
.search-wrapper input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(22,163,74,0.15);
}
.search-wrapper i {
  position: absolute; left: 14px; top: 50%;
  transform: translateY(-50%); color: var(--text-muted);
}

/* ---- AVATARS ---- */
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 14px; color: #fff;
  flex-shrink: 0; overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.avatar-lg { width: 80px; height: 80px; font-size: 28px; }
.avatar-xl { width: 96px; height: 96px; font-size: 36px; }
.avatar-xxl { width: 120px; height: 120px; font-size: 44px; }
.avatar-56 { width: 56px; height: 56px; font-size: 20px; }
.avatar-stack { display: flex; }
.avatar-stack .avatar { margin-left: -10px; border: 2px solid var(--card-bg); }
.avatar-stack .avatar:first-child { margin-left: 0; }
.avatar-camera-overlay {
  position: absolute; bottom: 0; right: 0;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--primary-gradient); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; cursor: pointer; border: 2px solid #fff;
  transition: all 0.25s ease; touch-action: manipulation;
}
.avatar-camera-overlay:hover { transform: scale(1.1); }

/* ---- MODALS ---- */
.modal-content { border-radius: var(--radius-xl) !important; border: none; overflow: hidden; }
.modal-header {
  background: var(--primary-gradient); color: #fff; border: none; padding: 20px 24px;
}
.modal-header .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }
.modal-body .nav-tabs .nav-link {
  color: var(--muted); border: none; border-bottom: 3px solid transparent;
  font-weight: 500; font-size: 14px;
}
.modal-body .nav-tabs .nav-link.active {
  color: var(--primary); border-bottom-color: var(--primary); background: transparent;
}
.modal-footer { border-top: 1px solid var(--card-border); }

/* ---- FORM CONTROLS ---- */
.form-control, .form-select {
  border-radius: 10px; font-size: 16px; padding: 10px 14px;
  border: 1px solid var(--card-border); background: var(--input-bg);
  transition: all 0.25s ease;
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(22,163,74,0.15);
}
.form-label { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-secondary); }

/* ---- TABLES ---- */
.table { font-size: 14px; }
.table thead th {
  font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--text-muted); border-bottom: 2px solid var(--card-border);
}
.table td { vertical-align: middle; border-color: var(--card-border); padding: 12px; }

/* ---- PROGRESS ---- */
.progress { height: 8px; border-radius: 4px; background: #e2f0e6; }
.progress-bar { border-radius: 4px; background: var(--primary-gradient); }

/* ---- TOAST ---- */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; }
.toast { min-width: 280px; border-radius: 10px; border: none; }

/* ---- DROPDOWN ---- */
.dropdown-menu { border-radius: 12px; border: none; box-shadow: 0 10px 40px rgba(0,0,0,0.1); }
.dropdown-item { padding: 10px 16px; border-radius: 8px; margin: 2px 8px; transition: all 0.2s ease; }
.dropdown-item:hover { background: var(--primary-soft); }

/* ---- NOTIFICATION DROPDOWN ---- */
.notif-dropdown { width: 360px; max-height: 420px; overflow-y: auto; padding: 0; }
.notif-dropdown-header { padding: 16px; border-bottom: 1px solid var(--card-border); font-weight: 600; font-size: 15px; }
.notif-dropdown-footer { padding: 12px 16px; text-align: center; border-top: 1px solid var(--card-border); }
.notif-dropdown-footer a { color: var(--primary); font-weight: 600; font-size: 13px; text-decoration: none; }
.notif-item {
  display: flex; gap: 12px; padding: 12px 16px;
  border-bottom: 1px solid var(--card-border);
  cursor: pointer; transition: all 0.2s ease;
  touch-action: manipulation;
}
.notif-item:hover { background: var(--primary-soft); }
.notif-item.unread { background: rgba(22,163,74,0.04); }
.notif-item .notif-icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0;
}
.notif-item .notif-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); flex-shrink: 0; margin-top: 6px; }

/* ---- EMPTY STATE ---- */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-state i { font-size: 64px; color: #bbf7d0; margin-bottom: 16px; }
.empty-state h5 { color: var(--text-primary); margin-bottom: 8px; }
.empty-state p { color: var(--text-muted); font-size: 14px; margin-bottom: 20px; }

/* ---- PROFILE HEADER (Apex Style) ---- */
.profile-header {
  background: var(--card-bg); border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow); border: 1px solid var(--card-border);
  padding: 0 32px 24px; position: relative; overflow: hidden;
}
.profile-cover {
  height: 120px; background: var(--primary-gradient);
  margin: 0 -32px; border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.profile-tabs {
  display: flex; gap: 0; border-bottom: 2px solid var(--card-border);
  background: var(--card-bg); border-left: 1px solid var(--card-border);
  border-right: 1px solid var(--card-border);
  padding: 0 24px; margin-bottom: 24px;
}
.profile-tab {
  padding: 14px 20px; font-size: 14px; font-weight: 500;
  color: var(--text-muted); background: none; border: none;
  cursor: pointer; position: relative; transition: all 0.25s ease;
}
.profile-tab:hover { color: var(--text-primary); }
.profile-tab.active { color: var(--text-primary); font-weight: 600; }
.profile-tab.active::after {
  content: ''; position: absolute; bottom: -2px; left: 0; right: 0;
  height: 2px; background: var(--primary);
}
.profile-tab-content { animation: fadeInUp 0.3s ease; }

/* ---- ACTIVITY TIMELINE ---- */
.activity-date-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-muted);
  margin: 20px 0 12px; padding-bottom: 8px;
  border-bottom: 1px solid var(--card-border);
}
.activity-date-label:first-child { margin-top: 0; }
.activity-item {
  display: flex; gap: 14px; padding: 14px 0;
  border-bottom: 1px solid rgba(0,0,0,0.04);
  transition: background 0.2s;
}
.activity-item:last-child { border-bottom: none; }
.activity-item:hover { background: var(--primary-soft); margin: 0 -16px; padding: 14px 16px; border-radius: 8px; }
.activity-icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; flex-shrink: 0;
}
.activity-content { flex: 1; min-width: 0; }

/* ---- TASK ITEM (dashboard) ---- */
.task-item {
  padding: 16px; border-radius: 12px; background: var(--input-bg);
  border: 1px solid var(--card-border); margin-bottom: 12px;
  transition: all 0.25s ease; cursor: pointer;
}
.task-item:hover { background: var(--card-bg); border-color: var(--primary); box-shadow: 0 2px 10px rgba(22,163,74,0.1); }

/* ---- INVOICE PRINT ---- */
.invoice-print-view { background: #fff; padding: 40px; max-width: 800px; margin: 0 auto; }
.invoice-watermark {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%,-50%) rotate(-30deg);
  font-size: 72px; font-weight: 900; opacity: 0.06;
  text-transform: uppercase; pointer-events: none;
}

/* ---- VIEW TOGGLE ---- */
.view-toggle .btn { border-radius: 8px; padding: 6px 14px; font-size: 14px; font-weight: 500; }
.view-toggle .btn.active { background: var(--primary-soft); color: var(--primary); border-color: var(--primary); }

/* ---- KANBAN ---- */
.kanban-col { min-height: 300px; }
.kanban-col-header {
  padding: 12px 16px; border-radius: 10px 10px 0 0;
  font-weight: 600; font-size: 14px; text-transform: uppercase; letter-spacing: 0.05em;
}

/* ---- DATE RANGE BAR ---- */
.date-range-bar { position: relative; height: 6px; border-radius: 3px; background: #e2f0e6; overflow: hidden; }
.date-range-bar .fill { height: 100%; border-radius: 3px; transition: width 0.5s ease; }

/* ---- ANIMATIONS ---- */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }
.animate-in { animation: fadeInUp 0.5s ease forwards; }
.delay-1 { animation-delay: 0.1s; opacity: 0; }
.delay-2 { animation-delay: 0.2s; opacity: 0; }
.delay-3 { animation-delay: 0.3s; opacity: 0; }
.delay-4 { animation-delay: 0.4s; opacity: 0; }
.live-indicator { animation: pulse 2s infinite; }
.stat-number { font-variant-numeric: tabular-nums; }

/* ---- SIDEBAR MOBILE ---- */
.sidebar-backdrop {
  display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.5); z-index: 999; opacity: 0; transition: opacity 0.3s ease;
}
.sidebar-backdrop.show { display: block; opacity: 1; }

.sidebar-toggle {
  display: none; position: fixed; top: 16px; left: 16px; z-index: 1050;
  width: 44px; height: 44px; border-radius: 10px; background: var(--card-bg);
  border: none; box-shadow: var(--card-shadow); touch-action: manipulation;
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .sidebar-toggle { display: flex; align-items: center; justify-content: center; }
  .topbar { padding: 0 16px 0 60px; }
  .main-content-inner { padding: 16px; padding-bottom: 80px; }
  .notif-dropdown { width: 300px; }
  .stat-card { padding: 16px; }
  .entity-card { padding: 16px; }
}

/* ---- PRINT ---- */
@media print {
  .sidebar, .topbar, .sidebar-toggle, .no-print, .toast-container { display: none !important; }
  .main-content { margin-left: 0 !important; }
  body { background: #fff; }
  .stat-card, .entity-card { box-shadow: none; border: 1px solid #ddd; }
}

/* ---- MISC ---- */
.cursor-pointer { cursor: pointer; }
.text-primary-custom { color: var(--primary) !important; }
.bg-primary-custom { background: var(--primary) !important; }
.bg-primary-soft { background: var(--primary-soft) !important; }
.border-primary-custom { border-color: var(--primary) !important; }
.fw-600 { font-weight: 600; }
.gap-8 { gap: 8px; }
.min-touch { min-width: 44px; min-height: 44px; }
section[id$="View"] { display: none; }
section[id$="View"].view-active { display: block; }
.tab-section { display: none; }
.tab-section.active { display: block; }

/* ---- STEPPER FORM ---- */
.stepper-header {
  display: flex; align-items: center; justify-content: center;
  padding: 16px 24px; gap: 0; position: relative;
  background: rgba(22,163,74,0.03); border-bottom: 1px solid var(--card-border);
}
.stepper-step {
  display: flex; align-items: center; gap: 10px; position: relative; z-index: 1; cursor: pointer;
}
.stepper-step .step-number {
  width: 36px; height: 36px; border-radius: 50%; display: flex;
  align-items: center; justify-content: center; font-weight: 700; font-size: 14px;
  border: 2px solid var(--card-border); color: var(--text-muted); background: var(--card-bg);
  transition: all 0.3s ease;
}
.stepper-step.active .step-number {
  background: var(--primary-gradient); color: #fff; border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(22,163,74,0.15);
}
.stepper-step.completed .step-number {
  background: var(--primary); color: #fff; border-color: var(--primary);
}
.stepper-step .step-label {
  font-size: 13px; font-weight: 600; color: var(--text-muted); transition: color 0.3s ease;
}
.stepper-step.active .step-label { color: var(--primary); }
.stepper-step.completed .step-label { color: var(--text-primary); }
.stepper-connector {
  flex: 1; height: 2px; background: var(--card-border); margin: 0 12px;
  position: relative; min-width: 24px;
}
.stepper-connector.done { background: var(--primary); }
.stepper-body { padding: 24px; min-height: 200px; }
.stepper-body .step-pane { display: none; animation: fadeInUp 0.3s ease; }
.stepper-body .step-pane.active { display: block; }
.stepper-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 24px; border-top: 1px solid var(--card-border);
}
.stepper-footer .step-indicator {
  font-size: 13px; color: var(--text-muted); font-weight: 500;
}
.review-section { padding: 16px; border-radius: var(--radius-md); background: var(--input-bg); margin-bottom: 12px; }
.review-section h6 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 12px; }
.review-row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--card-border); font-size: 14px; }
.review-row:last-child { border-bottom: none; }
.review-row .review-label { color: var(--text-muted); }
.review-row .review-value { font-weight: 600; color: var(--text-primary); }
.field-error { border-color: var(--danger) !important; box-shadow: 0 0 0 3px rgba(220,38,38,0.12) !important; }
.error-message { color: var(--danger); font-size: 12px; margin-top: 4px; font-weight: 500; }

/* ---- SKELETON LOADER ---- */
.skeleton { position: relative; overflow: hidden; background: #e2f0e6; border-radius: var(--radius-sm); }
.skeleton::after {
  content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer { to { left: 100%; } }
.skeleton-text { height: 14px; margin-bottom: 8px; width: 80%; }
.skeleton-title { height: 22px; margin-bottom: 12px; width: 50%; }
.skeleton-card { height: 120px; margin-bottom: 16px; }
.skeleton-avatar { width: 40px; height: 40px; border-radius: 50%; }

/* ---- IMPROVED TOAST ---- */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.bms-toast {
  display: flex; align-items: center; gap: 12px; padding: 14px 20px;
  border-radius: var(--radius-md); color: #fff; font-size: 14px; font-weight: 500;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18); min-width: 300px; max-width: 420px;
  animation: toastSlideIn 0.4s ease; position: relative; overflow: hidden;
}
.bms-toast.toast-success { background: linear-gradient(135deg, #16a34a, #15803d); }
.bms-toast.toast-error { background: linear-gradient(135deg, #dc2626, #b91c1c); }
.bms-toast.toast-warning { background: linear-gradient(135deg, #d97706, #b45309); }
.bms-toast.toast-info { background: linear-gradient(135deg, #0284c7, #0369a1); }
.bms-toast .toast-progress {
  position: absolute; bottom: 0; left: 0; height: 3px; background: rgba(255,255,255,0.4);
  animation: toastProgress 3.5s linear forwards;
}
.bms-toast .toast-close {
  margin-left: auto; background: none; border: none; color: rgba(255,255,255,0.7);
  cursor: pointer; font-size: 16px; padding: 0 4px; transition: color 0.2s;
}
.bms-toast .toast-close:hover { color: #fff; }
@keyframes toastSlideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes toastProgress { from { width: 100%; } to { width: 0; } }
.bms-toast.toast-exit { animation: toastSlideOut 0.3s ease forwards; }
@keyframes toastSlideOut { to { transform: translateX(120%); opacity: 0; } }

/* ---- FLOATING ACTION BUTTON (FAB) ---- */
.fab-container { position: fixed; bottom: 28px; right: 28px; z-index: 995; }
.fab-main {
  width: 56px; height: 56px; border-radius: 50%; border: none;
  background: var(--primary-gradient); color: #fff; font-size: 24px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 24px rgba(22,163,74,0.4); cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1); touch-action: manipulation;
}
.fab-main:hover { transform: scale(1.08); box-shadow: 0 8px 32px rgba(22,163,74,0.5); }
.fab-main.open { transform: rotate(45deg); }
.fab-menu {
  position: absolute; bottom: 68px; right: 0; display: flex; flex-direction: column;
  gap: 10px; opacity: 0; pointer-events: none; transform: translateY(10px) scale(0.9);
  transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
}
.fab-menu.show { opacity: 1; pointer-events: auto; transform: translateY(0) scale(1); }
.fab-item {
  display: flex; align-items: center; gap: 10px; white-space: nowrap;
  padding: 10px 16px; border-radius: var(--radius-md); background: var(--card-bg);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12); cursor: pointer; border: 1px solid var(--card-border);
  font-size: 13px; font-weight: 600; color: var(--text-primary);
  transition: all 0.2s ease; touch-action: manipulation;
}
.fab-item:hover { background: var(--primary-soft); color: var(--primary); transform: translateX(-4px); }
.fab-item i { width: 20px; text-align: center; color: var(--primary); }

/* ---- CONFIRMATION DIALOG ---- */
.confirm-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.5); z-index: 10000; display: flex;
  align-items: center; justify-content: center;
  animation: fadeIn 0.2s ease;
}
.confirm-dialog {
  background: var(--card-bg); border-radius: var(--radius-xl); padding: 32px;
  max-width: 400px; width: 90%; text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2); animation: fadeInUp 0.3s ease;
}
.confirm-dialog .confirm-icon {
  width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center; font-size: 28px;
}
.confirm-dialog h5 { margin-bottom: 8px; }
.confirm-dialog p { color: var(--text-muted); font-size: 14px; margin-bottom: 24px; }
.confirm-dialog .confirm-actions { display: flex; gap: 12px; justify-content: center; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ---- TABLE ENHANCEMENTS ---- */
.table-enhanced { border-collapse: separate; border-spacing: 0; }
.table-enhanced thead th {
  position: sticky; top: 0; background: var(--card-bg); z-index: 2;
  cursor: pointer; user-select: none; transition: background 0.2s;
}
.table-enhanced thead th:hover { background: var(--input-bg); }
.table-enhanced thead th .sort-icon { margin-left: 4px; font-size: 10px; opacity: 0.4; }
.table-enhanced thead th.sort-active .sort-icon { opacity: 1; color: var(--primary); }
.table-enhanced tbody tr { transition: background 0.2s ease; }
.table-enhanced tbody tr:hover { background: rgba(22,163,74,0.03); }
.pagination-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; font-size: 13px; color: var(--text-muted);
}
.pagination-bar .page-btns { display: flex; gap: 4px; }
.pagination-bar .page-btn {
  width: 32px; height: 32px; border-radius: var(--radius-sm); border: 1px solid var(--card-border);
  background: var(--card-bg); display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 13px; font-weight: 500; transition: all 0.2s;
}
.pagination-bar .page-btn:hover { border-color: var(--primary); color: var(--primary); }
.pagination-bar .page-btn.active { background: var(--primary-gradient); color: #fff; border-color: transparent; }
.pagination-bar .page-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.table-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px; margin-bottom: 16px;
}

/* ---- VIEW TRANSITIONS ---- */
.view-enter { animation: fadeInUp 0.35s ease; }

/* ---- AUTH PAGE ---- */
.auth-wrapper {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 99999;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0a1f12 0%, #0d3320 25%, #134d2e 50%, #1a6b3c 75%, #16a34a 100%);
  background-size: 400% 400%; animation: authGradient 12s ease infinite;
}
@keyframes authGradient {
  0%{background-position:0% 50%} 50%{background-position:100% 50%} 100%{background-position:0% 50%}
}
.auth-wrapper::before {
  content:''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  background: radial-gradient(circle at 20% 80%, rgba(22,163,74,0.15) 0%, transparent 50%),
              radial-gradient(circle at 80% 20%, rgba(34,197,94,0.1) 0%, transparent 50%);
  pointer-events: none;
}
.auth-card {
  position: relative; width: 420px; max-width: 92vw; padding: 40px 36px;
  background: rgba(255,255,255,0.05); backdrop-filter: blur(24px);
  border: 1px solid rgba(255,255,255,0.12); border-radius: 20px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.35); color: #fff;
  animation: fadeInUp 0.5s ease;
}
.auth-card .auth-logo {
  width: 56px; height: 56px; border-radius: 16px; display: flex;
  align-items: center; justify-content: center; font-size: 24px;
  background: var(--primary-gradient); color: #fff; margin: 0 auto 16px;
  box-shadow: 0 8px 24px rgba(22,163,74,0.4);
}
.auth-card h2 { text-align: center; font-weight: 700; font-size: 22px; margin-bottom: 4px; }
.auth-card .auth-subtitle { text-align: center; color: rgba(255,255,255,0.55); font-size: 14px; margin-bottom: 28px; }
.auth-card .form-label { color: rgba(255,255,255,0.7); font-size: 13px; font-weight: 500; margin-bottom: 6px; }
.auth-card .form-control {
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15);
  color: #fff; border-radius: 10px; padding: 10px 14px; font-size: 14px;
  transition: all 0.3s ease;
}
.auth-card .form-control:focus {
  background: rgba(255,255,255,0.12); border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(22,163,74,0.2); color: #fff;
}
.auth-card .form-control::placeholder { color: rgba(255,255,255,0.35); }
.auth-card .input-group-text {
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.5); border-radius: 10px 0 0 10px;
}
.auth-card .btn-auth {
  width: 100%; padding: 12px; border: none; border-radius: 10px;
  background: var(--primary-gradient); color: #fff; font-weight: 600;
  font-size: 15px; cursor: pointer; transition: all 0.3s ease;
  box-shadow: 0 4px 16px rgba(22,163,74,0.3); margin-top: 8px;
}
.auth-card .btn-auth:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(22,163,74,0.4); }
.auth-card .btn-auth:active { transform: translateY(0); }
.auth-card .btn-auth:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.auth-card .auth-divider {
  display: flex; align-items: center; gap: 12px; margin: 20px 0;
  color: rgba(255,255,255,0.35); font-size: 12px;
}
.auth-card .auth-divider::before, .auth-card .auth-divider::after {
  content:''; flex: 1; height: 1px; background: rgba(255,255,255,0.12);
}
.auth-card .auth-switch {
  text-align: center; margin-top: 20px; font-size: 13px; color: rgba(255,255,255,0.55);
}
.auth-card .auth-switch a { color: var(--primary-light); font-weight: 600; cursor: pointer; text-decoration: none; }
.auth-card .auth-switch a:hover { text-decoration: underline; }
.auth-card .password-toggle {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: rgba(255,255,255,0.4); cursor: pointer;
  font-size: 14px; padding: 4px;
}
.auth-card .password-toggle:hover { color: rgba(255,255,255,0.7); }
.auth-card .form-check-input { background-color: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.2); }
.auth-card .form-check-input:checked { background-color: var(--primary); border-color: var(--primary); }
.auth-card .form-check-label { color: rgba(255,255,255,0.55); font-size: 13px; }
.auth-error { color: #f87171; font-size: 13px; text-align: center; margin-top: 8px; min-height: 20px; }
.auth-floating { position: absolute; border-radius: 50%; opacity: 0.06; background: #fff; }

/* ---- STEPPER RESPONSIVE ---- */
@media (max-width: 768px) {
  .stepper-header { flex-wrap: wrap; gap: 8px; padding: 12px 16px; }
  .stepper-step .step-label { display: none; }
  .stepper-connector { min-width: 16px; }
  .stepper-body { padding: 16px; }
  .stepper-footer { padding: 12px 16px; flex-wrap: wrap; gap: 8px; }
  .fab-container { bottom: 20px; right: 20px; }
  .bms-toast { min-width: 260px; }
  .pagination-bar { flex-direction: column; gap: 8px; }
  .topbar-user-info { display: none; }
  .topbar-chevron { display: none; }
  .topbar-user-trigger { padding: 4px; }
}
