:root {
  color-scheme: light;
  font-family: Arial, Helvetica, sans-serif;
  color: #26323a;
  background: #f5f7f7;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 280px; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .58; }
button:focus-visible, input:focus-visible { outline: 2px solid #1681a1; outline-offset: 2px; }

.site-header { background: #173f46; color: #fff; }
.header-inner { max-width: 1200px; min-height: 64px; margin: auto; padding: 10px 28px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 700; white-space: nowrap; }
.brand-mark { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 5px; background: #dbf3ef; color: #173f46; font-size: 18px; }
.header-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.signed-in { margin-right: 6px; color: #c9e3e4; font-size: 13px; }
.header-button { padding: 7px 10px; border: 1px solid #74969a; border-radius: 5px; background: transparent; color: #fff; font-size: 13px; }
.header-button:hover { background: #28555d; }

.login-view { min-height: calc(100vh - 64px); display: grid; place-items: center; padding: 30px 16px 70px; }
.login-tool { width: min(100%, 390px); padding: 30px; border: 1px solid #d7dfe1; border-radius: 7px; background: #fff; box-shadow: 0 8px 24px #173f4610; }
.login-tool h1 { margin: 0 0 25px; font-size: 22px; color: #193b42; }
.login-tool form, .dialog-body { display: grid; }
label { margin-bottom: 7px; font-size: 13px; font-weight: 700; }
input { width: 100%; height: 42px; padding: 0 12px; border: 1px solid #bfcacd; border-radius: 5px; background: #fff; color: #26323a; font-size: 14px; }
input:disabled { background: #f2f4f4; color: #657579; }
.login-tool input { margin-bottom: 19px; }
.form-message { min-height: 18px; margin: 0 0 10px; color: #a53b31; font-size: 13px; line-height: 1.35; }
.primary-button, .secondary-button, .danger-button { min-height: 39px; padding: 9px 15px; border-radius: 5px; font-size: 13px; font-weight: 700; }
.primary-button { border: 1px solid #17666b; background: #17666b; color: #fff; }
.primary-button:hover:not(:disabled) { background: #115358; }
.secondary-button { border: 1px solid #bac7c9; background: #fff; color: #30434a; }
.secondary-button:hover:not(:disabled) { background: #f2f6f6; }
.danger-button { border: 1px solid #a53b31; background: #a53b31; color: #fff; }
.danger-button:hover:not(:disabled) { background: #872d25; }
.full-width { width: 100%; }

.workspace { max-width: 1200px; margin: auto; padding: 32px 28px 70px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin-bottom: 26px; }
.page-heading h1 { margin: 0 0 6px; color: #193b42; font-size: 25px; }
.page-heading p { margin: 0; color: #66777d; font-size: 13px; }
.toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.search-label { margin: 0; color: #465961; }
.toolbar input { width: min(100%, 290px); background: #fff; }
.status-message { min-height: 18px; margin: 0 0 9px; color: #17666b; font-size: 13px; }
.status-message.is-error { color: #a53b31; }
.table-wrap { border-top: 2px solid #264b52; background: #fff; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { height: 45px; padding: 0 18px; border-bottom: 1px solid #d6dfe0; color: #5b6c72; font-size: 12px; font-weight: 700; }
td { height: 62px; padding: 10px 18px; border-bottom: 1px solid #e4e9ea; font-size: 14px; }
.user-name { font-weight: 700; overflow-wrap: anywhere; }
.role-label { display: inline-block; padding: 5px 8px; border-radius: 4px; background: #eef3f4; color: #4b6066; font-size: 11px; font-weight: 700; }
.role-label.admin { background: #e8f3f0; color: #17666b; }
.ip-address { overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.login-time { color: #5b6c72; font-size: 12px; white-space: nowrap; }
.actions-heading { text-align: right; }
.row-actions { display: flex; justify-content: flex-end; gap: 8px; }
.row-actions button { min-height: 31px; padding: 5px 9px; border: 1px solid #ccd6d8; border-radius: 5px; background: #fff; color: #30434a; font-size: 12px; }
.row-actions button:hover { background: #f1f5f5; }
.row-actions .delete-action { color: #a53b31; }
.empty-state { margin: 0; padding: 28px 18px; color: #66777d; font-size: 13px; }

dialog { width: min(440px, calc(100% - 28px)); max-height: calc(100% - 28px); padding: 0; border: 1px solid #c8d3d5; border-radius: 7px; box-shadow: 0 22px 50px #162d3260; color: #26323a; }
dialog::backdrop { background: #15282d8c; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; padding: 19px 22px; border-bottom: 1px solid #e0e6e7; }
.dialog-heading h2 { margin: 0; color: #193b42; font-size: 18px; }
.close-button { width: 28px; height: 28px; border: 0; background: transparent; color: #586a70; font-size: 25px; line-height: 1; }
.dialog-body { padding: 20px 22px 0; }
.dialog-body input { margin-bottom: 18px; }
.field-hint { margin: -9px 0 17px; color: #66777d; font-size: 12px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; padding: 16px 22px 20px; }
.delete-copy { margin: 20px 22px 14px; line-height: 1.5; font-size: 14px; }
#deleteDialog .form-message { margin: 0 22px; }

@media (max-width: 600px) {
  .header-inner { align-items: flex-start; flex-wrap: wrap; padding: 13px 16px; }
  .header-actions { width: 100%; justify-content: flex-start; }
  .workspace { padding: 26px 16px 55px; }
  .page-heading { align-items: flex-start; }
  .page-heading h1 { font-size: 22px; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .toolbar input { width: 100%; }
  thead { display: none; }
  tr { display: grid; grid-template-columns: 1fr auto; padding: 12px 14px; border-bottom: 1px solid #e4e9ea; }
  td { height: auto; padding: 3px 0; border: 0; }
  td:nth-child(2), td:nth-child(3), td:nth-child(4) { grid-column: 1; }
  td:nth-child(3), td:nth-child(4) { color: #5b6c72; font-size: 12px; }
  td:nth-child(5) { grid-column: 2; grid-row: 1 / span 4; align-self: center; padding-left: 10px; }
  .row-actions { flex-wrap: wrap; max-width: 110px; }
  .login-tool { padding: 24px; }
}
