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

/* ========================================= */
/* BIẾN MÀU SẮC & GIAO DIỆN CAO CẤP          */
/* ========================================= */
:root {
  --bg-main: #020510;      /* Đen sâu nhất */
  --bg-surface: #070b14;   /* Bề mặt panel tối */
  --bg-card: rgba(15, 20, 36, 0.6);
  --line: rgba(255, 255, 255, 0.055);
  --primary: #7c3aed;
  --primary2: #a78bfa;
  --primary-grad: linear-gradient(135deg, #4f46e5, #7c3aed, #c026d3);
  --primary-glow: rgba(124, 58, 237, 0.35);
  --text: #f1f5f9;
  --muted: #64748b;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  --font-main: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(ellipse 80% 40% at 50% -10%, rgba(99, 102, 241, 0.25) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 0% 50%, rgba(79, 70, 229, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse 50% 50% at 100% 100%, rgba(192, 38, 211, 0.08) 0%, transparent 50%);
  background-attachment: fixed;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  overflow-x: hidden;
}

/* THANH CUỘN (SCROLLBAR) */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(124, 58, 237, 0.3);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(124, 58, 237, 0.55);
}

/* HEADER NỔI BẬT */
header {
  padding: 10px 24px;
  background: rgba(5, 8, 18, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(124, 58, 237, 0.15);
  box-shadow: 0 4px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(124, 58, 237, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  flex: 0 0 auto;
  text-decoration: none;
}

.brand-text {
  font-size: 14px;
  letter-spacing: 0.8px;
  font-weight: 900;
  background: linear-gradient(135deg, #a78bfa, #e879f9, #38bdf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
}

.brand-pro {
  display: inline-block;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 2px;
  vertical-align: middle;
  border: 1px solid rgba(124, 58, 237, 0.5);
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(124, 58, 237, 0.15);
  -webkit-text-fill-color: #a78bfa;
  margin-left: 2px;
}

/* CONTAINER TÌM KIẾM TRÊN HEADER */
.header-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  max-width: 600px;
  margin: 0 20px;
}

.search-input-wrap {
  position: relative;
  flex: 1.2;
  display: flex;
  align-items: center;
}

.search-input-wrap .search-icon {
  position: absolute;
  left: 12px;
  font-size: 13px;
  opacity: 0.5;
  pointer-events: none;
}

.search-input-wrap input {
  padding: 8px 12px 8px 32px;
  font-size: 13px;
  height: 36px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

.search-input-wrap input:focus {
  background: rgba(0, 0, 0, 0.5);
  border-color: var(--primary2);
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.2);
}

.header-filters-group {
  display: flex;
  gap: 8px;
  flex: 1.8;
}

.header-filters-group select {
  height: 36px;
  padding: 8px 12px;
  font-size: 12.5px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
  width: 100%;
}

.header-filters-group select:focus {
  border-color: var(--primary2);
  color: #fff;
  background: rgba(0, 0, 0, 0.5);
}

/* NÚT LỌC MOBILE */
.header-filter-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
}

.header-filter-btn.active {
  background: rgba(139, 92, 246, 0.2);
  border-color: var(--primary2);
  color: #fff;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: flex-end;
  flex: 0 0 auto;
}

.header-status {
  display: none !important;
}

#fbDot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 8px #f59e0b;
  display: inline-block;
  transition: all 0.3s ease;
}

.logout-btn {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.08);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
  box-shadow: none;
  cursor: pointer;
  font-weight: 700;
  transition: all 0.2s ease;
}
.logout-btn:hover {
  background: #ef4444;
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
  transform: translateY(-1px);
}
.logout-btn:active {
  transform: translateY(1px);
}

.container {
  padding: 24px;
  padding-bottom: 100px;
  width: 100%;
  max-width: 1600px; 
  margin: 0 auto;
  box-sizing: border-box;
}

/* CARD DASHBOARD (KPIs) */
.dashboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}

.card {
  background: linear-gradient(145deg, rgba(22, 30, 50, 0.7), rgba(11, 15, 25, 0.85));
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 18px;
  padding: 20px 22px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25), inset 0 1px 1px rgba(255,255,255,0.03);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--primary-grad);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35), inset 0 1px 2px rgba(255,255,255,0.05);
  border-color: rgba(139, 92, 246, 0.25);
}
.card:hover::before {
  opacity: 1;
}

.card div {
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-size: 11px;
  font-weight: 700;
}

.card span {
  font-size: 28px;
  font-weight: 800;
  display: block;
  margin-top: 10px;
  color: #fff;
  font-family: var(--font-main);
  letter-spacing: -0.5px;
}

/* INPUTS & TOOLBARS */
.toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  align-items: center;
}

/* ACTION BAR (HÀNG THAO TÁC NHANH) */
.action-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: rgba(10, 14, 23, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  margin-bottom: 20px;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.3);
}

.action-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.action-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  color: rgba(148, 163, 184, 0.45);
  text-transform: uppercase;
  user-select: none;
  white-space: nowrap;
  padding-right: 4px;
}

.action-divider {
  width: 1px;
  height: 28px;
  background: rgba(255, 255, 255, 0.07);
  flex-shrink: 0;
}

/* SECTION LABEL */
.section-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: rgba(148, 163, 184, 0.4);
  text-transform: uppercase;
  margin-bottom: 10px;
  padding-left: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* BUTTON OUTLINE VARIANTS */
.btn-outline-blue {
  background: rgba(2, 132, 199, 0.1);
  color: #38bdf8;
  border: 1px solid rgba(2, 132, 199, 0.25);
  font-size: 12.5px;
  padding: 7px 13px;
  box-shadow: none;
  border-radius: 8px;
}
.btn-outline-blue:hover {
  background: rgba(2, 132, 199, 0.25);
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.2);
  transform: translateY(-1px);
}

.btn-outline-red {
  background: rgba(190, 18, 60, 0.1);
  color: #f43f5e;
  border: 1px solid rgba(190, 18, 60, 0.25);
  font-size: 12.5px;
  padding: 7px 13px;
  box-shadow: none;
  border-radius: 8px;
}
.btn-outline-red:hover {
  background: rgba(190, 18, 60, 0.25);
  border-color: rgba(244, 63, 94, 0.5);
  box-shadow: 0 4px 14px rgba(190, 18, 60, 0.2);
  transform: translateY(-1px);
}

.btn-outline-green {
  background: rgba(16, 185, 129, 0.1);
  color: #4ade80;
  border: 1px solid rgba(16, 185, 129, 0.25);
  font-size: 12.5px;
  padding: 7px 13px;
  box-shadow: none;
  border-radius: 8px;
}
.btn-outline-green:hover {
  background: rgba(16, 185, 129, 0.25);
  border-color: rgba(74, 222, 128, 0.5);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.2);
  transform: translateY(-1px);
}
.btn-outline-green.active {
  background: rgba(16, 185, 129, 0.2);
  border-color: #4ade80;
  color: #4ade80;
}

.btn-outline-purple {
  background: rgba(139, 92, 246, 0.12);
  color: var(--primary2);
  border: 1px solid rgba(139, 92, 246, 0.3);
  font-size: 12.5px;
  padding: 7px 13px;
  box-shadow: none;
  border-radius: 8px;
}
.btn-outline-purple:hover {
  background: rgba(139, 92, 246, 0.25);
  border-color: var(--primary2);
  box-shadow: 0 4px 14px rgba(139, 92, 246, 0.25);
  transform: translateY(-1px);
}
.btn-outline-purple.active {
  background: rgba(139, 92, 246, 0.25);
  border-color: var(--primary2);
  color: #fff;
}

input, select, textarea {
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(5, 8, 18, 0.6);
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  box-sizing: border-box;
  transition: all 0.2s ease;
  width: 100%;
}

input::placeholder, textarea::placeholder {
  color: rgba(100, 116, 139, 0.7);
}
textarea {
  resize: vertical;
  min-height: 56px;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary2);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.18);
  background: rgba(5, 8, 18, 0.9);
}

button {
  padding: 11px 20px;
  border-radius: 10px;
  border: none;
  background: var(--primary-grad);
  color: white;
  cursor: pointer;
  font-weight: 700;
  font-family: inherit;
  font-size: 14px;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.25);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}
button:hover { 
  transform: translateY(-2px); 
  box-shadow: 0 8px 25px rgba(139, 92, 246, 0.5), 0 0 10px rgba(236, 72, 153, 0.2); 
  filter: brightness(1.05);
}
button:active {
  transform: translateY(1px);
}

/* FORM NHẬP LIỆU */
.form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
  background: linear-gradient(160deg, rgba(20, 26, 46, 0.7), rgba(10, 13, 25, 0.85));
  padding: 22px 24px;
  border-radius: 20px;
  border: 1px solid rgba(124, 58, 237, 0.15);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.04);
  position: relative;
  overflow: hidden;
}

.form::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary-grad);
  opacity: 0.7;
}

.form-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  width: 100%;
}

.form-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 180px;
}
.form-col.wide {
  flex: 2;
  min-width: 280px;
}

/* Label chuẩn, hiển thị phía trên input, không dùng absolute đè chữ */
.form-col label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* TABLE HIỆN ĐẠI */
.table-wrap {
  background: linear-gradient(145deg, rgba(17, 24, 39, 0.5), rgba(11, 15, 25, 0.8));
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  padding: 0;
  overflow-x: auto;
  overflow-y: visible;
  scroll-behavior: smooth;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(16px);
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 1050px;
}

th {
  text-align: left;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(148, 163, 184, 0.7);
  padding: 14px 16px;
  background: rgba(0, 0, 0, 0.2);
  font-weight: 800;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  white-space: nowrap;
}
th:first-child { border-top-left-radius: 20px; padding-left: 20px; }
th:last-child { border-top-right-radius: 20px; text-align: center; padding-right: 20px; }

td {
  padding: 13px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.025);
  background: transparent;
  font-size: 13.5px;
  vertical-align: middle;
  line-height: 1.45;
}

tbody tr {
  transition: background 0.15s ease;
}

tbody tr:hover {
  background: rgba(139, 92, 246, 0.04) !important;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:last-child td:first-child { border-bottom-left-radius: 16px; }
tbody tr:last-child td:last-child { border-bottom-right-radius: 16px; }

/* STATUS BADGES TRONG TABLE */
.status-badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 800;
  display: inline-block;
  white-space: nowrap;
  text-align: center;
  letter-spacing: 0.3px;
}
.st-new      { background: rgba(239, 68, 68, 0.12);   color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.25); }
.st-doing    { background: rgba(245, 158, 11, 0.12);  color: #fcd34d; border: 1px solid rgba(245, 158, 11, 0.25); }
.st-done     { background: rgba(59, 130, 246, 0.12);  color: #93c5fd; border: 1px solid rgba(59, 130, 246, 0.25); }
.st-delivered{ background: rgba(16, 185, 129, 0.12);  color: #6ee7b7; border: 1px solid rgba(16, 185, 129, 0.25); }

/* NÚT ACTION TRONG TABLE */
.action-cell { 
  text-align: center; 
  white-space: nowrap; 
}
.action-cell button {
  padding: 6px 8px;
  margin: 0 2px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: none;
  font-size: 13px;
  transition: all 0.2s ease;
}
.action-cell button:hover { 
  background: rgba(255, 255, 255, 0.1); 
  border-color: rgba(255, 255, 255, 0.15);
  transform: scale(1.05); 
}
.action-cell button.btn-zalo:hover { background: rgba(0, 104, 255, 0.2); border-color: rgba(0, 104, 255, 0.4); color: #38bdf8; }
.action-cell button.btn-del:hover { background: rgba(239, 68, 68, 0.2); border-color: rgba(239, 68, 68, 0.4); color: #f87171; }

/* CHIP TABS PHÂN LOẠI */
.chip-scroll {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 5px;
  background: rgba(10, 14, 23, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 999px;
  scrollbar-width: none;
  margin-bottom: 20px;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.4);
}
.chip-scroll::-webkit-scrollbar { display: none }

.chip { 
  display: flex; 
  align-items: center; 
  gap: 6px; 
  white-space: nowrap; 
  padding: 8px 16px; 
  border-radius: 999px; 
  background: transparent; 
  border: none;
  cursor: pointer; 
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1); 
  color: var(--muted); 
  font-weight: 600; 
  box-shadow: none;
  font-size: 13px;
}
.chip:hover { 
  background: rgba(255, 255, 255, 0.03); 
  color: #fff; 
}
.chip.active { 
  background: var(--primary-grad); 
  color: white; 
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.35); 
}

.badge { 
  background: rgba(0, 0, 0, 0.3); 
  padding: 2px 6px; 
  border-radius: 999px; 
  font-size: 10px; 
  font-weight: 800;
  margin-left: 2px;
}
.danger { 
  background: var(--danger); 
  color: white; 
  padding: 2px 6px; 
  border-radius: 999px; 
  font-size: 10px; 
  font-weight: 800;
}
.rate { 
  font-size: 10px; 
  color: var(--muted);
  opacity: 0.85;
}
.chip.active .rate {
  color: #fff;
}
.rate.low { color: #f87171; font-weight: 700; }
.rate.mid { color: #fbbf24; font-weight: 700; }
.rate.high { color: #34d399; font-weight: 700; }

/* VIEW TOGGLER SEGMENTED */
.view-toggler { 
  display: inline-flex; 
  gap: 4px; 
  background: rgba(11, 15, 25, 0.85); 
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 6px; 
  border-radius: 999px; 
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), inset 0 1px 1px rgba(255,255,255,0.05);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.view-toggler button { 
  background: transparent; 
  border: none; 
  color: var(--muted); 
  box-shadow: none; 
  padding: 10px 20px; 
  border-radius: 999px; 
  font-weight: 700;
  font-size: 13.5px;
  transition: all 0.2s ease;
}
.view-toggler button:hover { 
  color: #fff; 
  background: rgba(255, 255, 255, 0.05);
}
.view-toggler button.active { 
  background: var(--primary-grad); 
  color: white; 
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

/* KANBAN MƯỢT MÀ */
.kanban-view {
  display: none;
  grid-template-columns: repeat(4, minmax(260px, 1fr));
  gap: 16px;
  overflow-x: auto;
  min-height: 60vh;
  padding-bottom: 16px; 
}
.k-col {
  background: rgba(11, 15, 25, 0.4);
  border-radius: 16px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.03);
  display: flex; 
  flex-direction: column; 
  gap: 12px;
}
.k-col-header {
  font-weight: 800; 
  text-align: center; 
  padding: 10px; 
  border-radius: 10px;
  background: rgba(0,0,0,0.2); 
  font-size: 13px;
  letter-spacing: 0.5px;
}
.k-card {
  background: rgba(17, 24, 39, 0.85); 
  padding: 16px; 
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.04); 
  cursor: grab; 
  position: relative;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15); 
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.k-card:hover { 
  border-color: rgba(255, 255, 255, 0.12); 
  transform: translateY(-2px); 
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}
.k-card:active { 
  cursor: grabbing; 
  border-color: var(--primary); 
  transform: scale(1.02); 
  box-shadow: 0 10px 25px rgba(139, 92, 246, 0.2); 
}
.k-card .k-title { 
  font-weight: 800; 
  font-size: 14px; 
  color: #fff; 
  margin-bottom: 6px;
}
.k-card .k-info { 
  font-size: 12px; 
  color: var(--muted); 
  line-height: 1.4; 
}
.k-card .k-due { 
  font-size: 11px; 
  background: rgba(0, 0, 0, 0.35); 
  display: inline-flex; 
  align-items: center; 
  padding: 4px 8px; 
  border-radius: 6px; 
  margin-top: 8px; 
  font-weight: 600;
}

/* LỊCH LÀM VIỆC NỔI BẬT */
.calendar-view {
  display: none; 
  background: rgba(11, 15, 25, 0.4); 
  border: 1px solid var(--line);
  border-radius: 20px; 
  padding: 20px; 
  overflow-x: auto; 
  backdrop-filter: blur(10px);
}
.cal-header { 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  margin-bottom: 20px; 
  min-width: 700px; 
}
.cal-header h2 { 
  font-weight: 800; 
  color: #fff; 
  font-size: 18px;
}
.cal-grid { 
  display: grid; 
  grid-template-columns: repeat(7, minmax(100px, 1fr)); 
  gap: 8px; 
  min-width: 700px; 
}
.cal-day-name { 
  text-align: center; 
  font-weight: 800; 
  padding: 10px 0; 
  color: var(--muted); 
  background: rgba(0,0,0,0.15); 
  border-radius: 10px; 
  font-size: 12px;
}
.cal-cell { 
  min-height: 120px; 
  background: rgba(17, 24, 39, 0.4); 
  border: 1px solid rgba(255,255,255,0.02); 
  padding: 8px; 
  border-radius: 12px; 
  display: flex; 
  flex-direction: column; 
  gap: 6px; 
  transition: all 0.2s ease;
}
.cal-cell:hover { 
  background: rgba(17, 24, 39, 0.7); 
}
.cal-cell .date-num { 
  font-size: 13px; 
  font-weight: 700; 
  color: var(--muted); 
  margin-bottom: 4px; 
  padding: 2px;
  display: inline-block;
}
.cal-cell.today { 
  border-color: var(--primary); 
  background: rgba(139, 92, 246, 0.05); 
}
.cal-cell.today .date-num { 
  color: #fff; 
  background: var(--primary); 
  border-radius: 50%; 
  width: 22px; 
  height: 22px; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
}
.cal-event {
  font-size: 11px; 
  font-weight: 600; 
  padding: 4px 6px; 
  border-radius: 6px; 
  background: rgba(55, 65, 81, 0.7); 
  color: #fff;
  cursor: pointer; 
  white-space: nowrap; 
  overflow: hidden; 
  text-overflow: ellipsis; 
  transition: all 0.15s ease;
}
.cal-event:hover { 
  transform: translateX(1px); 
  filter: brightness(1.15); 
}
.cal-event.done { background: rgba(16, 185, 129, 0.15); color: #a7f3d0; text-decoration: line-through; border: 1px solid rgba(16, 185, 129, 0.25);}
.cal-event.soon { background: rgba(245, 158, 11, 0.7); }
.cal-event.overdue { background: rgba(239, 68, 68, 0.75); }

/* PAGINATION */
.pagination { 
  display: flex; 
  gap: 6px; 
  justify-content: center; 
  margin-top: 20px; 
}
.pageBtn { 
  background: rgba(17, 24, 39, 0.8); 
  padding: 8px 14px; 
  border-radius: 8px; 
  cursor: pointer; 
  font-weight: 700; 
  border: 1px solid rgba(255,255,255,0.04); 
  transition: all 0.2s ease;
  font-size: 13px;
  color: var(--muted);
}
.pageBtn:hover { 
  background: rgba(255,255,255,0.06); 
  color: #fff;
}
.pageBtn.active { 
  background: var(--primary-grad); 
  color: #fff; 
  border-color: transparent; 
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.35); 
}

/* MODAL CHUNG TỐI ƯU CAO CẤP */
.modal {
  position: fixed; 
  inset: 0; 
  background: rgba(2, 6, 23, 0.85); 
  backdrop-filter: blur(12px); 
  -webkit-backdrop-filter: blur(12px);
  display: none; 
  align-items: center; 
  justify-content: center; 
  z-index: 99999;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-content {
  background: linear-gradient(145deg, rgba(17, 24, 39, 0.95), rgba(11, 15, 25, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.08); 
  border-radius: 20px; 
  padding: 24px;
  width: 720px; 
  max-width: 95%; 
  max-height: 85vh; 
  overflow-y: auto; 
  overflow-x: hidden;
  display: flex; 
  flex-direction: column; 
  gap: 16px; 
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
  animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modalSlideUp { from { transform: translateY(20px) scale(0.98); opacity: 0; } to { transform: translateY(0) scale(1); opacity: 1; } }

.modal-content::-webkit-scrollbar { width: 4px; }
.modal-title { font-weight: 800; font-size: 16px; color: #fff; }
label { font-size: 12px; font-weight: 700; color: var(--muted); display: block; margin-bottom: 4px; margin-top: 8px;}
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 12px; border-top: 1px solid var(--line); padding-top: 16px; margin-top: 10px;}

/* TOAST MƯỢT MÀ */
.toast {
  position: fixed; 
  top: 24px; 
  right: 24px; 
  min-width: 280px; 
  max-width: 380px;
  padding: 14px 18px; 
  border-radius: 12px; 
  display: none; 
  z-index: 9999999; 
  color: #fff;
  font-weight: 600; 
  overflow: hidden; 
  backdrop-filter: blur(20px); 
  -webkit-backdrop-filter: blur(20px);
  background: rgba(11, 15, 25, 0.85); 
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 40px rgba(0,0,0,0.3); 
  animation: toastIn .3s cubic-bezier(0.16, 1, 0.3, 1);
}
.toast::after { content: ""; position: absolute; bottom: 0; left: 0; height: 3px; width: 100%; animation: progress 2.6s linear forwards; }
.toast.success::after { background: var(--success); }
.toast.error::after { background: var(--danger); }
.toast.warning::after { background: var(--warning); }
.toast.info::after { background: var(--info); }
.toast-wrap { display: flex; align-items: center; gap: 10px; font-size: 13.5px;}
.toast-icon { font-size: 20px;}
@keyframes toastIn { from { opacity: 0; transform: translateX(30px) scale(.98); } to { opacity: 1; transform: translateX(0) scale(1); } }
@keyframes progress { from { width: 100% } to { width: 0% } }

/* FIREBASE STATUS & LOGOUT */
/* Cấu hình đã được tích hợp lên Header */

/* MÀN HÌNH KHÓA KIỂU MỚI (CĂN GIỮA TUYỆT ĐỐI) */
#pwModal { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; background: rgba(2, 6, 23, 0.95); z-index: 999999; backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);}
.lock-container { 
  background: linear-gradient(145deg, rgba(17, 24, 39, 0.7), rgba(11, 15, 25, 0.9)); 
  padding: 32px; 
  border-radius: 24px; 
  text-align: center; 
  border: 1px solid rgba(139, 92, 246, 0.2); 
  box-shadow: 0 30px 60px rgba(0,0,0,0.7), inset 0 1px 10px rgba(255,255,255,0.02); 
  max-width: 400px; 
  width: 90%; 
  position: relative; 
  overflow: hidden;
  animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1); 
  display: flex; 
  flex-direction: column; 
  align-items: center; 
  justify-content: center;
}
.lock-container::before { content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%; background: radial-gradient(circle, rgba(139, 92, 246, 0.08) 0%, transparent 60%); z-index: 0; pointer-events: none; }
.lock-icon { font-size: 40px; margin-bottom: 16px; display: inline-flex; background: rgba(0,0,0,0.2); padding: 14px; border-radius: 50%; position: relative; z-index: 1; border: 1px solid rgba(255,255,255,0.04);}
.lock-container h2 { margin: 0 0 6px; font-size: 22px; font-weight: 800; color: #fff; position: relative; z-index: 1;}
.lock-container p { color: var(--muted); font-size: 13.5px; margin-bottom: 24px; position: relative; z-index: 1; font-weight: 500;}
.pin-field { 
  font-size: 28px; padding: 12px; width: 100%; max-width: 200px; text-align: center; 
  border-radius: 14px; border: 1px solid rgba(255,255,255,0.08); background: rgba(0,0,0,0.3); 
  letter-spacing: 12px; outline: none; transition: 0.3s; color: #fff; font-family: monospace; position: relative; z-index: 1;
  margin: 0 auto; display: block;
}
.pin-field:focus { border-color: var(--primary2); box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.15); background: rgba(11, 15, 25, 0.7); }
.pin-shake { animation: shake 0.4s cubic-bezier(.36,.07,.19,.97) both; border-color: #ef4444 !important; background: rgba(239, 68, 68, 0.08) !important;}
@keyframes slideUp { from { transform: translateY(30px) scale(0.97); opacity: 0; } to { transform: translateY(0) scale(1); opacity: 1; } }

/* IMAGE UPLOAD UI NÂNG CẤP */
.img-item { position: relative; width: 100%; height: auto; display: flex; justify-content: center; border-radius: 12px; overflow: hidden; background: #000; box-shadow: 0 4px 12px rgba(0,0,0,0.2);}
.img-item img { width: 100%; max-height: 400px; object-fit: contain; } 
.img-remove { position: absolute; top: 8px; right: 8px; z-index: 10; background: rgba(239, 68, 68, 0.85); width: 26px; height: 26px; border-radius: 50%; padding: 0; display: flex; align-items: center; justify-content: center; opacity: 0.8; font-size: 11px;}
.img-remove:hover { background: #ef4444; opacity: 1; transform: scale(1.05); }
.img-progress { position: absolute; bottom: 0; left: 0; height: 4px; background: var(--success); width: 0%; transition: 0.2s;}

/* GIAO DIỆN KHÁCH HÀNG NÂNG CẤP */
.customer-card-glass {
  background: linear-gradient(145deg, rgba(20, 27, 46, 0.6), rgba(11, 15, 25, 0.75));
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 18px;
  padding: 18px 20px;
  backdrop-filter: blur(12px);
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
  transition: 0.2s ease;
}
.customer-card-glass:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.3);
  border-color: rgba(124, 58, 237, 0.25);
}

/* NẮN FONT CHỮ CỦA 3 TAB HỒ SƠ / CHI TIẾT KHÁCH HÀNG / THEO DÕI ĐƠN CHẤT LƯỢNG CAO */
#customerListView h3,
#customerDetailView h2,
#customerDetailView h3,
#customerTrackingView h2,
#customerTrackingView h3 {
  font-size: 16px !important;
  font-weight: 800 !important;
  color: #ffffff !important;
  letter-spacing: 0.5px !important;
}

/* Các phụ đề dưới Header chính */
#customerTrackingView p[style*="color:var(--muted)"] {
  font-size: 12.5px !important;
}

/* Thẻ card chính của khách hàng trong danh sách */
.customer-card-glass b {
  font-size: 14px !important;
  font-weight: 700 !important;
}
.customer-card-glass span {
  font-size: 12.5px !important;
  line-height: 1.5 !important;
}
.customer-card-glass button {
  font-size: 11px !important;
  padding: 5px 10px !important;
  border-radius: 6px !important;
  font-weight: 700 !important;
}

/* View chi tiết khách hàng */
#customerDetailView label {
  font-size: 12px !important;
  font-weight: 700 !important;
  color: var(--muted) !important;
  margin-bottom: 4px !important;
  display: block !important;
}
#customerDetailView input,
#customerDetailView textarea {
  font-size: 13px !important;
  margin-bottom: 12px !important;
}
#customerDetailView .card b {
  font-size: 13.5px !important;
}
#customerDetailView .card span {
  font-size: 12.5px !important;
}
#customerDetailView table th {
  font-size: 10.5px !important;
}
#customerDetailView table td {
  font-size: 12.5px !important;
}

/* Đảm bảo cỡ chữ nhãn trạng thái trong bảng lịch sử giao dịch luôn nhỏ gọn (10.5px) và căn dòng chuẩn */
#customerDetailView table .status-badge,
#customerTrackingView table .status-badge,
#customerDetailView .status-badge,
#customerTrackingView .status-badge {
  font-size: 10.5px !important;
  font-weight: 800 !important;
  padding: 3px 8px !important;
  vertical-align: middle !important;
  line-height: 1.2 !important;
  margin: 0 !important;
}

/* View theo dõi đơn hàng */
#customerTrackingView .card {
  border-radius: 16px !important;
  padding: 18px !important;
}
#customerTrackingView table th {
  font-size: 10.5px !important;
}
#customerTrackingView table td {
  font-size: 12.5px !important;
}

/* Các nhóm class tiến độ theo dõi */
.tracking-product-title {
  font-size: 15px !important;
  font-weight: 800 !important;
  color: #ffffff !important;
}
.tracking-content-text {
  font-size: 13.5px !important;
  line-height: 1.6 !important;
  color: #e2e8f0 !important;
}
.tracking-status-value {
  font-size: 14.5px !important;
  font-weight: 800 !important;
  color: #4ade80 !important;
}
.tracking-remain-days {
  font-size: 14px !important;
  font-weight: 800 !important;
  color: #4ade80 !important;
}

/* KHỐNG CHẾ TUYỆT ĐỐI CÁC CỠ CHỮ INLINE TO BẤT THƯỜNG */
#customerDetailView [style*="font-size:18px"],
#customerDetailView [style*="font-size:18px;"],
#customerDetailView [style*="font-size: 18px"],
#customerTrackingView [style*="font-size:18px"],
#customerTrackingView [style*="font-size:18px;"] {
  font-size: 14.5px !important; /* Giảm các giá trị highlight từ 18px xuống 14.5px */
}

#customerDetailView [style*="font-size:24px"],
#customerDetailView [style*="font-size:24px;"],
#customerDetailView [style*="font-size: 24px"],
#customerTrackingView [style*="font-size:24px"],
#customerTrackingView [style*="font-size:24px;"] {
  font-size: 16px !important; /* Giảm emoji và tiêu đề to từ 24px xuống 16px */
}

#customerTrackingView [style*="font-size:20px"],
#customerTrackingView [style*="font-size:20px;"] {
  font-size: 14.5px !important; /* Giảm trạng thái to từ 20px xuống 14.5px */
}

#customerDetailView [style*="font-size:16px"],
#customerDetailView [style*="font-size:16px;"],
#customerTrackingView [style*="font-size:16px"],
#customerTrackingView [style*="font-size:16px;"] {
  font-size: 13.5px !important; /* Giảm các nhãn 16px xuống 13.5px */
}

#customerDetailView [style*="font-size:15px"],
#customerDetailView [style*="font-size:15px;"],
#customerTrackingView [style*="font-size:15px"],
#customerTrackingView [style*="font-size:15px;"] {
  font-size: 13px !important; /* Giảm 15px xuống 13px */
}

/* TRẠNG THÁI HIỂN THỊ DÒNG QUÁ HẠN / TỚI HẠN BẰNG BORDER LEFT ÁNH SÁNG */
tr.overdue td:first-child { 
  border-left: 4px solid #ef4444 !important; 
  box-shadow: inset 6px 0 10px rgba(239, 68, 68, 0.08); 
  background: rgba(239, 68, 68, 0.02); 
} 
tr.soon td:first-child { 
  border-left: 4px solid #f97316 !important; 
  box-shadow: inset 6px 0 10px rgba(249, 115, 22, 0.06); 
  background: rgba(249, 115, 22, 0.01); 
} 
tr.doing td:first-child { 
  border-left: 4px solid #fbbf24 !important; 
  box-shadow: inset 6px 0 10px rgba(251, 191, 36, 0.04);
} 
tr.done td:first-child { 
  border-left: 4px solid #3b82f6 !important; 
  box-shadow: inset 6px 0 10px rgba(59, 130, 246, 0.04);
} 
tr.delivered td:first-child { 
  border-left: 4px solid #10b981 !important; 
  box-shadow: inset 6px 0 10px rgba(16, 185, 129, 0.04);
} 

/* MÃ MÀU COLOR-CODING CHO KANBAN */
.k-card[data-product="Tranh Cát"] { border-left: 4px solid #ec4899; }
.k-card[data-product="Chữ Đám Cưới"] { border-left: 4px solid #3b82f6; }
.k-card[data-product="Bạt"] { border-left: 4px solid #f59e0b; }
.k-card[data-product="Khác"] { border-left: 4px solid #9ca3af; }

/* RÚT GỌN TEXT DÀI TRONG BẢNG */
.truncate-text {
  display: -webkit-box;
  -webkit-line-clamp: 2; 
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 250px; 
  white-space: pre-wrap;
  word-break: break-word;
}

/* NÚT ZALO NỔI (FAB) MƯỢT MÀ */
.zalo-fab {
  position: fixed; bottom: 24px; right: 24px; padding: 12px 20px; border-radius: 999px;
  background: linear-gradient(135deg, #0068ff, #005ce6); color: white !important; text-decoration: none;
  font-weight: 800; z-index: 99999; box-shadow: 0 8px 20px rgba(0, 104, 255, 0.35);
  display: flex; align-items: center; gap: 8px; transition: all 0.25s ease;
  font-size: 13.5px;
}
.zalo-fab:hover { transform: translateY(-3px) scale(1.02); box-shadow: 0 12px 25px rgba(0, 104, 255, 0.5); }

/* HIỆU ỨNG SKELETON LOADING */
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.07) 50%, rgba(255,255,255,0.03) 75%);
  background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: 8px;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.sk-text { height: 40px; margin-bottom: 12px; width: 100%; border-radius: 12px; }

/* CSS FIX RESPONSIVE MOBILE - BẢN TỐI ƯU GỌN GÀNG */
@media screen and (max-width: 768px) {
  /* 1. Header & Container */
  header { 
    padding: 10px 12px; 
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 6px;
  }
  .brand-text {
    display: none; /* Ẩn chữ trên mobile */
  }
  .header-left {
    margin-right: 4px;
  }
  .header-search-wrap {
    flex: 1 !important;
    max-width: none !important;
    margin: 0 4px !important;
    gap: 4px !important;
  }
  .header-filter-btn {
    display: flex !important;
  }
  .header-filters-group {
    display: none; /* Ẩn bộ lọc trên mobile, chỉ hiện khi active */
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: rgba(11, 15, 25, 0.96);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    padding: 10px 16px;
    border-bottom: 1px solid var(--line);
    flex-direction: row;
    gap: 8px;
    z-index: 999;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  }
  .header-filters-group.active {
    display: flex !important;
  }
  .header-filters-group select {
    flex: 1;
    max-width: none !important;
  }
  .header-right {
    margin-left: 4px;
    gap: 6px !important;
  }
  .logout-btn .logout-text {
    display: none; /* Ẩn chữ Đăng Xuất trên mobile */
  }
  .logout-btn {
    padding: 6px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 14px;
  }
  .container { padding: 12px; padding-bottom: 80px !important; max-width: 100vw; overflow-x: hidden; }

  /* GHIM BOTTOM CHO VIEW TOGGLER TRÊN MOBILE */
  .view-toggler {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    transform: none !important;
    width: 100vw !important;
    background: rgba(11, 15, 25, 0.96) !important;
    backdrop-filter: blur(24px) !important;
    -webkit-backdrop-filter: blur(24px) !important;
    border-top: 1px solid var(--line) !important;
    border-bottom: none !important;
    border-left: none !important;
    border-right: none !important;
    border-radius: 0 !important;
    padding: 12px 10px !important;
    margin: 0 !important;
    display: flex !important;
    justify-content: space-around !important;
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.4) !important;
    gap: 0 !important;
  }
  .view-toggler button {
    flex: 1;
    padding: 8px 12px !important;
    border-radius: 8px !important;
    font-size: 12px !important;
    text-align: center;
  }
  .view-toggler button.active {
    box-shadow: none !important;
  }

  /* 2. Dashboard KPIs & Charts */
  .dashboard { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .dashboard-charts { grid-template-columns: 1fr !important; }
  .card { padding: 16px 12px; border-radius: 12px; } 
  .card span { font-size: 20px; }

  /* 3. Toolbar & Tab Filter */
  .toolbar { flex-direction: column; align-items: stretch; gap: 10px; padding: 12px; }
  .toolbar > div, .toolbar select, .toolbar button { width: 100%; margin: 0; }
  .chip-scroll { 
    border-radius: 12px; 
    flex-wrap: nowrap; 
    padding: 6px; 
    margin-bottom: 16px;
    overflow-x: auto; 
    -webkit-overflow-scrolling: touch; 
  }
  .chip { padding: 6px 12px; font-size: 12.5px; }

  /* 4. FORM NHẬP LIỆU */
  .form { padding: 16px !important; border-radius: 16px !important; gap: 12px !important; }
  .form-row { flex-direction: column !important; gap: 12px !important; }
  .form-col, .form-col.wide { width: 100% !important; min-width: 100% !important; flex: none !important; }
  .form-col label { margin-bottom: 4px !important; font-size: 11.5px !important; }
  .form-row input, .form-row select, .form-row textarea { padding: 10px 14px; font-size: 13.5px; }

  /* 5. TABLE MOBILE */
  .table-wrap { border-radius: 12px; }
  table { min-width: 850px; }
  th, td { padding: 10px 8px; font-size: 13px; }
  
  /* 6. KANBAN MOBILE (HỖ TRỢ SNAP SCROLL NGANG TRƠN TRU) */
  .kanban-view { 
    flex-wrap: nowrap; 
    overflow-x: auto; 
    scroll-snap-type: x mandatory; 
    padding-bottom: 16px; 
    gap: 12px; 
  }
  #kanbanView:not([style*="display: none"]) {
    display: flex !important;
  }
  .k-col { min-width: 82vw; flex-shrink: 0; scroll-snap-align: center; border-radius: 12px; }

  /* 7. CALENDAR MOBILE */
  .calendar-view { padding: 12px; border-radius: 12px; }
  .cal-header { min-width: 100%; flex-direction: column; gap: 10px; }
  .cal-grid { min-width: 550px; gap: 4px; }
  .cal-cell { min-height: 90px; border-radius: 8px; }

  /* 8. MODAL MOBILE */
  .modal-content { 
    width: 95% !important; 
    max-width: 95% !important; 
    padding: 16px !important; 
    border-radius: 16px !important; 
    max-height: 85vh !important; 
  }
  .grid2 { grid-template-columns: 1fr !important; gap: 10px !important; }
  .modal-content .grid2 > div { width: 100% !important; padding: 0 !important; }
  .lock-container { width: 90%; padding: 24px; border-radius: 20px; }
  .pin-field { font-size: 24px; max-width: 160px; letter-spacing: 8px; }
  .toast { min-width: auto; width: 90%; right: 5%; left: 5%; top: 16px; }

  /* 9. NÚT NỔI */
  .zalo-fab { bottom: 12px; right: 12px; padding: 10px 16px; font-size: 13px;}
  .truncate-text { max-width: 200px; }
}

/* LIGHTBOX CSS */
.lightbox {
  position: fixed; inset: 0; background: rgba(2, 6, 23, 0.95);
  backdrop-filter: blur(12px); z-index: 10000000;
  display: none; align-items: center; justify-content: center;
  cursor: zoom-out; animation: fadeIn 0.2s ease;
}
.lightbox img {
  max-width: 90%; max-height: 90vh;
  border-radius: 12px; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  cursor: default; transition: transform 0.3s ease;
}
.lightbox-close {
  position: absolute; top: 20px; right: 20px;
  background: rgba(255,255,255,0.08); color: white;
  border: none; width: 44px; height: 44px; border-radius: 50%;
  font-size: 20px; cursor: pointer; display: flex;
  align-items: center; justify-content: center; transition: 0.2s;
}
.lightbox-close:hover { background: #ef4444; transform: scale(1.05); }  

/* CONTEXT MENU CSS */
.context-menu {
  position: fixed;
  z-index: 10000001;
  width: 190px;
  background: rgba(11, 15, 25, 0.95);
  backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
  display: none;
  flex-direction: column;
  padding: 4px;
  animation: modalSlideUp 0.15s ease;
}

.context-menu-item {
  padding: 8px 12px;
  color: #f3f4f6;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  border-radius: 8px;
  transition: 0.15s;
}

.context-menu-item:hover {
  background: rgba(139, 92, 246, 0.15);
  color: #c084fc;
}

.context-menu-item.delete:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

.context-menu-sep {
  height: 1px;
  background: rgba(255, 255, 255, 0.05);
  margin: 4px 0;
}

/* ẨN CỘT THAO TÁC TRÊN PC - CHỈ HIỂN THỊ TRÊN MOBILE */
@media screen and (min-width: 769px) {
  #tableView table th:last-child,
  #tableView table td:last-child,
  .action-cell {
    display: none !important;
  }
}

/* Ép các ô input không bao giờ vượt quá chiều rộng hàng cha */
.grid2 input, .grid2 select {
  max-width: 100%;
  min-width: 0; 
}

/* Tối ưu riêng cho ô Date để không bị phình trên màn hình nhỏ/laptop */
input[type="date"] {
  min-width: 0;
  width: 100%;
}

/* ==========================================================================
   RESET CSS DÀNH RIÊNG CHO BẢNG TRONG TEMPLATE BÁO GIÁ ĐỂ TRÁNH TRÀN BẢNG
   ========================================================================== */
#invoiceTemplate {
  box-sizing: border-box !important;
  width: 750px !important;
  min-width: 750px !important;
  max-width: 750px !important;
  padding: 40px !important;
  background: #ffffff !important;
}

#invoiceTemplate table {
  min-width: unset !important;
  width: 100% !important;
  border-collapse: collapse !important;
  border-spacing: 0 !important;
  table-layout: fixed !important;
  background: #ffffff !important;
}

#invoiceTemplate th, #invoiceTemplate td {
  color: #000000 !important;
  border: 1px solid #cbd5e1 !important;
  background: transparent !important;
  padding: 12px 10px !important;
  font-family: 'Plus Jakarta Sans', sans-serif !important;
  font-size: 13px !important;
  vertical-align: top !important;
  min-width: unset !important;
  box-sizing: border-box !important;
}

#invoiceTemplate th {
  font-weight: 700 !important;
  background: #f1f5f9 !important;
  text-transform: none !important;
  letter-spacing: normal !important;
  color: #000000 !important;
}

#invoiceTemplate tr {
  background: #ffffff !important;
  transform: none !important;
  border-left: none !important;
}

#invoiceTemplate tr:hover {
  background: #ffffff !important;
  transform: none !important;
}

#invoiceTemplate td#invQty {
  text-align: center !important;
  font-weight: 600 !important;
}

#invoiceTemplate td#invPrice {
  text-align: right !important;
  font-weight: 700 !important;
}

/* Bảo vệ cột cuối cùng của bảng báo giá không bị ẩn */
#invoiceTemplate table th:last-child, #invoiceTemplate td:last-child {
  display: table-cell !important;
}

/* ==========================================================
   SPLASH SCREEN DESIGN PRO
   ========================================================== */
#splashScreen {
  position: fixed;
  inset: 0;
  background: #020510;
  z-index: 99999999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.6s;
  opacity: 1;
  visibility: visible;
}

#splashScreen.fade-out {
  opacity: 0;
  visibility: hidden;
}

.splash-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.splash-logo {
  width: 90px;
  height: 90px;
  animation: splashPulse 2s infinite ease-in-out;
  filter: drop-shadow(0 0 15px rgba(139, 92, 246, 0.6));
}

.splash-logo svg {
  width: 100%;
  height: 100%;
}

.splash-title {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 1px;
  margin: 0;
  background: linear-gradient(135deg, #a78bfa, #e879f9, #38bdf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.splash-pro {
  display: inline-block;
  font-size: 13px;
  font-weight: 900;
  border: 1px solid rgba(124, 58, 237, 0.5);
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(124, 58, 237, 0.15);
  color: #a78bfa;
  margin-left: 4px;
}

.splash-subtitle {
  font-size: 13px;
  color: rgba(148, 163, 184, 0.6);
  margin: 0;
  letter-spacing: 0.5px;
}

.splash-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(139, 92, 246, 0.1);
  border-top-color: #8b5cf6;
  border-radius: 50%;
  animation: splashSpin 0.8s linear infinite;
  margin-top: 10px;
}

@keyframes splashSpin {
  to { transform: rotate(360deg); }
}

@keyframes splashPulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 15px rgba(139, 92, 246, 0.5)); }
  50% { transform: scale(1.05); filter: drop-shadow(0 0 25px rgba(236, 72, 153, 0.7)); }
}

