/* ===================================================================
   XSMB VIP - SỔ GHI SỐ & TIỀN THEO NGÀY (BET NOTES & EXPENSE NOTEBOOK)
   =================================================================== */

.notes-page-container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.notes-header-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
}

.notes-title-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.notes-title-group h2 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
}

.notes-badge {
  background: rgba(22, 163, 74, 0.12);
  color: var(--color-success);
  border: 1px solid rgba(22, 163, 74, 0.25);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
}

.notes-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0.35rem 0 0 0;
  max-width: 650px;
  line-height: 1.45;
}

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

.notes-btn {
  padding: 0.55rem 0.95rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: none;
}

.btn-primary-gradient {
  background: linear-gradient(135deg, var(--brand-red) 0%, #dc2626 100%);
  color: #fff;
  box-shadow: 0 2px 4px rgba(200, 16, 46, 0.25);
}

.btn-primary-gradient:hover {
  background: linear-gradient(135deg, var(--brand-red-hover) 0%, #b91c1c 100%);
  transform: translateY(-1px);
}

.btn-secondary-outline {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-highlight);
}

.btn-secondary-outline:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

/* Dropdown actions */
.notes-dropdown-wrapper {
  position: relative;
}

.notes-dropdown-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 210px;
  z-index: 100;
  padding: 0.4rem;
}

.notes-dropdown-menu.show {
  display: block;
}

.dropdown-item {
  width: 100%;
  padding: 0.6rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  text-align: left;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.dropdown-item:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.dropdown-item.text-danger {
  color: var(--color-danger);
}

.dropdown-item.text-danger:hover {
  background: rgba(220, 38, 38, 0.08);
}

.dropdown-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 0.35rem 0;
}

/* Odds Settings Panel */
.notes-settings-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
}

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

.settings-header-flex h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.settings-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.settings-field label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.settings-input {
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-highlight);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font-mono);
}

.settings-input:focus {
  outline: none;
  border-color: var(--brand-red);
  background: var(--bg-card);
}

.settings-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* Main 2-column Grid */
.notes-main-grid {
  display: grid;
  grid-template-columns: 370px 1fr;
  gap: 1.25rem;
  align-items: start;
}

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

/* Left Column: Form Card */
.notes-form-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 1rem;
}

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

.card-header-styled h3 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
}

.header-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-highlight);
}

.header-badge.badge-warning {
  background: rgba(217, 119, 6, 0.12);
  color: var(--color-warning);
  border-color: rgba(217, 119, 6, 0.3);
}

.form-group {
  margin-bottom: 1.15rem;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
}

.form-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}

.form-label-row .form-label {
  margin-bottom: 0;
}

.required {
  color: var(--brand-red);
}

.form-hint {
  font-weight: 400;
  font-size: 0.74rem;
  color: var(--text-muted);
  display: block;
  margin-top: 2px;
}

.form-input {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--border-highlight);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: var(--font-family);
  transition: all var(--transition-fast);
  box-sizing: border-box;
}

.form-input:focus {
  outline: none;
  border-color: var(--brand-red);
  background: var(--bg-card);
  box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.1);
}

/* Quick chips */
.quick-chip-row {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.4rem;
  flex-wrap: wrap;
}

.quick-chip {
  padding: 0.25rem 0.6rem;
  font-size: 0.74rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-highlight);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.quick-chip:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.quick-chip.active {
  background: var(--brand-navy);
  color: #fff;
  border-color: var(--brand-navy);
}

/* Bet Type Pills Selector Grid */
.type-selector-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.45rem;
}

.type-pill {
  position: relative;
  cursor: pointer;
  display: block;
  margin: 0;
}

.type-pill input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.pill-content {
  display: flex;
  flex-direction: column;
  padding: 0.45rem 0.65rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.type-code {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-primary);
}

.type-pill:hover .pill-content {
  border-color: var(--border-highlight);
  background: var(--bg-card-hover);
}

.type-pill input[type="radio"]:checked + .pill-content {
  background: rgba(200, 16, 46, 0.08);
  border-color: var(--brand-red);
}

.type-pill input[type="radio"]:checked + .pill-content .type-code {
  color: var(--brand-red);
}

/* Numbers input & preview */
.number-input-box {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 1px;
  font-family: var(--font-mono);
}

.number-helpers-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.45rem;
  flex-wrap: wrap;
}

.helper-label {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.mini-chip {
  padding: 0.2rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--bg-card);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.mini-chip:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.numbers-tags-preview {
  margin-top: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.preview-count {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-right: 0.25rem;
}

.number-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 0.35rem;
  background: var(--brand-navy);
  color: #fff;
  border-radius: var(--radius-xs);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.85rem;
}

/* Amount & Unit toggle */
.unit-toggle-group {
  display: flex;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-sm);
  padding: 2px;
}

.unit-btn {
  padding: 0.15rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 700;
  background: transparent;
  border: none;
  border-radius: 3px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.unit-btn.active {
  background: var(--brand-red);
  color: #fff;
}

.amount-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.amount-input-box {
  padding-right: 4rem;
  font-size: 1.05rem;
  font-weight: 700;
  font-family: var(--font-mono);
}

.potential-win-val {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--brand-navy);
}

[data-theme="dark"] .potential-win-val {
  color: #60a5fa;
}

.amount-unit-suffix {
  position: absolute;
  right: 0.85rem;
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--text-muted);
  pointer-events: none;
}

.amount-verbal-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
  font-style: italic;
  min-height: 1rem;
}

/* Form Action Buttons */
.form-actions-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.btn-submit-note {
  flex: 1;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, var(--brand-red) 0%, #dc2626 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 2px 6px rgba(200, 16, 46, 0.3);
}

.btn-submit-note:hover {
  background: linear-gradient(135deg, var(--brand-red-hover) 0%, #b91c1c 100%);
  transform: translateY(-1px);
}

.btn-cancel-edit {
  padding: 0.75rem 1rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-highlight);
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-cancel-edit:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

/* Right Column: Dashboard & Table */
.notes-content-area {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* 4 Metric Cards */
.notes-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

@media (max-width: 900px) {
  .notes-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 540px) {
  .notes-metrics-grid {
    grid-template-columns: 1fr;
  }
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1rem 1.15rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  box-shadow: var(--shadow-sm);
}

.metric-icon {
  font-size: 1.6rem;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  flex-shrink: 0;
}

.metric-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.metric-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.metric-value {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  font-family: var(--font-mono);
  margin: 0.15rem 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.metric-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Toolbar Card */
.notes-toolbar-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 0.85rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  box-shadow: var(--shadow-sm);
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.filter-control {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.toolbar-select {
  padding: 0.4rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-highlight);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 500;
}

.toolbar-select:focus {
  outline: none;
  border-color: var(--brand-red);
}

.toolbar-date-input {
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-highlight);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 0.82rem;
}

.notes-search-box input {
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-highlight);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 0.82rem;
  min-width: 200px;
}

.notes-search-box input:focus {
  outline: none;
  border-color: var(--brand-red);
  background: var(--bg-card);
}

/* Notes Table Card */
.notes-table-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.notes-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.notes-table thead th {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid var(--border-subtle);
  text-align: left;
}

.notes-table tbody td {
  padding: 0.8rem 0.85rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  vertical-align: middle;
}

.note-table-row:hover {
  background: var(--bg-card-hover);
}

.note-table-row.status-win {
  background: rgba(22, 163, 74, 0.03);
}

.note-table-row.status-win:hover {
  background: rgba(22, 163, 74, 0.07);
}

.date-link {
  color: var(--brand-navy);
  font-weight: 600;
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  transition: color var(--transition-fast);
}

.date-link:hover {
  color: var(--brand-red);
  text-decoration: underline;
}

/* Type Badges */
.type-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-xs);
  text-align: center;
  white-space: nowrap;
}

.type-badge-lo {
  background: rgba(30, 58, 138, 0.12);
  color: var(--brand-navy);
  border: 1px solid rgba(30, 58, 138, 0.25);
}

.type-badge-de {
  background: rgba(200, 16, 46, 0.12);
  color: var(--brand-red);
  border: 1px solid rgba(200, 16, 46, 0.25);
}

.type-badge-xien {
  background: rgba(217, 119, 6, 0.12);
  color: var(--color-warning);
  border: 1px solid rgba(217, 119, 6, 0.25);
}

.type-badge-cang {
  background: rgba(147, 51, 234, 0.12);
  color: #9333ea;
  border: 1px solid rgba(147, 51, 234, 0.25);
}

.type-badge-khac {
  background: var(--bg-muted);
  color: var(--text-secondary);
}

/* Numbers balls in table */
.note-numbers-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.note-num-ball {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  padding: 0 0.3rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-xs);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-primary);
}

.num-ball-winner {
  background: #fef08a !important;
  color: #854d0e !important;
  border-color: #eab308 !important;
  box-shadow: 0 0 0 2px rgba(234, 179, 8, 0.4);
  font-weight: 900;
}

/* Amount in table */
.amount-val {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  color: var(--text-primary);
}

.unit-tag {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.sub-cost {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 1px;
}

/* Result cell */
.result-cell-flex {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.result-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
  width: fit-content;
}

.badge-win {
  background: rgba(22, 163, 74, 0.15);
  color: var(--color-success);
  border: 1px solid rgba(22, 163, 74, 0.3);
}

.badge-win-special {
  background: rgba(220, 38, 38, 0.15);
  color: var(--brand-red);
  border: 1px solid rgba(220, 38, 38, 0.35);
  font-weight: 900;
}

.badge-lose {
  background: rgba(100, 116, 139, 0.12);
  color: var(--text-muted);
}

.badge-pending {
  background: rgba(217, 119, 6, 0.15);
  color: var(--color-warning);
}

.badge-live {
  background: rgba(220, 38, 38, 0.18);
  color: var(--brand-red);
  animation: pulseLive 1.5s infinite;
}

@keyframes pulseLive {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.result-detail-text {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* PnL formatting */
.pnl-win {
  color: var(--color-success);
  font-weight: 800;
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

.pnl-lose {
  color: var(--color-danger);
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 700;
}

.pnl-pending {
  color: var(--color-warning);
  font-size: 0.78rem;
  font-weight: 600;
}

.pnl-net {
  font-size: 0.72rem;
  font-weight: 700;
}

.note-desc-text {
  font-size: 0.78rem;
  color: var(--text-secondary);
  max-width: 160px;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Actions in row */
.action-btn-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
}

.btn-action-icon {
  background: transparent;
  border: none;
  font-size: 0.95rem;
  cursor: pointer;
  padding: 0.25rem 0.35rem;
  border-radius: var(--radius-xs);
  transition: all var(--transition-fast);
}

.btn-action-icon:hover {
  background: var(--bg-tertiary);
  transform: scale(1.15);
}

.btn-action-delete:hover {
  background: rgba(220, 38, 38, 0.1);
}

/* Empty State */
.notes-empty-state {
  padding: 3rem 1.5rem;
  text-align: center;
}

.notes-empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: 0.75rem;
}

.notes-empty-state h4 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 0.5rem 0;
}

.notes-empty-state p {
  font-size: 0.85rem;
  color: var(--text-muted);
  max-width: 420px;
  margin: 0 auto;
}

/* Toast Message */
.notes-toast-msg {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  padding: 0.75rem 1.25rem;
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.88rem;
  font-weight: 600;
  z-index: 10000;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.notes-toast-msg.show {
  transform: translateY(0);
  opacity: 1;
}

.notes-toast-msg.toast-success {
  border-left: 4px solid var(--color-success);
}

.notes-toast-msg.toast-info {
  border-left: 4px solid var(--brand-navy);
}

/* Desktop / Mobile Visibility Defaults */
.col-desktop {
  display: table-cell;
}

.col-mobile-card {
  display: none;
}

/* Dark mode adjustments for Bet Notes */
[data-theme="dark"] .notes-badge {
  background: rgba(22, 163, 74, 0.2);
  color: #4ade80;
  border-color: rgba(22, 163, 74, 0.4);
}

[data-theme="dark"] .num-ball-winner {
  background: #ca8a04 !important;
  color: #fff !important;
  border-color: #facc15 !important;
}

[data-theme="dark"] .type-pill input[type="radio"]:checked + .pill-content {
  background: rgba(220, 38, 38, 0.15);
}

[data-theme="dark"] .note-table-row.status-win {
  background: rgba(22, 163, 74, 0.08);
}

/* ===================================================================
   MOBILE OPTIMIZATIONS (GỌN GÀNG, ÍT CHỮ NHẤT, CHUẨN ĐIỆN THOẠI)
   =================================================================== */
@media (max-width: 768px) {
  /* Visibility toggles: Switch table to native card list */
  .col-desktop {
    display: none !important;
  }

  .col-mobile-card {
    display: block !important;
    padding: 0 !important;
    border: none !important;
    width: 100% !important;
  }

  .notes-page-container {
    gap: 0.65rem;
    margin-bottom: 1.5rem;
  }

  /* Compact Header */
  .notes-header-card {
    padding: 0.75rem 0.85rem;
    gap: 0.5rem;
    border-radius: var(--radius-md);
  }

  .notes-title-group h2 {
    font-size: 1.05rem;
  }

  .notes-subtitle,
  .notes-badge {
    display: none !important; /* Hide long subtitle & extra badge on mobile */
  }

  /* 4 Action Buttons in 1 compact row */
  .notes-top-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.35rem;
  }

  .notes-top-actions .notes-btn {
    padding: 0.45rem 0.2rem;
    font-size: 0.75rem;
    justify-content: center;
    text-align: center;
    border-radius: var(--radius-sm);
  }

  .notes-dropdown-wrapper {
    width: 100%;
  }

  .notes-dropdown-wrapper .notes-btn {
    width: 100%;
  }

  /* Form Card: Compact, Clean App-like Layout */
  .notes-form-card {
    padding: 0.75rem 0.85rem;
    border-radius: var(--radius-md);
    position: static;
  }

  .card-header-styled {
    padding-bottom: 0.4rem;
    margin-bottom: 0.5rem;
  }

  .card-header-styled h3 {
    font-size: 0.95rem;
  }

  .form-group {
    margin-bottom: 0.65rem;
  }

  .form-label {
    font-size: 0.78rem;
    margin-bottom: 0.25rem;
  }

  .form-hint,
  .helper-label {
    display: none !important; /* Cut verbose hint text */
  }

  /* Bet Type: 3 columns x 2 rows, segmented button style */
  .type-selector-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 0.35rem;
  }

  .type-pill .pill-content {
    padding: 0.45rem 0.2rem;
    flex-direction: column;
    text-align: center;
    justify-content: center;
    border-radius: var(--radius-sm);
  }

  .type-pill .type-code {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0;
  }

  .type-pill .pill-sub {
    display: none !important; /* Hide long sub descriptions on mobile */
  }

  /* Chips */
  .quick-chip-row {
    gap: 0.25rem;
    margin-top: 0.3rem;
  }

  .quick-chip,
  .mini-chip {
    padding: 0.22rem 0.45rem;
    font-size: 0.7rem;
    border-radius: var(--radius-xs);
  }

  .number-helpers-row {
    margin-top: 0.3rem;
    gap: 0.3rem;
  }

  .btn-submit-note {
    padding: 0.65rem 1rem;
    font-size: 0.95rem;
    font-weight: 700;
    border-radius: var(--radius-md);
  }

  /* Metrics: 2 columns grid, compact padding, no word clutter */
  .notes-metrics-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.45rem;
  }

  .metric-card.metric-count {
    grid-column: span 2;
  }

  .metric-card {
    padding: 0.5rem 0.65rem;
    border-radius: var(--radius-md);
    gap: 0.45rem;
  }

  .metric-icon {
    font-size: 1.15rem;
    width: 30px;
    height: 30px;
    min-width: 30px;
  }

  .metric-label {
    font-size: 0.65rem;
    margin-bottom: 0.1rem;
    font-weight: 600;
    text-transform: uppercase;
  }

  .metric-value {
    font-size: 0.92rem;
  }

  .metric-sub {
    display: none !important; /* Hide extra subtitles in cards on mobile */
  }

  /* Filter Toolbar: 3 selects in 1 row, clean search box */
  .notes-toolbar-card {
    padding: 0.55rem 0.65rem;
    gap: 0.45rem;
    border-radius: var(--radius-md);
  }

  .toolbar-left {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.3rem;
    width: 100%;
  }

  .filter-control label {
    display: none !important; /* Cut label prefixes */
  }

  .toolbar-select {
    width: 100%;
    padding: 0.35rem 0.25rem;
    font-size: 0.72rem;
    border-radius: var(--radius-sm);
  }

  .toolbar-right {
    width: 100%;
  }

  .notes-search-box input {
    font-size: 0.78rem;
    padding: 0.4rem 0.65rem;
  }

  /* Table Container to Card List */
  .notes-table-card {
    padding: 0.55rem;
    border-radius: var(--radius-md);
  }

  .table-responsive {
    overflow: visible;
    border: none;
  }

  .notes-table {
    display: block;
    width: 100%;
    border: none;
  }

  .notes-table thead {
    display: none !important;
  }

  .notes-table tbody {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    width: 100%;
  }

  .note-table-row {
    display: block;
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 0.65rem 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: border-color var(--transition-fast);
  }

  .note-table-row.status-win {
    border-color: rgba(34, 197, 94, 0.4);
    background: rgba(34, 197, 94, 0.04);
  }

  /* Mobile Card Layout Components */
  .m-card-inner {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
  }

  .m-card-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.35rem;
    border-bottom: 1px dashed var(--border-subtle);
  }

  .m-card-tag-date {
    display: flex;
    align-items: center;
    gap: 0.45rem;
  }

  .m-card-date {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
  }

  .m-card-numbers {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
    padding: 0.1rem 0;
  }

  .m-card-numbers .note-num-ball {
    width: 32px;
    height: 32px;
    font-size: 0.88rem;
    font-weight: 700;
  }

  /* 3-Column Stats Strip: Vào | Tạm tính | Thực tế */
  .m-card-stats-strip {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.3rem;
    background: var(--bg-tertiary);
    padding: 0.4rem 0.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
  }

  .m-stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
  }

  .m-stat-right {
    text-align: right;
  }

  .m-stat-lbl {
    font-size: 0.62rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
  }

  .m-stat-val {
    font-size: 0.78rem;
    font-weight: 700;
    font-family: var(--font-mono);
    white-space: nowrap;
  }

  .m-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
    font-size: 0.75rem;
    padding-top: 0.15rem;
  }

  .m-card-result {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
  }

  .m-card-detail-text {
    font-size: 0.72rem;
    color: var(--text-muted);
  }

  .m-card-note {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-style: italic;
  }
}

/* Extra small devices (phones <= 420px) */
@media (max-width: 420px) {
  .notes-top-actions .notes-btn {
    font-size: 0.7rem;
    padding: 0.4rem 0.15rem;
  }

  .type-pill .type-code {
    font-size: 0.75rem;
  }

  .m-stat-val {
    font-size: 0.74rem;
  }

  .metric-value {
    font-size: 0.85rem;
  }
}

