.admin-header { max-width: 1440px; margin: auto; padding: 16px 24px; min-height: 76px; display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.brand-link { display: flex; align-items: center; gap: 12px; color: #202925; text-decoration: none; font-size: 21px; font-weight: 650; overflow-wrap: anywhere; }
.brand-link svg { width: 32px; height: 32px; color: #167747; flex-shrink: 0; }
.page-name { color: #637067; }
#session-bar { margin-left: auto; display: flex; gap: 16px; align-items: center; min-width: 0; flex-wrap: wrap; }
#session-name { overflow-wrap: anywhere; }
.admin-main { max-width: 1440px; margin: 24px auto; }
.login-surface { max-width: 420px; margin: 28px auto; }
.admin-main h1 { font-size: 21px; }
.admin-tabs { display: flex; border-bottom: 1px solid #bfcac4; gap: 6px; margin-bottom: 22px; flex-wrap: wrap; }
.admin-tabs button { color: #4d6256; background: transparent; border: 0; border-bottom: 3px solid transparent; border-radius: 0; }
.admin-tabs button.active { color: #176747; border-bottom-color: #197744; font-weight: 600; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toolbar input { width: 280px; max-width: 100%; }
.icon-button { width: 44px; height: 44px; padding: 0; flex-shrink: 0; }
.table-scroll { overflow: auto; width: 100%; border-top: 1px solid #d8dfdb; border-bottom: 1px solid #d8dfdb; background: white; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; }
th { background: #edf1ee; font-weight: 600; white-space: nowrap; }
th, td { padding: 11px 12px; border-bottom: 1px solid #e0e6e2; }
td { vertical-align: middle; overflow-wrap: anywhere; min-width: 85px; max-width: 240px; }
#account-rows td:nth-child(6) { white-space: nowrap; }
.account-limits { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.account-limits > .form-row { min-width: 0; }
.account-limits input { min-width: 0; max-width: 100%; }
/* iOS date controls can add padding outside their declared width with native appearance. */
#account-expiry { -webkit-appearance: none; appearance: none; display: block; box-sizing: border-box; width: 100%; min-width: 0; max-width: 100%; }
#account-expiry::-webkit-date-and-time-value { min-height: 1.6em; text-align: left; }
@supports (-webkit-touch-callout: none) {
  #account-expiry { padding-left: 0; padding-right: 0; }
  #account-expiry::-webkit-date-and-time-value { box-sizing: border-box; padding: 0 12px; }
}
tr:last-child td { border-bottom: 0; }
.row-actions { display: flex; gap: 5px; flex-wrap: nowrap; }
.row-actions button { width: 32px; height: 32px; min-height: 32px; padding: 0; border-color: #b9c9bf; background: white; color: #496553; }
.row-actions button.danger { color: #a32929; border-color: #cf9c9c; }
.row-actions svg { width: 16px; height: 16px; }
.empty-cell { text-align: center; padding: 30px; color: #637067; }
.cell-label { display: none; }
.cell-value { min-width: 0; }
.settings-form { max-width: 580px; }
.server-layout { display: grid; grid-template-columns: minmax(0, 580px) minmax(0, 1fr); gap: 48px; }
.server-layout fieldset { padding: 0; margin: 0; border: 0; min-width: 0; }
.server-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.server-status h2 { font-size: 17px; margin: 0 0 18px; }
.server-status dl { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 16px; margin: 0; }
.server-status dt { color: #637067; }
.server-status dd { margin: 0; overflow-wrap: anywhere; }
.server-status { padding: 18px 0; border-top: 1px solid #d8dfdb; }
.storage-section { margin-top: 28px; padding-top: 22px; border-top: 1px solid #d8dfdb; }
.storage-section h2 { font-size: 17px; margin: 0; }
.storage-section .check-row { margin: 0; }
#storage-state { min-height: 24px; }
#storage-progress { max-width: 580px; margin-top: 20px; }
#storage-meter { width: 100%; height: 10px; accent-color: #197744; }
#storage-progress-text, #storage-message { overflow-wrap: anywhere; }
.storage-current { overflow-wrap: anywhere; }
.storage-last-result { margin-top: 18px; border: 1px solid #d8dfdb; padding: 14px 16px; border-radius: 4px; }
.storage-last-result summary { cursor: pointer; font-weight: 600; }
.storage-last-result dl { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 10px 16px; }
.storage-last-result dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 950px) { .server-layout { grid-template-columns: minmax(0, 1fr); gap: 28px; } }
@media (max-width: 420px) { .server-pair { grid-template-columns: minmax(0, 1fr); gap: 0; } .server-status dl { grid-template-columns: minmax(0, 1fr); gap: 8px; } .server-status dd { margin-bottom: 12px; } }
.settings-pair { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 20px; }
select { width: 100%; font: inherit; min-height: 44px; border: 1px solid #a8b7ae; border-radius: 4px; background: white; padding: 8px 10px; color: inherit; }
.check-row { display: flex; gap: 10px; align-items: center; font-weight: 400; margin-top: 16px; }
input[type="checkbox"] { width: 18px; min-height: 18px; flex-shrink: 0; accent-color: #197744; }
.mail-test { max-width: 580px; margin-top: 30px; padding-top: 20px; border-top: 1px solid #d8dfdb; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.mail-test input { flex: 1 1 260px; min-width: 0; }
.mail-test label { width: 100%; }
.invite-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 16px 0 24px; }
.invite-row label { margin: 0; }
.invite-row input { flex: 1 1 280px; min-width: 0; }
dialog { width: 540px; max-width: calc(100% - 32px); max-height: calc(100% - 32px); padding: 24px; border: 1px solid #c4d0c8; border-radius: 6px; color: #202925; overflow: auto; }
dialog::backdrop { background: #1c302d70; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.dialog-heading h2 { min-width: 0; }
#import-dialog { width: 1200px; }
#import-form { display: flex; gap: 16px; flex-wrap: wrap; align-items: end; margin-top: 20px; }
#import-form .form-row { flex: 1 1 230px; margin-bottom: 0; }
#import-form .actions { margin: 0; }
.import-history { margin-top: 24px; }
.import-actions { flex-wrap: wrap; }
#import-rows .error-row { background: #fff1f1; }
#import-rows .warning-row { background: #fffbed; }
#import-message, #import-summary { overflow-wrap: anywhere; }
.input-command { display: flex; gap: 10px; }
.input-command input { min-width: 0; flex: 1; }
.input-command button { flex-shrink: 0; }
.enrollment-main { max-width: 520px; }
.enrollment-qr { display: block; width: 260px; height: 260px; object-fit: contain; max-width: 100%; margin: 20px auto; background: white; }
#enroll-complete { margin-top: 20px; }
button:focus-visible, a:focus-visible { outline: 2px solid #315d9b; outline-offset: 2px; }
.reception-section { margin-top: 28px; padding-top: 20px; border-top: 1px solid #d8dfdb; }
.reception-statistics { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 12px; margin: 16px 0; }
.reception-statistics > div { min-width: 0; padding: 14px; border: 1px solid #d8dfdb; border-radius: 4px; }
.reception-statistics dt { color: #637067; font-size: 13px; }
.reception-statistics dd { margin: 6px 0 0; font-size: 20px; font-weight: 600; overflow-wrap: anywhere; }
@media (max-width: 760px) {
  .admin-header { gap: 12px; padding: 14px 16px; }
  .brand-link { min-width: 0; font-size: 19px; }
  .page-name { display: none; }
  #session-bar { margin-left: 0; width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; }
  .admin-main { margin: 20px auto; padding: 0 16px; }
  .admin-main h1 { font-size: 20px; }
  .login-surface { margin: 24px auto; }
  .login-surface .actions > button { width: 100%; }
  .admin-main input:not([type="checkbox"]), .admin-main select, dialog input { min-width: 0; font-size: 16px; }
  .admin-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
  .admin-tabs button { padding: 10px 8px; font-size: 14px; }
  .section-heading { gap: 12px; }
  .toolbar { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) 44px; gap: 8px; }
  .toolbar input { width: 100%; grid-column: 1 / -1; }
  #open-import { grid-column: 1 / -1; grid-row: 3; }
  #refresh-accounts { grid-column: 2; grid-row: 2; }
  .settings-pair, .server-pair, .account-limits { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .server-layout { gap: 24px; }
  .server-status dl { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .server-status dd { margin-bottom: 12px; }
  .mail-test input, .mail-test button, .invite-row input, .invite-row button { width: 100%; flex-basis: 100%; }
  .storage-section .section-heading { align-items: flex-start; }
  .check-row { min-height: 44px; }
  .storage-section .check-row { width: 100%; }
  .storage-last-result dl { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .storage-last-result dd { margin-bottom: 10px; }
  dialog { width: 540px; max-width: calc(100% - 24px); max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); padding: 18px; }
  dialog .actions { display: grid; grid-template-columns: minmax(0, 1fr); }
  .responsive-table, .responsive-table tbody { display: block; }
  /* Keep column headings available to assistive technology in the stacked view. */
  .responsive-table thead { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .responsive-table tbody tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; padding: 16px 12px; border-bottom: 1px solid #d8dfdb; }
  .responsive-table tbody tr:last-child { border-bottom: 0; }
  .responsive-table td { display: block; min-width: 0; max-width: none; padding: 0; border: 0; white-space: normal; }
  .responsive-table .cell-label { display: block; color: #637067; font-size: 12px; font-weight: 400; margin-bottom: 3px; }
  .responsive-table .cell-value { display: block; font-size: 14px; overflow-wrap: anywhere; }
  #account-rows td:nth-child(-n+5), #operator-rows td:first-child { grid-column: 1 / -1; display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 8px; align-items: baseline; }
  #account-rows td:first-child .cell-value { font-weight: 650; }
  #account-rows td:nth-child(6) { white-space: normal; }
  .responsive-table td:last-child { grid-column: 1 / -1; }
  .responsive-table td:last-child .cell-label { margin-bottom: 8px; }
  .row-actions { gap: 8px; flex-wrap: wrap; }
  .row-actions button { width: 44px; height: 44px; min-height: 44px; flex-shrink: 0; }
  .row-actions svg { width: 19px; height: 19px; }
  #account-rows .row-actions { display: grid; grid-template-columns: repeat(6, 44px); }
  .responsive-table .empty-row { display: block; }
  .responsive-table .empty-cell { display: block; padding: 14px 0; }
}
@media (max-width: 360px) {
  #account-rows .row-actions { grid-template-columns: repeat(3, 44px); }
}
@media (pointer: coarse) {
  .row-actions button { width: 44px; height: 44px; min-height: 44px; }
}
