:root {
  --brand: #0b7a69;
  --brand-2: #0e8f7a;
  --brand-soft: #e4f2f0;
  --ink: #17324d;
  --ink-soft: #51708a;
  --line: #dce6ec;
  --bg: #f3f7f9;
  --card: #ffffff;
  --ok: #16a34a;
  --warn: #d97706;
  --danger: #dc2626;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 49, 72, 0.06), 0 8px 24px rgba(16, 49, 72, 0.06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

button, input, select, textarea { font-family: inherit; font-size: inherit; }
button { cursor: pointer; }

/* ---------- Login ---------- */
.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: linear-gradient(180deg, #fbfdfe 0%, var(--bg) 100%);
}

.login-brand {
  flex: 1 1 46%;
  color: var(--ink);
  padding: 48px 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-brand .logo-row { display: flex; align-items: center; gap: 14px; margin-bottom: 30px; }
.login-brand .mark {
  width: 54px; height: 54px; border-radius: 14px;
  background: var(--brand-soft);
  display: grid; place-items: center;
  border: 1px solid #cbe4df;
}
.login-brand .mark svg { width: 30px; height: 30px; color: var(--brand); }
.login-brand h1 { font-size: 30px; font-weight: 800; margin: 0; letter-spacing: 0; line-height: 1.25; }
.login-brand .tagline { font-size: 15px; color: var(--ink-soft); margin-top: 6px; font-weight: 500; }
.login-brand .points { margin-top: 34px; display: grid; gap: 14px; }
.login-brand .points .row { display: flex; align-items: flex-start; gap: 12px; }
.login-brand .points .dot {
  width: 26px; height: 26px; border-radius: 8px; flex: none;
  background: var(--brand-soft);
  color: var(--brand);
  display: grid; place-items: center;
}
.login-brand .points .dot svg { width: 15px; height: 15px; }
.login-brand .points p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--ink-soft); }

.login-panel {
  flex: 1 1 54%;
  display: grid;
  place-items: center;
  padding: 32px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 36px 34px;
}

.local-test-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 11px;
  border: 1px solid #e6b84f;
  border-radius: 999px;
  background: #fff4d8;
  color: #8a4b00;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 12px;
}

.login-card .brand-pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--brand-soft); color: var(--brand);
  font-size: 12px; font-weight: 700;
  padding: 6px 12px; border-radius: 999px;
  margin-bottom: 16px;
}
.login-card h2 { font-size: 24px; margin: 0 0 4px; letter-spacing: 0; }
.login-card .sub { color: var(--ink-soft); font-size: 14px; margin: 0 0 26px; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-soft); margin-bottom: 7px; }
.field .control {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0 14px; height: 48px;
  background: #fbfdfe; transition: border-color .15s, box-shadow .15s;
}
.field .control:focus-within { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(14, 143, 122, 0.14); }
.field .control svg { width: 18px; height: 18px; color: var(--ink-soft); flex: none; }
.field input {
  border: 0; outline: 0; flex: 1; height: 100%;
  background: transparent; color: var(--ink); font-size: 15px;
}
.field input::placeholder { color: #9fb3c0; }
.field .eye {
  border: 0; background: transparent; color: var(--ink-soft);
  padding: 4px; display: grid; place-items: center;
}
.field .eye svg { width: 18px; height: 18px; }
.hint { font-size: 12px; color: var(--ink-soft); margin-top: 12px; line-height: 1.5; }

.btn-primary {
  width: 100%; height: 48px; border: 0; border-radius: var(--radius);
  background: var(--brand-2); color: #fff; font-size: 16px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: background .15s, transform .05s;
}
.btn-primary:hover { background: var(--brand); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { opacity: .6; cursor: default; }

.err {
  background: #fdecec; color: var(--danger);
  border: 1px solid #f5c6c6; border-radius: var(--radius);
  padding: 10px 12px; font-size: 13px; margin-bottom: 16px;
}

/* ---------- App shell ---------- */
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 16px;
  padding: 0 20px; height: 64px;
  position: sticky; top: 0; z-index: 10;
}
.topbar .app-brand { display: flex; align-items: center; gap: 11px; font-weight: 700; flex-shrink: 0; }
.topbar .app-brand span { white-space: nowrap; }
.topbar .app-brand .logo {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--brand-soft); color: var(--brand);
  display: grid; place-items: center;
}
.topbar .app-brand .logo svg { width: 21px; height: 21px; }
.topbar .topbar-test-badge { flex: none; margin: 0; }
.topbar .spacer { flex: 1; }
.topbar .userbox { display: flex; align-items: center; gap: 10px; }
.topbar .avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--brand-2); color: #fff; font-weight: 700; font-size: 14px;
  display: grid; place-items: center;
}
.topbar .user-meta { line-height: 1.2; }
.topbar .user-meta .name { font-weight: 700; font-size: 14px; }
.topbar .user-meta .role { font-size: 12px; color: var(--ink-soft); }
.btn-ghost {
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  height: 38px; padding: 0 14px; border-radius: var(--radius);
  font-weight: 600; font-size: 13px; display: flex; align-items: center; gap: 7px;
  white-space: nowrap; flex-shrink: 0;
}
.btn-ghost:hover { background: #f4f8fa; }
.btn-ghost svg { width: 16px; height: 16px; }

.page { width: 100%; max-width: 1040px; margin: 0 auto; padding: 30px 22px 60px; }
.page h2 { font-size: 22px; margin: 0 0 4px; letter-spacing: 0; }
.page .page-sub { color: var(--ink-soft); margin: 0 0 24px; font-size: 14px; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; }
.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform .08s, box-shadow .15s, border-color .15s;
  display: flex; flex-direction: column; gap: 12px;
  text-align: left; min-height: 168px;
}
.card:hover { transform: translateY(-2px); border-color: #bcd6d9; box-shadow: 0 12px 30px rgba(16,49,72,.1); }
.card:focus-visible { outline: 3px solid rgba(14, 143, 122, 0.22); outline-offset: 2px; }
.card.dragging {
  z-index: 2;
  opacity: 0.58;
  transform: scale(0.98);
  border-color: var(--brand-2);
  box-shadow: 0 18px 38px rgba(16, 49, 72, 0.16);
}
.card.drop-target {
  border-color: var(--brand-2);
  box-shadow: 0 0 0 3px rgba(14, 143, 122, 0.12);
}
.card-drag {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: #79909f;
  border: 1px solid #e4ecef;
  border-radius: 8px;
  background: #f8fbfc;
  cursor: grab;
  touch-action: none;
}
.card-drag:hover { color: var(--brand); border-color: #bcd6d9; background: #eef7f5; }
.card-drag:active { cursor: grabbing; }
.card-drag svg { width: 16px; height: 16px; pointer-events: none; }
.card .icon {
  width: 48px; height: 48px; border-radius: 13px;
  display: grid; place-items: center; flex: none;
}
.card .icon svg { width: 26px; height: 26px; }
.card .icon.c1 { background: #e3f3ee; color: #0f8a70; }
.card .icon.c2 { background: #e6eefb; color: #2563a8; }
.card .icon.c3 { background: #fdf1e0; color: #c07a15; }
.card .icon.c4 { background: #f3e8ff; color: #7e22ce; }
.card .icon.c5 { background: #fdecef; color: #b83f5a; }
.card .icon.c6 { background: #e8edff; color: #4356b8; }
.card h3 { margin: 0; font-size: 17px; letter-spacing: 0; }
.card p { margin: 0; font-size: 13.5px; color: var(--ink-soft); line-height: 1.5; flex: 1; }
.card .go { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--brand); }
.card .go svg { width: 16px; height: 16px; }

/* ---------- Module view ---------- */
.module-view {
  flex: 1; min-height: 0; height: calc(100vh - 64px);
  display: flex; flex-direction: column; background: var(--bg);
}
.module-bar {
  display: flex; align-items: center; gap: 12px;
  height: 54px; padding: 0 18px;
  border-bottom: 1px solid var(--line); background: var(--card);
}
.module-bar button {
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  height: 34px; padding: 0 12px; border-radius: 8px;
  font-weight: 600; font-size: 13px; display: flex; align-items: center; gap: 7px;
}
.module-bar button svg { width: 15px; height: 15px; }
.module-bar .title { font-weight: 700; }
.module-frame-wrap {
  flex: 1; min-height: 0; height: calc(100vh - 118px); padding: 0;
  display: flex; overflow: hidden; background: var(--bg);
  padding: 12px 16px 16px;
  position: relative;
}
.module-frame {
  border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow);
  width: 100%; height: calc(100vh - 146px);
  min-height: 0; flex: 0 0 auto; background: var(--card);
}

.module-loading {
  position: absolute;
  inset: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink-soft);
  font-weight: 700;
}

.module-loading > svg { width: 22px; height: 22px; color: var(--brand); }
.module-loading.error { flex-direction: column; color: var(--danger); text-align: center; }
.module-loading.error > svg { color: var(--danger); }
.module-loading[hidden] { display: none !important; }

/* ---------- Accounts ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }
.btn {
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  height: 38px; padding: 0 14px; border-radius: var(--radius); font-weight: 600; font-size: 13px;
  display: inline-flex; align-items: center; gap: 7px;
}
.btn:hover { background: #f4f8fa; }
.btn svg { width: 16px; height: 16px; }
.btn.accent { background: var(--brand-2); color: #fff; border-color: var(--brand-2); }
.btn.accent:hover { background: var(--brand); }
.btn.danger { color: var(--danger); border-color: #f3c8c8; }
.btn.small { height: 32px; padding: 0 10px; font-size: 12.5px; }

.table-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left; font-size: 12px; font-weight: 700; color: var(--ink-soft);
  padding: 12px 16px; border-bottom: 1px solid var(--line); background: #f7fafb;
}
tbody td { padding: 14px 16px; border-bottom: 1px solid #eef3f5; font-size: 14px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafcfd; }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.pill.admin { background: #e6eefb; color: #2563a8; }
.pill.staff { background: #e3f3ee; color: #0f8a70; }
.pill.clerk { background: #fff1d6; color: #9a5b00; }
.pill.supervisor { background: #fdecef; color: #a9344d; }
.pill.module { background: #edf4f6; color: #345f71; }
.pill.off { background: #f0f3f5; color: var(--ink-soft); }
.actions { display: flex; gap: 6px; }
.icon-btn {
  border: 1px solid var(--line); background: #fff; width: 32px; height: 32px;
  border-radius: 8px; display: grid; place-items: center; color: var(--ink);
}
.icon-btn:hover { background: #f4f8fa; }
.icon-btn svg { width: 15px; height: 15px; }
.permission-badges { display: flex; flex-wrap: wrap; gap: 5px; }
.account-username { font-size: 12px; color: #8aa0ad; margin-top: 3px; }
.account-state { font-size: 12px; color: #8aa0ad; margin-top: 3px; }

.form-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.account-form .field { margin-bottom: 14px; }
.account-form select {
  width: 100%; height: 48px; border: 1px solid var(--line); border-radius: var(--radius);
  background: #fbfdfe; color: var(--ink); padding: 0 12px; outline: 0;
}
.account-form select:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(14, 143, 122, 0.14); }
.account-form select:disabled { color: #8aa0ad; background: #f2f5f6; }
.permission-box {
  border: 1px solid var(--line); border-radius: 12px;
  background: #fbfdfe; padding: 14px;
}
.permission-title { font-size: 13px; font-weight: 700; color: var(--ink-soft); margin-bottom: 10px; }
.permission-grid { display: grid; gap: 9px; }
.permission-option {
  display: flex; align-items: center; gap: 9px;
  font-size: 14px; font-weight: 600; color: var(--ink);
}
.permission-option > span { display: grid; gap: 2px; min-width: 0; }
.permission-option strong { font-size: 14px; }
.permission-option small,
.feature-permission-option small {
  display: block;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.45;
}
.permission-option input { width: 17px; height: 17px; accent-color: var(--brand-2); }
.permission-option input:disabled + span { color: #8aa0ad; }
.feature-permission-list { display: grid; gap: 10px; }
.feature-permission-module {
  padding: 11px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 11px;
}
.feature-permission-module.active {
  border-color: #bcded6;
  box-shadow: 0 1px 0 rgba(14, 143, 122, 0.04);
}
.feature-module-toggle {
  align-items: flex-start;
  padding: 2px 0 10px;
  border-bottom: 1px solid var(--line);
}
.feature-module-toggle input { margin-top: 2px; }
.feature-permission-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-top: 10px;
}
.feature-permission-option {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-height: 54px;
  padding: 9px;
  color: var(--ink);
  background: #fbfdfe;
  border: 1px solid var(--line);
  border-radius: 9px;
}
.feature-permission-option > span { display: grid; gap: 2px; min-width: 0; }
.feature-permission-option strong { font-size: 12px; }
.feature-permission-option input {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin-top: 1px;
  accent-color: var(--brand-2);
}
.feature-permission-option:has(input:checked) {
  background: var(--brand-soft);
  border-color: #bcded6;
}
.feature-permission-option:has(input:disabled) {
  opacity: 0.52;
}
.dept-scope-box { margin-bottom: 14px; }
.dept-scope-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.dept-scope-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 10px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 12px;
  font-weight: 600;
}
.dept-scope-option.active,
.dept-scope-option:has(input:checked) {
  color: var(--brand);
  background: var(--brand-soft);
  border-color: #bcded6;
}
.dept-scope-option input {
  width: 16px;
  height: 16px;
  accent-color: var(--brand-2);
}
.dept-scope-option input:disabled + span { color: #8aa0ad; }
.dept-scope-toggle {
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
}
.bulk-dept-scope-grid { margin-top: 11px; }
.account-admin-toolbar { align-items: flex-end; }
.account-admin-toolbar h3 { margin: 0 0 3px; font-size: 16px; }
.account-admin-toolbar p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
}
.account-check-column {
  width: 46px;
  text-align: center;
}
.account-check-column input {
  width: 17px;
  height: 17px;
  accent-color: var(--brand-2);
}
.account-check-column input:disabled { opacity: 0.35; }
.account-row-selected { background: var(--brand-soft) !important; }
.bulk-editor { display: grid; gap: 14px; }
.bulk-summary {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px;
  background: #f7fafb;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.bulk-summary > div { display: grid; gap: 2px; min-width: 0; }
.bulk-summary strong { font-size: 14px; }
.bulk-summary small {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bulk-section {
  padding: 13px 14px;
  background: #fbfdfe;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.bulk-section h4 {
  margin: 0 0 8px;
  font-size: 13px;
}
.bulk-section select {
  width: 100%;
  height: 42px;
  padding: 0 11px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: 0;
}
.bulk-section select:focus {
  border-color: var(--brand-2);
  box-shadow: 0 0 0 3px rgba(14, 143, 122, 0.14);
}
.bulk-section p {
  margin: 7px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
}
.bulk-permission-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 11px;
}
.bulk-permission-option {
  padding: 9px 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
}
.bulk-permission-option:has(input:disabled) {
  background: #f4f7f8;
}
.bulk-warning {
  padding: 10px 12px;
  color: #80500f;
  background: #fff7e8;
  border: 1px solid #f0d3a9;
  border-radius: 10px;
  font-size: 11px;
  line-height: 1.5;
}

/* ---------- Super admin UI settings ---------- */
.settings-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
}
.settings-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  box-shadow: var(--shadow);
}
.settings-panel-head { margin-bottom: 16px; }
.settings-panel-head h3 { margin: 0 0 3px; font-size: 17px; }
.settings-panel-head p { margin: 0; color: var(--ink-soft); font-size: 13px; }
.settings-form .field:last-child { margin-bottom: 0; }
.settings-form select {
  width: 100%;
  height: 48px;
  padding: 0 12px;
  color: var(--ink);
  background: #fbfdfe;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: 0;
}
.settings-form select:focus {
  border-color: var(--brand-2);
  box-shadow: 0 0 0 3px rgba(14, 143, 122, 0.14);
}
.ui-order-list { display: grid; gap: 9px; }
.ui-order-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 32px 32px;
  align-items: center;
  gap: 8px;
  padding: 10px 11px;
  background: #f8fbfc;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.ui-order-index {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 7px;
  font-size: 12px;
  font-weight: 800;
}
.ui-order-name { min-width: 0; font-size: 13px; font-weight: 700; }
.ui-card-text-list { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ui-card-text-row {
  padding: 14px;
  background: #f8fbfc;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.ui-card-text-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 12px;
  font-size: 14px;
}
.icon.mini {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}
.icon.mini svg { width: 16px; height: 16px; }
.ui-card-text-row .field { margin-bottom: 12px; }
.ui-card-text-row .field:last-child { margin-bottom: 0; }
.ui-attendance-nav-list { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ui-attendance-nav-row {
  padding: 14px;
  background: #f8fbfc;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.ui-attendance-nav-row .ui-card-text-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
}
.ui-attendance-nav-row .ui-card-text-head small {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 600;
}
.ui-attendance-nav-row .field { margin-bottom: 12px; }
.ui-attendance-roles {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.ui-attendance-roles > strong { font-size: 12px; }
.ui-attendance-roles > div { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.ui-attendance-role {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
}
.ui-attendance-role input { accent-color: var(--brand); }
.ui-attendance-user-list { display: grid; gap: 12px; }
.ui-attendance-user-row {
  display: grid;
  gap: 12px;
  padding: 14px;
  background: #f8fbfc;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.ui-attendance-user-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}
.ui-attendance-user-head > div { display: grid; gap: 2px; min-width: 0; }
.ui-attendance-user-head strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.ui-attendance-user-head small { color: var(--ink-soft); font-size: 11px; }
.ui-user-initial {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: #fff;
  background: var(--brand);
  border-radius: 50%;
  font-size: 13px;
  font-weight: 800;
}
.ui-attendance-user-pages {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.ui-attendance-user-pages > strong { font-size: 12px; }
.ui-attendance-user-pages > div { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.settings-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
}
.settings-actions .spacer { flex: 1; }
.icon-btn:disabled { cursor: default; opacity: 0.36; }

body.large-text .page h2 { font-size: 25px; }
body.large-text .page-sub { font-size: 16px; }
body.large-text .card h3 { font-size: 19px; }
body.large-text .card p { font-size: 15px; }
body.large-text .card .go { font-size: 14px; }
body.large-text .settings-panel-head h3 { font-size: 19px; }

/* ---------- Modal ---------- */
.overlay {
  position: fixed; inset: 0; background: rgba(16, 34, 44, 0.42);
  display: grid; place-items: center; z-index: 100; padding: 20px;
}
.modal {
  background: #fff; border-radius: 16px; width: 100%; max-width: 540px;
  box-shadow: 0 20px 60px rgba(0,0,0,.22); padding: 26px 26px 22px;
  max-height: calc(100vh - 40px); overflow-y: auto;
}
.modal h3 { margin: 0 0 18px; font-size: 18px; letter-spacing: 0; }
.modal .actions { margin-top: 20px; display: flex; gap: 10px; justify-content: flex-end; }
.modal .actions .btn { height: 40px; }

/* empty state */
.empty { text-align: center; color: var(--ink-soft); padding: 48px 20px; }
.empty svg { width: 40px; height: 40px; opacity: .4; margin-bottom: 12px; }

/* toast */
.toasts { position: fixed; bottom: 24px; right: 24px; display: flex; flex-direction: column; gap: 10px; z-index: 200; }
.toast {
  background: #fff; color: var(--ink); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 16px; font-size: 14px; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 9px; min-width: 240px;
}
.toast.ok { border-left: 4px solid var(--ok); }
.toast.err { border-left: 4px solid var(--danger); }
.toast svg { width: 17px; height: 17px; }

/* responsive */
@media (max-width: 720px) {
  .login-shell { flex-direction: column; }
  .login-brand { padding: 36px 24px 8px; }
  .login-brand h1 { font-size: 24px; }
  .login-brand .points { margin-top: 20px; }
  .login-panel { padding: 18px; }
  .login-card { padding: 26px 22px; }
  .topbar { padding: 0 12px; gap: 10px; }
  .topbar .app-brand span { display: none; }
  .topbar .user-meta { display: none; }
  .btn-ghost { padding: 0 10px; font-size: 12px; gap: 5px; }
  .module-bar { padding: 0 12px; }
  .module-frame-wrap { padding: 8px; }
  .module-frame { height: calc(100vh - 140px); border-radius: 12px; }
  .page { padding: 20px 14px 50px; }
  .grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .card { min-height: 150px; padding: 16px; }
  .form-two { grid-template-columns: 1fr; gap: 0; }
  .bulk-permission-grid { grid-template-columns: 1fr; }
  .feature-permission-grid { grid-template-columns: 1fr; }
  .dept-scope-grid { grid-template-columns: 1fr; }
  .settings-layout,
  .ui-card-text-list,
  .ui-attendance-nav-list { grid-template-columns: 1fr; }
  .ui-attendance-user-pages { grid-template-columns: 1fr; }
  .settings-actions { flex-wrap: wrap; }
  .settings-actions .spacer { display: none; }
  .modal { padding: 22px 18px 18px; }
}

@media (max-width: 520px) {
  .topbar { gap: 6px; padding: 0 10px; }
  .topbar .topbar-test-badge { display: none; }
  .topbar .app-brand .logo { width: 32px; height: 32px; border-radius: 9px; }
  .topbar .avatar { width: 32px; height: 32px; }
  .topbar .btn-ghost {
    width: 34px; height: 34px; padding: 0; gap: 0;
    justify-content: center; font-size: 0;
  }
  .topbar .btn-ghost svg { width: 17px; height: 17px; }
}
