/* ===== Monitor Layout ===== */
.monitor-layout {
  min-height: 100vh;
  background: #f6f7f8;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.monitor-page {
  max-width: 100%;
  margin: 0 auto;
  padding: 0 12px;
}

/* ===== Top bar: header + stats in one row (1024×768) ===== */
.monitor-top-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #e2e8f0;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
}

/* ===== Header ===== */
.monitor-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.monitor-header__left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.monitor-header__icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #2b8cee;
  border-radius: 8px;
  color: white;
  font-size: 18px;
}

.monitor-header__icon-text {
  font-size: 20px;
}

.monitor-header__title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
  color: #0f172a;
}

.monitor-header__subtitle {
  font-size: 11px;
  color: #64748b;
  font-weight: 500;
  margin: 0;
}

.monitor-header__right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.monitor-header__datetime {
  background: #f1f5f9;
  padding: 6px 12px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.monitor-header__date {
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
  color: #334155;
}

.monitor-header__time {
  font-size: 12px;
  font-weight: 700;
  color: #2b8cee;
  font-variant-numeric: tabular-nums;
}

/* ===== Stats Cards (inline in top bar) ===== */
.monitor-stats-cards {
  display: flex;
  gap: 8px;
  padding: 0;
  flex-shrink: 0;
}

.monitor-stats-card {
  background: white;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  min-width: 0;
}

.monitor-stats-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.monitor-stats-card__label {
  font-size: 10px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.monitor-stats-card__badge {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.monitor-stats-card__badge--blue {
  color: #2b8cee;
  background: rgba(43, 140, 238, 0.1);
}

.monitor-stats-card__badge--orange {
  color: #d97706;
  background: rgba(217, 119, 6, 0.1);
}

.monitor-stats-card__badge--purple {
  color: #7c3aed;
  background: rgba(124, 58, 237, 0.1);
}

.monitor-stats-card__body {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.monitor-stats-card__item-label {
  font-size: 9px;
  color: #94a3b8;
  text-transform: uppercase;
  font-weight: 700;
  display: block;
}

.monitor-stats-card__item-value {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  display: block;
}

.monitor-stats-card__item-value--green {
  color: #16a34a;
}

/* ===== Main Layout (1024×768) ===== */
.monitor-main {
  display: flex;
  gap: 16px;
  padding: 12px 0 16px;
  min-height: 0;
}

/* ===== Last Meal Entry ===== */
.monitor-last-meal {
  width: 28%;
  min-width: 260px;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-shrink: 0;
}

.monitor-last-meal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.monitor-last-meal__title {
  font-size: 20px;
  font-weight: 700;
  margin: 0;
  color: #0f172a;
}

.monitor-last-meal__live {
  display: flex;
  align-items: center;
  gap: 8px;
}

.monitor-last-meal__live-text {
  font-size: 10px;
  font-weight: 700;
  color: #22c55e;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.monitor-last-meal__live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.monitor-last-meal__card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border: 1px solid #e2e8f0;
  overflow: hidden;
}

.monitor-last-meal__card--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
}

.monitor-last-meal__card--error {
  border-color: #fca5a5;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.1);
}

.monitor-last-meal__placeholder {
  text-align: center;
  color: #94a3b8;
  padding: 40px;
}

.monitor-last-meal__placeholder p {
  margin-top: 16px;
  font-size: 14px;
}

.monitor-last-meal__photo-wrapper {
  position: relative;
  aspect-ratio: 1;
  width: 100%;
}

.monitor-last-meal__photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.monitor-last-meal__photo-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #64748b, #475569);
}

.monitor-last-meal__photo-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 24px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
}

.monitor-last-meal__badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 8px;
  border-radius: 4px;
  margin-bottom: 12px;
}

.monitor-last-meal__badge--success {
  background: #22c55e;
  color: white;
}

.monitor-last-meal__badge--error {
  background: #ef4444;
  color: white;
}

.monitor-last-meal__name {
  font-size: 28px;
  font-weight: 700;
  color: white;
  margin: 0 0 4px;
}

.monitor-last-meal__iin {
  color: rgba(255, 255, 255, 0.8);
  font-weight: 500;
  margin: 0;
  font-size: 14px;
}

.monitor-last-meal__info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding: 24px;
  background: #f8fafc;
}

.monitor-last-meal__info-label {
  font-size: 10px;
  color: #64748b;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
  display: block;
  margin-bottom: 4px;
}

.monitor-last-meal__info-value {
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
  display: block;
}

.monitor-last-meal__info-value--primary {
  color: #2b8cee;
}

.monitor-last-meal__error-message {
  padding: 12px 24px;
  background: #fef2f2;
  color: #dc2626;
  font-size: 13px;
  font-weight: 500;
  border-top: 1px solid #fecaca;
}

/* ===== Info Panel ===== */
.monitor-info-panel {
  flex: 1;
  min-width: 0;
}

.monitor-info-panel__loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
}

.monitor-info-panel__content {
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border: 1px solid #e2e8f0;
  padding: 16px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.monitor-info-panel__selectors {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.monitor-step-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.monitor-step-panel__toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.monitor-step-panel__toolbar--row {
  flex-wrap: nowrap;
  margin-bottom: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
}

.monitor-step-panel__toolbar--row .monitor-status-filter {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
  flex: 1;
  min-width: 0;
}

.monitor-back-btn {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
}

.monitor-back-btn:hover {
  background: #e2e8f0;
  border-color: #cbd5e1;
}

.monitor-refresh-btn {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: white;
  background: #2b8cee;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
  margin-left: auto;
}

.monitor-refresh-btn:hover:not(:disabled) {
  background: #1d7ad6;
}

.monitor-refresh-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ===== Grade Selector ===== */
.monitor-selector-label {
  font-size: 10px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  display: block;
  margin-bottom: 12px;
}

.monitor-grade-selector__buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  max-width: 400px;
}

.monitor-grade-btn {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: white;
  font-weight: 600;
  font-size: 18px;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s;
}

.monitor-grade-btn:hover {
  border-color: #2b8cee;
  color: #2b8cee;
}

.monitor-grade-btn--active {
  background: #2b8cee;
  color: white;
  border-color: #2b8cee;
  box-shadow: 0 0 0 4px rgba(43, 140, 238, 0.2);
}

.monitor-grade-btn--active:hover {
  color: white;
}

/* ===== Class Selector (calculator grid) ===== */
.monitor-class-selector__buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  max-width: 400px;
}

.monitor-class-btn {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: white;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s;
}

.monitor-class-btn:hover {
  border-color: #2b8cee;
  color: #2b8cee;
}

.monitor-class-btn--active {
  background: #2b8cee;
  color: white;
  border-color: #2b8cee;
  box-shadow: 0 0 0 4px rgba(43, 140, 238, 0.2);
}

.monitor-class-btn--active:hover {
  color: white;
}

/* ===== Status Filter ===== */
.monitor-status-filter {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f1f5f9;
}

.monitor-status-filter__btn {
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s;
}

.monitor-status-filter__btn:hover {
  background: #f1f5f9;
}

.monitor-status-filter__btn--active {
  background: #0f172a;
  color: white;
}

.monitor-status-filter__btn--active:hover {
  background: #1e293b;
}

.monitor-status-filter__btn--red {
  color: #ef4444;
}

.monitor-status-filter__btn--red.monitor-status-filter__btn--active {
  background: #ef4444;
  color: white;
}

/* ===== Orders Table ===== */
.monitor-orders {
  overflow: auto;
  min-height: 0;
}

.monitor-orders-empty {
  text-align: center;
  padding: 40px;
  color: #94a3b8;
}

.monitor-orders__table {
  width: 100%;
  text-align: left;
  border-collapse: collapse;
}

.monitor-orders__table thead tr {
  border-bottom: 1px solid #f1f5f9;
}

.monitor-orders__table th {
  padding: 0 0 16px 8px;
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.monitor-orders__table tbody tr {
  border-bottom: 1px solid #fafafa;
  transition: background 0.15s;
}

.monitor-orders__table tbody tr:hover {
  background: #f8fafc;
}

.monitor-orders__row--error {
  background: rgba(254, 242, 242, 0.5) !important;
}

.monitor-orders__row--error:hover {
  background: rgba(254, 226, 226, 0.5) !important;
}

.monitor-orders__table td {
  padding: 16px 8px;
}

.monitor-orders__student {
  display: flex;
  align-items: center;
  gap: 12px;
}

.monitor-orders__avatar {
  flex-shrink: 0;
}

.monitor-orders__name {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.monitor-orders__iin {
  font-size: 12px;
  color: #64748b;
  font-weight: 500;
  margin: 0;
}

.monitor-orders__time {
  font-size: 14px;
  font-weight: 600;
  color: #475569;
}

.monitor-orders__status-cell {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.monitor-order-status {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  width: fit-content;
}

.monitor-order-status--eaten {
  background: #dcfce7;
  color: #15803d;
}

.monitor-order-status--absent {
  background: #6b21a8;
  color: #fff;
}

.monitor-order-status--not-eaten {
  background: #f1f5f9;
  color: #64748b;
}

.monitor-order-status--error {
  background: #fee2e2;
  color: #dc2626;
}

.monitor-orders__error-text {
  font-size: 12px;
  color: #dc2626;
  font-weight: 500;
  font-style: italic;
}
:root {
  --primary-color: #1677ff;
  --secondary-color: #5c6ac4;
  --background-color: #f5f5f5;
  --text-color: #333333;
  --error-color: #ff4d4f;
  --success-color: #52c41a;
  --warning-color: #faad14;
  --border-radius: 4px;
  --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.09);
  --transition-time: 0.3s;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue',
    Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol',
    'Noto Color Emoji';
  background-color: var(--background-color);
  color: var(--text-color);
  line-height: 1.5;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

.page-title {
  margin-bottom: 24px;
  color: var(--text-color);
  font-weight: 600;
}

.section-title {
  margin-bottom: 16px;
  font-size: 18px;
  font-weight: 500;
}

/* Card styles */
.card {
  background-color: #fff;
  border-radius: var(--border-radius);
  box-shadow: var(--card-shadow);
  margin-bottom: 16px;
  padding: 24px;
}

/* Form styles */
.form-container {
  max-width: 600px;
}

/* Center element */
.center-flex {
  display: flex;
  justify-content: center;
  align-items: center;
}

.full-height {
  min-height: 100vh;
}

/* Alert messages */
.alert {
  margin-bottom: 16px;
  padding: 8px 12px;
  border-radius: var(--border-radius);
}

.alert-error {
  background-color: #fff2f0;
  border: 1px solid #ffccc7;
}

.alert-success {
  background-color: #f6ffed;
  border: 1px solid #b7eb8f;
}

/* Button groups */
.button-group {
  display: flex;
  gap: 8px;
}

/* Responsive table wrapper */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

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

.align-right-input-number .ant-input-number-input {
  text-align: right;
}