/* ========= WEBSITE SHELL ========= */
:root {
  --hv-orange: #ff5722;
  --hv-orange-dark: #e64a19;
  --hv-bg: #f3f4f7;
  --hv-ink: #1f2937;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--hv-bg);
  color: var(--hv-ink);
  font-family: "Segoe UI", Arial, sans-serif;
}

#login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at top left, rgba(255, 87, 34, 0.18), transparent 36%),
    radial-gradient(circle at bottom right, rgba(102, 126, 234, 0.16), transparent 32%),
    #111827;
}

#login-screen[hidden],
#app[hidden],
.app-view[hidden] {
  display: none !important;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 20px;
  padding: 36px 32px 28px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
  text-align: center;
}

.login-badge {
  width: 64px;
  height: 64px;
  margin: 0 auto 12px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #ff5722 0%, #e64a19 100%);
  color: #fff;
}

.login-card h1 {
  margin: 0 0 8px;
  font-size: 28px;
}

.login-card p {
  margin: 0 0 22px;
  color: #6b7280;
  line-height: 1.5;
}

.login-card label {
  display: block;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: #374151;
}

.login-card form {
  text-align: left;
}

.login-card input,
#login-btn {
  width: 100%;
  border-radius: 12px;
  font-size: 15px;
}

.login-card input {
  padding: 12px 14px;
  border: 2px solid #e5e7eb;
  background: #fafafa;
  margin-bottom: 14px;
}

.login-card input:focus {
  outline: none;
  border-color: #ff5722;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(255, 87, 34, 0.12);
}

#login-error {
  margin: -4px 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #ffebee;
  color: #c62828;
  font-size: 13px;
  font-weight: 600;
}

#login-btn {
  border: none;
  padding: 13px 16px;
  background: linear-gradient(135deg, #ff5722 0%, #e64a19 100%);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

#login-btn:disabled {
  opacity: 0.7;
  cursor: wait;
  transform: none;
  box-shadow: none;
}

#login-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(255, 87, 34, 0.35);
}

.login-card small {
  display: block;
  margin-top: 16px;
  color: #9ca3af;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid #e6e8ee;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8), 0 8px 24px rgba(15, 23, 42, 0.04);
}

.app-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  padding: 0 18px;
  gap: 12px;
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.app-logo {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #ff7043 0%, #e64a19 100%);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.app-logo .hv-icon,
.login-badge .hv-icon {
  width: 22px;
  height: 22px;
}

.login-badge .hv-icon {
  width: 34px;
  height: 34px;
}

.app-brand-text {
  min-width: 0;
}

.app-brand strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: #0f172a;
}

.app-branch {
  display: block;
  margin-top: 2px;
  color: #ea580c;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

.app-session {
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-session-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 4px 8px 4px 4px;
  border: 1px solid #eef0f4;
  border-radius: 999px;
  background: #f8fafc;
}

.app-session-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff7ed;
  color: #c2410c;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.app-session-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding-right: 6px;
}

.app-session-copy span {
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.15;
}

.app-session-copy small {
  color: #94a3b8;
  font-size: 10px;
  font-weight: 500;
}

.app-menu {
  position: relative;
}

.menu-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  color: #0f172a;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.menu-btn:hover,
.menu-btn[aria-expanded="true"] {
  border-color: #fdba74;
  background: #fff7ed;
  color: #c2410c;
}

.menu-btn-ico,
.menu-item-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.app-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 248px;
  padding: 8px;
  background: #fff;
  border: 1px solid #e8eaef;
  border-radius: 14px;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.16);
  z-index: 60;
}

.app-menu-panel[hidden] {
  display: none !important;
}

.menu-heading {
  margin: 2px 8px 6px;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #334155;
  font-size: 13.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.menu-item:hover {
  background: #f8fafc;
}

.menu-item.active {
  background: #fff7ed;
  color: #c2410c;
}

.menu-item-danger {
  color: #be123c;
}

.menu-item-danger:hover {
  background: #fff1f2;
}

.menu-sep {
  height: 1px;
  margin: 6px 8px;
  background: #f1f5f9;
}

.hv-icon {
  display: inline-block;
  vertical-align: -0.2em;
  flex-shrink: 0;
}

.hv-dialog-icon {
  display: flex;
  justify-content: center;
  margin: 0 auto 14px;
  color: inherit;
}

.hanvot-header h3 .hv-icon,
#hanvot-close .hv-icon {
  color: #fff;
}

#hanvot-close,
#hanvot-data-close,
#hanvot-stats-close,
.hanvot-cell-popup-close,
.hanvot-remove-single-img {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

button:disabled .hv-icon {
  animation: hanvot-spin 0.8s linear infinite;
}

.hanvot-field label,
.hanvot-header h3,
.hanvot-stats-section h4,
.hanvot-stats-filter label {
  display: flex;
  align-items: center;
  gap: 6px;
}

.stat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #c2410c;
}

.hanvot-btn-pickup svg,
.hanvot-btn-edit svg,
.hanvot-btn-save-row svg,
.hanvot-btn-cancel-row svg,
.menu-btn svg,
.menu-item svg {
  pointer-events: none;
}

.app-main {
  padding: 20px 16px 40px;
}

#app #hanvot-panel,
#app #hanvot-data-panel,
#app #hanvot-stats-panel {
  position: relative;
  top: auto;
  left: auto;
  transform: none;
  display: block;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  max-height: none;
  z-index: 1;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.08);
}

#app #hanvot-data-panel,
#app #hanvot-stats-panel {
  max-width: 1600px;
}

#app #hanvot-stats-panel {
  height: auto;
}

#app .hanvot-body,
#app .hanvot-data-body,
#app .hanvot-stats-body {
  max-height: none;
}

@media (max-width: 900px) {
  .app-header-inner {
    padding: 0 12px;
    min-height: 52px;
  }

  .app-branch {
    max-width: 150px;
  }

  .app-session-copy,
  .menu-btn-text {
    display: none;
  }

  .menu-btn {
    width: 36px;
    padding: 0;
    justify-content: center;
  }

  #hanvot-panel .hanvot-grid,
  .hanvot-actions,
  .hanvot-stats-cards {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 480px) {
  .app-brand strong {
    font-size: 13px;
  }
}

/* ========= MENU BUTTON STYLES ========= */
#hanvot-menu-item {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#hanvot-menu-item .hanvot-menu-btn {
  display: block;
  padding: 10px 15px;
  color: #fff !important;
  text-decoration: none;
  transition: background 0.2s;
  background: transparent !important;
}

#hanvot-menu-item .hanvot-menu-btn:hover {
  background: rgba(255, 255, 255, 0.1) !important;
}

#hanvot-menu-item .menu-item-title {
  font-weight: 600;
}

/* ========= PANEL STYLES ========= */
#hanvot-panel {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: #ffffff;
  border: none;
  border-radius: 16px;
  width: 580px;
  max-width: 95vw;
  max-height: 90vh;
  z-index: 2147483646;
  display: none;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.2);
  font-family: 'Segoe UI', Arial, sans-serif;
  overflow: hidden;
}

/* ========= HEADER ========= */
.hanvot-header {
  background: linear-gradient(135deg, #ff5722 0%, #e64a19 100%);
  color: #fff;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hanvot-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

#hanvot-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #fff;
  font-size: 22px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

#hanvot-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

/* ========= BODY ========= */
.hanvot-body {
  padding: 20px;
  max-height: calc(90vh - 70px);
  overflow-y: auto;
}

/* ========= GRID LAYOUT ========= */
.hanvot-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.hanvot-col-full {
  grid-column: 1 / -1;
}

/* ========= FORM FIELDS ========= */
.hanvot-field {
  margin-bottom: 0;
}

.hanvot-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #444;
  margin-bottom: 6px;
}

.hanvot-field input,
.hanvot-field select {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  font-size: 14px;
  transition: all 0.2s;
  box-sizing: border-box;
  background: #fafafa;
}

.hanvot-field select {
  cursor: pointer;
  appearance: auto;
}

.hanvot-field input:focus,
.hanvot-field select:focus {
  outline: none;
  border-color: #ff5722;
  box-shadow: 0 0 0 4px rgba(255, 87, 34, 0.1);
  background: #fff;
}

.hanvot-field input::placeholder {
  color: #aaa;
}

/* ========= CUSTOM INPUT ========= */
.hanvot-custom-input {
  margin-top: 8px;
}

/* ========= TIỀN TOGGLE BUTTONS ========= */
.hanvot-tien-toggles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.hanvot-toggle-btn {
  padding: 12px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  background: #fafafa;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #666;
  transition: all 0.2s;
}

.hanvot-toggle-btn:hover {
  border-color: #ff5722;
  background: rgba(255, 87, 34, 0.05);
}

.hanvot-toggle-btn.active {
  border-color: #4CAF50;
  background: #e8f5e9;
  color: #2e7d32;
}

.hanvot-toggle-btn .toggle-icon {
  font-size: 18px;
}

.hanvot-toggle-btn .toggle-text {
  white-space: nowrap;
}

/* ========= KHÁCH HÀNG ROW ========= */
.hanvot-khachhang-row {
  display: flex;
  gap: 8px;
}

.hanvot-khachhang-row select {
  min-width: 70px;
  max-width: 100%;
  width: auto;
  flex-shrink: 0;
}

.hanvot-khachhang-row input {
  flex: 1;
  min-width: 80px;
}

/* ========= HINT TEXT ========= */
.hanvot-hint {
  display: block;
  font-size: 11px;
  color: #888;
  margin-top: 4px;
  font-style: italic;
}

/* ========= DATE PICKER ========= */
.hanvot-field input[type="date"] {
  cursor: pointer;
  color-scheme: light;
}

.hanvot-field input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: background 0.2s;
}

.hanvot-field input[type="date"]::-webkit-calendar-picker-indicator:hover {
  background: rgba(255, 87, 34, 0.1);
}

/* ========= BUTTONS ========= */
.hanvot-actions {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 8px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #eee;
}

.hanvot-btn-primary,
.hanvot-btn-secondary {
  padding: 12px 10px;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  white-space: nowrap;
}

.hanvot-btn-primary {
  background: linear-gradient(135deg, #ff5722 0%, #e64a19 100%);
  color: #fff;
}

.hanvot-btn-primary:hover {
  box-shadow: 0 6px 20px rgba(255, 87, 34, 0.4);
  transform: translateY(-2px);
}

.hanvot-btn-primary:active {
  transform: translateY(0);
}

.hanvot-btn-secondary {
  background: #f0f0f0;
  color: #555;
}

.hanvot-btn-secondary:hover {
  background: #e0e0e0;
}

/* ========= STATUS ========= */
#hanvot-status {
  margin-top: 12px;
  padding: 0;
  text-align: center;
  font-size: 13px;
  min-height: 20px;
  border-radius: 6px;
}

#hanvot-status.success {
  color: #2e7d32;
  background: #e8f5e9;
  padding: 10px;
}

#hanvot-status.error {
  color: #c62828;
  background: #ffebee;
  padding: 10px;
}

#hanvot-status.loading {
  color: #1565c0;
  background: #e3f2fd;
  padding: 10px;
}

/* ========= DATA PANEL STYLES ========= */
#hanvot-data-panel {
  position: fixed;
  top: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: #ffffff;
  border: none;
  border-radius: 12px;
  width: 98%;
  max-width: 1600px;
  max-height: 93vh;
  z-index: 2147483647;
  display: none;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  font-family: 'Segoe UI', Arial, sans-serif;
  overflow: hidden;
}

/* ========= DATA TOOLBAR ========= */
.hanvot-data-toolbar {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  background: #f5f5f5;
  border-bottom: 1px solid #e0e0e0;
}

.hanvot-data-toolbar input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
}

.hanvot-data-toolbar input:focus {
  outline: none;
  border-color: #ff5722;
  box-shadow: 0 0 0 3px rgba(255, 87, 34, 0.1);
}

.hanvot-btn-refresh {
  padding: 10px 16px;
  background: #4CAF50;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s;
}

.hanvot-btn-refresh:hover {
  background: #43A047;
}

/* ========= DATA BODY ========= */
.hanvot-data-body {
  padding: 16px;
  max-height: calc(85vh - 130px);
  overflow: auto;
}

#hanvot-data-loading {
  text-align: center;
  padding: 40px;
  color: #666;
  font-size: 16px;
}

.hanvot-data-error {
  text-align: center;
  padding: 40px;
  color: #c62828;
  background: #ffebee;
  border-radius: 8px;
}

.hanvot-data-empty {
  text-align: center;
  padding: 40px;
  color: #666;
  background: #f5f5f5;
  border-radius: 8px;
}

/* ========= DATA TABLE ========= */
.hanvot-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.hanvot-data-table th {
  background: linear-gradient(135deg, #ff5722 0%, #e64a19 100%);
  color: #fff;
  padding: 12px 8px;
  text-align: center;
  font-weight: 600;
  white-space: nowrap;
  position: sticky;
  top: 0;
}

.hanvot-data-table td {
  padding: 10px 8px;
  border-bottom: 1px solid #e0e0e0;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hanvot-data-table tr:hover {
  background: #fff3e0;
}

.hanvot-data-table td.editable {
  cursor: pointer;
}

.hanvot-data-table td.editable:hover {
  background: #ffe0b2;
}

.hanvot-data-table td.editing {
  background: #fff9c4 !important;
  outline: 2px solid #ff5722;
  white-space: normal;
  word-break: break-word;
}

/* ========= TABLE BUTTONS ========= */
.hanvot-btn-edit,
.hanvot-btn-save-row,
.hanvot-btn-cancel-row {
  padding: 4px 8px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  margin: 0 2px;
  transition: transform 0.1s;
}

.hanvot-btn-edit:hover,
.hanvot-btn-save-row:hover,
.hanvot-btn-cancel-row:hover {
  transform: scale(1.1);
}

.hanvot-btn-edit {
  background: #e3f2fd;
}

.hanvot-btn-save-row {
  background: #e8f5e9;
}

.hanvot-btn-cancel-row {
  background: #ffebee;
}

/* ========= PICKUP BUTTON ========= */
.hanvot-btn-pickup {
  padding: 4px 8px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  margin: 0 2px;
  transition: transform 0.1s, background 0.2s;
  background: #fff3e0;
}

.hanvot-btn-pickup:hover {
  transform: scale(1.1);
  background: #ffe0b2;
}

.hanvot-btn-pickup[data-picked="true"] {
  background: #e8f5e9;
  cursor: default;
}

.hanvot-btn-pickup:disabled {
  opacity: 0.7;
  cursor: wait;
}

/* ========= NGÀY LẤY CELL ========= */
.hanvot-ngaylay-cell {
  text-align: center;
  font-size: 11px;
  white-space: nowrap;
}

.hanvot-ngaylay-cell.not-picked {
  color: #f57c00;
  font-weight: 600;
  background: #fff3e0;
}

.hanvot-ngaylay-cell.picked-up {
  color: #2e7d32;
  font-weight: 500;
  background: #e8f5e9;
}

/* ========= UPLOAD AREA STYLES ========= */
.hanvot-upload-area {
  border: 2px dashed #e0e0e0;
  border-radius: 10px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 60px;
  background: #fafafa;
}

.hanvot-upload-area:hover {
  border-color: #ff5722;
  background: rgba(255, 87, 34, 0.05);
}

.hanvot-upload-area.dragover {
  border-color: #ff5722;
  background: rgba(255, 87, 34, 0.1);
}

.hanvot-upload-placeholder {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #888;
}

.hanvot-upload-placeholder span:first-child {
  font-size: 24px;
}

.hanvot-upload-placeholder span:nth-child(2) {
  font-size: 13px;
}

/* ========= MULTIPLE IMAGES PREVIEW ========= */
.hanvot-upload-preview-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 0;
}

.hanvot-preview-item {
  position: relative;
  width: 70px;
  height: 70px;
  border-radius: 6px;
  overflow: hidden;
  border: 2px solid #ddd;
  transition: all 0.2s;
}

.hanvot-preview-item:hover {
  border-color: #ff5722;
}

.hanvot-preview-item.uploaded {
  border-color: #4CAF50;
}

.hanvot-preview-item.uploaded::after {
  content: "✓";
  position: absolute;
  top: 2px;
  left: 2px;
  background: #4CAF50;
  color: white;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hanvot-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hanvot-remove-single-img {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(198, 40, 40, 0.9);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}

.hanvot-preview-item:hover .hanvot-remove-single-img {
  opacity: 1;
}

.hanvot-img-name {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  font-size: 8px;
  padding: 2px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ========= UPLOAD ACTIONS ========= */
.hanvot-upload-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.hanvot-btn-add-img,
.hanvot-btn-clear-img {
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s;
}

.hanvot-btn-add-img {
  background: #e3f2fd;
  color: #1565c0;
}

.hanvot-btn-add-img:hover {
  background: #bbdefb;
}

.hanvot-btn-clear-img {
  background: #ffebee;
  color: #c62828;
}

.hanvot-btn-clear-img:hover {
  background: #ffcdd2;
}

#hanvot-upload-status {
  margin-top: 6px;
  font-size: 11px;
}

/* ========= IMAGE CELL IN TABLE ========= */
.hanvot-img-cell {
  text-align: center;
  padding: 4px !important;
  max-width: 120px !important;
}

.hanvot-img-cell img {
  transition: transform 0.2s;
}

.hanvot-img-cell img:hover {
  transform: scale(2);
  z-index: 100;
  position: relative;
}

.hanvot-multi-img {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px;
  position: relative;
}

.hanvot-img-count {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ff5722;
  color: white;
  font-size: 10px;
  padding: 2px 5px;
  border-radius: 10px;
  font-weight: bold;
}

/* ========= CELL CONTENT POPUP ========= */
.hanvot-cell-popup {
  position: fixed;
  z-index: 2147483648;
  background: #fff;
  border: 2px solid #ff5722;
  border-radius: 8px;
  padding: 12px 16px;
  min-width: 200px;
  max-width: 400px;
  max-height: 300px;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  font-family: 'Segoe UI', Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
  white-space: pre-wrap;
  animation: hanvot-popup-fade-in 0.15s ease-out;
}

@keyframes hanvot-popup-fade-in {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
  20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.hanvot-cell-popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e0e0e0;
}

.hanvot-cell-popup-title {
  font-weight: 600;
  color: #ff5722;
  font-size: 12px;
}

.hanvot-cell-popup-close {
  background: #f5f5f5;
  border: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  color: #666;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.hanvot-cell-popup-close:hover {
  background: #ffebee;
  color: #c62828;
}

.hanvot-cell-popup-content {
  color: #333;
}

.hanvot-data-table td {
  cursor: pointer;
}

.hanvot-data-table td:hover {
  background: #fff3e0;
}

/* ========= STATISTICS PANEL STYLES ========= */
#hanvot-stats-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #ffffff;
  border: none;
  border-radius: 16px;
  width: 900px;
  max-width: 95vw;
  max-height: 90vh;
  z-index: 2147483647;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.25);
  font-family: 'Segoe UI', Arial, sans-serif;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#hanvot-stats-panel .hanvot-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.hanvot-stats-toolbar {
  padding: 15px 20px;
  background: #f8f9fa;
  border-bottom: 1px solid #e0e0e0;
}

.hanvot-stats-filter {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.hanvot-stats-filter label {
  font-weight: 600;
  color: #555;
}

.hanvot-stats-filter select {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
  cursor: pointer;
}

#hanvot-stats-custom-range {
  display: flex;
  align-items: center;
  gap: 8px;
}

#hanvot-stats-custom-range input {
  padding: 6px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 13px;
}

#hanvot-stats-custom-range span {
  color: #999;
}

.hanvot-btn-apply {
  padding: 6px 16px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
}

.hanvot-btn-apply:hover {
  opacity: 0.9;
}

.hanvot-stats-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.hanvot-stats-section {
  margin-bottom: 25px;
}

.hanvot-stats-section h4 {
  color: #333;
  margin: 0 0 15px 0;
  padding-bottom: 8px;
  border-bottom: 2px solid #667eea;
  font-size: 15px;
}

/* Stats Cards */
.hanvot-stats-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
}

.hanvot-stat-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px 15px;
  text-align: center;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  border: 1px solid #eee;
  transition: transform 0.2s, box-shadow 0.2s;
}

.hanvot-stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.hanvot-stat-card .stat-icon {
  font-size: 28px;
  margin-bottom: 8px;
}

.hanvot-stat-card .stat-value {
  font-size: 24px;
  font-weight: 700;
  color: #333;
  margin-bottom: 4px;
}

.hanvot-stat-card .stat-label {
  font-size: 12px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-total { border-top: 3px solid #2196F3; }
.stat-revenue { border-top: 3px solid #4CAF50; }
.stat-pending { border-top: 3px solid #FF9800; }
.stat-completed { border-top: 3px solid #9C27B0; }
.stat-paid { border-top: 3px solid #00BCD4; }
.stat-partial { border-top: 3px solid #FFEB3B; }
.stat-unpaid { border-top: 3px solid #f44336; }
.stat-debt { border-top: 3px solid #E91E63; }

/* Bar Charts */
.hanvot-stats-chart {
  background: #fff;
  border-radius: 10px;
  padding: 15px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.hanvot-bar-item {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.hanvot-bar-item:last-child {
  margin-bottom: 0;
}

.bar-label {
  width: 140px;
  font-size: 13px;
  color: #555;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar-container {
  flex: 1;
  height: 24px;
  background: #f0f0f0;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 12px;
  transition: width 0.5s ease;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

.bar-fill.bar-price {
  background: linear-gradient(90deg, #4CAF50 0%, #8BC34A 100%);
}

.bar-fill.bar-weekday {
  background: linear-gradient(90deg, #FF9800 0%, #FFC107 100%);
}

.bar-fill.bar-trend {
  background: linear-gradient(90deg, #2196F3 0%, #03A9F4 100%);
}

.bar-fill.bar-cuoc {
  background: linear-gradient(90deg, #E91E63 0%, #F06292 100%);
}

.bar-value {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  font-weight: 600;
  color: #333;
}

/* Stats Table */
.hanvot-stats-table-container {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.hanvot-stats-table {
  width: 100%;
  border-collapse: collapse;
}

.hanvot-stats-table th {
  background: #f8f9fa;
  padding: 12px 15px;
  text-align: left;
  font-size: 13px;
  color: #555;
  border-bottom: 2px solid #e0e0e0;
}

.hanvot-stats-table td {
  padding: 10px 15px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 13px;
}

.hanvot-stats-table tr:hover td {
  background: #f8f9fa;
}

.hanvot-stats-table tr:last-child td {
  border-bottom: none;
}

/* No Data */
.hanvot-stats-chart .no-data,
.hanvot-stats-table-container .no-data {
  padding: 30px;
  text-align: center;
  color: #999;
  font-style: italic;
}

/* Stats Button */
.hanvot-btn-stats {
  padding: 8px 16px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  font-size: 13px;
  transition: all 0.2s;
}

.hanvot-btn-stats:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* ========= LOADING SPINNER ========= */
.hanvot-data-loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  gap: 16px;
}

.hanvot-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #e0e0e0;
  border-top: 4px solid #ff5722;
  border-radius: 50%;
  animation: hanvot-spin 0.8s linear infinite;
}

@keyframes hanvot-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.hanvot-data-loading-spinner span {
  font-size: 14px;
  color: #888;
  font-weight: 500;
}

/* ========= PAGINATION STYLES ========= */
.hanvot-page-btn {
  padding: 6px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
  color: #333;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
  min-width: 36px;
  text-align: center;
}

.hanvot-page-btn:hover:not(:disabled) {
  background: #fff3e0;
  border-color: #ff5722;
  color: #ff5722;
}

.hanvot-page-btn.active {
  background: linear-gradient(135deg, #ff5722 0%, #e64a19 100%);
  color: #fff;
  border-color: #ff5722;
}

.hanvot-page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.hanvot-page-ellipsis {
  padding: 6px 4px;
  color: #999;
  font-size: 13px;
}

/* Responsive */
@media (max-width: 768px) {
  #hanvot-stats-panel {
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
  }
  
  .hanvot-stats-cards {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .bar-label {
    width: 100px;
    font-size: 11px;
  }
}
