:root {
  --primary: #1974D3;
  --primary-dark: #00a5cf;
  --primary-deep: #00a5cf;
  --accent: #FFE686;
  --accent-gold: #FFCC98;
  --sky: #53CCEC;
  --primary-hover: #1974D3;
  --bg-color: #f1f5f9;
  --surface: #ffffff;
  --text-main: #000000;
  /* Deep blue for text */
  --text-muted: #1e81a3;
  --border: #FFCC98;
  --danger: #ef4444;
  --success: #1974D3;
  --warning: #FFE686;
  --radius-sm: 0.375rem;
  --radius-md: 0.75rem;
  --radius-lg: 1.25rem;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

  /* Spacing System */
  --space-xs: 0.25rem;
  /* 4px */
  --space-sm: 0.5rem;
  /* 8px */
  --space-md: 1rem;
  /* 16px */
  --space-lg: 1.5rem;
  /* 24px */
}

/* Custom Searchable Dropdown Styles */
.custom-dropdown-container {
  position: relative;
  width: 100%;
}

.custom-dropdown-container:focus-within {
  z-index: 100000 !important;
}

.form-group:focus-within {
  z-index: 100000 !important;
}

.custom-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background-color: #fff7d9 !important;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  z-index: 20000;
  max-height: 165px;
  overflow-y: auto;
  display: none;
}

.custom-dropdown-menu.open {
  display: block;
}

.custom-dropdown-item {
  padding: 0.45rem 0.6rem;
  cursor: pointer;
  font-size: 0.7rem;
  transition: background-color 0.2s;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  color: var(--text-main) !important;
}

.custom-dropdown-item:last-child {
  border-bottom: none;
}

.custom-dropdown-item:hover,
.custom-dropdown-item.active {
  background-color: rgba(25, 116, 211, 0.1) !important;
  font-weight: 600;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* A¢"?A¢"?A¢"? Global Layout A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"? */
html {
  font-size: 19px;
}

html,
body {
  font-family: 'Baloo Tamma 2', cursive;
  background: var(--bg-color);
  color: var(--text-main);
  height: 100vh;
  width: 100vw;
  display: flex;
  overflow: hidden;
  margin: 0;
  padding: 0;
}

.sidebar {
  width: 85px;
  min-width: 85px;
  flex-shrink: 0;
  background: #ffffff;
  padding: var(--space-lg) var(--space-sm);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  color: #334155;
  overflow: hidden;
  white-space: nowrap;
  transition: width 0.1s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: width;
  z-index: 1000;
  border-right: 1px solid var(--border);
}

.sidebar:hover {
  width: 260px;
  min-width: 260px;
  padding: var(--space-lg) var(--space-md);
}

.sidebar h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 0.5rem;
  text-align: center;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.1s;
}

.sidebar:hover h2 {
  opacity: 1;
}

.nav-link {
  padding: 0.85rem 0.75rem;
  color: #475569;
  text-decoration: none;
  border-radius: var(--radius-md);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  font-weight: 500;
  transition: width 0.1s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: width;
  border-left: 3px solid transparent;
  width: 100%;
  overflow: hidden;
}

.nav-icon {
  font-size: 1.1rem;
  min-width: 28px;
  height: 24px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  margin-right: 8px;
}

#sidebarNav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  margin: 1.5rem 0;
  padding-right: 2px;
}

/* Custom Scrollbar for Sidebar */
#sidebarNav::-webkit-scrollbar {
  width: 4px;
}

#sidebarNav::-webkit-scrollbar-track {
  background: transparent;
}

#sidebarNav::-webkit-scrollbar-thumb {
  background: #e2e8f0;
  border-radius: 10px;
}

#sidebarNav::-webkit-scrollbar-thumb:hover {
  background: #cbd5e1;
}

.nav-text {
  opacity: 0;
  font-size: 0.85rem;
  white-space: nowrap;
  transition: opacity 0.1s;
}

.sidebar:hover .nav-text {
  opacity: 1;
}

.nav-link:hover {
  background: rgba(10, 64, 234, 0.05);
  color: #0A40EA;
}

.btn-logout {
  width: 100%;
  padding: 12px;
  background: #effc00c3;
  color: #000fde9e;
  /* red-500 */
  border: 1px solid #fee2e2;
  border-radius: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  justify-content: center;
  align-items: center;
}

.btn-logout:hover {
  background: #600101;
  border-color: #7a0606;
  box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.1);
}

.nav-link.active {
  background: rgba(10, 64, 234, 0.1);
  color: #0A40EA;
  font-weight: 700;
  border-left-color: #0A40EA;
  box-shadow: inset 0 0 0 1px rgba(10, 64, 234, 0.15);
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.header {
  height: 60px;
  flex-shrink: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-lg);
}

.content-body {
  flex: 1;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

#listViewInner {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 !important;
  min-height: 0 !important;
  position: relative !important;
  padding-left: 0 !important;
  margin-left: 0 !important;
}

.operation-layout {
  display: flex !important;
  flex-direction: column !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* A¢"?A¢"?A¢"? Standard Table (all views except Operation) A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"? */
.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 0.375rem;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.2s;
}

.btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-micro {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 2px;
  font-size: 0.9rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 0.2s;
}

.btn-micro:hover {
  background: rgba(0, 0, 0, 0.05);
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-danger {
  background: var(--danger);
  color: white;
  box-shadow: var(--shadow-sm);
}

.group-nav {
  width: 250px;
  background: #f8fafc;
  border-right: 1px solid #e2e8f0;
  padding: 1.25rem 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* Card wraps the table (all views) */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  margin: var(--space-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  position: relative;
  box-shadow: var(--shadow-md);
}

.card-header {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  background: #fff;
  flex-shrink: 0;
}

.table-actions {
  display: flex;
  gap: 0.5rem;
}

/* Standard table container A¢?" allows scrolling within the card */
.table-container {
  flex: 1;
  overflow: auto;
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}

th,
td {
  padding: 0.6rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
  white-space: nowrap;
}

thead {
  position: sticky;
  top: 0;
  z-index: 100 !important;
  background: var(--primary);
}

thead th:first-child {
  border-top-left-radius: 0.5rem;
}

thead th:last-child {
  border-top-right-radius: 0.5rem;
}

tbody tr {
  --row-bg: white;
}

tbody tr:hover,
.operation-layout tbody tr:hover,
.data-table tbody tr:hover {
  --row-bg: #f1f5f9;
}

.sticky-col-0 {
  position: sticky;
  left: 0;
  z-index: 20 !important;
  background-color: var(--row-bg, #ffffff) !important;
}

.sticky-col-1 {
  position: sticky;
  left: 40px;
  z-index: 20 !important;
  background-color: var(--row-bg, #ffffff) !important;
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.05);
}

thead th.sticky-col-0,
thead th.sticky-col-1 {
  z-index: 110 !important;
  background: var(--primary) !important;
}

/* Sync-hover is now handled via --row-bg on tr:hover */

.status-group-header {
  background-color: #f8fafc !important;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--primary);
  cursor: pointer;
  user-select: none;
  border-bottom: 2px solid var(--border);
}

.status-group-header:hover {
  background-color: #f1f5f9 !important;
}

.status-group-header td {
  padding: 10px 15px !important;
}

.status-group-header .group-toggle {
  display: inline-block;
  width: 20px;
  transition: transform 0.2s;
}

.status-group-header.collapsed .group-toggle {
  transform: rotate(-90deg);
}

th {
  background: transparent !important;
  color: #ffffff;
  text-align: center !important;
  font-weight: 600;
  font-size: 0.7rem;
  letter-spacing: 0.02em;
  border: none;
  border-bottom: 2px solid var(--primary-dark);
  padding: 4px 4px;
  vertical-align: bottom;
}

.header-content {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.header-label {
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center !important;
  text-align: center !important;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #ffffff;
  margin-bottom: 4px;
  white-space: normal;
  line-height: 1.1;
}

.col-numeric {
  text-align: right !important;
  font-variant-numeric: tabular-nums;
  font-family: 'Baloo Tamma 2', monospace;
}

.col-numeric .header-label {
  justify-content: center !important;
  text-align: center !important;
}

.col-text,
.col-date {
  text-align: left !important;
}

th input,
th select {
  width: 100%;
  padding: 0.35rem 0.5rem;
  margin-top: 0.5rem;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  color: #1e293b !important;
  font-weight: 500;
  display: none;
}

th input[type="checkbox"] {
  display: inline-block !important;
  width: auto !important;
  margin: 0 auto !important;
  cursor: pointer;
}

/* Operation Layout explicitly shows them */
.operation-layout th input,
.operation-layout th select {
  display: block;
  padding: 1px 4px;
  height: 20px;
  font-size: 0.65rem;
  font-weight: 500;
  text-align: center;
  color: white;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  transition: all 0.2s ease;
  width: 100%;
  box-sizing: border-box;
}

.operation-layout th input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.operation-layout th input:hover,
.operation-layout th select:hover {
  background: rgba(255, 255, 255, 0.2);
}

.operation-layout th input:focus,
.operation-layout th select:focus {
  background: #ffffff;
  color: #1e293b;
  border-color: #ffffff;
  outline: none;
}

.operation-layout th select option {
  background: #ffffff;
  color: #1e293b;
}

.operation-layout th,
.operation-layout td {
  padding: 0.4rem 0.6rem;
  font-size: 0.82rem;
}

.operation-layout tbody tr {
  transition: background-color 0.15s;
}

.operation-layout tbody tr:hover {
  background-color: #f1f5f9;
}

th input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

tbody tr:hover {
  background: #f1f5f9;
  cursor: pointer;
}

/* A¢"?A¢"?A¢"? Status Badges A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"? */
.status {
  padding: 0.25rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid transparent;
  transition: all 0.2s;
}

.status.done {
  background: #ecfdf5;
  color: #065f46;
  border-color: #a7f3d0;
}

.status.pending {
  background: #fffbeb;
  color: #92400e;
  border-color: #fde68a;
  box-shadow: 0 0 0 1px var(--accent) inset;
}

.status.waitting,
.status.wait {
  background: #fff7ed;
  color: #c2410c;
  border-color: #fed7aa;
  box-shadow: 0 0 0 1px var(--accent-gold) inset;
}

/* A¢"?A¢"?A¢"? Center Modal / Detail View A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"? */
.center-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  width: 95%;
  max-width: 800px;
  max-height: 90vh;
  background: var(--surface);
  box-shadow: var(--shadow-xl);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
  border: 1px solid var(--border);
}

.center-modal.open {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: auto;
}

.panel-header {
  padding: var(--space-sm) var(--space-md);
  background: var(--primary-deep);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-header h3 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.panel-body {
  padding: var(--space-md);
  overflow-y: auto;
  flex: 1;
}

.panel-footer {
  padding: var(--space-sm) var(--space-md);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
  background: #f8fafc;
}

/* A¢"?A¢"?A¢"? Forms A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"? */
.form-group {
  margin-bottom: var(--space-sm);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 100%;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: var(--space-xs);
  color: var(--text-main);
}

.form-control {
  width: 100%;
  padding: 0.4rem var(--space-sm);
  border: 1px solid #cbd5e1;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  transition: border-color 0.2s;
  background-color: #f1f5f9 !important;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(10, 64, 234, 0.1);
}

.field-group {
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: var(--space-sm);
  margin-bottom: var(--space-sm);
  background: #fafafa;
}

.field-group-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--primary);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr !important;
  gap: 0.5rem;
}

/* A¢"?A¢"?A¢"? Modal backdrop A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"? */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 40;
}

.modal-backdrop.open {
  display: block;
}

/* A¢"?A¢"?A¢"? Toast A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"? */
#toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 1rem 1.5rem;
  background: #333;
  color: white;
  border-radius: 0.25rem;
  font-weight: 500;
  z-index: 9999;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s;
}

#toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* --- Premium Loading Overlay --- */
.loading {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  /* Slate-900 with transparency */
  backdrop-filter: blur(8px);
  display: none;
  /* Controlled by JS flex/none */
  align-items: center;
  justify-content: center;
  z-index: 100000;
  animation: fadeInOverlay 0.3s ease-out;
}

.loader-content {
  background: white;
  padding: 2.5rem;
  border-radius: 1.5rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  max-width: 90%;
  width: 320px;
  transform: scale(1);
  animation: scaleInLoader 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid #f1f5f9;
  border-top: 5px solid var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loading-text {
  color: #1e293b;
  font-weight: 700;
  font-size: 1.1rem;
  text-align: center;
  font-family: 'Baloo Tamma 2', sans-serif;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

@keyframes fadeInOverlay {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes scaleInLoader {
  from {
    transform: scale(0.9);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}


/* A¢"?A¢"?A¢"? Dashboard A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"? */
.dash-filter-btn {
  padding: 0.5rem 1.5rem;
  border: none;
  background: transparent;
  color: #64748b;
  font-weight: 600;
  cursor: pointer;
  border-radius: 2rem;
  transition: all 0.2s;
}

.dash-filter-btn.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.dash-tabs {
  display: flex;
  gap: 2rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

/* Stats grid: desktop always 4 columns, mobile overrides to 2×2 */
#dashStatsGrid {
  grid-template-columns: repeat(4, 1fr);
}

.dash-tab {
  padding: 0.5rem 0.5rem;
  cursor: pointer;
  font-weight: 600;
  color: #64748b;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  transition: all 0.2s;
}

.dash-tab:hover {
  color: var(--primary);
}

.dash-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.col-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Booking Cards Grid: 4 cards on desktop */
.booking-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

/* Split wrap for 16 chỗ */
.split-wrap-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

/* 16 Chỗ Sub-grid */
.booking-cards-grid-half {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.booking-card {
  container-type: inline-size;
  --size-xs: clamp(10.5px, 3cqi, 15px);
  --size-sm: clamp(13px, 4cqi, 20px);
  --size-md: clamp(15.5px, 5cqi, 24px);
  --size-lg: clamp(18px, 6cqi, 28px);
  --size-xl: clamp(20px, 7cqi, 33px);
  --size-2xl: clamp(24px, 8.5cqi, 42px);
  background: white !important;
  color: #000000 !important;
  border-radius: 0.75rem;
  padding: 0;
  border: 1.5px solid #000181;
  /* Deepest Blue */
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  /* light subtle shadow initially */
  transition: transform 0.25s, box-shadow 0.25s;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.mob-stats-shrink {
  font-size: var(--size-md);
}

.mob-amt-shrink {
  font-size: var(--size-xl);
}

.card-action-btn {
  padding: 0.2rem 0.4rem;
  font-weight: 700;
  font-size: var(--size-xs);
  text-transform: uppercase;
  white-space: nowrap;
}

.btn-icon {
  display: none;
}

.btn-text {
  display: inline;
}

.booking-card:hover {
  transform: translateY(-2px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
  border-color: var(--primary);
}

.card-time-box {
  background: linear-gradient(90deg, #000181 0%, #0A40EA 100%);
  padding: 0.45rem 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1.5px solid #000181;
  /* Ensure distinct separator */
}

.card-time-large {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
  font-size: var(--size-2xl);
  font-weight: 700;
  color: #ffffff;
  /* Changed from var(--primary-deep) for higher contrast and clarity */
  letter-spacing: normal;
}

.card-direction-tag {
  font-size: var(--size-xs);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.8);
  color: #000000;
}

.card-main-body {
  padding: 0.3rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex: 1;
  /* Pushes footer to bottom */
}

/* Standardization for rows */
.card-host-section {
  background: #e0f2fe;
  /* Light blue as requested */
  padding: 0.35rem 0.5rem;
  border-radius: 0.3rem;
  height: 2.8rem;
  /* Fixed height to accommodate 2 lines consistently */
  display: flex;
  align-items: center;
  margin-bottom: 2px;
}

.card-info-grid {
  display: grid;
  grid-template-columns: 1fr 2fr !important;
  /* Force 1:2 ratio */
  grid-template-rows: 2.8rem 2.8rem;
  gap: 0.5rem;
  border-top: 1px dashed var(--border);
  padding-top: 0.3rem;
}

.card-info-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.card-info-label {
  font-size: var(--size-xs);
  font-weight: 900;
  color: #000000;
  text-transform: uppercase;
}

.card-info-value {
  font-size: var(--size-sm);
  font-weight: 600;
  color: #000000;
  /* Allow 2 lines of text before ellipsis */
  display: -webkit-box;
  display: -moz-box;
  display: box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
  line-height: 1.2;
}

.card-highlight-row {
  background: #e0f2fe;
  /* light blue */
  padding: 0.35rem 0.5rem;
  border-radius: 0.3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-footer-stats {
  height: 2.6rem;
  background: #f9fafb;
  display: flex !important;
  align-items: center;
  border-top: 1px solid var(--border);
  padding: 0 0.75rem;
  /* Slightly more padding */
}

.card-actions-row {
  height: 2.8rem;
  padding: 0.4rem 0.2rem;
  background: #fff;
  display: flex !important;
  gap: 0.2rem;
  justify-content: flex-end;
  border-top: 1px dashed var(--border);
  flex-wrap: nowrap;
  overflow: hidden;
}

.stat-group {
  display: flex;
  gap: 0.75rem;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-label {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #000000;
}

.stat-value {
  font-size: 0.85rem;
  font-weight: 700;
  color: #000000;
}

/* --- New Phase 2 Stat Cards --- */
.stat-card-today {
  background: #aac9ce !important;
  color: #1e293b !important;
}

.stat-card-tmr {
  background: #f5cec7 !important;
  color: #1e293b !important;
}

.stat-card-done {
  background: linear-gradient(135deg, #1ca7ec 0%, var(--primary) 100%) !important;
  color: white !important;
}

.stat-card-rev {
  background: var(--primary-deep) !important;
  color: white !important;
}

.bg-pastel-4,
.bg-pastel-7,
.bg-pastel-16,
.bg-pastel-29 {
  background: white !important;
}





.badge-car {
  background: transparent;
  color: #000000;
  border: none;
  font-weight: 800;
  padding: 0;
}

/* A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?
   OPERATION VIEW A¢?" isolated, does NOT affect any other menu
   A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ?A¢ ? */

/* The listViewInner gets this class only when currentTable === 'operation' */
.operation-layout {
  display: flex;
  flex-direction: row;
  height: 100%;
}

.operation-layout.hide-sidebar .group-nav {
  display: none;
}

.operation-layout .table-container {
  flex: 1;
  min-width: 0;
}

/* ── SPLIT PANEL / RECONCILIATION LAYOUT ── */
.split-panel-layout {
  display: flex;
  gap: 1rem;
  flex: 1;
  min-height: 0;
}

.split-panel-left {
  width: 320px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow-y: auto;
  padding-bottom: 0.5rem;
  padding-right: 0.5rem;
}

.split-panel-right {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.operation-layout {
  display: flex !important;
  flex: 1 !important;
  position: relative !important;
  overflow: hidden !important;
  height: 100% !important;
  width: 100% !important;
  min-height: 0 !important;
}

/* Sidebar nav for date hierarchy A¢?" absolutely positioned on the left */
.operation-layout .group-nav {
  position: absolute !important;
  top: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  width: 200px !important;
  display: flex !important;
  flex-direction: column !important;
  background: #f8fafc !important;
  border-right: 1px solid var(--border) !important;
  padding: 8px !important;
  overflow-y: auto !important;
}

/* Table container for operation - fills the space to the right of the group-nav */
.operation-layout .table-container {
  position: absolute !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  overflow: auto !important;
  background: var(--surface) !important;
}

/* Card inside operation fills the container */
.operation-layout .card {
  margin: 0 !important;
  border-radius: 0 !important;
  border: none !important;
  height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
}

/* Operation table layout */
.operation-layout table {
  table-layout: auto;
  min-width: 100%;
}

.operation-layout th {
  white-space: normal;
  line-height: 1.2;
  vertical-align: bottom;
  padding: 0.6rem 0.5rem;
  min-width: max-content;
}

.operation-layout td {
  padding: 0.4rem 0.75rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 350px;
  vertical-align: middle;
}

.operation-layout tbody tr {
  min-height: 36px;
}

/* Sidebar date items */
.group-nav-item {
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: 4px;
  font-size: 0.85rem;
  color: #475569;
  transition: all 0.2s ease;
  white-space: normal;
  word-break: break-word;
  line-height: 1.4;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.group-nav-item:hover {
  background: rgba(15, 23, 42, 0.05);
  /* very light slate */
  color: #0f172a;
}

.group-nav-item.active {
  background: rgba(10, 64, 234, 0.08);
  /* light primary */
  color: var(--primary);
  font-weight: 700;
  box-shadow: inset 3px 0 0 var(--primary);
}

#groupNav::-webkit-scrollbar {
  width: 5px;
}

#groupNav::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}

/* Compact action buttons in operation */
.operation-layout .col-action .btn {
  padding: 2px 6px !important;
  font-size: 0.7rem !important;
  margin: 1px !important;
}

/* Status selection boxes */
.status-box {
  flex: 1;
  cursor: pointer;
  padding: 2rem;
  border-radius: 1rem;
  text-align: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 2px solid transparent;
}

.status-box:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.status-box-ok {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.status-box-ok:hover {
  background: #dcfce7;
  border-color: var(--success);
}

.status-box-no {
  border-color: #fecaca;
  background: #fef2f2;
}

.status-box-no:hover {
  background: #fee2e2;
  border-color: var(--danger);
}

/* A¢"?A¢"?A¢"? Side Detail Panel (Right Sidebar) A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"?A¢"? */
.side-detail-panel {
  position: fixed;
  top: 0;
  right: -650px;
  /* Hidden by default + padding for shadow */
  width: 600px;
  height: 100vh;
  background: #ffffff;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
  z-index: 10002;
  transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  border-left: 5px solid var(--accent);
  overflow: hidden;
}

.side-detail-panel.open {
  right: 0;
}

.side-detail-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 10001;
  display: none;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.3s forwards;
}

.side-detail-backdrop.open {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* ═══════════════════════════════════════════════════════════
   MOBILE RESPONSIVE — Operation & Pending Dashboard
   Breakpoint: ≤ 768px (tablet / phone)
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 768px) {

  /* ── 1. Global Layout ── */
  html {
    font-size: 16px;
  }

  html,
  body {
    overflow: hidden;
    height: 100vh;
  }

  /* Sidebar slides off-screen; toggled via JS adding .mobile-open */
  .sidebar {
    position: fixed !important;
    left: -300px !important;
    top: 0 !important;
    width: 260px !important;
    min-width: 260px !important;
    height: 100dvh !important;
    z-index: 1001 !important;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15) !important;
    padding: 1rem !important;
  }

  .sidebar.mobile-open {
    left: 0 !important;
  }

  /* Hamburger button */
  #mobileMenuBtn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--primary) !important;
    color: white !important;
    border-radius: 10px !important;
    font-size: 1.2rem !important;
  }

  /* Sidebar text visible when drawer is open */
  .sidebar .nav-text {
    opacity: 1 !important;
  }

  .sidebar h2 {
    opacity: 1 !important;
  }

  /* Header */
  .header {
    padding: 0 0.75rem;
    height: 48px;
  }

  .header h1 {
    font-size: 0.85rem !important;
  }

  .header .user-info {
    font-size: 0.7rem !important;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .header #userAvatarImg {
    width: 26px !important;
    height: 26px !important;
  }

  /* ── 2. Pending Dashboard top controls: stack vertically ── */
  #pendingDashboardContainer {
    padding: 0.75rem !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  #pendingDashboardContainer>div:first-child {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.6rem !important;
    margin-bottom: 1rem !important;
  }

  #pendingDashboardContainer h2 {
    font-size: 1.3rem !important;
  }

  /* Search + filter pills side-by-side */
  #pendingDashboardContainer>div:first-child>div {
    flex-direction: row !important;
    gap: 0.5rem !important;
    flex-wrap: nowrap !important;
  }

  #dashSearch {
    width: 100% !important;
    font-size: 0.82rem !important;
    padding: 0.45rem 0.85rem !important;
  }

  .date-filters-dash {
    padding: 3px !important;
  }

  .dash-filter-btn {
    padding: 0.35rem 0.7rem !important;
    font-size: 0.76rem !important;
  }

  /* ── 3. Stats: 2 × 2 grid ── */
  #dashStatsGrid {
    grid-template-columns: 1fr 1fr !important;
    gap: 0.6rem !important;
    margin-bottom: 1rem !important;
  }

  .stat-card-today,
  .stat-card-tmr,
  .stat-card-done,
  .stat-card-rev {
    padding: 0.85rem !important;
    min-height: 80px !important;
    border-radius: 0.85rem !important;
  }

  /* Smaller label text */
  .stat-card-today>div:first-child,
  .stat-card-tmr>div:first-child,
  .stat-card-done>div:first-child,
  .stat-card-rev>div:first-child {
    font-size: 0.62rem !important;
    letter-spacing: 0.02em !important;
  }

  #statTodayCount,
  #statTmrCount {
    font-size: 1.55rem !important;
  }

  #statTotalPax {
    font-size: 1.05rem !important;
  }

  #statTotalRev {
    font-size: 0.9rem !important;
  }

  /* Hide decorative emoji icons */
  .stat-card-today>div:last-child,
  .stat-card-tmr>div:last-child,
  .stat-card-done>div:last-child,
  .stat-card-rev>div:last-child {
    display: none !important;
  }

  /* ── 4. Direction Tabs: horizontal scroll ── */
  .dash-tabs {
    gap: 0 !important;
    margin-bottom: 0.75rem !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-shrink: 0;
    padding-bottom: 2px;
  }

  .dash-tabs::-webkit-scrollbar {
    display: none;
  }

  .dash-tab {
    white-space: nowrap !important;
    padding: 0.45rem 0.9rem !important;
    font-size: 0.8rem !important;
    flex-shrink: 0;
  }

  /* ── 5. Booking Cards: compact ── */
  .booking-cards-grid,
  .booking-cards-grid-half {
    grid-template-columns: 1fr 1fr !important;
    gap: 0.55rem !important;
  }

  .split-wrap-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  .booking-card {
    border-radius: 0.65rem !important;
    --size-xs: 10px;
    --size-sm: 12px;
    --size-md: 14px;
    --size-lg: 16px;
    --size-xl: 18px;
    --size-2xl: 20px;
  }

  /* Shrink stat text on very small screens to avoid overlaps */
  .mob-stats-shrink {
    font-size: 0.7rem !important;
    padding: 0 !important;
  }

  .mob-amt-shrink {
    font-size: 0.8rem !important;
    padding: 0 !important;
  }

  .card-footer-stats {
    gap: 0.25rem;
  }

  .card-time-box {
    padding: 0.3rem 0.75rem !important;
  }

  .card-time-large {
    font-size: 1.25rem !important;
  }

  /* Action Buttons: Text hidden, Icon shown on mobile */
  .btn-text {
    display: none !important;
  }

  .btn-icon {
    display: flex !important;
  }

  .card-action-btn {
    width: 32px !important;
    height: 32px !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  /* ── 6. RESPONSIVE TABLES & DATA VIEWS ── */

  /* Unlock the main window scroll so sections can flow naturally */
  .main-content {
    overflow-y: auto !important;
    overflow-x: hidden !important;
  }

  /* Make wrapper sections natively scrollable on mobile (no frozen flex heights) */
  section[id$="Container"] {
    overflow-y: visible !important;
    height: auto !important;
    min-height: auto !important;
    flex-direction: column !important;
    padding: 0.5rem !important;
  }

  .operation-layout,
  .split-panel-layout {
    flex-direction: column !important;
    height: auto !important;
    /* Stack columns vertically */
    overflow: visible !important;
    gap: 0.2rem !important;
    /* Extremely tight gap */
  }

  /* ── AppSheet Mobile Tabs Logic ── */
  .mobile-view-tabs {
    display: none;
    /* Hidden by default on mobile, unless .has-mobile-tabs */
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    width: 100%;
    position: sticky;
    top: 50px;
    /* Below header */
    z-index: 100;
    background: #eef2f6;
    /* Subtle panel */
    padding: 0.25rem;
    border-radius: 10px;
  }

  .has-mobile-tabs .mobile-view-tabs {
    display: flex !important;
  }

  .mobile-view-tabs button {
    flex: 1;
    padding: 0.5rem;
    border: none;
    background: transparent;
    color: #475569;
    font-weight: 700;
    border-radius: 6px;
    cursor: pointer;
    text-align: center;
    font-size: 0.8rem;
    transition: all 0.2s;
  }

  .mobile-view-tabs button.active {
    background: #fff;
    color: var(--primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  }

  /* Fix Booking Data Group Nav (Only when it IS visible) */
  .operation-layout .group-nav {
    position: relative !important;
    transform: none !important;
    width: 100% !important;
    max-width: 100% !important;
    border-right: none !important;
    border-bottom: 2px solid var(--border) !important;
    height: auto !important;
    overflow-y: visible !important;
    margin-bottom: 0.5rem !important;
    box-shadow: none !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: 0.25rem !important;
    padding: 0.25rem 0 !important;
  }

  .operation-layout .table-container {
    position: relative !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    flex: 1 !important;
  }

  .operation-layout .group-nav .group-nav-item {
    flex: 0 0 auto !important;
    width: auto !important;
    margin-bottom: 0 !important;
    padding: 6px 10px !important;
    border-radius: 6px !important;
    background: #f8fafc !important;
    border: 1px solid var(--border) !important;
  }

  .operation-layout .group-nav .group-nav-item.active {
    background: #eff6ff !important;
    border-color: var(--primary) !important;
  }

  .split-panel-left {
    width: 100% !important;
    padding-right: 0 !important;
    flex-shrink: 0 !important;
    overflow-y: visible !important;
    gap: 0.2rem !important;
  }

  .split-panel-right {
    padding-right: 0 !important;
    overflow-y: visible !important;
    gap: 0.2rem !important;
  }

  /* Table horizontal scrolling constraint */
  .table-container {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    /* Smooth scroll on iOS */
    padding-bottom: 0.2rem;
    /* Room for scrollbar */
    width: 100%;
    margin-bottom: 1rem;
  }

  /* Layout compactness */
  .card {
    padding: 0.4rem !important;
    gap: 0.2rem !important;
    margin-bottom: 0.2rem !important;
  }

  .card-header {
    padding-bottom: 0.2rem !important;
    margin-bottom: 0.2rem !important;
  }

  .form-group {
    margin-bottom: 0.15rem !important;
  }

  /* Scale down table typography */
  .data-table th,
  .data-table td {
    white-space: nowrap !important;
    /* Prevent column squish */
    font-size: 0.72rem !important;
    padding: 0.35rem 0.4rem !important;
  }

  .card-header h4,
  h2 {
    font-size: 1.1rem !important;
  }

  .form-group label {
    font-size: 0.65rem !important;
  }

  .form-control {
    font-size: 0.8rem !important;
    padding: 0.3rem !important;
  }

  input.form-control,
  select.form-control {
    display: block !important;
  }

  textarea.form-control {
    display: block !important;
    height: auto !important;
    min-height: 60px !important;
  }

  /* Scale down the top stats block in reconciliations */
  #nxTotalCongNo,
  #phTotalSum,
  #peTotalSum {
    font-size: 1.25rem !important;
  }

  .card-direction-tag {
    font-size: 0.62rem !important;
    padding: 2px 5px !important;
  }

  .card-main-body {
    padding: 0.2rem 0.4rem !important;
    gap: 0.15rem !important;
  }

  .card-host-section {
    height: auto !important;
    min-height: 1.8rem !important;
    padding: 0.2rem 0.4rem !important;
    font-size: 0.78rem !important;
    margin-bottom: 1px !important;
  }

  .card-info-grid {
    grid-template-rows: auto auto !important;
    gap: 0.25rem !important;
    padding-top: 0.15rem !important;
  }

  .card-info-label {
    font-size: 0.58rem !important;
  }

  .card-info-value {
    font-size: 0.75rem !important;
    -webkit-line-clamp: 1 !important;
    line-clamp: 1 !important;
  }

  .card-highlight-row {
    padding: 0.2rem 0.4rem !important;
    font-size: 0.76rem !important;
  }

  .card-footer-stats {
    height: 2rem !important;
    padding: 0 0.45rem !important;
  }

  .stat-label {
    font-size: 0.53rem !important;
  }

  .stat-value {
    font-size: 0.72rem !important;
  }

  .card-actions-row {
    height: auto !important;
    min-height: 2.2rem !important;
    padding: 0.25rem 0.15rem !important;
  }

  .card-actions-row .btn {
    padding: 3px 7px !important;
    font-size: 0.7rem !important;
  }

  /* ── 6. Side Detail Panel: full-screen slide-up ── */
  .side-detail-panel {
    width: 100vw !important;
    right: -100vw !important;
    border-left: none !important;
    border-top: 4px solid var(--accent) !important;
    border-radius: 1.25rem 1.25rem 0 0 !important;
    top: auto !important;
    bottom: 0 !important;
    height: 90dvh !important;
    transform: translateY(100%) !important;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
    right: 0 !important;
  }

  .side-detail-panel.open {
    transform: translateY(0) !important;
    right: 0 !important;
  }

  /* ── 7. Center modals → bottom sheet ── */
  .center-modal {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 92dvh !important;
    top: auto !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    transform: translateY(100%) scale(1) !important;
    border-radius: 1.25rem 1.25rem 0 0 !important;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
  }

  .center-modal.open {
    transform: translateY(0) scale(1) !important;
  }



  /* ── 9. Forms: 2 columns on mobile as requested ── */
  .grid-2 {
    grid-template-columns: 1fr 1fr !important;
  }

  .field-group-title {
    font-size: 0.9rem !important;
    margin-bottom: 0.5rem !important;
    padding-bottom: 0.25rem !important;
  }

  /* ── 10. Override Logic for Mobile Tabs (Stands at the very end to win specificity) ── */
  .mobile-mode-filter .split-panel-right {
    display: none !important;
  }

  .mobile-mode-data .split-panel-left {
    display: none !important;
  }

  .mobile-mode-filter .table-container {
    display: none !important;
  }

  .mobile-mode-data .group-nav {
    display: none !important;
  }

  .mobile-mode-data #loadMoreContainer {
    display: block !important;
  }

  .mobile-mode-filter #loadMoreContainer {
    display: none !important;
  }
}

/* ── Ultra small: iPhone SE / ≤ 390px ── */
@media (max-width: 390px) {

  html {
    font-size: 14px;
  }

  /* Stats: horizontal scroll strip on very small screens */
  #dashStatsGrid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* ── Mobile Layout for Payment Host Reconciliation ── */
.ph-mobile-dashboard {
  display: none;
}

.ph-mobile-table-header {
  display: none;
}

.ph-mobile-action-bar {
  display: none;
}

@media (max-width: 768px) {
  .desktop-only-inline {
    display: none !important;
  }

  .mobile-reconcile-view {
    padding: 0 !important;
    background: #f8fafc !important;
  }

  .ph-desktop-header {
    display: none !important;
  }

  .ph-mobile-dashboard {
    display: flex;
    flex-direction: column;
    background: var(--primary);
    color: white;
    padding: 1rem 0.75rem 0.8rem 0.75rem;
    border-bottom-left-radius: 1rem;
    border-bottom-right-radius: 1rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    z-index: 10;
  }

  .ph-mobile-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
  }

  .ph-mobile-dates {
    font-size: 0.85rem;
    opacity: 0.9;
    margin-top: 0.2rem;
  }

  .ph-mobile-filter-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 0.5rem;
    color: white;
    padding: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
  }

  .ph-mobile-statsRow {
    display: flex;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 1rem;
    padding: 0.75rem;
  }

  .ph-mstat {
    flex: 1;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .ph-mstat-mid {
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    margin: 0 0.5rem;
  }

  .ph-mstat-val {
    font-size: 1rem;
    font-weight: 800;
    margin-bottom: 0.1rem;
  }

  .ph-mstat-lbl {
    font-size: 0.75rem;
    opacity: 0.9;
  }

  .mobile-reconcile-view .split-panel-layout {
    flex-direction: column !important;
    background: transparent !important;
    padding: 0 0.5rem 80px 0.5rem !important;
    /* padding bottom spacer for action bar */
  }

  .mobile-reconcile-view.mobile-mode-filter .split-panel-right {
    display: block !important;
    /* Keep table visible underneath */
  }

  .mobile-reconcile-view .split-panel-left {
    display: none !important;
    /* Hidden normally */
  }

  .mobile-reconcile-view.mobile-mode-filter .split-panel-left {
    display: block !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    z-index: 2001;
    padding: 1.5rem;
    border-top-left-radius: 1.5rem;
    border-top-right-radius: 1.5rem;
    box-shadow: 0 -5px 25px rgba(0, 0, 0, 0.2);
    max-height: 80vh;
    overflow-y: auto;
  }

  .mobile-reconcile-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    backdrop-filter: blur(2px);
  }

  .mobile-reconcile-view.mobile-mode-filter .mobile-reconcile-backdrop {
    display: block !important;
  }

  .mobile-reconcile-view .split-panel-right {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
  }

  .ph-mobile-table-header {
    display: flex;
    justify-content: space-between;
    padding: 0.2rem 0.5rem 0.2rem 0.5rem;
    align-items: center;
  }

  /* Convert Table to Cards */
  .mobile-reconcile-view table.data-table,
  .mobile-reconcile-view table.data-table tbody {
    display: block;
    width: 100%;
    border: none;
    background: transparent;
  }

  .mobile-reconcile-view table.data-table thead {
    display: none !important;
    /* Hide native table head */
  }



  /* Sticky Bottom Form Action Bar */
  .ph-mobile-action-bar {
    position: fixed;
    bottom: 0px;
    left: 0;
    right: 0;
    background: white;
    border-top-left-radius: 1rem;
    border-top-right-radius: 1rem;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.1);
    padding: 0.75rem 1rem 0.5rem 1rem;
    display: flex !important;
    flex-direction: column;
    gap: 0.4rem;
    z-index: 1000;
  }

  .ph-mobile-action-bar-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
    color: var(--primary);
    font-weight: 700;
  }

  .ph-mobile-action-bar-btn {
    width: 100%;
    background: #fde047;
    color: #0f172a;
    padding: 0.7rem;
    font-family: inherit;
    font-weight: 800;
    font-size: 1rem;
    border: none;
    border-radius: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    cursor: pointer;
  }

  .ph-mobile-action-bar-btn:active {
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
  }
}


/* Hide Mobile Action Bar on Desktop strictly */
@media (min-width: 769px) {
  .ph-mobile-action-bar {
    display: none !important;
  }
}


/* Cancel Status Color */
.status.cancel,
.status.hủy,
.status.huy,
.status.cancelled {
  background: #fee2e2 !important;
  color: #dc2626 !important;
  border-color: #fca5a5 !important;
}

/* Nhaxe Total Layout */
.nhaxe-total-container {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 15px !important;
  align-items: center !important;
}

.nhaxe-total-box {
  flex: 1 !important;
  min-width: 250px !important;
}

@media (max-width: 768px) {
  .nhaxe-total-container {
    flex-direction: column !important;
  }
}


.op-month-btn {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.2s;
}

.op-month-btn.active {
  background: rgba(12, 30, 76, 0.1);
  color: #0c1e4c;
  border-color: #0c1e4c;
}

.op-status-tab {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 0.9rem;
  font-weight: 700;
  color: #64748b;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.2s;
}

.op-status-tab.active {
  background: #0c1e4c;
  color: white;
  border-color: #0c1e4c;
}


/* Hotfix 1: Hide on Desktop */
.hide-on-desktop {
  display: none !important;
}

@media (max-width: 768px) {

  th.hide-on-desktop,
  td.hide-on-desktop {
    display: table-cell !important;
  }

  span.hide-on-desktop,
  div.hide-on-desktop {
    display: inline-flex !important;
  }

  /* Hotfix 2: Wrap Left Panel on Mobile */
  .split-panel-layout {
    flex-direction: column !important;
  }

  .split-panel-left {
    width: 100% !important;
    max-width: 100% !important;
    position: relative !important;
    height: auto !important;
    display: flex !important;
    flex-direction: column !important;
    border-right: none !important;
    box-shadow: none !important;
  }

  /* Show the desktop elements on mobile */
  .ph-desktop-only {
    display: block !important;
  }
}

/* Hotfix 3: Nhaxe Responsive Total Wrapper */
.nx-desktop-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: stretch;
  width: 100%;
  margin-bottom: 1rem;
}

.nx-desktop-filter-row>div {
  flex: 1;
  min-width: 300px;
}

.nx-total-box {
  background: var(--bg-card);
  padding: 1rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
}


/* Fix split-panel-left overflow so totals text is never cut off */
@media (min-width: 769px) {
  .split-panel-left {
    overflow-y: auto !important;
    max-height: 100% !important;
  }
}


/* Responsiveness for Card Group Grid in Bookings Desktop View */
@media (min-width: 769px) {
  .bookings-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .bookings-grid {
    grid-template-columns: 1fr;
  }
}



/* Sticky Column Styles - ensure no gap */
.sticky-col-0 {
  position: sticky !important;
  left: 0;
  z-index: 20;
  background-color: var(--row-bg, #ffffff) !important;
}

.sticky-col-1 {
  position: sticky !important;
  left: 40px;
  z-index: 20;
  background-color: var(--row-bg, #ffffff) !important;
  box-shadow: 2px 0 4px -1px rgba(0, 0, 0, 0.1);
}

/* Sticky Header Columns synchronization */
thead th.sticky-col-0 {
  position: sticky !important;
  left: 0;
  top: 0;
  z-index: 110 !important;
  background: var(--primary) !important;
  color: #ffffff !important;
}

thead th.sticky-col-1 {
  position: sticky !important;
  left: 40px;
  top: 0;
  z-index: 110 !important;
  background: var(--primary) !important;
  color: #ffffff !important;
  box-shadow: 2px 0 4px -1px rgba(0, 0, 0, 0.15);
}

/* Strict Mobile Card Width Constraints */
.recon-mobile-card {
  width: 92vw !important;
  max-width: 92vw !important;
  margin: 0.5rem auto !important;
  border-radius: 0.6rem !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08) !important;
  border: 1px solid var(--border) !important;
  box-sizing: border-box !important;
}

/* Hotfixes for hiding elements globally */
#pendingDashboardContainer h2,
#pendingNhaxeContainer h2,
#paymentHostContainer h2,
#paymentEmployeeContainer h2,
#paymentBangdonContainer h2,
#nhaxeReconciliationContainer h2,
#hostInvoiceContainer h2,
#nhaxeReconciliationHistoryContainer h2,
#paymentBangdonHistoryContainer h2,
#nguoithuInvoiceContainer h2,
#logTransferContainer h2,
#listViewTitle,
#groupNav {
  display: none !important;
}

/* Prevent menu clipping */
.card,
#listViewContainer,
#listViewInner {
  overflow: visible !important;
}

.table-container {
  position: relative !important;
  min-height: 0 !important;
}

/* Elegant Desktop Filters */
.desktop-filter-select {
  background: #f0f7ff !important;
  border: 1px solid #bfdbfe !important;
  color: #1e3a8a !important;
  font-size: 0.75rem !important;
  font-weight: 600 !important;
  border-radius: 8px !important;
  padding: 4px 8px 4px 28px !important;
  height: 32px !important;
  width: auto !important;
  min-width: 110px;
  max-width: 180px;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%231e3a8a' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 8px center !important;
}

.desktop-filter-wrapper svg {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  stroke: #1e3a8a;
}

/* Header reduction */
.header h1 {
  font-size: 0.85rem !important;
  /* Approx 2/3 of 1.25rem */
  font-weight: 600 !important;
}

/* Unified Pagination Footer */
.unified-footer {
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-top: 1px solid #e2e8f0;
  padding: 0.6rem 1.5rem;
  display: flex !important;
  justify-content: space-between;
  align-items: center;
  z-index: 1000;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
  font-size: 0.8rem;
}

.unified-footer-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Density spacing variables */
:root {
  --density-row-padding: 0.6rem;
  --density-font-size: 0.85rem;
}

:root[data-density='compact'] {
  --density-row-padding: 0.2rem 0.5rem;
  --density-font-size: 0.8rem;
}

:root[data-density='normal'] {
  --density-row-padding: 0.6rem 0.5rem;
  --density-font-size: 0.85rem;
}

:root[data-density='relaxed'] {
  --density-row-padding: 1.1rem 0.5rem;
  --density-font-size: 0.95rem;
}

/* Hover states for Table */
.data-table tbody tr,
.operation-layout tbody tr {
  transition: background-color 0.15s ease;
}

.data-table tbody tr:hover,
.operation-layout tbody tr:hover {
  background-color: rgba(0, 0, 0, 0.035) !important;
}

.data-table td,
.data-table th,
.operation-layout td,
.operation-layout th {
  padding: var(--density-row-padding) !important;
  font-size: var(--density-font-size) !important;
}

.operation-layout th {
  padding-top: 0.25rem !important;
  padding-bottom: 0.25rem !important;
}

/* Search highlighting */
.search-highlight {
  background-color: #fef08a;
  color: #854d0e;
  padding: 0 2px;
  border-radius: 2px;
  font-weight: 600;
}

/* Global Slim Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
  background-color: #94a3b8;
}