:root {
  color-scheme: light;
  --green-950: #123d31;
  --green-800: #17533f;
  --green-650: #267056;
  --green-100: #e8f3ed;
  --cream: #f6f3e9;
  --sand: #e9dfc6;
  --ink: #18332a;
  --muted: #65766f;
  --white: #ffffff;
  --danger: #a43f3f;
  --shadow: 0 24px 70px rgba(24, 51, 42, .13);
  font-family: Inter, "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: linear-gradient(145deg, #f7f5ed 0%, #eef5ef 55%, #e2eee8 100%); }
button, input, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.page-glow { position: fixed; border-radius: 999px; filter: blur(10px); opacity: .6; pointer-events: none; }
.page-glow-one { width: 480px; height: 480px; background: rgba(60, 145, 103, .15); top: -220px; right: -100px; }
.page-glow-two { width: 360px; height: 360px; background: rgba(210, 180, 111, .15); bottom: -160px; left: -120px; }
.app-shell { position: relative; z-index: 1; width: min(1240px, calc(100% - 36px)); margin: 0 auto; padding: 36px 0 64px; }
.center-card { background: rgba(255,255,255,.9); border: 1px solid rgba(23,83,63,.1); border-radius: 26px; box-shadow: var(--shadow); backdrop-filter: blur(18px); }
.compact-card { width: min(420px, 100%); margin: 20vh auto 0; padding: 42px; text-align: center; }
.login-layout { min-height: calc(100vh - 100px); display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(340px, .65fr); gap: 54px; align-items: center; }
.welcome-panel { padding: 42px 36px; }
.eyebrow { color: var(--green-650); font-size: 12px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.welcome-panel h1 { margin: 18px 0; font-family: Georgia, "Noto Serif TC", serif; font-size: clamp(44px, 6vw, 78px); line-height: 1.08; letter-spacing: -.035em; color: var(--green-950); }
.welcome-panel > p { max-width: 620px; font-size: 18px; line-height: 1.8; color: var(--muted); }
.feature-list { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.feature-list span { padding: 10px 14px; background: rgba(255,255,255,.55); border: 1px solid rgba(23,83,63,.12); border-radius: 999px; color: var(--green-800); font-weight: 700; }
.login-card { padding: 32px; }
.brand-row { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.brand-row > div:last-child { display: flex; flex-direction: column; }
.brand-row strong { color: var(--green-950); font-size: 18px; }
.brand-row span { color: var(--muted); font-size: 13px; }
.brand-mark { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 17px; color: #fff; background: linear-gradient(145deg, #2c795e, #123d31); font-family: Georgia, serif; font-size: 27px; box-shadow: 0 10px 26px rgba(23,83,63,.25); }
.brand-mark.small { width: 42px; height: 42px; border-radius: 13px; font-size: 22px; }
label { display: grid; gap: 7px; margin-bottom: 16px; font-size: 13px; font-weight: 750; color: var(--green-950); }
input, select { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid #cbd8d1; border-radius: 12px; color: var(--ink); background: #fff; outline: none; }
input:focus, select:focus { border-color: var(--green-650); box-shadow: 0 0 0 3px rgba(38,112,86,.13); }
.primary-button, .launch-button { border: 0; color: #fff; background: var(--green-800); border-radius: 12px; font-weight: 800; transition: transform .15s, background .15s; }
.primary-button { width: 100%; min-height: 48px; padding: 11px 18px; }
.primary-button:hover, .launch-button:hover { background: var(--green-950); transform: translateY(-1px); }
button:disabled { opacity: .55; cursor: wait; }
.form-error { min-height: 22px; color: var(--danger); font-size: 13px; }
.security-note { color: var(--muted); font-size: 12px; line-height: 1.6; text-align: center; }
.portal-header { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 28px; padding: 14px 18px; background: rgba(255,255,255,.75); border: 1px solid rgba(23,83,63,.1); border-radius: 20px; backdrop-filter: blur(16px); }
.portal-header .brand-row { margin: 0; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.user-chip { display: flex; flex-direction: column; align-items: flex-end; margin-right: 8px; }
.user-chip span { font-weight: 800; }.user-chip small { color: var(--muted); }
.ghost-button { min-height: 40px; padding: 8px 13px; border: 1px solid #c8d6cf; border-radius: 11px; color: var(--green-800); background: #fff; font-weight: 750; }
.content-panel { padding: 34px; background: rgba(255,255,255,.76); border: 1px solid rgba(23,83,63,.1); border-radius: 26px; box-shadow: var(--shadow); backdrop-filter: blur(16px); }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 28px; }
.section-heading h2 { margin: 7px 0 0; font-family: Georgia, "Noto Serif TC", serif; font-size: clamp(30px, 4vw, 46px); color: var(--green-950); }
.section-heading > p { color: var(--muted); }
.system-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 18px; }
.system-card { min-height: 280px; display: flex; flex-direction: column; padding: 24px; border: 1px solid #d8e3dd; border-radius: 20px; background: #fff; box-shadow: 0 14px 36px rgba(23,83,63,.07); }
.system-icon { width: 54px; height: 54px; display: grid; place-items: center; margin-bottom: 30px; border-radius: 16px; background: var(--green-100); color: var(--green-800); font-size: 26px; font-weight: 900; }
.system-icon.schedule { background: #f5eddb; color: #7b5b20; }.system-icon.audit { background: #e9edf7; color: #3e5689; }
.system-card h3 { margin: 0 0 10px; font-size: 23px; }.system-card p { margin: 0; color: var(--muted); line-height: 1.65; }
.launch-button { display: flex; justify-content: space-between; align-items: center; width: 100%; margin-top: auto; padding: 13px 15px; }
.empty-state { grid-column: 1/-1; padding: 58px; text-align: center; border: 1px dashed #b9c9c1; border-radius: 18px; color: var(--muted); }
.empty-state strong, .empty-state span { display: block; }.empty-state strong { color: var(--green-950); font-size: 20px; margin-bottom: 8px; }
.admin-heading { align-items: center; }
.heading-note { margin: 9px 0 0; color: var(--muted); font-size: 14px; }
.admin-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.summary-card { display: grid; grid-template-columns: 1fr auto; gap: 3px 12px; padding: 18px; border: 1px solid #dbe6e0; border-radius: 16px; background: #fff; }
.summary-card span { align-self: center; color: var(--muted); font-size: 13px; font-weight: 750; }
.summary-card strong { grid-row: 1 / 3; grid-column: 2; align-self: center; color: var(--green-950); font-family: Georgia, serif; font-size: 32px; }
.summary-card small { color: #84928c; }
.summary-card.warning { border-color: #eadbc1; background: #fffaf1; }
.permission-workspace { display: grid; grid-template-columns: minmax(270px, 320px) minmax(0, 1fr); min-height: 620px; overflow: hidden; border: 1px solid #d8e3dd; border-radius: 20px; background: #fff; }
.people-panel { padding: 20px 14px; border-right: 1px solid #e1e9e5; background: #f7faf8; }
.panel-title-row, .selected-person-header, .permission-card-top, .dialog-heading, .dialog-actions { display: flex; align-items: center; }
.panel-title-row { justify-content: space-between; gap: 12px; padding: 0 6px 16px; }
.panel-title-row h3, .selected-person-title h3, .dialog-heading h3 { margin: 3px 0 0; color: var(--green-950); }
.step-label { color: var(--green-650); font-size: 11px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.compact-button { min-height: 36px; padding: 7px 10px; border: 0; border-radius: 10px; color: #fff; background: var(--green-800); font-weight: 800; }
.search-field, .filter-field { margin: 0 6px 10px; color: var(--muted); font-size: 12px; }
.search-field input, .filter-field select { min-height: 42px; margin-top: 2px; background: #fff; }
.result-count { padding: 5px 8px 8px; color: var(--muted); font-size: 12px; }
.people-list { display: grid; gap: 6px; max-height: 470px; overflow: auto; padding: 2px 4px 8px; scrollbar-width: thin; }
.person-list-item { width: 100%; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 11px; border: 1px solid transparent; border-radius: 13px; color: var(--ink); background: transparent; text-align: left; }
.person-list-item:hover { background: #edf4f0; }
.person-list-item.selected { border-color: #bcd2c6; background: #e4f0e9; box-shadow: inset 3px 0 var(--green-650); }
.person-avatar { width: 54px; height: 54px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 17px; color: #fff; background: linear-gradient(145deg, #3a8469, #1b5945); font-size: 20px; font-weight: 900; }
.small-avatar { width: 38px; height: 38px; border-radius: 12px; font-size: 15px; }
.person-list-copy { min-width: 0; display: grid; gap: 2px; }
.person-list-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.person-list-copy small { color: var(--muted); }
.access-count { min-width: 38px; padding: 5px 7px; border-radius: 999px; color: #7c8983; background: #e8eeeb; font-size: 11px; font-weight: 850; text-align: center; }
.access-count.has-access { color: #226044; background: #dceee3; }
.list-empty { padding: 32px 12px; color: var(--muted); text-align: center; font-size: 13px; }
.permission-panel { min-width: 0; padding: 24px; }
.person-empty { min-height: 500px; display: grid; place-content: center; justify-items: center; gap: 8px; color: var(--muted); text-align: center; }
.person-empty strong { color: var(--green-950); font-size: 18px; }
.empty-illustration { width: 72px; height: 72px; display: grid; place-items: center; margin-bottom: 8px; border-radius: 22px; background: var(--green-100); font-size: 32px; }
.selected-person-header { gap: 14px; padding-bottom: 20px; border-bottom: 1px solid #e4ebe7; }
.selected-person-copy { min-width: 0; flex: 1; }
.selected-person-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.selected-person-title h3 { font-size: 24px; }
.selected-person-copy p { margin: 5px 0 0; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.permission-guide { margin: 16px 0; padding: 12px 14px; border-radius: 12px; color: #52665d; background: #f0f6f2; font-size: 13px; line-height: 1.6; }
.system-permission-cards { display: grid; gap: 12px; }
.permission-card { padding: 18px; border: 1px solid #d8e3dd; border-radius: 16px; background: #fff; box-shadow: 0 8px 20px rgba(23,83,63,.04); }
.permission-card.not-assigned { border-style: dashed; background: #fafcfb; }
.permission-card-top { gap: 12px; margin-bottom: 14px; }
.compact-icon { width: 42px; height: 42px; margin: 0; border-radius: 12px; font-size: 19px; }
.permission-card-top > div:nth-child(2) { display: flex; align-items: center; gap: 8px; flex: 1; flex-wrap: wrap; }
.permission-card h4 { margin: 0; color: var(--green-950); font-size: 17px; }
.card-edit-button { padding: 8px 11px; border: 1px solid #bfcfc7; border-radius: 9px; color: var(--green-800); background: #fff; font-size: 12px; font-weight: 800; }
.card-edit-button:hover { border-color: var(--green-650); background: var(--green-100); }
.permission-row { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px; align-items: start; padding: 8px 0; border-top: 1px solid #edf1ef; font-size: 13px; }
.permission-row > span { color: var(--muted); }
.tag-list { display: flex; flex-wrap: wrap; gap: 5px; }
.tag-list em { padding: 4px 7px; border-radius: 7px; color: #425d50; background: #edf3ef; font-size: 11px; font-style: normal; font-weight: 750; }
.feature-tags em { color: #5d4d2f; background: #f6efdf; }
.permission-row small { color: #8a9690; }
.permission-layer { display: flex; align-items: center; gap: 10px; }
.access-layer { margin: 2px 0 12px; padding: 11px 12px; border-radius: 11px; background: #f0f6f2; }
.permission-layer > div { display: grid; gap: 2px; }
.permission-layer small, .permission-layer-title small { color: var(--muted); font-size: 11px; font-weight: 800; }
.permission-layer strong { color: #34584a; font-size: 12px; }
.layer-number { width: 24px; height: 24px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 8px; color: #fff; background: var(--green-650); font-size: 11px; font-weight: 900; }
.permission-layer-title { display: flex; align-items: center; gap: 8px; margin: 14px 0 2px; }
.permission-layer-title .layer-number { color: var(--green-800); background: var(--green-100); }
.status-pill { display: inline-block; padding: 5px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.status-pill.active { background: #e1f1e7; color: #24643f; }
.status-pill.inactive { background: #f3e8e8; color: #8d3d3d; }
.status-pill.warning { background: #fff0d3; color: #805e20; }
.status-pill.neutral { background: #edf0ee; color: #69766f; }
.audit-card { margin-top: 18px; padding: 18px 22px; border: 1px solid #d8e3dd; border-radius: 18px; background: #fff; }
.audit-card summary { cursor: pointer; font-weight: 800; }
.audit-list { margin-top: 16px; }
.audit-list > div { display: grid; grid-template-columns: 150px 90px 150px 1fr; gap: 10px; padding: 9px 0; border-bottom: 1px solid #e5ece8; font-size: 12px; }
.audit-list time, .audit-list small { color: var(--muted); }
.form-dialog { width: min(520px, calc(100vw - 28px)); padding: 0; border: 0; border-radius: 22px; color: var(--ink); background: #fff; box-shadow: 0 30px 100px rgba(18,61,49,.28); }
.form-dialog::backdrop { background: rgba(14,39,31,.48); backdrop-filter: blur(4px); }
.wide-dialog { width: min(720px, calc(100vw - 28px)); }
.form-dialog form { max-height: min(780px, calc(100vh - 36px)); overflow: auto; padding: 26px; }
#assignment-form { display: grid; grid-template-rows: minmax(0, 1fr) auto; overflow: hidden; padding: 0; }
.dialog-scroll { min-height: 0; overflow: auto; padding: 26px 26px 0; }
#assignment-form .dialog-actions { position: static; margin: 0; padding: 16px 26px 26px; }
.dialog-heading { justify-content: space-between; gap: 16px; margin-bottom: 10px; }
.dialog-heading h3 { font-size: 24px; }
.dialog-description, .field-help { margin: 0 0 20px; color: var(--muted); font-size: 13px; line-height: 1.65; }
.form-dialog label > small { color: var(--muted); font-size: 11px; font-weight: 500; line-height: 1.5; }
.icon-button { width: 38px; height: 38px; border: 0; border-radius: 50%; color: #597067; background: #eff4f1; font-size: 24px; line-height: 1; }
.assignment-context { display: flex; align-items: center; gap: 10px; margin: 12px 0 20px; padding: 12px; border-radius: 13px; background: #f2f7f4; }
.assignment-context > div:last-child { display: grid; gap: 3px; }
.assignment-context span { color: var(--muted); font-size: 12px; }
.mini-avatar { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; color: #fff; background: var(--green-650); font-weight: 900; }
.permission-step { margin: 0 0 16px; padding: 18px; border: 1px solid #dbe5df; border-radius: 16px; background: #fbfcfb; }
.permission-step-heading { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 15px; }
.permission-step-heading h4 { margin: 0; color: var(--green-950); font-size: 17px; }
.permission-step-heading p { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.step-number { width: 30px; height: 30px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 10px; color: #fff; background: var(--green-650); font-size: 13px; font-weight: 900; }
.access-state-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin: 0; padding: 0; border: 0; }
.access-state-choice { position: relative; display: flex; align-items: flex-start; gap: 9px; min-height: 112px; margin: 0; padding: 12px; border: 1px solid #dce5e0; border-radius: 12px; background: #fff; cursor: pointer; }
.access-state-choice:hover { border-color: #a9c6b7; }
.access-state-choice:has(input:checked) { border-color: var(--green-650); background: #eaf4ee; box-shadow: 0 0 0 2px rgba(38,112,86,.1); }
.access-state-choice:has(input:focus-visible) { outline: 3px solid rgba(38,112,86,.2); outline-offset: 2px; }
.access-state-choice input { position: absolute; opacity: 0; pointer-events: none; }
.access-state-choice > span:last-child { display: grid; gap: 4px; }
.access-state-choice strong { color: var(--green-950); font-size: 13px; }
.access-state-choice small { color: var(--muted); font-size: 10px; font-weight: 500; line-height: 1.5; }
.access-state-mark { width: 24px; height: 24px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 8px; color: #718078; background: #edf1ef; font-size: 12px; font-weight: 900; }
.access-state-choice:has(input:checked) .access-state-mark { color: #fff; background: var(--green-650); }
.scope-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.switch-line { display: flex; grid-template-columns: auto 1fr; align-items: flex-start; gap: 10px; margin: 0; padding: 10px; border-radius: 11px; background: #f6f9f7; }
.switch-line input { width: 19px; min-height: 19px; margin-top: 2px; accent-color: var(--green-650); }
.switch-line span { display: grid; gap: 3px; }
.switch-line small { color: var(--muted); font-weight: 500; line-height: 1.45; }
.field-label { display: block; margin: 6px 0 4px; font-size: 13px; font-weight: 800; }
.capability-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 18px; }
.capability { display: flex; grid-template-columns: auto 1fr; gap: 8px; align-items: flex-start; margin: 0; padding: 10px; border: 1px solid #e1e8e4; border-radius: 10px; background: #f8faf9; }
.capability:has(input:checked) { border-color: #a9cab8; background: #eaf4ee; }
.capability input { width: 17px; min-height: 17px; margin-top: 2px; accent-color: var(--green-650); }
.capability span { display: grid; gap: 2px; }
.capability small { color: var(--muted); font-size: 10px; font-weight: 500; }
.dialog-actions { position: sticky; bottom: -26px; z-index: 2; gap: 10px; margin: 8px -26px -26px; padding: 16px 26px 26px; border-top: 1px solid #e4ebe7; background: linear-gradient(180deg, rgba(255,255,255,.96), #fff 34%); box-shadow: 0 -10px 22px rgba(26,62,48,.06); }
.dialog-actions .primary-button { width: auto; min-width: 140px; }
.action-spacer { flex: 1; }
.danger-button { min-height: 40px; padding: 8px 12px; border: 1px solid #e0bebe; border-radius: 10px; color: var(--danger); background: #fff7f7; font-weight: 800; }
.form-dialog input[readonly] { color: #6f7c76; background: #f0f3f1; }
.toast { position: fixed; left: 50%; bottom: 26px; z-index: 10; transform: translate(-50%,30px); opacity: 0; padding: 12px 18px; color: #fff; background: var(--green-950); border-radius: 12px; box-shadow: var(--shadow); transition: .2s; pointer-events: none; }.toast.show { transform: translate(-50%,0); opacity: 1; }
@media (max-width: 1000px) { .admin-summary { grid-template-columns: 1fr 1fr; }.permission-workspace { grid-template-columns: 280px minmax(0, 1fr); } }
@media (max-width: 820px) { .login-layout { grid-template-columns: 1fr; gap: 12px; }.welcome-panel { padding: 20px 8px; }.welcome-panel h1 { font-size: 44px; }.system-grid { grid-template-columns: 1fr; }.system-card { min-height: 230px; }.permission-workspace { display: block; overflow: visible; }.people-panel { border-right: 0; border-bottom: 1px solid #e1e9e5; }.people-list { max-height: 310px; }.permission-panel { padding: 18px; }.person-empty { min-height: 250px; } }
@media (max-width: 620px) { .app-shell { width: min(100% - 20px, 1240px); padding-top: 12px; }.welcome-panel { padding-top: 12px; }.welcome-panel h1 { font-size: 38px; }.login-card, .content-panel { padding: 18px; }.portal-header { align-items: flex-start; }.header-actions { flex-wrap: wrap; justify-content: flex-end; }.user-chip { width: 100%; }.section-heading { display: block; }.admin-heading .ghost-button { margin-top: 12px; }.admin-summary { grid-template-columns: 1fr 1fr; gap: 8px; }.summary-card { padding: 13px; }.summary-card strong { font-size: 26px; }.summary-card small { display: none; }.selected-person-header { align-items: flex-start; flex-wrap: wrap; }.selected-person-copy { width: calc(100% - 70px); }.selected-person-header .ghost-button { width: 100%; }.permission-card-top { align-items: flex-start; flex-wrap: wrap; }.permission-card-top > div:nth-child(2) { min-width: calc(100% - 58px); }.card-edit-button { width: 100%; }.permission-row { grid-template-columns: 1fr; gap: 5px; }.scope-grid, .capability-list, .access-state-options { grid-template-columns: 1fr; }.access-state-choice { min-height: 0; }.permission-step { padding: 14px; }.dialog-actions { flex-wrap: wrap; }.dialog-actions .action-spacer { display: none; }.dialog-actions .danger-button { order: 3; width: 100%; }.dialog-actions .primary-button { flex: 1; }.audit-list > div { grid-template-columns: 1fr 1fr; } }
