body {
  font-family: Arial, sans-serif;
  margin: 0;
  background: #f3f5fb;
  color: #222;
}

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px;
}

.card {
  background: #fff;
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

h1, h2, h3 {
  margin: 0 0 10px;
}

input, select, button {
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid #c9d2eb;
  box-sizing: border-box;
  margin-bottom: 8px;
}

button {
  background: #2d64f1;
  color: #fff;
  border: none;
  cursor: pointer;
}

button.secondary {
  background: #e8eefc;
  color: #2a3e7a;
}

.row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.row-between {
  justify-content: space-between;
}

.muted {
  color: #667;
  font-size: 13px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th, td {
  border-bottom: 1px solid #edf0f7;
  text-align: left;
  padding: 8px 6px;
  font-size: 13px;
  vertical-align: top;
}

.status-no_checkout {
  color: #bb1e2d;
  font-weight: bold;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid #edf0f7;
  border-radius: 10px;
}

.grid-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}

.inline-form {
  display: flex;
  gap: 6px;
  align-items: center;
}

.inline-form input {
  margin: 0;
}

.inline-form button {
  margin: 0;
  width: auto;
  white-space: nowrap;
}

.btn-auto {
  width: auto;
  margin-bottom: 0;
}

.actions-cell {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.row-detail {
  display: none;
  background: #fbfcff;
}

.class-item {
  border: 1px solid #e6ebfb;
  border-radius: 10px;
  margin-bottom: 8px;
  padding: 8px;
}

.class-item > summary {
  cursor: pointer;
  font-weight: bold;
}

.class-edit-form {
  margin-top: 8px;
}

.collapsible > summary {
  cursor: pointer;
  font-weight: bold;
  margin-bottom: 10px;
}

.flash-ok {
  background: #ecf8ef;
  color: #1f6c33;
}

.flash-error {
  background: #fdeeee;
  color: #9b1c24;
}

@media (max-width: 800px) {
  .wrap {
    padding: 10px;
  }
  .grid-two {
    grid-template-columns: 1fr;
  }
  .btn-auto {
    width: 100%;
  }
}

/* Мобильная адаптация для классного руководителя и админа */
body[data-viewport-mode="mobile"] .header-card .row-between {
  gap: 12px;
}

body[data-viewport-mode="mobile"] .header-card .row > .row {
  flex-wrap: wrap;
}

body[data-viewport-mode="mobile"] .form-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

body[data-viewport-mode="mobile"] .form-actions-row form {
  flex: 1;
  min-width: 120px;
}

body[data-viewport-mode="mobile"] .form-actions-row button {
  width: 100%;
}

/* Device adaptation based on runtime viewport width. */
body[data-viewport-mode="mobile"] .wrap {
  max-width: 100%;
  padding: 8px;
}

body[data-viewport-mode="mobile"] .card {
  padding: 10px;
  border-radius: 10px;
}

body[data-viewport-mode="mobile"] input,
body[data-viewport-mode="mobile"] select,
body[data-viewport-mode="mobile"] button {
  font-size: 16px; /* prevents zoom-in on mobile inputs */
  padding: 10px;
}

body[data-viewport-mode="mobile"] th,
body[data-viewport-mode="mobile"] td {
  font-size: 12px;
  padding: 6px 5px;
}

body[data-viewport-mode="mobile"] .row,
body[data-viewport-mode="mobile"] .row-between {
  flex-direction: column;
  align-items: stretch;
}

body[data-viewport-mode="mobile"] .grid-two {
  grid-template-columns: 1fr;
}

body[data-viewport-mode="mobile"] .table-wrap {
  border-radius: 8px;
}

body[data-viewport-mode="tablet"] .wrap {
  max-width: 920px;
  padding: 12px;
}

