:root {
  color-scheme: light;
  --ink: #17313a;
  --ink-soft: #597077;
  --navy: #102b35;
  --teal: #167b70;
  --teal-deep: #09645a;
  --teal-light: #e4f3ef;
  --sand: #f7f5f0;
  --surface: #ffffff;
  --line: #e3e9e7;
  --danger: #a44440;
  --shadow: 0 20px 50px rgba(15, 42, 50, .06);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-height: 100%; }
body { margin: 0; background: var(--sand); color: var(--ink); font-size: 15px; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
a { color: inherit; }
:focus-visible { outline: 3px solid #59b9ac; outline-offset: 2px; }
.screen-loading { min-height: 100vh; display: grid; place-items: center; color: var(--ink-soft); }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 254px minmax(0, 1fr); }
.sidebar { background: var(--navy); color: #eaf5f1; padding: 30px 18px 20px; display: flex; flex-direction: column; gap: 34px; }
.brand { display: flex; gap: 11px; align-items: center; padding: 0 12px; }
.brand-mark { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: #d8ece5; color: #0e6e64; font-weight: 800; font-size: 17px; letter-spacing: -.05em; }
.brand-title { display: block; font-weight: 800; letter-spacing: -.025em; font-size: 17px; line-height: 1.15; }
.brand-sub { display: block; font-size: 11px; color: #aac5c4; margin-top: 3px; letter-spacing: .07em; text-transform: uppercase; }
.nav { display: grid; gap: 5px; }
.nav-label { margin: 0 12px 9px; font-size: 10px; text-transform: uppercase; letter-spacing: .18em; font-weight: 800; color: #8baeb0; }
.nav-btn { border: 0; width: 100%; display: flex; align-items: center; gap: 11px; text-align: left; border-radius: 10px; padding: 12px 13px; color: #cce0df; background: transparent; font-weight: 600; }
.nav-btn:hover, .nav-btn.active { background: #234550; color: #fff; }
.nav-btn.active::before { content: ""; width: 4px; height: 17px; border-radius: 5px; background: #72c6b3; margin-left: -5px; }
.nav-btn svg { width: 18px; height: 18px; flex: none; }
.sidebar-bottom { margin-top: auto; border-top: 1px solid #31505a; padding: 19px 10px 0; }
.sidebar-person { font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.sidebar-role { color: #a6c2c2; font-size: 12px; margin: 4px 0 15px; }
.logout-btn { background: transparent; color: #d3e7e3; border: 0; padding: 7px 0; display: flex; align-items: center; gap: 8px; font-size: 13px; }
.main { padding: 36px clamp(24px, 5vw, 72px) 70px; min-width: 0; }
.content { max-width: 1120px; margin: 0 auto; }
.topline { color: var(--teal); letter-spacing: .17em; text-transform: uppercase; font-size: 11px; font-weight: 800; margin: 0 0 8px; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(30px, 3.2vw, 43px); letter-spacing: -.055em; line-height: 1.12; margin-bottom: 10px; font-weight: 800; }
h2 { font-size: 20px; letter-spacing: -.035em; margin-bottom: 4px; }
h3 { font-size: 16px; letter-spacing: -.02em; margin-bottom: 5px; }
.lead { color: var(--ink-soft); font-size: 15px; line-height: 1.6; }
.page-head { display: flex; gap: 18px; align-items: flex-end; justify-content: space-between; margin-bottom: 30px; }
.page-head .lead { margin-bottom: 0; }
.button { border-radius: 10px; border: 1px solid transparent; padding: 11px 16px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; font-size: 13px; font-weight: 750; text-decoration: none; white-space: nowrap; }
.button svg { width: 17px; height: 17px; }
.button.primary { color: white; background: var(--teal); box-shadow: 0 8px 18px rgba(22, 123, 112, .17); }
.button.primary:hover { background: var(--teal-deep); }
.button.secondary { color: var(--ink); background: white; border-color: #cbd9d6; }
.button.secondary:hover, .button.ghost:hover { background: #f1f8f5; }
.button.ghost { color: var(--teal-deep); background: transparent; padding-inline: 9px; }
.button.danger { color: var(--danger); background: #fff7f6; border-color: #efd8d6; }
.button.small { min-height: 33px; padding: 6px 10px; font-size: 12px; }
.summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 30px; }
.stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 21px 23px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.stat-card::after { content: ""; position: absolute; width: 86px; height: 86px; border-radius: 50%; background: #e8f5f1; right: -24px; top: -29px; }
.stat-card:nth-child(2)::after { background: #e8f1f5; }
.stat-card:nth-child(3)::after { background: #f9f0e5; }
.stat-label { color: var(--ink-soft); font-size: 12px; font-weight: 650; margin-bottom: 11px; }
.stat-value { font-weight: 800; letter-spacing: -.06em; font-size: 32px; line-height: 1; }
.stat-note { color: #829397; font-size: 11px; margin-top: 9px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.panel-head { display: flex; gap: 16px; align-items: center; justify-content: space-between; padding: 22px 24px; border-bottom: 1px solid var(--line); }
.panel-head p { color: var(--ink-soft); font-size: 12px; margin: 0; }
.search { width: min(300px, 100%); position: relative; }
.search input { width: 100%; border: 1px solid #d9e3df; border-radius: 9px; padding: 10px 12px 10px 35px; background: #fbfcfa; outline: none; font-size: 13px; }
.search input:focus { border-color: #60b3a8; box-shadow: 0 0 0 3px #def3ee; }
.search svg { position: absolute; width: 16px; height: 16px; top: 11px; left: 11px; color: #7c9897; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { color: #87999c; font-size: 10px; text-transform: uppercase; letter-spacing: .13em; font-weight: 800; padding: 13px 24px; background: #fafbf9; white-space: nowrap; }
td { padding: 14px 24px; border-top: 1px solid #edf0ed; vertical-align: middle; }
tbody tr:hover { background: #fbfdfb; }
.person-cell { display: flex; align-items: center; gap: 12px; min-width: 210px; }
.avatar { flex: none; width: 38px; height: 38px; border-radius: 12px; background: #e5f2ed; color: #147467; display: grid; place-items: center; font-size: 13px; font-weight: 800; overflow: hidden; }
.avatar.large { width: 58px; height: 58px; border-radius: 17px; font-size: 19px; }
.avatar-image { display: block; object-fit: cover; }
.person-name { display: block; font-weight: 750; font-size: 13px; }
.person-sub { display: block; font-size: 11px; color: #87999c; margin-top: 2px; }
.count { display: inline-flex; justify-content: center; min-width: 34px; border-radius: 8px; padding: 6px 10px; font-weight: 800; color: var(--teal-deep); background: #eaf6f1; font-size: 12px; }
.count.blue { color: #3d657d; background: #eaf1f6; }
.sum { font-weight: 800; font-size: 14px; }
.link-button { border: 0; background: none; color: var(--teal-deep); padding: 7px 0; font-weight: 750; font-size: 12px; white-space: nowrap; }
.link-button:hover { text-decoration: underline; }
.link-button svg { width: 14px; height: 14px; vertical-align: middle; margin-left: 3px; }
.muted { color: var(--ink-soft); }
.empty { padding: 42px 24px; text-align: center; color: var(--ink-soft); }
.empty .empty-icon { width: 54px; height: 54px; display: grid; place-items: center; margin: 0 auto 12px; border-radius: 16px; background: #eef7f2; color: var(--teal); font-size: 23px; }
.empty h3 { color: var(--ink); }
.back-btn { border: 0; background: transparent; color: var(--teal-deep); font-size: 13px; font-weight: 750; padding: 0; margin-bottom: 24px; }
.detail-person { display: flex; align-items: center; gap: 16px; }
.detail-person h1 { margin-bottom: 5px; }
.badge { display: inline-flex; align-items: center; border-radius: 100px; padding: 5px 9px; font-size: 10px; font-weight: 800; background: #eff2f0; color: #597075; }
.badge.rep { background: #eaf5f0; color: #177366; }
.badge.admin { background: #e9edf6; color: #465e8e; }
.badge.inactive { background: #fbefed; color: #a34b42; }
.entry-list { padding: 4px 24px; }
.entry { display: flex; align-items: flex-start; gap: 14px; padding: 19px 0; border-bottom: 1px solid var(--line); }
.entry:last-child { border-bottom: 0; }
.entry-mark { width: 34px; height: 34px; flex: none; border-radius: 10px; background: #e8f5f0; display: grid; place-items: center; color: var(--teal); font-size: 15px; font-weight: 800; }
.entry-mark.partner { color: #557791; background: #eaf1f7; }
.entry-body { flex: 1; min-width: 0; }
.entry-title { font-size: 13px; font-weight: 800; line-height: 1.4; }
.entry-meta { margin-top: 4px; color: #829296; font-size: 11px; line-height: 1.5; }
.entry-actions { display: flex; gap: 6px; }
.detail-metrics { display: flex; flex-wrap: wrap; gap: 9px; margin: 18px 0 28px; }
.metric-pill { padding: 9px 13px; border-radius: 9px; background: white; border: 1px solid var(--line); font-size: 12px; color: var(--ink-soft); }
.metric-pill strong { color: var(--ink); font-size: 15px; margin-right: 5px; }
.form-panel { padding: 25px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.field { display: grid; gap: 7px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 12px; font-weight: 750; color: #35505a; }
.field input, .field select { width: 100%; border: 1px solid #d7e1dd; background: #fcfdfb; border-radius: 9px; min-height: 43px; padding: 10px 12px; color: var(--ink); outline: none; }
.field input:focus, .field select:focus { border-color: #61b8ab; box-shadow: 0 0 0 3px #ddf2ed; }
.field small { color: #849498; line-height: 1.4; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 23px; }
.profile-grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: 16px; }
.identity-box { padding: 25px; }
.identity-row { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.avatar-controls { margin: -5px 0 19px; }
.avatar-controls .helper { margin: 9px 0 0; }
.data-pair { border-top: 1px solid var(--line); padding: 14px 0; display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.data-pair span:first-child { color: var(--ink-soft); }
.data-pair strong { text-align: right; }
.user-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.notice { background: #e7f5eb; border: 1px solid #bfe1cb; color: #21583e; border-radius: 10px; padding: 13px 16px; margin-bottom: 20px; font-size: 13px; }
.notice.error { background: #fff2f0; border-color: #eac3be; color: #9d423b; }
.dialog-backdrop { position: fixed; inset: 0; z-index: 20; background: rgba(9, 28, 37, .46); display: grid; place-items: center; padding: 16px; }
.dialog { width: min(100%, 480px); max-height: min(90vh, 780px); overflow-y: auto; background: white; border-radius: 18px; box-shadow: 0 30px 100px rgba(8, 25, 32, .3); }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; padding: 25px 27px 18px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { margin: 0; }
.dialog-body { padding: 23px 27px 27px; }
.icon-btn { border: 0; background: #f2f5f3; color: #597075; width: 30px; height: 30px; border-radius: 8px; font-size: 19px; line-height: 1; }
.secret-box { display: flex; align-items: center; gap: 8px; padding: 12px; background: #f5f8f5; border: 1px solid #dce8e2; border-radius: 9px; margin: 16px 0; }
.secret-box code { flex: 1; font-size: 14px; font-weight: 700; word-break: break-all; }
.code-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; list-style: none; padding: 0; margin: 17px 0; }
.code-list li { background: #f4f8f5; border: 1px solid #e1eae4; border-radius: 8px; padding: 9px; text-align: center; }
.code-list code { font-size: 11px; font-weight: 800; letter-spacing: .025em; }
.helper { color: var(--ink-soft); font-size: 12px; line-height: 1.5; }
.field-spaced, .helper-spaced { margin-top: 16px; }
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 520px); }
.login-visual { background: #102b35; color: white; padding: clamp(30px, 6vw, 80px); display: flex; flex-direction: column; position: relative; overflow: hidden; }
.login-visual::before { content: ""; position: absolute; width: min(58vw, 620px); height: min(58vw, 620px); border: 1px solid #285764; border-radius: 50%; right: -180px; top: 12%; box-shadow: 0 0 0 70px #143540, 0 0 0 71px #285764, 0 0 0 150px #11303b, 0 0 0 151px #285764; opacity: .75; }
.login-copy { margin: auto 0; position: relative; max-width: 620px; }
.login-copy .eyebrow { color: #9bd1c5; text-transform: uppercase; font-size: 11px; font-weight: 800; letter-spacing: .2em; }
.login-copy h1 { font-size: clamp(42px, 5.3vw, 72px); letter-spacing: -.07em; line-height: 1.02; margin: 18px 0 21px; }
.login-copy p { max-width: 430px; color: #bbd5d2; line-height: 1.7; font-size: 16px; }
.login-foot { position: relative; color: #8fb1b1; font-size: 12px; }
.login-form-wrap { display: grid; place-items: center; padding: 34px; background: #fbfaf6; }
.login-column { width: min(100%, 350px); }
.login-form { width: 100%; }
.login-legal { margin-top: 34px; border-top: 1px solid var(--line); padding-top: 16px; color: var(--ink-soft); font-size: 12px; line-height: 1.55; }
.login-legal h2 { font-size: 14px; margin-bottom: 6px; }
.login-legal h2 a { color: var(--teal-deep); text-decoration: none; }
.login-legal h2 a:hover, .login-legal address a:hover { text-decoration: underline; }
.login-legal p { margin-bottom: 8px; }
.login-legal address { font-style: normal; }
.login-legal address a { color: var(--teal-deep); }
.login-form h2 { font-size: 27px; letter-spacing: -.05em; margin-bottom: 8px; }
.login-form > p { color: var(--ink-soft); line-height: 1.55; margin-bottom: 31px; }
.login-form .field { margin-bottom: 17px; }
.login-form .button { width: 100%; margin-top: 10px; }
.login-error { background: #fff0ee; color: #9c433b; padding: 11px 13px; border-radius: 8px; font-size: 12px; margin-bottom: 18px; }
.login-info { background: #e7f5eb; color: #21583e; padding: 11px 13px; border-radius: 8px; font-size: 12px; margin-bottom: 18px; }
.text-action { background: none; border: 0; color: var(--teal-deep); font-size: 12px; font-weight: 750; padding: 6px 0; margin-top: 10px; }
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 200px minmax(0, 1fr); }
  .main { padding: 32px 25px 60px; }
  th, td { padding-inline: 16px; }
  .profile-grid { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .app-shell { display: block; }
  .sidebar { padding: 13px 16px; display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px; }
  .brand { padding: 0; margin-right: auto; }
  .brand-mark { width: 34px; height: 34px; }
  .nav { order: 3; display: flex; width: 100%; overflow-x: auto; gap: 5px; }
  .nav-label, .sidebar-bottom { display: none; }
  .nav-btn { white-space: nowrap; width: auto; padding: 8px 10px; font-size: 12px; }
  .nav-btn.active::before { display: none; }
  .nav-btn svg { width: 15px; height: 15px; }
  .main { padding: 25px 16px 50px; }
  .page-head { align-items: flex-start; flex-direction: column; margin-bottom: 23px; }
  .summary { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
  .stat-card { padding: 15px 12px; }
  .stat-value { font-size: 25px; }
  .stat-note { display: none; }
  .panel-head { flex-direction: column; align-items: stretch; }
  .search { width: 100%; }
  .detail-person h1 { font-size: 28px; }
  .entry { gap: 9px; }
  .entry-actions { flex-direction: column; }
  .login-wrap { display: block; }
  .login-visual { min-height: 275px; padding: 28px; }
  .login-copy h1 { font-size: 39px; margin: 12px 0; }
  .login-copy p { font-size: 13px; margin: 0; }
  .login-foot { display: none; }
  .login-form-wrap { min-height: calc(100vh - 275px); padding: 34px 20px; }
}
@media (max-width: 390px) {
  .summary { grid-template-columns: 1fr 1fr; }
  .stat-card:first-child { grid-column: span 2; }
  .form-grid { grid-template-columns: 1fr; }
  .code-list { grid-template-columns: 1fr; }
}
