:root {
  --sgx-primary: #F97316;
  --sgx-primary-dark: #EA580C;
  --sgx-primary-light: #FDBA74;
  --sgx-secondary: #1F2937;
  --sgx-secondary-light: #374151;
  --sgx-bg: #F4F6F9;
  --sgx-white: #FFFFFF;
  --sgx-success: #22C55E;
  --sgx-danger: #EF4444;
  --sgx-warning: #F59E0B;
  --sgx-info: #3B82F6;
  --sgx-dark: #111827;
  --sgx-border: #E5E7EB;
  --sgx-text: #1F2937;
  --sgx-text-muted: #6B7280;
  --sgx-sidebar-width: 260px;
  --sgx-sidebar-collapsed: 70px;
  --sgx-header-height: 60px;
  --sgx-radius: 8px;
  --sgx-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --sgx-shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  --sgx-transition: all 0.3s ease;
}

[data-theme="dark"] {
  --sgx-bg: #1a1d23;
  --sgx-white: #252830;
  --sgx-text: #E5E7EB;
  --sgx-text-muted: #9CA3AF;
  --sgx-border: #374151;
  --sgx-secondary: #374151;
  --sgx-dark: #0F1117;
}

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

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--sgx-bg);
  color: var(--sgx-text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c1c1c1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #a1a1a1; }

/* Header */
.sgx-header {
  height: var(--sgx-header-height);
  background: var(--sgx-white);
  border-bottom: 1px solid var(--sgx-border);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1030;
  display: flex;
  align-items: center;
  padding: 0 20px;
  box-shadow: var(--sgx-shadow);
}

.sgx-header .sidebar-toggle {
  background: none;
  border: none;
  font-size: 1.4rem;
  color: var(--sgx-text);
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  transition: var(--sgx-transition);
}

.sgx-header .sidebar-toggle:hover { background: var(--sgx-bg); }

.sgx-header .brand-logo {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--sgx-primary);
  margin-left: 12px;
  text-decoration: none;
  white-space: nowrap;
}

.sgx-header .brand-logo span { color: var(--sgx-secondary); }

.sgx-header .header-search {
  margin-left: 30px;
  position: relative;
  max-width: 350px;
  flex: 1;
}

.sgx-header .header-search input {
  width: 100%;
  padding: 8px 16px 8px 40px;
  border: 1px solid var(--sgx-border);
  border-radius: 20px;
  background: var(--sgx-bg);
  font-size: 0.875rem;
  transition: var(--sgx-transition);
}

.sgx-header .header-search input:focus {
  outline: none;
  border-color: var(--sgx-primary);
  box-shadow: 0 0 0 3px rgba(249,115,22,0.1);
}

.sgx-header .header-search i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--sgx-text-muted);
}

.sgx-header .header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.sgx-header .header-btn {
  background: none;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--sgx-text);
  position: relative;
  cursor: pointer;
  transition: var(--sgx-transition);
  font-size: 1.1rem;
}

.sgx-header .header-btn:hover { background: var(--sgx-bg); }

.sgx-header .header-btn .badge {
  position: absolute;
  top: 2px;
  right: 2px;
  font-size: 0.65rem;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sgx-header .user-dropdown {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  transition: var(--sgx-transition);
}

.sgx-header .user-dropdown:hover { background: var(--sgx-bg); }

.sgx-header .user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.18);
  border: 2px solid rgba(255,255,255,0.3);
}

.sgx-header .user-info { display: flex; flex-direction: column; line-height: 1.2; }
.sgx-header .user-info .user-name { font-weight: 600; font-size: 0.85rem; }
.sgx-header .user-info .user-role { font-size: 0.75rem; color: var(--sgx-text-muted); }

/* Sidebar */
.sgx-sidebar {
  position: fixed;
  top: var(--sgx-header-height);
  left: 0;
  bottom: 0;
  width: var(--sgx-sidebar-width);
  background: var(--sgx-white);
  border-right: 1px solid var(--sgx-border);
  z-index: 1020;
  transition: var(--sgx-transition);
  overflow-y: auto;
  overflow-x: hidden;
}

.sgx-sidebar.collapsed { width: var(--sgx-sidebar-collapsed); }

.sgx-sidebar .nav-section {
  padding: 12px 20px 4px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--sgx-text-muted);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
}

.sgx-sidebar.collapsed .nav-section { opacity: 0; }

.sgx-sidebar .nav-item { list-style: none; }

.sgx-sidebar .nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  color: var(--sgx-text);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--sgx-transition);
  border-left: 3px solid transparent;
  white-space: nowrap;
  overflow: hidden;
}

.sgx-sidebar .nav-link:hover {
  background: rgba(249,115,22,0.06);
  color: var(--sgx-primary);
}

.sgx-sidebar .nav-link.active {
  background: rgba(249,115,22,0.1);
  color: var(--sgx-primary);
  border-left-color: var(--sgx-primary);
  font-weight: 600;
}

.sgx-sidebar .nav-link i { font-size: 1.1rem; width: 22px; text-align: center; flex-shrink: 0; }

.sgx-sidebar .nav-link .nav-text { transition: var(--sgx-transition); }

.sgx-sidebar.collapsed .nav-link .nav-text { opacity: 0; width: 0; }

.sgx-sidebar .nav-treeview {
  padding-left: 20px;
  display: none;
}

.sgx-sidebar .nav-treeview.show { display: block; }

.sgx-sidebar .nav-treeview .nav-link {
  padding: 8px 20px 8px 40px;
  font-size: 0.8rem;
}

.sgx-sidebar .nav-link.has-treeview::after {
  content: '\f107';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  margin-left: auto;
  transition: transform 0.3s;
  font-size: 0.75rem;
}

.sgx-sidebar .nav-link.has-treeview.expanded::after { transform: rotate(180deg); }

.sgx-sidebar.collapsed .nav-link.has-treeview::after { display: none; }

/* Main Content */
.sgx-main {
  margin-left: var(--sgx-sidebar-width);
  margin-top: var(--sgx-header-height);
  padding: 24px;
  transition: var(--sgx-transition);
  min-height: calc(100vh - var(--sgx-header-height));
}

.sgx-main.expanded { margin-left: var(--sgx-sidebar-collapsed); }

/* Content Header */
.content-header {
  margin-bottom: 24px;
}

.content-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.content-header .breadcrumb {
  background: none;
  padding: 0;
  margin: 0;
  font-size: 0.85rem;
}

.content-header .breadcrumb-item a {
  color: var(--sgx-primary);
  text-decoration: none;
}

.content-header .breadcrumb-item.active { color: var(--sgx-text-muted); }

/* Cards */
.sgx-card {
  background: var(--sgx-white);
  border-radius: var(--sgx-radius);
  border: 1px solid var(--sgx-border);
  box-shadow: var(--sgx-shadow);
  margin-bottom: 20px;
  transition: var(--sgx-transition);
}

.sgx-card:hover { box-shadow: var(--sgx-shadow-lg); }

.sgx-card .card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--sgx-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent;
}

.sgx-card .card-header h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
}

.sgx-card .card-body { padding: 20px; }

.sgx-card .card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--sgx-border);
  background: transparent;
}

/* KPI Cards */
.kpi-card {
  background: var(--sgx-white);
  border-radius: var(--sgx-radius);
  padding: 20px;
  border: 1px solid var(--sgx-border);
  box-shadow: var(--sgx-shadow);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--sgx-transition);
  cursor: pointer;
  height: 100%;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--sgx-shadow-lg);
}

.kpi-card .kpi-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.kpi-card .kpi-icon.orange { background: rgba(249,115,22,0.12); color: var(--sgx-primary); }
.kpi-card .kpi-icon.blue { background: rgba(59,130,246,0.12); color: var(--sgx-info); }
.kpi-card .kpi-icon.green { background: rgba(34,197,94,0.12); color: var(--sgx-success); }
.kpi-card .kpi-icon.red { background: rgba(239,68,68,0.12); color: var(--sgx-danger); }
.kpi-card .kpi-icon.yellow { background: rgba(245,158,11,0.12); color: var(--sgx-warning); }
.kpi-card .kpi-icon.purple { background: rgba(139,92,246,0.12); color: #8B5CF6; }

.kpi-card .kpi-info { flex: 1; min-width: 0; }
.kpi-card .kpi-value { font-size: 1.6rem; font-weight: 700; line-height: 1.2; }
.kpi-card .kpi-label { font-size: 0.8rem; color: var(--sgx-text-muted); margin-top: 2px; }
.kpi-card .kpi-change { font-size: 0.75rem; margin-top: 4px; }
.kpi-card .kpi-change.up { color: var(--sgx-success); }
.kpi-card .kpi-change.down { color: var(--sgx-danger); }

/* Buttons */
.btn-sgx {
  background: var(--sgx-primary);
  color: #fff;
  border: none;
  padding: 8px 20px;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.875rem;
  transition: var(--sgx-transition);
  cursor: pointer;
}

.btn-sgx:hover { background: var(--sgx-primary-dark); color: #fff; }

.btn-sgx-outline {
  background: transparent;
  color: var(--sgx-primary);
  border: 1px solid var(--sgx-primary);
  padding: 8px 20px;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.875rem;
  transition: var(--sgx-transition);
  cursor: pointer;
}

.btn-sgx-outline:hover { background: var(--sgx-primary); color: #fff; }

.btn-sgx-sm { padding: 5px 12px; font-size: 0.8rem; }
.btn-sgx-lg { padding: 10px 28px; font-size: 1rem; }

/* Tables */
.sgx-table {
  width: 100%;
  border-collapse: collapse;
}

.sgx-table thead th {
  background: var(--sgx-bg);
  padding: 12px 16px;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--sgx-text-muted);
  border-bottom: 2px solid var(--sgx-border);
}

.sgx-table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--sgx-border);
  font-size: 0.875rem;
  vertical-align: middle;
}

.sgx-table tbody tr:hover { background: rgba(249,115,22,0.03); }

/* Status Badges */
.badge-sgx {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
  display: inline-block;
}

.badge-sgx.active { background: rgba(34,197,94,0.12); color: #16A34A; }
.badge-sgx.pending { background: rgba(245,158,11,0.12); color: #D97706; }
.badge-sgx.completed { background: rgba(59,130,246,0.12); color: #2563EB; }
.badge-sgx.cancelled { background: rgba(239,68,68,0.12); color: #DC2626; }
.badge-sgx.draft { background: rgba(107,114,128,0.12); color: #4B5563; }
.badge-sgx.overdue { background: rgba(239,68,68,0.12); color: #DC2626; }
.badge-sgx.review { background: rgba(139,92,246,0.12); color: #7C3AED; }
.badge-sgx.approved { background: rgba(34,197,94,0.12); color: #16A34A; }
.badge-sgx.submitted { background: rgba(59,130,246,0.12); color: #2563EB; }

/* Priority Badges */
.priority-high { color: #DC2626; font-weight: 600; }
.priority-medium { color: #D97706; font-weight: 600; }
.priority-low { color: #16A34A; font-weight: 600; }
.priority-critical { color: #991B1B; font-weight: 700; }

/* Forms */
.sgx-form-group { margin-bottom: 18px; }

.sgx-form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 6px;
  color: var(--sgx-text);
}

.sgx-form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--sgx-border);
  border-radius: 6px;
  font-size: 0.875rem;
  background: var(--sgx-white);
  color: var(--sgx-text);
  transition: var(--sgx-transition);
}

.sgx-form-control:focus {
  outline: none;
  border-color: var(--sgx-primary);
  box-shadow: 0 0 0 3px rgba(249,115,22,0.1);
}

.sgx-form-control:disabled { background: var(--sgx-bg); color: var(--sgx-text-muted); }

textarea.sgx-form-control { min-height: 100px; resize: vertical; }

/* Kanban Board */
.kanban-board {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  padding-bottom: 20px;
  min-height: 500px;
}

.kanban-column {
  min-width: 300px;
  max-width: 350px;
  flex: 1;
  background: var(--sgx-bg);
  border-radius: var(--sgx-radius);
  padding: 16px;
}

.kanban-column .kanban-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--sgx-border);
}

.kanban-column .kanban-header h5 {
  font-size: 0.9rem;
  font-weight: 700;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.kanban-column .kanban-count {
  background: var(--sgx-secondary);
  color: #fff;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.kanban-card {
  background: var(--sgx-white);
  border-radius: var(--sgx-radius);
  padding: 14px;
  margin-bottom: 12px;
  border: 1px solid var(--sgx-border);
  box-shadow: var(--sgx-shadow);
  cursor: grab;
  transition: var(--sgx-transition);
}

.kanban-card:hover { box-shadow: var(--sgx-shadow-lg); }
.kanban-card:active { cursor: grabbing; }

.kanban-card .kanban-card-title {
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 8px;
}

.kanban-card .kanban-card-meta {
  font-size: 0.75rem;
  color: var(--sgx-text-muted);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.kanban-card .kanban-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--sgx-border);
}

/* Progress Bar */
.sgx-progress {
  height: 8px;
  background: var(--sgx-bg);
  border-radius: 4px;
  overflow: hidden;
}

.sgx-progress-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}

.sgx-progress-bar.orange { background: var(--sgx-primary); }
.sgx-progress-bar.green { background: var(--sgx-success); }
.sgx-progress-bar.blue { background: var(--sgx-info); }
.sgx-progress-bar.red { background: var(--sgx-danger); }

/* Timeline */
.sgx-timeline {
  position: relative;
  padding-left: 30px;
}

.sgx-timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--sgx-border);
}

.sgx-timeline-item {
  position: relative;
  padding-bottom: 24px;
}

.sgx-timeline-item::before {
  content: '';
  position: absolute;
  left: -26px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--sgx-primary);
  border: 2px solid var(--sgx-white);
  box-shadow: 0 0 0 2px var(--sgx-primary);
}

.sgx-timeline-item .timeline-time {
  font-size: 0.75rem;
  color: var(--sgx-text-muted);
  margin-bottom: 4px;
}

.sgx-timeline-item .timeline-content {
  font-size: 0.85rem;
}

.sgx-timeline-item .timeline-content strong { color: var(--sgx-primary); }

/* Footer */
.sgx-footer {
  padding: 16px 24px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--sgx-text-muted);
  border-top: 1px solid var(--sgx-border);
  background: var(--sgx-white);
  margin-top: 24px;
}

/* Login Page */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--sgx-secondary) 0%, #0F172A 100%);
  padding: 20px;
}

.login-card {
  background: var(--sgx-white);
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
  width: 100%;
  max-width: 440px;
  overflow: hidden;
}

.login-card .login-header {
  background: var(--sgx-primary);
  padding: 32px;
  text-align: center;
  color: #fff;
}

.login-card .login-header .login-logo {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.login-card .login-header p { opacity: 0.9; font-size: 0.9rem; margin: 0; }

.login-card .login-body { padding: 32px; }

.login-card .login-body .form-label {
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 6px;
}

.login-card .login-body .input-group-text {
  background: var(--sgx-bg);
  border: 1px solid var(--sgx-border);
  border-right: none;
}

.login-card .login-body .form-control {
  border-left: none;
}

.login-card .login-body .form-control:focus {
  border-color: var(--sgx-border);
  box-shadow: none;
}

.login-card .login-footer {
  text-align: center;
  padding: 20px;
  border-top: 1px solid var(--sgx-border);
  font-size: 0.85rem;
  color: var(--sgx-text-muted);
}

/* Modal */
.sgx-modal .modal-header {
  background: var(--sgx-primary);
  color: #fff;
  padding: 16px 20px;
}

.sgx-modal .modal-header .btn-close { filter: brightness(0) invert(1); }

/* Tabs */
.sgx-tabs {
  display: flex;
  border-bottom: 2px solid var(--sgx-border);
  gap: 0;
  margin-bottom: 20px;
}

.sgx-tabs .sgx-tab {
  padding: 12px 24px;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--sgx-text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: var(--sgx-transition);
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}

.sgx-tabs .sgx-tab:hover { color: var(--sgx-primary); }

.sgx-tabs .sgx-tab.active {
  color: var(--sgx-primary);
  border-bottom-color: var(--sgx-primary);
}

.sgx-tab-content { display: none; }
.sgx-tab-content.active { display: block; }

/* Action Buttons Sticky */
.sticky-actions {
  position: sticky;
  bottom: 0;
  background: var(--sgx-white);
  padding: 16px 20px;
  border-top: 1px solid var(--sgx-border);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  z-index: 10;
  margin: 0 -20px -20px;
  border-radius: 0 0 var(--sgx-radius) var(--sgx-radius);
}

/* Activity Feed */
.activity-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--sgx-border);
}

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

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

.activity-item .activity-content { flex: 1; min-width: 0; }
.activity-item .activity-text { font-size: 0.85rem; }
.activity-item .activity-time { font-size: 0.75rem; color: var(--sgx-text-muted); }

/* Quick Actions */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.quick-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 12px;
  background: var(--sgx-bg);
  border: 1px solid var(--sgx-border);
  border-radius: var(--sgx-radius);
  cursor: pointer;
  transition: var(--sgx-transition);
  text-decoration: none;
  color: var(--sgx-text);
}

.quick-action-btn:hover {
  background: var(--sgx-primary);
  color: #fff;
  border-color: var(--sgx-primary);
  transform: translateY(-2px);
}

.quick-action-btn i { font-size: 1.5rem; }
.quick-action-btn span { font-size: 0.8rem; font-weight: 500; }

/* Responsive */
@media (max-width: 991.98px) {
  .sgx-sidebar {
    transform: translateX(-100%);
    width: var(--sgx-sidebar-width) !important;
  }
  .sgx-sidebar.mobile-show { transform: translateX(0); }
  .sgx-main { margin-left: 0 !important; }
  .sgx-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1015;
  }
  .sgx-sidebar-overlay.show { display: block; }
  .sgx-header .header-search { display: none; }
  .kanban-board { flex-direction: column; }
  .kanban-column { max-width: 100%; min-width: 100%; }
}

@media (max-width: 767.98px) {
  .sgx-main { padding: 16px; }
  .sgx-header .user-info { display: none; }
  .kpi-card { padding: 14px; }
  .kpi-card .kpi-value { font-size: 1.3rem; }
  .content-header h1 { font-size: 1.2rem; }
  .quick-actions { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 575.98px) {
  .sgx-header { padding: 0 10px; }
  .sgx-header .brand-logo { font-size: 1.1rem; }
  .sgx-header .header-btn { width: 34px; height: 34px; font-size: 0.95rem; }
  .sgx-tabs { overflow-x: auto; flex-wrap: nowrap; }
  .sgx-tabs .sgx-tab { padding: 10px 16px; white-space: nowrap; }
}

/* Print */
@media print {
  .sgx-header, .sgx-sidebar, .sgx-footer, .sticky-actions, .btn { display: none !important; }
  .sgx-main { margin: 0 !important; padding: 0 !important; }
  .sgx-card { box-shadow: none !important; border: 1px solid #ddd !important; }
}

/* Dark mode overrides */
[data-theme="dark"] .sgx-card,
[data-theme="dark"] .kpi-card,
[data-theme="dark"] .kanban-card,
[data-theme="dark"] .login-card { background: #252830; }

[data-theme="dark"] .sgx-form-control { background: #1a1d23; color: #E5E7EB; }
[data-theme="dark"] .kanban-column { background: #1a1d23; }
[data-theme="dark"] .sgx-table thead th { background: #1a1d23; }
[data-theme="dark"] .dataTables_wrapper .dataTables_filter input { background: #1a1d23; color: #E5E7EB; }
[data-theme="dark"] .dataTables_wrapper .dataTables_length select { background: #1a1d23; color: #E5E7EB; }
[data-theme="dark"] .select2-container--default .select2-selection--single,
[data-theme="dark"] .select2-container--default .select2-selection--multiple { background: #1a1d23; border-color: #374151; }
[data-theme="dark"] .select2-container--default .select2-selection--single .select2-selection__rendered { color: #E5E7EB; }
[data-theme="dark"] .select2-dropdown { background: #252830; border-color: #374151; }
[data-theme="dark"] .select2-container--default .select2-results__option { color: #E5E7EB; }
[data-theme="dark"] .select2-container--default .select2-results__option--highlighted { background: var(--sgx-primary); }
[data-theme="dark"] .modal-content { background: #252830; }
[data-theme="dark"] .page-link { background: #252830; border-color: #374151; color: #E5E7EB; }
[data-theme="dark"] .page-item.active .page-link { background: var(--sgx-primary); border-color: var(--sgx-primary); }

/* ═══════════════════════════════════════════════════════════
   DASHBOARD LAYOUT
═══════════════════════════════════════════════════════════ */

:root {
  --sidebar-width: 240px;
  --header-height: 60px;
  --sgx-primary: #F97316;
  --sgx-success: #22C55E;
  --sgx-info: #3B82F6;
  --sgx-warning: #F59E0B;
  --sgx-danger: #EF4444;
  --sgx-purple: #8B5CF6;
  --sidebar-bg: #ffffff;
  --sidebar-border: #E5E7EB;
  --sidebar-text: #374151;
  --sidebar-muted: #9CA3AF;
  --sidebar-hover-bg: rgba(249,115,22,0.07);
  --sidebar-active-bg: rgba(249,115,22,0.12);
  --header-bg: #ffffff;
  --body-bg: #F3F4F6;
  --card-bg: #ffffff;
  --text-main: #111827;
  --text-muted: #6B7280;
  --border-color: #E5E7EB;
}

[data-theme="dark"] {
  --sidebar-bg: #1a1d23;
  --sidebar-border: #2d3748;
  --sidebar-text: #9CA3AF;
  --sidebar-muted: #6B7280;
  --sidebar-hover-bg: rgba(249,115,22,0.08);
  --sidebar-active-bg: rgba(249,115,22,0.15);
  --header-bg: #1f2937;
  --body-bg: #111827;
  --card-bg: #1f2937;
  --text-main: #F9FAFB;
  --text-muted: #9CA3AF;
  --border-color: #374151;
}

body { background: var(--body-bg); font-family: 'Inter', sans-serif; color: var(--text-main); margin: 0; }

/* Header */
.sgx-header {
  position: fixed; top: 0; left: 0; right: 0; height: var(--header-height);
  background: var(--header-bg); border-bottom: 1px solid var(--border-color);
  display: flex; align-items: center; padding: 0 1rem; gap: 1rem; z-index: 1030;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.sidebar-toggle {
  background: none; border: none; font-size: 1.1rem; color: var(--text-muted);
  cursor: pointer; padding: 0.4rem 0.6rem; border-radius: 6px; line-height: 1;
}
.sidebar-toggle:hover { background: var(--border-color); }
.brand-logo {
  font-size: 1.2rem; font-weight: 800; color: var(--sgx-primary);
  text-decoration: none; white-space: nowrap;
}
.brand-logo span { color: var(--text-main); }
.header-search {
  flex: 1; max-width: 420px; display: flex; align-items: center;
  background: var(--body-bg); border: 1px solid var(--border-color);
  border-radius: 8px; padding: 0 0.75rem; gap: 0.5rem;
}
.header-search i { color: var(--text-muted); font-size: 0.85rem; }
.header-search input {
  border: none; background: transparent; outline: none; width: 100%;
  font-size: 0.875rem; color: var(--text-main); padding: 0.45rem 0;
}
.header-actions { display: flex; align-items: center; gap: 0.5rem; margin-left: auto; }
.header-btn {
  background: none; border: none; font-size: 1rem; color: var(--text-muted);
  cursor: pointer; padding: 0.4rem 0.6rem; border-radius: 6px; position: relative;
}
.header-btn:hover { background: var(--border-color); }
.header-btn .badge { position: absolute; top: 2px; right: 2px; font-size: 0.6rem; padding: 2px 4px; }
.user-dropdown { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; padding: 0.3rem 0.6rem; border-radius: 8px; }
.user-dropdown:hover { background: var(--border-color); }
.user-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  color: #fff; font-size: 0.8rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; box-shadow: 0 2px 6px rgba(0,0,0,0.18);
  border: 2px solid rgba(255,255,255,0.3);
}
.user-info { display: flex; flex-direction: column; }
.user-name { font-size: 0.82rem; font-weight: 600; color: var(--text-main); }
.user-role { font-size: 0.72rem; color: var(--text-muted); }

/* Sidebar */
.sgx-sidebar {
  position: fixed; top: var(--header-height); left: 0; bottom: 0;
  width: var(--sidebar-width); background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  overflow-y: auto; z-index: 1020; transition: width 0.25s ease, transform 0.25s ease;
  box-shadow: 1px 0 4px rgba(0,0,0,0.04);
}
.sgx-sidebar::-webkit-scrollbar { width: 4px; }
.sgx-sidebar::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }
.sgx-sidebar nav { padding: 1rem 0 2rem; }
.nav-section {
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em;
  color: var(--sidebar-muted); text-transform: uppercase; padding: 1rem 1.25rem 0.4rem;
}
.sgx-sidebar .nav-link {
  display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 1.25rem;
  color: var(--sidebar-text); font-size: 0.85rem; font-weight: 500; border-radius: 0;
  transition: background 0.15s, color 0.15s;
}
.sgx-sidebar .nav-link:hover { background: var(--sidebar-hover-bg); color: #F97316; }
.sgx-sidebar .nav-link.active { background: var(--sidebar-active-bg); color: #F97316; border-right: 3px solid #F97316; font-weight: 600; }
.sgx-sidebar .nav-link i { width: 18px; text-align: center; font-size: 0.9rem; }

/* Sidebar collapsed */
.sgx-sidebar.collapsed { width: 60px; }
.sgx-sidebar.collapsed .nav-text,
.sgx-sidebar.collapsed .nav-section { display: none; }
.sgx-sidebar.collapsed .nav-link { justify-content: center; padding: 0.75rem; }

/* Sidebar overlay (mobile) */
.sgx-sidebar-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1015;
}
.sgx-sidebar-overlay.show { display: block; }

/* Main */
.sgx-main {
  margin-left: var(--sidebar-width); margin-top: var(--header-height);
  padding: 1.5rem; min-height: calc(100vh - var(--header-height));
  transition: margin-left 0.25s ease;
}
.sgx-main.expanded { margin-left: 60px; }

/* Content Header */
.content-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.5rem; flex-wrap: wrap; gap: 0.5rem;
}
.content-header h1 { font-size: 1.4rem; font-weight: 700; color: var(--text-main); margin: 0; }
.content-header .breadcrumb { background: none; padding: 0; margin: 0; }
.breadcrumb-item.active { color: var(--text-muted); font-size: 0.85rem; }

/* KPI Cards */
.kpi-card {
  background: var(--card-bg); border-radius: 12px; padding: 1.25rem;
  display: flex; align-items: center; gap: 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.07); border: 1px solid var(--border-color);
  transition: transform 0.15s, box-shadow 0.15s;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.kpi-icon {
  width: 52px; height: 52px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 1.3rem;
}
.kpi-icon.orange  { background: rgba(249,115,22,0.12); color: #F97316; }
.kpi-icon.green   { background: rgba(34,197,94,0.12);  color: #22C55E; }
.kpi-icon.blue    { background: rgba(59,130,246,0.12);  color: #3B82F6; }
.kpi-icon.yellow  { background: rgba(245,158,11,0.12);  color: #F59E0B; }
.kpi-icon.purple  { background: rgba(139,92,246,0.12);  color: #8B5CF6; }
.kpi-icon.red     { background: rgba(239,68,68,0.12);   color: #EF4444; }
.kpi-value { font-size: 1.8rem; font-weight: 800; line-height: 1; color: var(--text-main); }
.kpi-label { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; font-weight: 500; }
.kpi-change { font-size: 0.72rem; margin-top: 4px; font-weight: 500; }
.kpi-change.up   { color: #22C55E; }
.kpi-change.down { color: #EF4444; }

/* Cards */
.sgx-card {
  background: var(--card-bg); border-radius: 12px;
  border: 1px solid var(--border-color);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06); overflow: hidden;
}
.sgx-card .card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.25rem; border-bottom: 1px solid var(--border-color);
  background: transparent;
}
.sgx-card .card-header h3 { font-size: 0.95rem; font-weight: 700; color: var(--text-main); margin: 0; }
.sgx-card .card-body { padding: 1.25rem; }

/* Outline button */
.btn-sgx-outline {
  background: transparent; border: 1px solid var(--sgx-primary); color: var(--sgx-primary);
  border-radius: 6px; font-size: 0.78rem; font-weight: 600; padding: 0.3rem 0.7rem;
  text-decoration: none; display: inline-flex; align-items: center; transition: 0.15s;
}
.btn-sgx-outline:hover { background: var(--sgx-primary); color: #fff; }
.btn-sgx-sm { padding: 0.25rem 0.6rem; font-size: 0.75rem; }

/* Activity items */
.activity-item {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.75rem 0; border-bottom: 1px solid var(--border-color);
}
.activity-item:last-child { border-bottom: none; }
.activity-icon {
  width: 36px; height: 36px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 0.9rem;
}
.activity-content { flex: 1; min-width: 0; }
.activity-text { font-size: 0.83rem; font-weight: 500; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.activity-time { font-size: 0.73rem; color: var(--text-muted); margin-top: 2px; }

/* Badges */
.badge-sgx {
  font-size: 0.7rem; font-weight: 600; padding: 0.2rem 0.55rem; border-radius: 20px;
}
.badge-sgx.active    { background: rgba(34,197,94,0.12);  color: #16A34A; }
.badge-sgx.pending   { background: rgba(245,158,11,0.12); color: #D97706; }
.badge-sgx.submitted { background: rgba(59,130,246,0.12); color: #2563EB; }

/* Quick Actions */
.quick-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.quick-action-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.5rem; padding: 1rem 1.5rem; border-radius: 10px;
  background: var(--body-bg); border: 1px solid var(--border-color);
  color: var(--text-main); text-decoration: none; font-size: 0.8rem; font-weight: 500;
  transition: 0.15s; min-width: 100px;
}
.quick-action-btn i { font-size: 1.3rem; color: var(--sgx-primary); }
.quick-action-btn:hover { background: var(--sgx-primary); color: #fff; border-color: var(--sgx-primary); }
.quick-action-btn:hover i { color: #fff; }

/* Footer */
.sgx-footer {
  margin-top: 2rem; padding: 1rem 0;
  font-size: 0.78rem; color: var(--text-muted); text-align: center;
  border-top: 1px solid var(--border-color);
}

/* Mobile */
@media (max-width: 991px) {
  .sgx-sidebar { transform: translateX(-100%); }
  .sgx-sidebar.mobile-show { transform: translateX(0); }
  .sgx-main { margin-left: 0; }
  .header-search { max-width: 200px; }
  .user-info { display: none; }
}

@media (max-width: 576px) {
  .header-search { display: none; }
  .quick-action-btn { min-width: 80px; padding: 0.75rem 1rem; }
}
