:root { color-scheme: light; font-family: Inter, "Microsoft YaHei", Arial, sans-serif; color: #172027; background: #eef1f2; }
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button { min-height: 38px; border: 1px solid #c9d0d3; border-radius: 5px; background: #fff; color: #172027; padding: 7px 13px; cursor: pointer; }
button:hover { border-color: #64747b; background: #f7f9f9; }
button:disabled { opacity: .45; cursor: not-allowed; }
.primary { background: #176b4d; border-color: #176b4d; color: #fff; }
.primary:hover { background: #11573e; }
.danger-outline { border-color: #b44949; color: #9e3030; }
input, select, textarea { min-height: 40px; border: 1px solid #c5cdd0; border-radius: 5px; background: #fff; padding: 8px 10px; color: #172027; }
input:focus, select:focus, textarea:focus { outline: 2px solid #9bc6b5; outline-offset: 1px; border-color: #176b4d; }
.hidden { display: none !important; }
.binding-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: #e8edeb; }
.binding-panel { width: min(520px, 100%); background: #fff; border: 1px solid #d4dadd; border-radius: 7px; box-shadow: 0 12px 32px rgba(23,32,39,.09); overflow: hidden; }
.binding-brand { min-height: 74px; display: flex; align-items: center; gap: 11px; padding: 16px 24px; color: #fff; background: #20282c; }
.binding-brand div { display: grid; gap: 2px; }
.binding-brand strong { font-size: 16px; }
.binding-brand span:not(.brand-mark) { color: #c9d2d5; font-size: 12px; }
.binding-heading { margin-bottom: 4px; }
.binding-heading h1, .binding-state h1 { margin: 0 0 8px; font-size: 22px; }
.binding-heading p, .binding-state > p { margin: 0; color: #68777d; font-size: 13px; }
.binding-form, .binding-state { padding: 24px; }
.binding-form { display: grid; gap: 7px; }
.binding-form label { margin-top: 7px; color: #526168; font-size: 13px; }
.binding-form input, .binding-form select { width: 100%; }
.binding-form input[readonly] { color: #405057; background: #f1f4f3; cursor: default; }
.binding-hint { min-height: 18px; margin: 0; color: #68777d; font-size: 12px; }
.binding-class-picker { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.binding-class-picker button { min-height: 40px; margin: 0; white-space: nowrap; }
.binding-class-nav { display: grid; gap: 10px; padding: 12px; border: 1px solid #d4dadd; border-radius: 5px; background: #f7f9f8; }
.binding-class-nav section { display: grid; gap: 7px; }
.binding-class-nav strong { color: #526168; font-size: 13px; }
.binding-class-nav div { display: flex; flex-wrap: wrap; gap: 7px; }
.binding-class-nav button { min-height: 34px; margin: 0; padding: 5px 10px; }
.binding-form button { margin-top: 13px; min-height: 44px; }
.binding-form .error { margin-top: 3px; }
.binding-status { display: inline-block; margin-bottom: 13px; padding: 4px 8px; border-radius: 4px; color: #126044; background: #dcefe7; font-size: 12px; }
.binding-details { margin: 18px 0 0; border-top: 1px solid #e2e6e8; }
.binding-details div { display: grid; grid-template-columns: 88px minmax(0,1fr); gap: 12px; padding: 12px 0; border-bottom: 1px solid #e2e6e8; }
.binding-details dt { color: #68777d; font-size: 13px; }
.binding-details dd { min-width: 0; margin: 0; overflow-wrap: anywhere; font-weight: 650; }
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: #e8edeb; }
.auth-panel { width: min(380px, 100%); background: #fff; border: 1px solid #d4dadd; border-radius: 7px; padding: 32px; box-shadow: 0 12px 32px rgba(23,32,39,.09); display: grid; gap: 13px; }
.auth-panel h1 { margin: 4px 0 12px; font-size: 24px; }
.captcha-row { display: grid; grid-template-columns: 1fr 92px auto; gap: 8px; align-items: center; }
.captcha-row strong { min-height: 40px; display: flex; align-items: center; justify-content: center; border: 1px solid #c5cdd0; border-radius: 5px; background: #f1f5f3; letter-spacing: 0; }
.captcha-row input { width: 100%; min-width: 0; }
.captcha-row button { padding-inline: 10px; }
.brand-mark { width: 38px; height: 38px; border-radius: 6px; display: inline-grid; place-items: center; background: #176b4d; color: #fff; font-weight: 750; font-size: 13px; }
.error { color: #a22d2d; min-height: 20px; margin: 0; font-size: 13px; }
.workspace { min-height: 100vh; display: grid; grid-template-columns: 220px minmax(0,1fr); }
.sidebar { position: sticky; top: 0; min-width: 0; height: 100vh; background: #20282c; color: #fff; padding: 18px 14px; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 22px; }
.sidebar nav { display: grid; gap: 4px; }
.sidebar nav button { border: 0; background: transparent; color: #cad2d5; text-align: left; width: 100%; padding: 10px 12px; }
.sidebar nav button:hover, .sidebar nav button.active { color: #fff; background: #344147; }
.identity { margin-top: auto; border-top: 1px solid #3c484d; padding: 15px 8px 0; display: grid; gap: 5px; font-size: 13px; color: #c5ced1; }
.link-button { border: 0; background: transparent; color: #fff; padding: 0; min-height: 28px; text-align: left; }
main { min-width: 0; padding: 0 28px 40px; }
.topbar { height: 84px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #d5dbdd; }
.topbar h1 { font-size: 22px; margin: 0 0 4px; }
.topbar p { margin: 0; font-size: 12px; color: #68777d; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(120px,1fr)); gap: 12px; padding: 20px 0; }
.metrics > div, .metrics > .metric-card { background: #fff; border: 1px solid #d7dddf; border-radius: 6px; padding: 14px 16px; }
.metrics > .metric-card { min-height: 0; text-align: left; color: inherit; }
.metrics > .metric-card:hover { border-color: #176b4d; background: #f5faf8; }
.metrics > .metric-card small { display: block; margin-top: 4px; color: #176b4d; font-size: 11px; }
.metrics span { display: block; color: #68777d; font-size: 12px; }
.metrics strong { display: block; font-size: 24px; margin-top: 5px; }
.view { display: none; }
.view.active { display: block; }
.toolbar, .actionbar, .inline-form { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; flex-wrap: wrap; }
.toolbar input[type=search] { width: min(360px,100%); }
.actionbar { min-height: 50px; background: #e5ebe8; padding: 7px 10px; border-left: 3px solid #176b4d; }
.actionbar span { margin-right: auto; font-size: 13px; }
.section-heading { min-height: 48px; color: #596970; }
.table-wrap { overflow: auto; border: 1px solid #d3dadc; background: #fff; }
table { width: 100%; border-collapse: collapse; min-width: 780px; }
th, td { border-bottom: 1px solid #e2e6e8; padding: 10px 12px; text-align: left; vertical-align: middle; font-size: 13px; }
th { position: sticky; top: 0; background: #f6f8f8; color: #56666d; font-weight: 650; }
tbody tr:hover { background: #f8faf9; }
.status { display: inline-block; min-width: 58px; padding: 3px 7px; border-radius: 4px; text-align: center; font-size: 12px; background: #e5e8e9; }
.status.online, .status.completed { color: #126044; background: #dcefe7; }
.status.failed { color: #992f2f; background: #f5dddd; }
.status.pending { color: #825b0a; background: #f4e8c9; }
.mono { font-family: Consolas, monospace; font-size: 12px; }
dialog { width: min(700px, calc(100% - 32px)); border: 1px solid #c7ced1; border-radius: 7px; padding: 20px; }
dialog::backdrop { background: rgba(14,20,23,.48); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; }
.dialog-head h2 { margin: 0; font-size: 19px; }
.dialog-head button { border: 0; font-size: 24px; }
dialog textarea { width: 100%; resize: vertical; }
.dialog-actions { display: flex; justify-content: flex-end; margin-top: 12px; }
.token-output { padding: 12px; background: #fff4cf; border: 1px solid #d8bf64; overflow-wrap: anywhere; font-family: Consolas, monospace; }
#toast { position: fixed; right: 22px; bottom: 22px; max-width: 420px; background: #20282c; color: #fff; border-radius: 5px; padding: 11px 14px; opacity: 0; pointer-events: none; transition: opacity .18s; }
#toast.show { opacity: 1; }
@media (max-width: 800px) {
  .binding-shell { place-items: start center; padding: 0; background: #fff; }
  .binding-panel { width: 100%; min-height: 100vh; border: 0; border-radius: 0; box-shadow: none; }
  .binding-brand { padding-inline: 18px; }
  .binding-form, .binding-state { padding: 22px 18px; }
  .workspace { grid-template-columns: 1fr; align-content: start; }
  .sidebar { position: static; height: auto; padding: 12px; }
  .sidebar nav { display: flex; width: 100%; min-width: 0; overflow-x: auto; }
  .sidebar nav button { width: auto; white-space: nowrap; }
  .identity { display: none; }
  main { padding: 0 14px 28px; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .topbar { height: 72px; }
  .org-container { grid-template-columns: 1fr; }
}

/* Organization view */
.org-container { display: grid; grid-template-columns: 340px 1fr; gap: 16px; align-items: start; }
.org-school-panel { display: flex; flex-direction: column; gap: 8px; }
.org-school-list { display: flex; flex-direction: column; gap: 6px; }
.org-school-card { background: #fff; border: 1px solid #e0e5e8; border-radius: 8px; padding: 12px 14px; cursor: pointer; transition: border-color .15s; }
.org-school-card:hover { border-color: #8fa0a8; }
.org-school-card.active { border-color: #176b4d; background: #f0f7f4; }
.org-school-card strong { display: block; font-size: 15px; margin-bottom: 2px; }
.org-card-actions { margin-top: 6px; display: flex; gap: 8px; }
.danger-text { color: #9e3030; }
.dim { color: #7a8893; font-size: 13px; }
.org-class-panel { min-height: 200px; }

/* Dialogs */
dialog { border: 1px solid #d4dadd; border-radius: 10px; padding: 0; max-width: 460px; width: 90%; box-shadow: 0 8px 32px rgba(0,0,0,.15); }
dialog::backdrop { background: rgba(0,0,0,.3); }
dialog form.dialog-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid #e8ecee; }
dialog form.dialog-head h2 { margin: 0; font-size: 17px; }
dialog form.dialog-head button { border: none; background: none; font-size: 22px; min-height: auto; padding: 0 4px; }
dialog label { display: block; margin: 10px 20px 0; font-size: 13px; color: #5C6975; }
dialog input, dialog select { display: block; width: calc(100% - 40px); margin: 4px 20px 0; }
.dialog-actions { padding: 16px 20px; display: flex; justify-content: flex-end; }
.link-button { border: none; background: none; color: #176b4d; min-height: auto; padding: 2px 4px; font-size: 13px; }

/* Application release workflow */
.release-targets, .release-deployments { margin: 18px 0; }
.release-target-head, .release-deployment-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 10px; }
.release-target-head h2, .release-deployment-head h2 { margin: 0 0 4px; font-size: 16px; }
.release-target-head .toolbar { margin: 0; justify-content: flex-end; }
.release-target-table { max-height: 230px; }
.release-status-summary { display: flex; gap: 5px; flex-wrap: wrap; }
.release-dialog { max-width: 760px; }
.dialog-body { padding: 16px 20px 0; }
.dialog-body > p { margin: 0 0 12px; }
.dialog-body input[type="search"] { display: block; width: 100%; margin: 0 0 10px; }
.release-picker-table { max-height: min(48vh, 420px); }
.release-confirm-table { max-height: min(36vh, 300px); }

/* Student notice workflow */
.notice-toolbar { justify-content: space-between; }
.notice-toolbar #notice-new { margin-left: auto; }
.notice-dialog { max-width: 760px; }
.notice-dialog textarea { display: block; width: calc(100% - 40px); margin: 4px 20px 0; }
.notice-dialog .dialog-body > select { display: block; width: calc(100% - 40px); margin: 8px 20px 0; }
.notice-dialog .dialog-body > p { margin: 10px 20px 0; }
.notice-preview { display: inline-block; max-width: 440px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
.notice-delivery { white-space: nowrap; font-size: 12px; color: #5C6975; }
.notice-recipient-table { max-height: min(52vh, 430px); }
.status.draft, .status.scheduled { color: #825b0a; background: #f4e8c9; }
.status.recalled, .status.expired { color: #5C6975; background: #e5e8e9; }

@media (max-width: 800px) {
  .release-target-head, .release-deployment-head { align-items: flex-start; flex-direction: column; gap: 9px; }
  .release-target-head .toolbar { justify-content: flex-start; }
  .release-target-head .toolbar button { flex: 1 1 auto; }
  .notice-toolbar #notice-new { margin-left: 0; }
  .notice-preview { max-width: 180px; }
}
