:root {
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: #161b2c;
    background: #f8f9fc;
    --accent: #5143ed;
    --green: var(--accent);
    --accent-hover: #4133d4;
    --accent-soft: #efedff;
    --muted: #73788c;
    --border: #e8eaf1;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, .button {
    display: inline-flex; align-items: center; justify-content: center; gap: 9px;
    min-height: 46px; border: 1px solid transparent; border-radius: 11px;
    padding: 12px 21px; background: var(--accent); color: #fff;
    font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
    transition: background .18s, box-shadow .18s, transform .18s;
}
button:hover, .button:hover { background: var(--accent-hover); text-decoration: none; box-shadow: 0 5px 16px #5143ed18; }
button:active, .button:active { transform: translateY(1px); }
button:disabled { opacity: .5; cursor: default; }
.icon { flex-shrink: 0; vertical-align: middle; width: 21px; height: 21px; }
button .icon, .button .icon { width: 18px; height: 18px; }
input, select, textarea {
    width: 100%; min-width: 0; min-height: 48px; padding: 12px 14px;
    border: 1px solid #dedfeb; border-radius: 10px; background: #fff;
    color: #242940; font: inherit; font-size: 14px; transition: border-color .18s, box-shadow .18s;
}
input::placeholder, textarea::placeholder { color: #9599a9; }
textarea { resize: vertical; line-height: 1.75; }
input:hover, select:hover, textarea:hover { border-color: #b9b5df; }
:focus-visible { outline: 3px solid #bcb5ff; outline-offset: 3px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px #5143ed0c; }
label { display: flex; flex-direction: column; gap: 8px; font-size: 13px; font-weight: 600; color: #454a60; }
h1, h2, h3 { color: #151a2a; font-weight: 600; }
h1 { font-size: clamp(29px, 3vw, 40px); line-height: 1.25; letter-spacing: -1.1px; margin: 8px 0 15px; }
h2 { font-size: 20px; line-height: 1.4; letter-spacing: -.35px; margin: 0 0 22px; }
h3 { font-size: 17px; line-height: 1.4; margin: 8px 0; letter-spacing: -.2px; }
p { margin: 0 0 16px; }
.accent { color: var(--accent); }
.muted { color: var(--muted); font-weight: 400; }
.small { font-size: 12px; }
.eyebrow { color: var(--accent); font-size: 10px; font-weight: 600; letter-spacing: 1.5px; margin: 0 0 10px; }
.topbar {
    min-height: 88px; padding: 19px 38px; display: flex; align-items: center;
    justify-content: space-between; gap: 22px; background: #fff; border-bottom: 1px solid var(--border);
}
.brand { display: inline-flex; align-items: center; gap: 12px; color: #181c30; font-size: 18px; font-weight: 650; letter-spacing: -.4px; }
.brand:hover { text-decoration: none; }
.brand small { display: block; margin-top: 1px; font-size: 11px; letter-spacing: .1px; color: var(--muted); font-weight: 400; }
.logo { display: inline-flex; width: 44px; height: 44px; align-items: center; justify-content: center; border-radius: 13px; background: var(--accent); color: #fff; }
.logo .icon { width: 27px; height: 27px; stroke-width: 1.4; }
.account { display: flex; align-items: center; gap: 24px; }
.account-profile { display: flex; align-items: center; gap: 11px; color: #252a40; font-size: 13px; font-weight: 600; }
.account-profile small { display: block; font-size: 10px; color: var(--muted); font-weight: 400; }
.account-profile:hover { text-decoration: none; color: var(--accent); }
.avatar, .person-avatar { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 39px; height: 39px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); }
.quiet { background: #f5f5fa; color: #63697c; border: 1px solid var(--border); padding: 9px 13px; font-size: 12px; }
.quiet:hover { background: var(--accent-soft); color: var(--accent); box-shadow: none; }
.logout { border: 0; background: transparent; }
.shell { display: grid; grid-template-columns: 245px minmax(0, 1fr); min-height: calc(100vh - 88px); }
.nav { display: flex; flex-direction: column; gap: 8px; padding: 38px 20px 25px; background: #fff; border-right: 1px solid var(--border); }
.nav-label { padding: 0 15px 18px; font-size: 9px; color: #73788c; letter-spacing: 1.2px; }
.nav > a { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-radius: 10px; color: #73788c; font-size: 13px; font-weight: 500; }
.nav > a:hover { background: #f8f7fe; color: var(--accent); text-decoration: none; }
.nav > a.active { color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.nav > a .icon { width: 19px; height: 19px; }
.nav-note { margin: 72px 9px 35px; padding: 21px 18px; background: #f8f8fc; border-radius: 15px; }
.note-icon { display: block; color: var(--accent); margin-bottom: 16px; }
.nav-note strong { display: block; font-size: 13px; font-weight: 600; line-height: 1.6; }
.nav-note p { font-size: 11px; color: #73788c; margin: 10px 0 0; }
.nav-footer { margin-top: auto; padding: 12px 8px; font-size: 10px; color: #73788c; }
main { width: 100%; max-width: 1400px; min-width: 0; padding: 45px 48px 72px; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 34px; }
.page-heading p { margin-bottom: 0; }
.page-heading .eyebrow { margin-bottom: 10px; }
.page-heading .button { flex-shrink: 0; }
.panel { padding: 29px; margin: 0 0 26px; background: #fff; border: 1px solid var(--border); border-radius: 17px; box-shadow: 0 4px 20px #1e214a02; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 22px; margin: 0 0 30px; }
.stats > div { position: relative; min-width: 0; padding: 25px 27px; border: 1px solid var(--border); border-radius: 17px; background: #fff; }
.stat-icon { display: flex; align-items: center; justify-content: center; width: 39px; height: 39px; margin-bottom: 21px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.stat-label { display: block; color: #747a8f; font-size: 12px; }
.stats strong { display: block; font-size: 34px; font-weight: 600; line-height: 1.3; letter-spacing: -.8px; margin-top: 6px; }
.stats small { display: block; margin-top: 7px; color: #73788c; font-size: 11px; }
.filters { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 20px 22px; padding: 24px 28px 28px; }
.filter-heading { grid-column: 1/-1; display: flex; align-items: center; gap: 10px; color: #474c62; font-size: 13px; font-weight: 600; padding-bottom: 3px; }
.filter-heading .icon { color: var(--accent); width: 18px; height: 18px; }
.filter-actions { display: flex; align-items: end; gap: 22px; padding-bottom: 1px; }
.filter-actions a { font-size: 12px; color: var(--muted); padding-bottom: 13px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 15px; }
.section-heading h2 { margin: 0; }
.section-heading > .small { padding: 6px 11px; background: #f6f6fa; border-radius: 7px; white-space: nowrap; }
.section-heading .eyebrow { color: #73788c; font-size: 9px; margin-bottom: 8px; }
.report-card { display: flex; align-items: center; gap: 19px; padding: 24px 0; border-top: 1px solid #eff0f5; color: inherit; }
.report-card:hover { text-decoration: none; }
.report-card:hover h3 { color: var(--accent); }
.report-icon { display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 48px; height: 48px; border: 1px solid #e7e4fb; border-radius: 13px; color: var(--accent); background: #faf9ff; }
.report-content { min-width: 0; flex: 1; }
.report-card h3 { margin: 8px 0; font-size: 16px; transition: color .18s; }
.excerpt { color: #787e92; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 12px; max-width: 660px; }
.report-meta { display: flex; gap: 18px; flex-wrap: wrap; color: #73788c; font-size: 11px; }
.report-meta > span { display: inline-flex; align-items: center; gap: 6px; }
.report-meta .icon { width: 14px; height: 14px; }
.report-card time { white-space: nowrap; font-size: 12px; color: #555a70; font-weight: 500; }
.report-card time small { display: block; font-size: 11px; text-align: right; color: #73788c; margin-top: 5px; font-weight: 400; }
.report-arrow { color: #a5a3bf; margin-left: 5px; }
.report-arrow .icon { width: 17px; height: 17px; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 6px; font-size: 10px; font-weight: 500; white-space: nowrap; align-self: start; }
.badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge.new { background: #f0edff; color: #6355d8; }
.badge.resolved { background: #eaf7f0; color: #369567; }
.stack { display: flex; flex-direction: column; gap: 23px; }
.stack > button { align-self: start; }
.stack > h2 { margin-bottom: 0; }
.form-width { max-width: 780px; }
.page-new .form-width { margin-top: 32px; }
.page-profile .form-width { margin-top: 30px; }
.upload { border: 1px dashed #c9c3f1; padding: 24px; background: #faf9ff; border-radius: 12px; gap: 15px; }
.upload-heading { display: flex; align-items: center; gap: 10px; color: var(--accent); }
.upload input { padding: 0; background: transparent; border: 0; min-height: 0; font-size: 12px; }
input[type=file]::file-selector-button { padding: 10px 14px; margin-right: 12px; font: inherit; font-weight: 500; color: var(--accent); background: #efedff; border: 0; border-radius: 7px; cursor: pointer; }
.upload small { line-height: 1.7; font-size: 11px; }
.photo-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 15px; }
.photo-grid img { display: block; width: 100%; height: 190px; object-fit: cover; border-radius: 12px; background: #f0eff7; }
.photo-grid a[data-gallery] { position: relative; display: block; border-radius: 12px; overflow: hidden; }
.photo-grid a[data-gallery]::after { content: '↗'; position: absolute; right: 10px; bottom: 10px; width: 32px; height: 32px; border-radius: 9px; background: #fff; color: var(--accent); display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 10px #0002; font-size: 18px; }
.photo-grid a[data-gallery]:hover { box-shadow: 0 0 0 3px #d6d0ff; }
.remarks { white-space: pre-wrap; overflow-wrap: anywhere; color: #5f657c; line-height: 1.9; padding: 23px; background: #f8f9fc; border-radius: 12px; font-size: 14px; }
.metadata { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 24px; padding-bottom: 28px; border-bottom: 1px solid var(--border); }
.metadata span { display: block; font-size: 11px; color: #73788c; margin-bottom: 7px; }
.metadata strong { display: block; font-size: 13px; font-weight: 500; overflow-wrap: anywhere; }
.back { display: inline-block; color: #8c91a5; font-size: 12px; margin-bottom: 24px; }
.person { display: flex; align-items: start; justify-content: space-between; gap: 28px; padding: 26px 0; border-top: 1px solid var(--border); }
.person-info { display: flex; gap: 15px; min-width: 0; }
.person-info > div { min-width: 0; }
.person-avatar { border-radius: 12px; width: 42px; height: 42px; margin-top: 6px; }
.person h3 { margin-top: 3px; overflow-wrap: anywhere; }
.person p { margin-bottom: 5px; font-size: 12px; overflow-wrap: anywhere; }
.person-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; width: 360px; max-width: 100%; flex-shrink: 0; font-size: 12px; }
.person-actions details { width: 100%; }
.person-actions > .stack { width: 100%; flex-direction: row; align-items: end; gap: 12px; padding: 16px; background: #faf9ff; border-radius: 10px; }
.person-actions > .stack label { flex: 1; }
.person-actions > .stack button { align-self: end; padding: 12px; font-size: 12px; white-space: nowrap; }
.inline { display: flex; align-items: center; flex-wrap: wrap; gap: 18px; font-size: 13px; }
summary { cursor: pointer; color: #57546f; font-size: 14px; font-weight: 600; padding: 4px 0; margin-bottom: 0; }
details[open] > summary { margin-bottom: 25px; }
.person-actions summary { font-size: 12px; font-weight: 400; color: #8b879f; }
.person-actions details[open] > summary { margin-bottom: 14px; }
.empty { padding: 46px 24px; text-align: center; color: var(--muted); font-size: 13px; }
.empty-icon { display: inline-flex; align-items: center; justify-content: center; width: 58px; height: 58px; background: var(--accent-soft); color: var(--accent); border-radius: 16px; margin-bottom: 14px; }
.empty p { margin-bottom: 0; }
.alert { margin-bottom: 25px; padding: 17px 21px; border-radius: 11px; font-size: 13px; }
.error { color: #ad4b42; background: #fff0ee; border: 1px solid #f5ddd9; }
.success { color: #2f8661; background: #edf8f2; border: 1px solid #daf0e3; }
.pagination { display: flex; justify-content: center; gap: 28px; font-size: 13px; padding: 6px; }
.login-wrap { display: flex; flex-direction: column; justify-content: center; min-height: 100vh; max-width: none; padding: 45px; background: #fff; }
.login-wrap > .alert { width: 100%; max-width: 1160px; margin: 0 auto 25px; }
.login-layout { display: grid; grid-template-columns: 1.15fr 1fr; width: 100%; max-width: 1160px; margin: auto; gap: 90px; align-items: center; }
.login-story { min-height: 640px; padding: 40px 45px 30px; background: #f7f7fc; border-radius: 25px; display: flex; flex-direction: column; }
.login-story .brand { font-size: 17px; }
.login-story .brand small { font-size: 10px; }
.login-story .logo { width: 37px; height: 37px; border-radius: 10px; }
.login-story .logo .icon { width: 23px; height: 23px; }
.login-intro { margin: 57px 0 38px; }
.login-intro h2 { margin: 13px 0 20px; font-size: 39px; letter-spacing: -1px; line-height: 1.3; }
.login-intro h2 span { color: var(--accent); }
.login-intro > p:not(.eyebrow) { max-width: 365px; font-size: 14px; line-height: 1.85; color: #83889c; }
.login-features { display: flex; flex-direction: column; gap: 22px; margin-top: 35px; }
.login-features > div { display: flex; align-items: center; gap: 15px; }
.icon-tile { display: flex; align-items: center; justify-content: center; width: 39px; height: 39px; flex-shrink: 0; border-radius: 10px; background: #eeebff; color: var(--accent); }
.login-features strong { display: block; font-weight: 500; font-size: 13px; }
.login-features small { display: block; color: #73788c; font-size: 11px; margin-top: 3px; }
.login-footer { display: flex; align-items: center; gap: 8px; color: #73788c; font-size: 10px; margin: auto 0 0; }
.login-footer .icon { width: 15px; height: 15px; }
.login { width: 100%; max-width: 440px; padding: 12px 0; border: 0; box-shadow: none; margin: 0; }
.login h1 { font-size: 31px; letter-spacing: -.8px; }
.login .muted { font-size: 14px; line-height: 1.85; max-width: 340px; }
.login-symbol { display: inline-flex; align-items: center; justify-content: center; width: 55px; height: 55px; background: #efedff; color: var(--accent); border-radius: 15px; margin-bottom: 28px; }
.login-symbol .icon { width: 27px; height: 27px; }
.login .stack { gap: 22px; margin: 32px 0 27px; }
.login .stack button { width: 100%; justify-content: space-between; margin-top: 7px; }
.login-help { display: flex; gap: 11px; align-items: start; padding: 22px 0 0; border-top: 1px solid var(--border); font-size: 11px; color: #73788c; line-height: 1.8; }
.login-help .icon { width: 17px; height: 17px; margin-top: 2px; color: #aba5d3; }
@media(min-width:1700px) { main { padding: 55px 70px 85px; } }
@media(max-width:1150px) {
    .shell { grid-template-columns: 210px minmax(0,1fr); }
    .nav { padding-left: 13px; padding-right: 13px; }
    .nav > a { gap: 9px; padding: 13px 10px; font-size: 12px; }
    main { padding: 35px 28px 60px; }
    .stats { gap: 14px; }
    .stats > div { padding: 22px; }
    .filters { gap: 18px; }
    .person { flex-direction: column; gap: 18px; }
    .person-actions { width: 100%; }
    .person-actions > .stack { max-width: 400px; }
    .login-layout { gap: 45px; }
    .login-story { padding: 35px; }
    .login-intro h2 { font-size: 34px; }
}
@media(max-width:850px) {
    .topbar { padding: 18px 22px; }
    .shell { grid-template-columns: 185px minmax(0,1fr); }
    .nav-label { font-size: 8px; padding-left: 10px; }
    .nav > a { font-size: 11px; gap: 7px; }
    .nav > a .icon { width: 17px; height: 17px; }
    .nav-note { margin: 45px 3px 30px; padding: 16px; }
    main { padding: 30px 22px 50px; }
    .page-heading { align-items: start; flex-direction: column; gap: 20px; }
    .stats > div { padding: 17px 14px; }
    .stats .stat-label { font-size: 11px; }
    .stats small { font-size: 10px; }
    .filters { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .filter-actions { grid-column: 1/-1; }
    .panel { padding: 23px; }
    .report-icon, .report-arrow { display: none; }
    .metadata { gap: 16px; }
    .metadata strong { font-size: 12px; }
    .login-wrap { padding: 30px; }
    .login-layout { gap: 30px; }
    .login-story { min-height: 620px; padding: 28px; }
    .login-intro h2 { font-size: 29px; }
    .login-features small { font-size: 10px; }
    .login h1 { font-size: 27px; }
}
@media(max-width:680px) {
    .topbar { min-height: 79px; padding: 15px 18px; gap: 12px; }
    .brand { font-size: 15px; gap: 9px; }
    .brand small { font-size: 9px; }
    .logo { width: 37px; height: 37px; border-radius: 11px; }
    .logo .icon { width: 23px; height: 23px; }
    .account { gap: 9px; }
    .account-profile { gap: 0; }
    .account-profile > span:not(.avatar) { display: none; }
    .avatar { width: 34px; height: 34px; }
    .logout { width: 35px; min-height: 40px; padding: 6px; }
    .logout span { display: none; }
    .shell { display: block; }
    .nav { padding: 0 15px; flex-direction: row; gap: 6px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--border); }
    .nav > a { position: relative; border-radius: 0; padding: 15px 10px; white-space: nowrap; font-size: 11px; gap: 7px; }
    .nav > a.active { background: transparent; }
    .nav > a.active::after { content: ''; position: absolute; bottom: 0; left: 9px; right: 9px; height: 2px; background: var(--accent); border-radius: 4px; }
    .nav-label, .nav-note, .nav-footer { display: none; }
    main { padding: 30px 18px 45px; }
    h1 { font-size: 29px; letter-spacing: -.8px; }
    h2 { font-size: 18px; }
    .eyebrow { font-size: 9px; letter-spacing: 1.1px; }
    main > .muted, .page-heading .muted { font-size: 13px; }
    .page-heading { margin-bottom: 26px; }
    .page-heading .button { min-height: 43px; padding: 10px 16px; font-size: 12px; }
    .stats { gap: 9px; margin-bottom: 23px; }
    .stats > div { padding: 14px 11px; border-radius: 12px; }
    .stat-icon { width: 30px; height: 30px; border-radius: 8px; margin-bottom: 13px; }
    .stat-icon .icon { width: 17px; height: 17px; }
    .stats .stat-label { font-size: 10px; line-height: 1.5; min-height: 30px; }
    .stats strong { font-size: 27px; margin-top: 5px; }
    .stats small { display: none; }
    .panel { padding: 20px; border-radius: 14px; margin-bottom: 23px; }
    .filters { gap: 15px 12px; }
    .filter-heading { margin-bottom: 3px; }
    label { font-size: 11px; gap: 7px; }
    input, select, textarea { padding: 11px; font-size: 14px; }
    .filter-actions { gap: 21px; }
    .filter-actions button { padding: 11px 17px; font-size: 12px; }
    .section-heading { gap: 12px; align-items: start; }
    .section-heading h2 { font-size: 17px; }
    .section-heading > .small { font-size: 10px; }
    .report-card { gap: 15px; padding: 22px 0; align-items: start; }
    .report-card h3 { font-size: 15px; }
    .report-card time { font-size: 10px; margin-top: 3px; }
    .report-card time small { font-size: 10px; }
    .excerpt { font-size: 12px; }
    .report-meta { gap: 8px 12px; font-size: 10px; }
    .badge { font-size: 9px; }
    .photo-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 11px; }
    .photo-grid img { height: 145px; border-radius: 10px; }
    .metadata { grid-template-columns: 1fr; gap: 17px; padding-bottom: 23px; }
    .metadata > div { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; }
    .metadata span { flex-shrink: 0; margin: 0; font-size: 10px; }
    .metadata strong { text-align: right; font-size: 12px; }
    .remarks { padding: 18px; font-size: 13px; }
    .upload { padding: 17px; }
    .person-info { gap: 12px; }
    .person-avatar { width: 36px; height: 36px; border-radius: 10px; }
    .person h3 { font-size: 15px; }
    .person p { font-size: 11px; }
    .person-actions > .stack { padding: 13px; gap: 8px; }
    .person-actions > .stack button { font-size: 11px; padding: 11px 10px; }
    .login-wrap { padding: 23px; min-height: 100svh; }
    .login-layout { display: flex; flex-direction: column; align-items: center; gap: 34px; max-width: 440px; }
    .login-story { background: transparent; padding: 0; min-height: 0; width: 100%; }
    .login-intro, .login-footer { display: none; }
    .login-story .brand { font-size: 17px; }
    .login { padding: 31px 24px 23px; border: 1px solid var(--border); border-radius: 18px; }
    .login h1 { font-size: 27px; }
    .login-symbol { width: 46px; height: 46px; margin-bottom: 22px; border-radius: 12px; }
    .login .stack { margin-top: 28px; }
    .login label { font-size: 12px; }
    .login .muted { font-size: 13px; }
    .login-help { font-size: 10px; }
}
@media(max-width:380px) {
    main { padding-left: 14px; padding-right: 14px; }
    .panel { padding: 17px; }
    .stats > div { padding: 13px 9px; }
    .stats .stat-label { font-size: 9px; }
    .filters { grid-template-columns: 1fr; }
    .filter-actions { grid-column: auto; }
    .person-actions > .stack { flex-direction: column; align-items: stretch; }
    .person-actions > .stack button { align-self: stretch; }
}
@media(prefers-reduced-motion:reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
