:root {
  --ink: #182636;
  --muted: #647286;
  --blue: #245fd6;
  --blue-dark: #184bb5;
  --line: #e1e7ef;
  --surface: #fff;
  --canvas: #f4f6fa;
  --danger: #b92d35;
  --green: #19684e;
  --radius: 16px;
  --shadow: 0 8px 28px rgba(27,46,73,.05);
  font-family: Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-size: 15px;
  line-height: 1.6;
}

button,input,select,textarea {
  font: inherit;
}

button,a,input,select,textarea {
  transition: background-color 180ms ease,border-color 180ms ease,box-shadow 180ms ease,color 180ms ease,transform 180ms ease;
}

a {
  color: var(--blue);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button {
  cursor: pointer;
}

button:disabled {
  opacity: .55;
  cursor: not-allowed;
  transform: none;
}

button:active,.btn:active {
  transform: translateY(1px);
}

:focus-visible {
  outline: 3px solid #78a8ff;
  outline-offset: 4px;
}

[hidden] {
  display: none!important;
}

h1,h2,h3,p {
  margin-top: 0;
}

h1 {
  font-size: clamp(28px,4vw,40px);
  line-height: 1.2;
  letter-spacing: -1.2px;
  font-weight: 720;
  margin-bottom: 14px;
}

h2 {
  font-size: 21px;
  letter-spacing: -.4px;
  line-height: 1.35;
  margin-bottom: 18px;
}

h3 {
  font-size: 19px;
  line-height: 1.4;
  letter-spacing: -.3px;
  margin-bottom: 10px;
}

p {
  margin-bottom: 16px;
}

small {
  font-size: 12px;
}

.muted,.form-help {
  color: var(--muted);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 1.7px;
  font-size: 11px;
  font-weight: 750;
  color: var(--blue);
  margin-bottom: 12px;
}

.lead {
  color: var(--muted);
  max-width: 670px;
  margin-bottom: 0;
  font-size: 16px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  padding: 12px;
  background: #fff;
  z-index: 10;
}

.skip-link:focus {
  top: 12px;
}

/* Application shell */
.app-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: 1240px;
  margin: auto;
  padding: 20px 20px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-weight: 750;
  font-size: 21px;
  letter-spacing: -.4px;
  line-height: 1.3;
}

.brand:hover {
  text-decoration: none;
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .35px;
  font-weight: 500;
  margin-top: 3px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  background: var(--blue);
  color: #fff;
  border-radius: 12px;
  font-size: 25px;
  box-shadow: 0 4px 10px #245fd626;
}

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

.account-label {
  display: none;
  color: var(--muted);
  font-size: 13px;
}

.main-nav {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  max-width: 1240px;
  margin: auto;
  padding: 0 16px;
  scrollbar-width: thin;
}

.main-nav a {
  white-space: nowrap;
  display: block;
  padding: 16px 12px 14px;
  color: var(--muted);
  font-weight: 550;
  font-size: 13px;
  position: relative;
}

.main-nav a:hover {
  background: #f5f8ff;
  text-decoration: none;
  color: var(--blue);
}

.main-nav a.active {
  color: var(--blue);
}

.main-nav a.active:after {
  content: "";
  height: 3px;
  background: var(--blue);
  position: absolute;
  bottom: 0;
  left: 12px;
  right: 12px;
  border-radius: 3px 3px 0 0;
}

.app-main {
  width: 100%;
  max-width: 1240px;
  margin: auto;
  padding: 32px 20px 56px;
  flex: 1;
}

.app-main:focus {
  outline: 0;
}

.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  flex-direction: column;
  margin-bottom: 32px;
}

.page-heading /* Buttons and actions */
.btn {
  flex-shrink: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 18px;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.5;
  text-align: center;
  color: var(--ink);
  background: #edf1f7;
}

.btn:hover {
  text-decoration: none;
  background: #e4eaf3;
}

.btn-primary,.btn-success {
  background: var(--blue);
  color: #fff;
}

.btn-primary:hover,.btn-success:hover {
  background: var(--blue-dark);
  box-shadow: 0 4px 12px #245fd626;
}

.btn-secondary,.btn-info,.btn-warning {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}

.btn-secondary:hover,.btn-info:hover,.btn-warning:hover {
  border-color: #bdcce4;
  background: #f5f8ff;
}

.btn-danger {
  background: #fff0f0;
  color: var(--danger);
  border-color: #f2d7d9;
}

.btn-danger:hover {
  background: #ffe4e6;
}

.btn-quiet {
  background: transparent;
  border-color: var(--line);
  color: var(--muted);
}

.btn-quiet:hover {
  background: var(--canvas);
}

.btn-sm {
  padding: 7px 12px;
  min-height: 36px;
  font-size: 12px;
}

.btn-block {
  width: 100%;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

/* Dashboard */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 12px;
  margin-bottom: 36px;
}

.metric-card {
  padding: 22px 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.metric-card>span {
  font-size: 13px;
  color: var(--muted);
}

.metric-card strong {
  display: block;
  font-size: 36px;
  letter-spacing: -1.5px;
  line-height: 1.4;
  font-weight: 700;
  margin: 6px 0;
}

.metric-card small {
  color: var(--muted);
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-heading h2 {
  margin: 0;
}

.section-heading>.muted {
  font-size: 12px;
}

.section-block {
  margin-bottom: 32px;
}

.workflow-grid {
  display: grid;
  gap: 16px;
}

.workflow-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  color: var(--ink);
  box-shadow: var(--shadow);
}

.workflow-card:hover {
  text-decoration: none;
  border-color: #98b8f0;
  transform: translateY(-3px);
  box-shadow: 0 12px 24px #245fd611;
}

.step-number {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid #d9e5fb;
  background: #f3f7ff;
  color: var(--blue);
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 28px;
}

.workflow-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
  margin-bottom: 28px;
  flex: 1;
}

.card-action {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--blue);
  font-size: 13px;
  font-weight: 650;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.setup-callout {
  background: #eaf0fc;
  border: 1px solid #dbe5f6;
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.setup-callout p:last-child {
  margin: 0;
  max-width: 640px;
  color: var(--muted);
  font-size: 13px;
}

.setup-callout h2 {
  margin-bottom: 8px;
}

.app-footer {
  max-width: 1240px;
  width: 100%;
  margin: auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  padding: 24px 20px;
  border-top: 1px solid var(--line);
  color: #7b8695;
  font-size: 11px;
}

/* Forms and panels */
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.two-column {
  display: grid;
  gap: 20px;
}

.form-field {
  margin-bottom: 18px;
  min-width: 0;
}

.form-field label {
  display: block;
  font-size: 12px;
  font-weight: 650;
  margin-bottom: 7px;
  color: #344258;
}

input:not([type=checkbox]):not([type=radio]),select,textarea {
  width: 100%;
  min-height: 44px;
  background: #fff;
  border: 1px solid #ced7e3;
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
}

input::placeholder,textarea::placeholder {
  color: #939dac;
}

input:focus,select:focus,textarea:focus {
  border-color: #4e87e9;
  box-shadow: 0 0 0 3px #245fd614;
  outline: none;
}

input[aria-invalid=true] {
  border-color: var(--danger);
}

input[type=file] {
  padding: 18px!important;
  border-style: dashed!important;
  background: #f8faff!important;
}

input[type=checkbox],input[type=radio] {
  width: 18px;
  height: 18px;
  accent-color: var(--blue);
  vertical-align: middle;
  margin-right: 8px;
}

input:disabled,select:disabled {
  background: #f0f3f8;
  color: var(--muted);
}

textarea {
  resize: vertical;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0 16px;
}

.form-help {
  font-size: 12px;
}

.field-error {
  display: block;
  color: var(--danger);
  margin-top: 6px;
}

.required {
  color: var(--danger);
}

.notice {
  padding: 12px 16px;
  border: 1px solid #d1dff8;
  background: #edf4ff;
  color: #23518a;
  font-size: 13px;
  border-radius: 9px;
  margin-bottom: 18px;
  overflow-wrap: anywhere;
}

.notice-error {
  background: #fff2f3;
  border-color: #f1c9ce;
  color: var(--danger);
}

.notice-success {
  background: #edf9f4;
  border-color: #c6e8da;
  color: var(--green);
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 20px;
  right: 20px;
  z-index: 100;
  background: var(--ink);
  color: #fff;
  border-radius: 10px;
  padding: 14px 20px;
  box-shadow: 0 8px 30px #18263633;
  font-size: 13px;
  max-width: 600px;
  margin: auto;
}

.toast.error {
  background: var(--danger);
}

.badge {
  display: inline-flex;
  align-items: center;
  background: #eef3fc;
  color: #496a9a;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 650;
  padding: 3px 10px;
}

.classroom-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.classroom-info {
  font-size: 12px;
  color: var(--muted);
  margin-top: 5px;
}

.classroom-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.empty-state {
  text-align: center;
  padding: 36px 20px;
  color: var(--muted);
  background: #f8faff;
  border: 1px dashed #d4deed;
  border-radius: 12px;
}

.empty-state h3 {
  color: var(--ink);
}

.record-grid {
  display: grid;
  gap: 16px;
}

.record-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}

.record-meta {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 16px;
  margin: 18px 0;
}

.record-meta dt {
  font-size: 11px;
  color: var(--muted);
}

.record-meta dd {
  font-size: 13px;
  margin: 3px 0 0;
  overflow-wrap: anywhere;
}

.record-card h3 {
  overflow-wrap: anywhere;
}

/* Accessible dialogs */
.app-dialog {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  color: var(--ink);
  width: min(640px,calc(100% - 32px));
  max-height: 85vh;
  box-shadow: 0 24px 80px #13233a33;
}

.app-dialog::backdrop {
  background: #18263677;
  backdrop-filter: blur(3px);
}

.dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.dialog-heading h2 {
  margin: 0;
}

.icon-button {
  background: #f1f4f8;
  border: 0;
  border-radius: 7px;
  width: 34px;
  height: 34px;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
}

.icon-button:hover {
  background: #e3e9f2;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
  margin-top: 18px;
}

/* Import tables and document choices */
.table-scroll {
  width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

th,td {
  padding: 11px 14px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
}

th {
  background: #f5f8fc;
  font-weight: 650;
  color: #43546e;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover {
  background: #fafcff;
}

.import-steps {
  display: grid;
  gap: 20px;
}

.import-result {
  margin-top: 20px;
}

.data-preview {
  margin-top: 22px;
}

.data-preview h3 {
  font-size: 15px;
}

.document-grid {
  display: grid;
  gap: 16px;
  margin: 24px 0;
}

.document-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

.document-card:has(input:checked) {
  border-color: var(--blue);
  background: #f5f8ff;
  box-shadow: 0 0 0 1px var(--blue);
}

.document-card h3 {
  font-size: 15px;
  margin: 12px 0 8px;
}

.document-card p {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}

.document-card>span {
  font-size: 11px;
  color: var(--muted);
}

.checkbox-label {
  display: flex;
  align-items: center;
  font-size: 13px;
  margin-bottom: 18px;
}

.error-panel {
  max-width: 620px;
  text-align: center;
  padding: 48px 24px;
  margin: 48px auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.error-panel h1 {
  font-size: 64px;
  color: var(--blue);
}

.error-panel p {
  color: var(--muted);
}

/* Sign in */
.login-page {
  background: #edf2fb;
}

.login-header {
  width: 100%;
  max-width: 1180px;
  margin: auto;
  padding: 26px 24px;
}

.login-main {
  width: 100%;
  max-width: 1180px;
  margin: auto;
  display: grid;
  gap: 30px;
  padding: 24px 24px 60px;
  flex: 1;
  align-items: center;
}

.login-intro h1 {
  font-size: clamp(32px,5vw,53px);
  line-height: 1.18;
  letter-spacing: -2px;
}

.login-intro>p:not(.eyebrow) {
  color: var(--muted);
  max-width: 420px;
  font-size: 16px;
}

.login-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 28px;
  color: #577095;
  font-size: 11px;
  font-weight: 650;
}

.login-card {
  background: #fff;
  border: 1px solid #dce4f0;
  border-radius: 22px;
  padding: 30px 24px;
  box-shadow: 0 18px 50px #1b345711;
}

.login-card h2 {
  font-size: 26px;
  margin-bottom: 10px;
}

.login-card>.muted {
  font-size: 13px;
  margin-bottom: 26px;
}

.login-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: var(--blue);
  background: #eef4ff;
  border-radius: 12px;
  font-size: 24px;
  margin-bottom: 24px;
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 88px!important;
}

.password-field button {
  position: absolute;
  right: 7px;
  top: 7px;
  padding: 6px 8px;
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 11px;
  border-radius: 5px;
}

.password-field button:hover {
  background: #edf2fa;
}

.login-help {
  font-size: 11px;
  color: var(--muted);
  margin: 20px 0 0;
  text-align: center;
}

.login-footer {
  padding: 22px 24px;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
}

/* Seating plan */
.seating-toolbar {
  margin-bottom: 24px;
}

.seating-summary {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
  padding-top: 16px;
  margin-top: 16px;
  border-top: 1px solid var(--line);
}

.seating-summary strong {
  color: var(--ink);
}

.classrooms-container {
  display: grid;
  gap: 20px;
}

.classroom {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
}

.classroom-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.classroom-title {
  font-size: 17px;
  font-weight: 700;
}

.classroom-layout {
  padding: 20px;
  overflow-x: auto;
}

.desk-layout {
  display: grid;
  gap: 12px;
  min-width: max-content;
}

.desk-layout-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.row-label {
  width: 20px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.desk-pair {
  display: flex;
  gap: 5px;
}

.desk {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 87px;
  min-height: 65px;
  border: 1px solid #d3deef;
  border-radius: 8px;
  color: #526583;
  background: #eef3fc;
  font-size: 11px;
  padding: 8px 4px;
  gap: 4px;
  overflow: hidden;
}

.desk:hover {
  border-color: #7397d1;
  box-shadow: 0 0 0 2px #245fd619;
}

.desk.occupied {
  color: #173b60;
  background: #e3efff;
  border-color: #b8d2f4;
}

.desk.blocked {
  background: repeating-linear-gradient(135deg,#eff1f5,#eff1f5 6px,#e3e7ed 6px,#e3e7ed 12px);
  color: #7a8595;
  border-color: #cbd2db;
}

.desk.drag-over {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px #245fd628;
}

.desk-place {
  font-size: 10px;
  font-weight: 650;
  color: var(--muted);
}

.desk-name {
  max-width: 78px;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.desk-void {
  width: 179px;
}

.seat-details {
  background: #f5f8fc;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 20px;
  font-size: 13px;
}

.seat-details p {
  margin: 0 0 7px;
}

.seat-details p:last-child {
  margin: 0;
}

.seat-options {
  display: grid;
  gap: 8px;
  max-height: 380px;
  overflow: auto;
}

.seat-option {
  text-align: left;
  justify-content: flex-start;
}

.seat-option small {
  font-weight: 400;
  color: var(--muted);
}

.places-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 20px;
}

.places-grid .btn {
  min-width: 54px;
}

.legend {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend:before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 3px;
  background: #e3efff;
  border: 1px solid #b8d2f4;
}

.legend.free:before {
  background: #eef3fc;
}

.legend.blocked:before {
  background: #d4dbe5;
}

/* Responsive layouts */
@media(min-width:600px) {
  .form-grid {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }
  .account-label {
    display: block;
  }
  .metrics-grid {
    gap: 16px;
  }
  .metric-card {
    padding: 24px;
  }
  .record-grid {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }
  .document-grid {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }
  .login-card {
    padding: 40px;
  }
  .header-inner {
    padding: 24px 32px 14px;
  }
  .main-nav {
    padding: 0 24px;
  }
  .app-main {
    padding: 40px 32px 64px;
  }
  .app-footer {
    padding: 24px 32px;
  }
}

@media(min-width:960px) {
  .page-heading {
    flex-direction: row;
    align-items: center;
    margin-bottom: 36px;
  }
  .metrics-grid {
    grid-template-columns: repeat(4,minmax(0,1fr));
  }
  .workflow-grid {
    grid-template-columns: repeat(3,minmax(0,1fr));
  }
  .two-column {
    grid-template-columns: 340px minmax(0,1fr);
    align-items: start;
  }
  .setup-callout {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 32px;
  }
  .setup-callout .button-row {
    max-width: 360px;
    flex-shrink: 0;
  }
  .main-nav a {
    padding: 18px 18px 16px;
    font-size: 14px;
  }
  .login-main {
    grid-template-columns: 1.1fr .9fr;
    gap: 100px;
    padding-top: 48px;
    padding-bottom: 90px;
  }
  .login-intro {
    padding-bottom: 32px;
  }
  .login-header {
    padding-top: 40px;
  }
  .import-steps {
    grid-template-columns: 1.2fr 1fr;
    align-items: start;
  }
  .document-grid {
    grid-template-columns: repeat(3,minmax(0,1fr));
  }
}

@media(prefers-reduced-motion:reduce) {
  *,*::before,*::after {
    transition: none!important;
    animation: none!important;
    scroll-behavior: auto!important;
  }
}
