/* ==========================================================================
   CONSTRUCTION PROGRESS S-CURVE MANAGEMENT SYSTEM
   Modern Dark / Slate Theme with High Contrast & Construction Accents
   ========================================================================== */

:root {
  /* Color Palette */
  --bg-primary: #0b0f19;
  --bg-secondary: #111827;
  --bg-header: #111c44;
  --bg-card: rgba(17, 24, 39, 0.85);
  --bg-card-hover: #1f293d;
  --bg-input: #1e293b;
  --border-color: #334155;
  --border-light: rgba(255, 255, 255, 0.08);

  /* Brand / Accent Colors */
  --accent-orange: #f97316;
  /* Construction Safety Orange */
  --accent-orange-hover: #ea580c;
  --accent-orange-subtle: rgba(249, 115, 22, 0.15);

  --accent-blue: #0284c7;
  /* Planned S-Curve / Technical */
  --accent-blue-light: #38bdf8;
  --accent-blue-subtle: rgba(2, 132, 199, 0.15);

  --accent-green: #10b981;
  /* Actual On Track / Success */
  --accent-green-hover: #059669;
  --accent-green-subtle: rgba(16, 185, 129, 0.15);

  --accent-amber: #f59e0b;
  /* Warning */
  --accent-amber-subtle: rgba(245, 158, 11, 0.15);

  --accent-red: #ef4444;
  /* Critical / Delay */
  --accent-red-subtle: rgba(239, 68, 68, 0.15);

  /* Typography */
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-inverse: #0b0f19;

  /* Shadows & Glassmorphism */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
  --glass-blur: blur(12px);

  /* Layout (Crisp Geometry & Spacing) */
  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-lg: 4px;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  font-size: 14px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-image:
    radial-gradient(at 0% 0%, rgba(249, 115, 22, 0.08) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(2, 132, 199, 0.08) 0px, transparent 50%),
    radial-gradient(at 50% 100%, rgba(16, 185, 129, 0.05) 0px, transparent 50%);
  background-attachment: fixed;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

/* Top Wrapper: Sticky Header + Nav Tabs (2-Column Unified Container) */
.app-top-wrapper {
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  height: auto;
  background: var(--bg-header, #111c44);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-sizing: border-box;
}

/* Cột 1 (bên trái - khu vực Logo): Chiều rộng cố định 240px, tự động ăn khớp 100% chiều cao Cột 2 */
.top-logo-block {
  width: 240px;
  min-width: 240px;
  max-width: 240px;
  height: auto;
  align-self: stretch;
  background: transparent;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.5rem;
  flex-shrink: 0;
  box-sizing: border-box;
}

.brand-logo-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.brand-logo-img {
  max-height: 80px;
  max-width: 90%;
  width: auto;
  object-fit: contain;
  padding: 2px 4px;
  margin: auto;
  box-sizing: border-box;
  transition: opacity 0.2s ease;
}

/* Cột 2 (bên phải): 2 dòng xếp dọc (Dòng 1: Header chính, Dòng 2: Nav Tabs) */
.top-main-block {
  flex: 1;
  min-width: 0;
  height: auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: transparent;
}

/* Header & Navigation */
header.app-header {
  background: transparent;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  position: static;
  padding: 0.5rem 1.25rem;
  width: 100%;
  height: auto;
  box-sizing: border-box;
  display: flex;
  align-items: center;
}

.header-container {
  max-width: 100%;
  width: 100%;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: nowrap !important;
  overflow: hidden;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  flex-shrink: 1;
}

.brand-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--accent-orange), #ea580c);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.15rem;
  font-weight: bold;
  box-shadow: 0 0 15px rgba(249, 115, 22, 0.3);
  flex-shrink: 0;
}

.brand-text {
  padding-left: 0;
  min-width: 0;
  overflow: hidden;
}

.brand-text h1 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-text p {
  font-size: 0.75rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-quick-info {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: var(--bg-input);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.quick-stat {
  display: flex;
  flex-direction: column;
}

.quick-stat-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.quick-stat-val {
  font-size: 0.95rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Button Styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: var(--accent-orange);
  color: white;
  box-shadow: 0 2px 8px rgba(249, 115, 22, 0.3);
}

.btn-primary:hover {
  background: var(--accent-orange-hover);
  transform: translateY(-1px);
}

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

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: #475569;
}

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

.btn-success:hover {
  background: var(--accent-green-hover);
}

.btn-outline-orange {
  background: transparent;
  border-color: var(--accent-orange);
  color: var(--accent-orange);
}

.btn-outline-orange:hover {
  background: var(--accent-orange-subtle);
}

.btn-sm {
  padding: 0.3rem 0.6rem;
  font-size: 0.75rem;
}

/* Nav Tabs (Dòng 2 của Cột 2) */
.nav-tabs-wrapper {
  background: transparent;
  border-bottom: none;
  position: static;
  width: 100%;
  height: auto;
  display: flex;
  align-items: center;
  box-sizing: border-box;
}

.nav-tabs {
  max-width: 100%;
  width: 100%;
  margin: 0;
  padding: 4px 16px;
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  background: transparent;
  box-sizing: border-box;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 8px 16px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
  white-space: nowrap;
  box-sizing: border-box;
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  color: var(--accent-orange);
  border-bottom-color: var(--accent-orange);
  background: linear-gradient(180deg, transparent 80%, var(--accent-orange-subtle) 100%);
}

.tab-badge {
  background: var(--bg-input);
  color: var(--text-muted);
  font-size: 0.7rem;
  padding: 0.15rem 0.4rem;
  border-radius: 999px;
}

/* App Workspace Layout: Collapsible Sidebar + Main Area (below top-wrapper) */
.app-workspace-layout {
  display: flex;
  width: 100%;
  min-height: calc(100vh - 100px);
  overflow-x: hidden;
  flex: 1;
  position: relative;
  margin-top: 0 !important;
  top: 0 !important;
}

/* Sidebar Container & Left Sidebar (Thân trang: #sidebar-container) */
#sidebar-container,
.sidebar-container {
  width: 240px;
  min-width: 240px;
  max-width: 240px;
  background: #071529;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: relative;
  top: 0 !important;
  margin-top: 0 !important;
  z-index: 90;
  flex-shrink: 0;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1), min-width 0.25s ease, max-width 0.25s ease, border-color 0.25s ease;
  box-sizing: border-box;
  padding: 0 !important;
}

.project-sidebar {
  width: 100%;
  min-width: 100%;
  max-width: 100%;
  height: 100%;
  background: transparent;
  display: flex;
  flex-direction: column;
  padding: 0 0 1rem 0 !important;
  margin: 0 !important;
  margin-top: 0 !important;
  top: 0 !important;
  gap: 0.75rem;
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
}

/* Khi không có #sidebar-container bao bọc riêng thì .project-sidebar tự nhận kích thước 240px */
.app-workspace-layout>.project-sidebar {
  width: 240px;
  min-width: 240px;
  max-width: 240px;
  background: #071529;
  border-right: 1px solid var(--border-color);
  position: relative;
  top: 0 !important;
  margin-top: 0 !important;
  z-index: 90;
  flex-shrink: 0;
  padding: 0 0 1rem 0 !important;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1), min-width 0.25s ease, max-width 0.25s ease, border-color 0.25s ease;
}

/* Collapsed state: Toàn bộ khung panel Danh mục dự án ẩn biến mất hoàn toàn */
#sidebar-container.collapsed,
.sidebar-container.collapsed,
.project-sidebar.collapsed {
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border-right: none !important;
  overflow: visible !important;
}

#sidebar-container.collapsed .sidebar-header,
.sidebar-container.collapsed .sidebar-header,
.project-sidebar.collapsed .sidebar-header {
  padding: 0;
  border-bottom: none;
  width: 0;
  overflow: visible;
}

#sidebar-container.collapsed .sidebar-header-title-wrap,
#sidebar-container.collapsed .sidebar-project-list,
#sidebar-container.collapsed .sidebar-footer,
.sidebar-container.collapsed .sidebar-header-title-wrap,
.sidebar-container.collapsed .sidebar-project-list,
.sidebar-container.collapsed .sidebar-footer,
.project-sidebar.collapsed .sidebar-header-title-wrap,
.project-sidebar.collapsed .sidebar-project-list,
.project-sidebar.collapsed .sidebar-footer {
  display: none !important;
}

/* NÚT BẤM TOGGLE KHI COLLAPSED: Nằm sát mép trái màn hình, nền bán trong suốt, opacity 0.4, hover 1.0 */
#sidebar-container.collapsed .sidebar-toggle-btn,
.sidebar-container.collapsed .sidebar-toggle-btn,
.project-sidebar.collapsed .sidebar-toggle-btn {
  position: fixed;
  left: 0;
  top: 130px;
  z-index: 1050;
  width: 28px;
  height: 42px;
  border-radius: 0 6px 6px 0;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-left: none;
  box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.45);
  opacity: 0.4;
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 0.8rem;
}

#sidebar-container.collapsed .sidebar-toggle-btn:hover,
.sidebar-container.collapsed .sidebar-toggle-btn:hover,
.project-sidebar.collapsed .sidebar-toggle-btn:hover {
  opacity: 1.0;
  background: var(--accent-orange);
  color: #ffffff;
  border-color: var(--accent-orange);
  transform: scale(1.06);
  box-shadow: 0 0 14px rgba(249, 115, 22, 0.55);
}

@media (max-width: 1024px) {
  .nav-tabs {
    padding: 0 1rem;
  }

  .app-workspace-layout {
    flex-direction: column;
  }

  #sidebar-container,
  .sidebar-container,
  .project-sidebar {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    height: auto;
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }
}

/* Sidebar Header with Toggle */
.sidebar-header-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border-light);
  margin-top: 0;
  margin-top: 0 !important;
  top: 0 !important;
  box-sizing: border-box;
}

.sidebar-header-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.sidebar-header-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Toggle Button */
.sidebar-toggle-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.7rem;
  transition: var(--transition);
  flex-shrink: 0;
  padding: 0;
  line-height: 1;
}

.sidebar-toggle-btn:hover {
  background: var(--accent-orange);
  color: white;
  border-color: var(--accent-orange);
  transform: scale(1.05);
}

.sidebar-project-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0 0.75rem;
  flex: 1;
}

.sidebar-project-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.sidebar-project-item:hover {
  background: var(--bg-card-hover);
  border-color: #475569;
}

.sidebar-project-item.active {
  border-color: var(--accent-orange);
  background: rgba(232, 119, 34, 0.1);
  box-shadow: 0 0 0 1px rgba(232, 119, 34, 0.3);
}

.sidebar-project-item-header {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
}

.sidebar-project-folder-icon {
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.sidebar-project-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  word-break: break-word;
}

.sidebar-project-status {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding-left: 1.45rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.status-text {
  font-size: 0.75rem;
  font-weight: 600;
}

/* 4 Trạng thái chuẩn hóa */
.status-dot-in_progress {
  background-color: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
}

.status-text-in_progress {
  color: #10b981;
}

.status-dot-paused {
  background-color: #ef4444;
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.6);
}

.status-text-paused {
  color: #ef4444;
}

.status-dot-not_started {
  background-color: #94a3b8;
  box-shadow: 0 0 6px rgba(148, 163, 184, 0.6);
}

.status-text-not_started {
  color: #94a3b8;
}

.status-dot-completed {
  background-color: #3b82f6;
  box-shadow: 0 0 6px rgba(59, 130, 246, 0.6);
}

.status-text-completed {
  color: #3b82f6;
}

.sidebar-footer {
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-light);
}

.sidebar-footer-hint {
  font-size: 0.7rem;
  color: var(--text-muted);
  display: block;
  text-align: center;
}

/* Main Content & Workspace Area */
#main-content-container,
.app-main-area {
  flex: 1;
  min-width: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
  transition: all 0.25s ease;
}

main.app-main {
  flex: 1;
  max-width: 100%;
  width: 100%;
  margin: 0;
  padding: 0.65rem 1rem;
}

.tab-pane {
  display: none;
  animation: fadeIn 0.25s ease-in-out;
}

.tab-pane.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Cards & Containers */
.card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 1.5rem;
}

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

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-primary);
}

/* KPI Grid & Dashboard Top Layout */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

/* Dashboard Top Layout: 2-column Grid (79% / 21%) */
.dashboard-top-layout {
  display: grid;
  grid-template-columns: 79% 21%;
  gap: 0.65rem;
  margin-top: 0 !important;
  margin-bottom: 0.75rem;
  padding-top: 0 !important;
  align-items: stretch;
}

@media (max-width: 1200px) {
  .dashboard-top-layout {
    grid-template-columns: 1fr;
  }
}

.dashboard-main-col {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
}

.dashboard-side-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.kpi-vertical-stack {
  display: flex !important;
  flex-direction: column !important;
  grid-template-columns: none !important;
  gap: 0.35rem !important;
  /* gap: 0.45rem !important; */
  height: 100% !important;
  margin-bottom: 0 !important;
}

.kpi-vertical-stack .kpi-card,
.kpi-card-compact {
  flex: 1 1 0 !important;
  min-height: 0 !important;
  overflow: hidden !important;
  padding: 0.5rem 0.75rem !important;
  margin-bottom: 0 !important;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-radius: var(--radius-sm) !important;
}

.kpi-vertical-stack .kpi-value {
  font-size: 1.75rem !important;
  font-weight: 700 !important;
  margin-bottom: 0.1rem !important;
}

.kpi-vertical-stack .kpi-header {
  margin-bottom: 0.15rem !important;
}

.kpi-vertical-stack .kpi-title {
  font-size: 0.72rem !important;
}

.kpi-vertical-stack .kpi-icon {
  font-size: 1.5rem !important;
}

.kpi-vertical-stack .kpi-subtext {
  font-size: 0.68rem !important;
}

.kpi-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--accent-orange);
}

.kpi-card.kpi-blue::before {
  background: var(--accent-blue-light);
}

.kpi-card.kpi-green::before {
  background: var(--accent-green);
}

.kpi-card.kpi-amber::before {
  background: var(--accent-amber);
}

.kpi-card.kpi-red::before {
  background: var(--accent-red);
}

.kpi-card:hover {
  transform: translateY(-2px);
  border-color: #475569;
}

.kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.kpi-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.kpi-icon {
  font-size: 1.25rem;
  opacity: 0.7;
}

.kpi-value {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  margin-bottom: 0.35rem;
}

.kpi-subtext {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* Status Badges */
.badge,
.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 999px;
  white-space: nowrap;
}

.badge-ontrack,
.status-badge.badge-ontrack,
.badge-success,
.status-success,
.status-ahead {
  background: rgba(34, 197, 94, 0.15) !important;
  color: #22c55e !important;
  border: 1px solid #22c55e !important;
}

.badge-delayed,
.status-badge.badge-delayed,
.status-delayed {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #ef4444 !important;
  border: 1px solid #ef4444 !important;
}

.badge-warning,
.status-warning {
  background: var(--accent-amber-subtle);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-danger,
.status-critical {
  background: var(--accent-red-subtle);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-blue {
  background: var(--accent-blue-subtle);
  color: #38bdf8;
  border: 1px solid rgba(2, 132, 199, 0.3);
}

.badge-pending {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

/* S-Curve Chart Section (Compact 320px) */
.chart-container-compact,
.chart-container {
  position: relative;
  height: 320px !important;
  /* height: 380px !important; */
  width: 100%;
}

.chart-card-compact {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

.chart-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.chart-legend-custom {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.8rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-light);
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-secondary);
}

.legend-color {
  width: 14px;
  height: 14px;
  border-radius: 3px;
}

/* Latest Daily Report Strip */
.latest-report-strip {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  transition: var(--transition);
}

.latest-report-strip:hover {
  border-color: #475569;
}

.latest-report-strip-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 0.5rem;
}

.latest-report-strip-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.latest-report-meta {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  font-size: 0.8rem;
}

.latest-report-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-secondary);
}

.latest-report-item strong {
  color: var(--text-primary);
}

.latest-report-issues {
  background: rgba(232, 119, 34, 0.12);
  border-left: 3px solid var(--accent-orange);
  border-radius: 4px;
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  word-break: break-word;
}

.latest-report-issues strong {
  color: var(--accent-orange);
  white-space: nowrap;
}

/* Nội dung Khó khăn, vướng mắc giữ nguyên định dạng ngắt dòng \n */
.difficulty-content {
  white-space: pre-line !important;
  word-break: break-word;
  line-height: 1.5;
}

body.theme-light .latest-report-issues {
  background: rgba(234, 88, 12, 0.08);
  border-left-color: var(--accent-orange);
  color: var(--text-secondary);
}

/* WBS Table */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

table.wbs-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}

table.wbs-table th {
  background: #162032;
  color: var(--text-secondary);
  font-weight: 600;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 10;
}

table.wbs-table td {
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

table.wbs-table tr:hover {
  background: var(--bg-card-hover);
}

/* WBS Row Styles based on hierarchy */
tr.wbs-summary-0 {
  background: rgba(30, 41, 59, 0.7);
  font-weight: 700;
  color: #f1f5f9;
}

tr.wbs-summary-1 {
  background: rgba(30, 41, 59, 0.4);
  font-weight: 600;
  color: #e2e8f0;
}

tr.wbs-summary-2 {
  background: rgba(30, 41, 59, 0.22);
  font-weight: 600;
}

tr.wbs-summary-3 {
  background: rgba(30, 41, 59, 0.12);
  font-weight: 500;
}

tr.wbs-leaf {
  color: var(--text-primary);
}

.wbs-code-badge {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  background: var(--bg-input);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.75rem;
  border: 1px solid var(--border-color);
  color: var(--accent-orange);
}

.task-name-cell {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.level-indent {
  display: inline-block;
  width: 1.25rem;
}

.weight-input-wrapper {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.weight-input {
  width: 68px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.25rem 0.4rem;
  border-radius: 4px;
  font-size: 0.8rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.weight-input:focus {
  outline: none;
  border-color: var(--accent-orange);
  box-shadow: 0 0 0 2px var(--accent-orange-subtle);
}

/* Progress bar inside table cell */
.progress-bar-container {
  width: 100px;
  height: 8px;
  background: var(--bg-input);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
  display: inline-block;
  vertical-align: middle;
  margin-right: 0.5rem;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-orange), var(--accent-green));
  border-radius: 999px;
  transition: width 0.3s ease;
}

/* Daily Report Section Layout */
.daily-report-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 1024px) {
  .daily-report-grid {
    grid-template-columns: 1fr;
  }
}

/* Form Styles */
.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.form-control {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.55rem 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-orange);
  box-shadow: 0 0 0 2px var(--accent-orange-subtle);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
}

/* Daily Tasks Progress Input List */
.daily-tasks-input-list {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  overflow: visible;
  /* Đảm bảo dropdown không bị cắt cụt */
}

.daily-task-item {
  display: grid;
  grid-template-columns: minmax(300px, 55%) 85px 1fr auto;
  gap: 0.5rem;
  align-items: center;
  padding: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

.daily-task-item:last-child {
  margin-bottom: 0;
}

/* Daily Equipment Input Table */
.equipment-form-table {
  width: 100%;
  border-collapse: collapse;
}

.equipment-form-table th {
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 2;
  background: #162032;
}

.equipment-form-table td {
  padding: 0.35rem 0.4rem;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

.equipment-form-table tr:hover {
  background: var(--bg-card-hover);
}

.equipment-form-table input.form-control,
.equipment-form-table select.form-control {
  padding: 0.35rem 0.5rem;
  font-size: 0.8rem;
}

/* Recent Logs Cards */
.report-logs-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: none;
  overflow: visible;
  padding-right: 0rem;
}

.report-card {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.9rem;
  transition: var(--transition);
}

.report-card:hover {
  border-color: var(--accent-orange);
  background: var(--bg-card-hover);
}

.report-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 0.4rem;
}

.report-date {
  font-weight: 700;
  color: var(--accent-orange);
  font-size: 0.9rem;
}

.report-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.5rem;
  font-size: 0.75rem;
  margin-bottom: 0.5rem;
}

.report-meta-item {
  color: var(--text-secondary);
}

.report-meta-item strong {
  color: var(--text-primary);
}

/* Upload & Dropzone */
.dropzone-box {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
  text-align: center;
  background: rgba(17, 24, 39, 0.4);
  cursor: pointer;
  transition: var(--transition);
}

.dropzone-box:hover,
.dropzone-box.drag-over {
  border-color: var(--accent-orange);
  background: var(--accent-orange-subtle);
}

.dropzone-icon {
  font-size: 3rem;
  color: var(--accent-orange);
  margin-bottom: 1rem;
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 280px;
  animation: slideIn 0.3s ease-out;
}

.toast-success {
  border-left: 4px solid var(--accent-green);
}

.toast-error {
  border-left: 4px solid var(--accent-red);
}

.toast-warning {
  border-left: 4px solid var(--accent-amber);
}

.toast-info {
  border-left: 4px solid var(--accent-blue-light);
}

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

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99999 !important;
  padding: 1rem;
}

.modal-overlay.active {
  display: flex !important;
}

.modal-overlay.hidden,
.hidden {
  display: none !important;
}

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

.modal-close:hover {
  color: var(--text-primary);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .header-container {
    flex-direction: column;
    align-items: flex-start;
  }

  .project-quick-info {
    width: 100%;
    justify-content: space-between;
  }

  .chart-container {
    height: 320px;
  }
}

/* ==========================================
   WBS Searchable Autocomplete Combobox (FEATURE-COMBOBOX)
   ========================================== */
.wbs-combobox-wrapper {
  position: relative;
  width: 100%;
}

.wbs-combobox-wrapper .input-wbs-search {
  width: 100%;
  cursor: text;
  font-size: 0.8rem;
  padding: 0.35rem 0.5rem;
}

.wbs-combobox-wrapper .input-wbs-search:focus {
  border-color: var(--accent-orange, #f97316);
  box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.2);
}

.wbs-autocomplete-dropdown {
  position: absolute;
  top: calc(100% + 3px);
  left: 0;
  min-width: 420px;
  width: 100%;
  max-width: min(650px, 92vw);
  z-index: 1050;
  max-height: 240px;
  overflow-y: auto;
  background: var(--bg-card, #1e293b);
  border: 1px solid var(--border-color, #334155);
  border-radius: var(--radius-sm, 4px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.65);
  display: none;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}

/* Smart Dropup */
.wbs-autocomplete-dropdown.dropup {
  top: auto;
  bottom: calc(100% + 3px);
  box-shadow: 0 -10px 25px rgba(0, 0, 0, 0.65);
}

/* Webkit Scrollbar */
.wbs-autocomplete-dropdown::-webkit-scrollbar {
  width: 6px;
}

.wbs-autocomplete-dropdown::-webkit-scrollbar-track {
  background: transparent;
}

.wbs-autocomplete-dropdown::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.25);
  border-radius: 4px;
}

.wbs-autocomplete-dropdown::-webkit-scrollbar-thumb:hover {
  background-color: var(--accent-orange, #f97316);
}

.wbs-autocomplete-dropdown.active {
  display: block;
}

.wbs-autocomplete-item {
  padding: 0.45rem 0.65rem;
  cursor: pointer;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-primary, #f8fafc);
  transition: background 0.12s ease, color 0.12s ease;
}

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

.wbs-autocomplete-item:hover,
.wbs-autocomplete-item.highlighted {
  background: rgba(249, 115, 22, 0.18);
  color: #ffffff;
}

.wbs-autocomplete-item .wbs-item-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  background: var(--bg-input, #0f172a);
  color: var(--accent-orange, #f97316);
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid rgba(249, 115, 22, 0.3);
  white-space: nowrap;
}

.wbs-autocomplete-item .wbs-item-name {
  flex: 1;
  white-space: normal;
  word-break: break-word;
  line-height: 1.35;
}

.wbs-autocomplete-item .wbs-item-duration {
  font-size: 0.72rem;
  color: var(--text-muted, #94a3b8);
  white-space: nowrap;
}

.wbs-autocomplete-empty {
  padding: 0.75rem;
  text-align: center;
  color: var(--text-muted, #94a3b8);
  font-size: 0.8rem;
  font-style: italic;
}

/* ==========================================
   Excel Preview & Inline Edit Modal (FEATURE-EXCEL-PREVIEW)
   ========================================== */
.modal-preview-content {
  max-width: min(1380px, 96vw);
  width: 96vw;
  max-height: 92vh;
  height: 90vh;
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7);
}

.excel-preview-table-container {
  flex: 1;
  overflow-y: auto;
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  margin-bottom: 0.75rem;
  scrollbar-width: thin;
}

.excel-preview-table-container::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.excel-preview-table-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.25);
  border-radius: 3px;
}

.excel-preview-table-container::-webkit-scrollbar-thumb:hover {
  background: var(--accent-orange);
}

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

.excel-preview-table th {
  position: sticky;
  top: 0;
  background: var(--bg-secondary);
  z-index: 2;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  padding: 0.6rem 0.5rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
}

.excel-preview-table td {
  padding: 0.35rem 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: middle;
}

.excel-preview-table input.form-control-sm,
.excel-preview-table select.form-control-sm {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.5rem;
  font-size: 0.83rem;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.excel-preview-table input.form-control-sm:focus,
.excel-preview-table select.form-control-sm:focus {
  border-color: var(--accent-orange);
  outline: none;
  box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.2);
}

.excel-preview-table input.form-control-sm:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: rgba(15, 23, 42, 0.5);
}

.excel-preview-table tr.row-summary {
  background: rgba(148, 163, 184, 0.04);
}

.excel-preview-table tr.row-summary input.preview-wbs,
.excel-preview-table tr.row-summary input.preview-name {
  font-weight: 600;
  color: var(--accent-orange);
}

.excel-preview-table tr.date-error-row input[type="date"] {
  border-color: #ef4444 !important;
  background: rgba(239, 68, 68, 0.12) !important;
  color: #fca5a5 !important;
}

.excel-preview-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* ==========================================
   Live WBS Editor & Drag-and-Drop (FEATURE-LIVE-WBS-EDITOR)
   ========================================== */
.wbs-live-edit-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4), 0 0 12px rgba(56, 189, 248, 0.15);
  flex-wrap: wrap;
  gap: 0.75rem;
  transition: all 0.25s ease;
}

.live-edit-status {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.live-edit-pulse {
  width: 10px;
  height: 10px;
  background-color: #38bdf8;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.7);
  animation: pulse-blue 1.8s infinite;
}

@keyframes pulse-blue {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.7);
  }

  70% {
    transform: scale(1.1);
    box-shadow: 0 0 0 8px rgba(56, 189, 248, 0);
  }

  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(56, 189, 248, 0);
  }
}

.live-edit-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Kéo thả dòng */
.wbs-table th.col-drag,
.wbs-table td.col-drag {
  width: 36px;
  text-align: center;
  padding: 0.25rem 0.2rem;
}

.wbs-drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: var(--text-muted);
  cursor: grab;
  cursor: -webkit-grab;
  border-radius: 4px;
  user-select: none;
  font-size: 1rem;
  transition: background 0.15s, color 0.15s;
}

.wbs-drag-handle:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #38bdf8;
}

.wbs-drag-handle:active {
  cursor: grabbing;
}

.wbs-table tr.wbs-dragging {
  opacity: 0.45;
  background: rgba(56, 189, 248, 0.15) !important;
  outline: 2px dashed #38bdf8;
}

/* Các chỉ báo vị trí thả (Drop Indicators) */
.wbs-table tr.drop-indicator-top {
  box-shadow: inset 0 3px 0 0 #38bdf8 !important;
  background: rgba(56, 189, 248, 0.1) !important;
}

.wbs-table tr.drop-indicator-bottom {
  box-shadow: inset 0 -3px 0 0 #38bdf8 !important;
  background: rgba(56, 189, 248, 0.1) !important;
}

.wbs-table tr.drop-indicator-child {
  background: rgba(56, 189, 248, 0.25) !important;
  outline: 2px solid #38bdf8 !important;
}

.wbs-table tr.wbs-drop-forbidden,
.wbs-table tr.wbs-drop-forbidden * {
  cursor: not-allowed !important;
}

/* Inline Edit Controls */
.wbs-inline-input {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.45rem;
  font-size: 0.82rem;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.wbs-inline-input:focus {
  border-color: #38bdf8;
  outline: none;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.wbs-inline-input:disabled {
  opacity: 0.55;
  background: rgba(15, 23, 42, 0.5);
  cursor: not-allowed;
}

.wbs-action-btn-group {
  display: inline-flex;
  gap: 0.25rem;
  align-items: center;
}

.btn-wbs-action {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.4rem;
  font-size: 0.78rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: all 0.15s ease;
}

.btn-wbs-action:hover {
  background: rgba(255, 255, 255, 0.16);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.25);
}

.btn-wbs-action.btn-action-delete:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.4);
}

.btn-wbs-action:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.wbs-table tr.date-error-row input[type="date"] {
  border-color: #ef4444 !important;
  background: rgba(239, 68, 68, 0.12) !important;
  color: #fca5a5 !important;
}

/* ==========================================================================
   FEATURE-DAILY-PHOTOS: Micro Chips, Thumbnails Grid & Lightbox Modal
   ========================================================================== */
.photo-attachment-group {
  margin-bottom: 0.85rem;
}

.selected-photos-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  min-height: 24px;
  margin-top: 0.35rem;
}

.photo-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 20px;
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
  color: var(--text-primary);
  transition: all 0.15s ease;
  user-select: none;
}

.photo-chip:hover {
  background: rgba(56, 189, 248, 0.18);
  border-color: rgba(56, 189, 248, 0.5);
}

.photo-chip-icon {
  font-size: 0.8rem;
  line-height: 1;
}

.photo-chip-name {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
  color: var(--text-primary);
}

.photo-chip-size {
  color: var(--text-muted);
  font-size: 0.7rem;
}

.photo-chip-remove {
  background: transparent;
  border: none;
  color: #f87171;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0 0.15rem;
  margin-left: 0.15rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.photo-chip-remove:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.2);
}

/* Report Photos Accordion & Thumbnails Grid */
.report-photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.5rem;
  padding: 0.25rem 0;
}

.report-photo-thumb {
  position: relative;
  width: 100%;
  height: 75px;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: #0b0f19;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.report-photo-thumb:hover {
  transform: scale(1.03);
  border-color: var(--accent-blue-light);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.report-photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.report-photo-zoom-hint {
  position: absolute;
  bottom: 3px;
  right: 3px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 0.65rem;
  padding: 1px 4px;
  border-radius: 3px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.report-photo-thumb:hover .report-photo-zoom-hint {
  opacity: 1;
}

/* Lightbox Modal */
#modal-photo-lightbox.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

#modal-photo-lightbox.modal-overlay.active {
  display: flex;
}

.lightbox-modal-content {
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalFadeIn 0.2s ease-out;
}

.lightbox-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border-color);
  background: rgba(30, 41, 59, 0.6);
}

.lightbox-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  max-width: 80%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lightbox-body {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.75rem;
  overflow: auto;
  background: #050811;
  min-height: 200px;
}

.lightbox-image {
  max-width: 85vw;
  max-height: 78vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

/* ========================================================
   FEATURE-EXECUTIVE-DASHBOARD: HEADER META & DRILLDOWN & CONFIG
   ======================================================== */

/* Header Meta Badges */
.project-meta-badges {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.25rem;
  font-size: 0.825rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

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

.meta-item-sep {
  color: var(--text-muted);
  opacity: 0.6;
}

.text-danger-overdue {
  color: var(--accent-red) !important;
  font-weight: 700;
  animation: pulseOverdue 2s infinite ease-in-out;
}

@keyframes pulseOverdue {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.7;
  }
}

/* Summary Tasks Breadcrumb & Drilldown */
.summary-tasks-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.55rem 0.85rem;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  flex-wrap: wrap;
}

.drilldown-path {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.drilldown-crumb-link {
  color: var(--accent-blue-light);
  cursor: pointer;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s ease;
}

.drilldown-crumb-link:hover {
  color: #7dd3fc;
  text-decoration: underline;
}

.drilldown-crumb-sep {
  color: var(--text-muted);
  user-select: none;
}

.drilldown-crumb-current {
  color: var(--text-primary);
  font-weight: 600;
}

.kpi-card.has-children {
  cursor: pointer;
  position: relative;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.kpi-card.has-children:hover {
  transform: translateY(-2px);
  border-color: var(--accent-blue-light);
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.18);
}

.drilldown-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.72rem;
  color: var(--accent-blue-light);
  background: rgba(56, 189, 248, 0.12);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-weight: 500;
  border: 1px solid rgba(56, 189, 248, 0.25);
  user-select: none;
}

/* Modal Project Config & WBS Tree */
.config-wbs-tree-container,
#settings-wbs-list,
#config-wbs-tree {
  max-height: 280px !important;
  overflow-y: auto !important;
  border: 1px solid var(--border-color) !important;
  border-radius: var(--radius-sm) !important;
  background: var(--bg-card) !important;
  padding: 0.5rem !important;
}

#settings-wbs-list #config-wbs-tree {
  border: none !important;
  padding: 0 !important;
  max-height: none !important;
  overflow: visible !important;
  background: transparent !important;
}

.config-wbs-item,
.setting-category-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.4rem;
  border-radius: 4px;
  font-size: 0.825rem;
  transition: background 0.15s ease;
  position: relative;
}

.config-wbs-item:hover,
.setting-category-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

body.theme-light .config-wbs-item:hover,
body.theme-light .setting-category-item:hover {
  background: rgba(0, 0, 0, 0.05);
}

/* Thụt đầu dòng theo cấp WBS và đường nét đứt phân nhánh cây */
.setting-category-item.tree-level-1 {
  padding-left: 0.25rem !important;
  font-weight: 600;
}

.setting-category-item.tree-level-2 {
  padding-left: 20px !important;
  border-left: 1px dashed rgba(255, 255, 255, 0.18);
  margin-left: 10px;
}

.setting-category-item.tree-level-3 {
  padding-left: 40px !important;
  border-left: 1px dashed rgba(255, 255, 255, 0.18);
  margin-left: 10px;
}

.setting-category-item.tree-level-4 {
  padding-left: 60px !important;
  border-left: 1px dashed rgba(255, 255, 255, 0.18);
  margin-left: 10px;
}

body.theme-light .setting-category-item.tree-level-2,
body.theme-light .setting-category-item.tree-level-3,
body.theme-light .setting-category-item.tree-level-4 {
  border-left: 1px dashed rgba(0, 0, 0, 0.2);
}

/* Nút Mũi tên đóng/mở Accordion */
.wbs-tree-toggle-btn {
  background: transparent;
  border: none;
  color: var(--accent-blue-light, #38bdf8);
  cursor: pointer;
  padding: 0.1rem 0.3rem;
  font-size: 0.72rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  user-select: none;
  min-width: 18px;
  height: 18px;
  transition: transform 0.15s ease, background 0.15s ease;
}

.wbs-tree-toggle-btn:hover {
  background: rgba(56, 189, 248, 0.15);
}

.wbs-tree-toggle-spacer {
  display: inline-block;
  width: 18px;
  min-width: 18px;
}

.wbs-tree-guide-icon {
  font-family: monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
  user-select: none;
  opacity: 0.65;
  margin-right: -0.1rem;
}

/* Label & Checkbox */
.config-wbs-item label,
.setting-category-item label,
.wbs-tree-label {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  margin-bottom: 0;
  color: var(--text-primary);
  user-select: none;
}

.setting-category-cb {
  cursor: pointer;
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent-blue, #0284c7);
  flex-shrink: 0;
}

.config-wbs-badge {
  font-family: monospace;
  font-weight: 600;
  font-size: 0.75rem;
  padding: 0.1rem 0.35rem;
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent-blue-light);
  border-radius: 3px;
  flex-shrink: 0;
}

.config-wbs-badge.level-1 {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  font-weight: 700;
}

.tree-node-title {
  font-size: 0.84rem;
  color: var(--text-primary);
  line-height: 1.3;
}

.tree-node-title.is-parent {
  font-weight: 600;
}

.tree-node-title.is-leaf {
  font-weight: 400;
  color: var(--text-secondary);
}

/* ==========================================================================
   FEATURE-THEME-LOGO-SETTINGS-FIX (PHASE 56-59)
   3 THEMES: LIGHT, BLACK, TTC & DYNAMIC LOGO
   ========================================================================== */

/* 1. ☀️ Light theme (Nền sáng) */
body.theme-light,
[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-input: #ffffff;
  --border-color: #cbd5e1;
  --border-light: rgba(0, 0, 0, 0.08);

  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-inverse: #ffffff;

  --accent-orange: #ea580c;
  --accent-orange-hover: #c2410c;
  --accent-orange-subtle: rgba(234, 88, 12, 0.12);

  --accent-blue: #0284c7;
  --accent-blue-light: #0369a1;
  --accent-blue-subtle: rgba(2, 132, 199, 0.12);

  --accent-green: #059669;
  --accent-green-hover: #047857;
  --accent-green-subtle: rgba(5, 150, 105, 0.12);

  --accent-amber: #d97706;
  --accent-amber-subtle: rgba(217, 119, 6, 0.12);

  --accent-red: #dc2626;
  --accent-red-subtle: rgba(220, 38, 38, 0.12);

  background-image:
    radial-gradient(at 0% 0%, rgba(234, 88, 12, 0.05) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(2, 132, 199, 0.05) 0px, transparent 50%),
    radial-gradient(at 50% 100%, rgba(5, 150, 105, 0.04) 0px, transparent 50%);
}

body.theme-light .app-top-wrapper {
  background: #ffffff;
  border-bottom: 1px solid #cbd5e1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

body.theme-light .top-logo-block {
  background: transparent;
  border-right: 1px solid #cbd5e1;
}

body.theme-light header.app-header {
  background: transparent;
  border-bottom: 1px solid #e2e8f0;
  box-shadow: none;
}

body.theme-light .project-quick-info {
  background: #f8fafc;
  border-color: #cbd5e1;
}

body.theme-light .card {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

body.theme-light .kpi-card {
  background: #ffffff;
  border-color: #e2e8f0;
}

body.theme-light .kpi-card:hover {
  background: #f8fafc;
}

body.theme-light .wbs-table th,
body.theme-light .excel-preview-table th {
  background: #f1f5f9;
  color: #334155;
  border-color: #cbd5e1;
}

body.theme-light .wbs-table td,
body.theme-light .excel-preview-table td {
  border-color: #e2e8f0;
}

body.theme-light .wbs-table tr:hover {
  background: #f8fafc;
}

body.theme-light .modal-content {
  background: #ffffff;
  color: #0f172a;
  border-color: #cbd5e1;
}

body.theme-light .form-control {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
}

body.theme-light .form-control:focus {
  border-color: var(--accent-orange);
  box-shadow: 0 0 0 2px rgba(234, 88, 12, 0.2);
}

body.theme-light .nav-tabs-wrapper {
  background: transparent;
  border-bottom: none;
}

body.theme-light .tab-btn {
  color: #64748b;
}

body.theme-light .tab-btn.active {
  color: var(--accent-orange);
  border-bottom-color: var(--accent-orange);
}

body.theme-light .report-log-card {
  background: #ffffff;
  border-color: #e2e8f0;
}

/* 2. 🌙 Black theme (Nền đen tương phản cao) */
body.theme-black,
[data-theme="black"] {
  --bg-primary: #000000;
  --bg-secondary: #0a0a0a;
  --bg-card: #121212;
  --bg-card-hover: #1c1c1c;
  --bg-input: #141414;
  --border-color: #27272a;
  --border-light: rgba(255, 255, 255, 0.1);

  --text-primary: #ffffff;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --text-inverse: #000000;

  --accent-orange: #f97316;
  --accent-orange-hover: #ea580c;
  --accent-orange-subtle: rgba(249, 115, 22, 0.2);

  --accent-blue: #38bdf8;
  --accent-blue-light: #7dd3fc;
  --accent-blue-subtle: rgba(56, 189, 248, 0.2);

  background-image: none;
}

body.theme-black .app-top-wrapper {
  background: #111c44;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

body.theme-black .top-logo-block {
  background: transparent;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

body.theme-black header.app-header {
  background: transparent;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

body.theme-black .nav-tabs-wrapper {
  background: transparent;
}

body.theme-black .project-quick-info {
  background: #141414;
  border-color: #27272a;
}

body.theme-black .card {
  background: #121212;
  border-color: #27272a;
}

body.theme-black .modal-content {
  background: #0f0f11;
  border-color: #27272a;
}

/* 3. 🏢 TTC theme (Màu xanh chủ đạo #1A3D68, accent cam #E87722) */
body.theme-ttc,
[data-theme="ttc"] {
  --bg-primary: #0d1e33;
  --bg-secondary: #132a48;
  --bg-card: rgba(26, 61, 104, 0.8);
  --bg-card-hover: #1f4574;
  --bg-input: #122844;
  --border-color: #2a5282;
  --border-light: rgba(255, 255, 255, 0.12);

  --accent-orange: #E87722;
  --accent-orange-hover: #d16413;
  --accent-orange-subtle: rgba(232, 119, 34, 0.2);

  --accent-blue: #38bdf8;
  --accent-blue-light: #7dd3fc;
  --accent-blue-subtle: rgba(56, 189, 248, 0.2);

  --text-primary: #ffffff;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-inverse: #0d1e33;

  background-image:
    radial-gradient(at 0% 0%, rgba(232, 119, 34, 0.12) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(26, 61, 104, 0.45) 0px, transparent 50%),
    radial-gradient(at 50% 100%, rgba(13, 30, 51, 0.6) 0px, transparent 50%);
}

body.theme-ttc .app-top-wrapper {
  background: #111c44;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

body.theme-ttc .top-logo-block {
  background: transparent;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

body.theme-ttc header.app-header {
  background: transparent;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

body.theme-ttc .nav-tabs-wrapper {
  background: transparent;
}

body.theme-ttc .project-quick-info {
  background: #122844;
  border-color: #2a5282;
}

body.theme-ttc .card {
  background: rgba(26, 61, 104, 0.65);
  border-color: #2a5282;
}

body.theme-ttc .modal-content {
  background: #132a48;
  border-color: #2a5282;
}

/* Theme Picker UI Controls */
.theme-picker-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
}

.theme-choice-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 0.5rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  font-size: 0.85rem;
  font-weight: 500;
}

.theme-choice-btn input[type="radio"] {
  margin-right: 0.45rem;
  cursor: pointer;
  accent-color: var(--accent-orange);
}

.theme-choice-btn:hover {
  border-color: var(--accent-blue-light);
  background: var(--bg-card-hover);
}

.theme-choice-btn.active,
.theme-choice-btn:has(input[type="radio"]:checked) {
  border-color: var(--accent-orange);
  background: var(--accent-orange-subtle);
  font-weight: 600;
  box-shadow: 0 0 10px rgba(232, 119, 34, 0.25);
}

/* Modal Z-Index Guards */
#modal-settings {
  z-index: 9999 !important;
}

#settings-modal,
#modal-settings,
#modal-project-config,
.modal-settings,
#modal-daily-report,
.modal-blur-backdrop {
  z-index: 99999 !important;
}

#settings-modal.active,
#modal-settings.active,
#modal-project-config.active,
.modal-settings.active,
#modal-daily-report.active {
  display: flex !important;
}

#settings-modal.hidden,
#modal-settings.hidden,
#modal-project-config.hidden,
.modal-settings.hidden,
#modal-daily-report.hidden {
  display: none !important;
}

.modal-blur-backdrop {
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  background: rgba(0, 0, 0, 0.65) !important;
}

.btn-accent-orange {
  background: #ea580c !important;
  border-color: #ea580c !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  box-shadow: 0 2px 8px rgba(234, 88, 12, 0.35);
  transition: all 0.2s ease;
}

.btn-accent-orange:hover {
  background: #f97316 !important;
  border-color: #f97316 !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.45);
}

.report-logs-fullwidth {
  width: 100% !important;
  max-width: 100% !important;
}

.modal-content-large {
  max-width: 920px;
  width: 95%;
  max-height: 90vh;
  overflow-y: auto;
}

/* ======================================================== */
/* OPERATIONAL KPIS & EVALUATION STYLES (PHASE 73)          */
/* ======================================================== */
.kpi-mini-progress {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
  margin: 0.25rem 0 0.2rem 0;
}

.kpi-mini-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #f97316);
  border-radius: 2px;
  transition: width 0.4s ease;
}

.kpi-val-status.status-pass {
  color: #22c55e !important;
  font-weight: 800 !important;
  letter-spacing: 1px;
}

.kpi-val-status.status-fail {
  color: #ef4444 !important;
  font-weight: 800 !important;
  letter-spacing: 1px;
}

.kpi-val-status.status-none {
  color: #94a3b8 !important;
  font-weight: 600 !important;
}

.kpi-diff-badge {
  font-size: 0.82rem;
  font-weight: 700;
  margin-left: 0.45rem;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  line-height: 1.2;
}

.kpi-diff-up {
  color: #22c55e;
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.kpi-diff-down {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.kpi-diff-same {
  color: #94a3b8;
  background: rgba(148, 163, 184, 0.15);
  border: 1px solid rgba(148, 163, 184, 0.3);
}

/* ======================================================== */
/* PHASE 75: PAYMENT SCHEDULE & PROJECT MANAGEMENT STYLES   */
/* ======================================================== */

/* 1. Payment Badges */
.badge-paid {
  background: rgba(16, 185, 129, 0.15) !important;
  color: #10b981 !important;
  border: 1px solid rgba(16, 185, 129, 0.4) !important;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm, 4px);
  display: inline-block;
  white-space: nowrap;
}

.badge-unpaid {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #ef4444 !important;
  border: 1px solid rgba(239, 68, 68, 0.4) !important;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm, 4px);
  display: inline-block;
  white-space: nowrap;
}

.badge-submitted {
  background: rgba(245, 158, 11, 0.15) !important;
  color: #f59e0b !important;
  border: 1px solid rgba(245, 158, 11, 0.4) !important;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm, 4px);
  display: inline-block;
  white-space: nowrap;
}

.badge-invoiced {
  background: rgba(139, 92, 246, 0.15) !important;
  color: #8b5cf6 !important;
  border: 1px solid rgba(139, 92, 246, 0.4) !important;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm, 4px);
  display: inline-block;
  white-space: nowrap;
}

/* 2. Sidebar Settings & Footer Button */
.sidebar-footer-settings-wrap {
  position: relative;
  width: 100%;
}

.btn-sidebar-settings {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.55rem 0.85rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-sidebar-settings:hover {
  background: rgba(56, 189, 248, 0.12);
  border-color: var(--accent-blue-light);
  color: var(--accent-blue-light);
}

.sidebar-settings-menu {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  width: 100%;
  background: var(--bg-card, #1e293b);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  z-index: 1000;
  overflow: hidden;
}

.sidebar-settings-menu.hidden {
  display: none !important;
}

.settings-menu-item {
  width: 100%;
  text-align: left;
  padding: 0.65rem 0.9rem;
  background: transparent;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.85rem;
  font-weight: 500;
  transition: background 0.15s ease;
}

.settings-menu-item:hover {
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent-blue-light);
}

/* 3. Project Management Table Controls */
.proj-select-checkbox {
  cursor: pointer;
  width: 16px;
  height: 16px;
  accent-color: var(--accent-orange);
}

.badge-archive-visible {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 600;
}

.badge-archive-hidden {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 600;
}

.badge-archive-trash {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 600;
}

/* Tab Quản lý Dự Án & Thùng Rác (Hotfix) */
.proj-mgmt-tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

.proj-tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.88rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
}

.proj-tab-btn:hover {
  background: var(--bg-card-hover, rgba(255, 255, 255, 0.05));
  color: var(--text-primary);
}

.proj-tab-btn.active {
  background: rgba(249, 115, 22, 0.15);
  color: var(--accent-orange);
  border-color: rgba(249, 115, 22, 0.4);
}

.badge-z-folder {
  display: inline-block;
  font-family: var(--font-mono, monospace);
  font-size: 0.75rem;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: rgba(14, 165, 233, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(14, 165, 233, 0.25);
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}