.system-tabs { display: flex; gap: .5rem; flex-wrap: wrap; margin: 0 0 1rem; }
.system-tabs [aria-current] { background: #e9f5ef; color: #155640; border-color: #a4ccbb; font-weight: 700; }
.system-card { background: white; border: 1px solid #e1e9e5; border-radius: 14px; padding: 1rem 1.25rem; margin: 0 0 1rem; min-width: 0; }
.system-card-header, .system-inline, .system-copy { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.system-card-header { justify-content: space-between; margin-bottom: .75rem; }
.system-card h2 { font-size: 1.05rem; margin: 0; }
.system-card td { overflow-wrap: anywhere; }
.system-card td button { white-space: nowrap; }
.system-card > button { margin: .8rem .5rem 0 0; }
.system-copy { margin: .9rem 0; align-items: end; }
.system-copy label { flex: 1 1 280px; }
.system-dialog { width: min(96vw, 520px); max-height: 90vh; overflow: auto; }
.system-fields { display: grid; gap: .85rem; }
.system-fields fieldset { border: 1px solid #e1e9e5; border-radius: 8px; display: grid; gap: .3rem; }
.system-fields label:has([type="checkbox"]) { display: flex; align-items: center; justify-content: start; gap: .5rem; }
.system-fields input[type="checkbox"] { width: auto; order: -1; }
.system-fields textarea { width: 100%; padding: .5rem; border: 1px solid #b4c5bd; border-radius: 6px; font: inherit; }
.system-feedback:not(:empty) { padding: .75rem 1rem; background: #f1f7f5; border-radius: 8px; margin-bottom: .75rem; }
.system-feedback label { margin: .5rem 0; }
.permission-preview { display: flex; flex-wrap: wrap; align-items: end; gap: .75rem; }
.permission-preview label { flex: 1 1 12rem; }
.permission-preview-result { margin-top: 1rem; }
.permission-preview-result .system-card { margin: 0; padding: 0; border: 0; }
.tenant-image-logo { width: 32px; height: 32px; object-fit: contain; border-radius: 6px; }
.signin-identity { display: flex; align-items: center; gap: .5rem; margin-bottom: .65rem; }
#signin-feishu { display: inline-block; margin-top: .75rem; }
#detail-modules li { display: grid; gap: .4rem; margin: .65rem 0; }

.system-heading { margin-bottom: 1rem; }
.system-heading h1 { font-size: 28px; margin: .4rem 0; }
.system-heading p:last-child { color: var(--muted); }
.tenant-shell .system-card, .tenant-shell .system-dialog { background: var(--panel); color: var(--ink); border-color: var(--border); }
.tenant-shell :is(.system-card,.system-dialog,.system-tabs,.system-feedback) button {
  border: 1px solid var(--border); border-radius: 6px; min-height: 36px; padding: .45rem .7rem;
}
.tenant-shell :is(.system-card,.system-dialog) button.primary { color: var(--canvas); background: var(--blue); border-color: var(--blue); }
.tenant-shell .system-tabs button[aria-current] { color: var(--blue); background: var(--accent-bg); border-color: var(--blue); }
.tenant-shell .system-card :is(td,th) { border-color: var(--border); }
.tenant-shell .system-card th { background: var(--nav); color: var(--muted); }
.tenant-shell :is(.system-card,.system-dialog) :is(input,select,textarea) { color: var(--ink); background: var(--nav); border-color: var(--border); }
.tenant-shell :is(.system-card,.system-dialog,.system-management) .muted { color: var(--muted); }
.tenant-shell .system-fields fieldset { border-color: var(--border); }
.tenant-shell .system-feedback:not(:empty) { color: var(--ink); background: var(--accent-bg); }
.tenant-shell .system-dialog { padding: 1.25rem; }
.tenant-shell .system-dialog .dialog-actions { display: flex; justify-content: end; gap: .5rem; margin-top: 1rem; }
.tenant-shell .system-dialog .error:not(:empty) { color: #dc6464; margin-top: .75rem; }
#workbench-company { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mobile-company-logo { display: none; }
@media (max-width: 820px) { .mobile-company-logo { display: block; width: 23px; height: 23px; } }

.directory-layout { display: grid; grid-template-columns: minmax(10rem, 16rem) minmax(0, 1fr); gap: 1rem; }
.directory-departments { max-height: 32rem; overflow: auto; border: 1px solid var(--border); border-radius: 8px; padding: .5rem; }
.directory-departments ul { padding-inline-start: .75rem; }
.directory-department { display: flex; align-items: start; }
.tenant-shell .directory-departments button { min-width: 0; border-color: transparent; text-align: start; overflow-wrap: anywhere; }
.tenant-shell .directory-departments button[aria-current] { background: var(--accent-bg); color: var(--blue); }
.tenant-shell .directory-toggle { flex: none; }
.directory-search { display: flex; flex-wrap: wrap; align-items: end; gap: .5rem; margin-bottom: .75rem; }
.directory-search label { flex: 1 1 10rem; }
.directory-results > .system-card { margin-top: .5rem; padding: 0; border: 0; }
@media (max-width: 640px) {
  .scheduled-task-card table, .scheduled-task-card tbody, .scheduled-task-card tr, .scheduled-task-card td { display: block; }
  .scheduled-task-card thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .scheduled-task-card tr { border: 1px solid var(--border); border-radius: 8px; padding: .45rem .75rem; margin-bottom: .75rem; }
  .tenant-shell .scheduled-task-card td { display: flex; gap: .75rem; align-items: flex-start; padding: .35rem 0; border: 0; }
  .scheduled-task-card td::before { content: attr(data-label); flex: 0 0 4em; color: var(--muted); }
  .directory-layout { grid-template-columns: minmax(0, 1fr); }
  .directory-departments { max-height: 13rem; }
}

.directory-person { display: inline-flex; align-items: center; gap: .55rem; position: relative; }
.directory-avatar { display: inline-grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--accent-bg); color: var(--blue); font-weight: 600; object-fit: cover; }
.directory-avatar-photo { position: absolute; inset-inline-start: 0; opacity: 0; }
