:root {
    --bg: #edf6ff;
    --bg-strong: #dceefe;
    --surface: rgba(249, 252, 255, 0.92);
    --surface-strong: #f8fbff;
    --text: #10233b;
    --muted: #60758d;
    --line: rgba(34, 78, 122, 0.12);
    --accent: #4b8fd8;
    --accent-soft: rgba(75, 143, 216, 0.14);
    --accent-deep: #2c6fb7;
    --success: #1f6f67;
    --success-bg: rgba(31, 111, 103, 0.12);
    --danger: #a13f5a;
    --danger-bg: rgba(161, 63, 90, 0.12);
    --shadow: 0 24px 60px rgba(69, 115, 170, 0.14);
    --radius-xl: 28px;
    --radius-lg: 20px;
    --radius-md: 14px;
}

* {
    box-sizing: border-box;
}

.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;
}

body {
    --content-font-scale: 0.85;
}

body {
    margin: 0;
    font-family: 'SUIT', sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(127, 196, 255, 0.26), transparent 34%),
        radial-gradient(circle at bottom right, rgba(83, 150, 224, 0.18), transparent 30%),
        linear-gradient(135deg, #f3faff 0%, #e6f2ff 48%, #f8fbff 100%);
    min-height: 100vh;
}

.shell {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    min-height: 100vh;
    align-items: start;
}

.shell.auth-shell {
    grid-template-columns: minmax(0, 1fr);
}

.sidebar {
    padding: 28px 22px 22px;
    background:
        radial-gradient(circle at top, rgba(106, 177, 255, 0.16), transparent 24%),
        linear-gradient(180deg, rgba(11, 31, 54, 0.98) 0%, rgba(16, 46, 80, 0.96) 100%);
    color: #eef7ff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 18px;
    position: sticky;
    top: 0;
    min-height: 100vh;
    z-index: 2;
    border-right: 1px solid rgba(162, 202, 240, 0.12);
}

.eyebrow {
    margin: 0 0 10px;
    font-size: 12px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(216, 234, 249, 0.8);
}

.sidebar h1,
.hero h2,
.section-head h3 {
    margin: 0;
    line-height: 1.1;
}

.sidebar-main,
.sidebar-bottom {
    display: grid;
    gap: 18px;
}

.sidebar-brand {
    display: grid;
    gap: 10px;
}

.sidebar-brand-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.sidebar h1 {
    font-size: clamp(26px, 2.4vw, 38px);
    letter-spacing: -0.04em;
}

.brand-home-link {
    color: inherit;
    text-decoration: none;
}

.brand-home-link:hover {
    opacity: 0.92;
}

.sidebar-copy,
.muted,
.sidebar-panel p,
.nav-link small {
    color: var(--muted);
}

.sidebar-copy {
    color: rgba(216, 234, 249, 0.8);
    line-height: 1.65;
}

.sidebar-user-chip {
    display: grid;
    gap: 4px;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(191, 220, 246, 0.16);
}

.sidebar-user-chip strong {
    font-size: 16px;
}

.sidebar-user-chip span {
    color: rgba(216, 234, 249, 0.74);
    font-size: 13px;
}

.sidebar-logout-form {
    margin: 0;
}

.sidebar-logout-button {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.08));
    color: #f4f9ff;
    font-size: 20px;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.sidebar-logout-button:hover {
    transform: translateY(-1px);
    background: linear-gradient(180deg, rgba(255, 146, 146, 0.28), rgba(255, 255, 255, 0.08));
    box-shadow: 0 10px 20px rgba(7, 22, 40, 0.18);
}

.nav {
    display: grid;
    gap: 10px;
}

.nav-link {
    display: block;
    padding: 15px 16px;
    border-radius: 20px;
    text-decoration: none;
    color: inherit;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.03));
    border: 1px solid rgba(191, 220, 246, 0.12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.nav-link:hover,
.nav-link.active {
    transform: translateY(-1px);
    background: linear-gradient(180deg, rgba(78, 147, 220, 0.22), rgba(58, 117, 190, 0.16));
    border-color: rgba(115, 182, 246, 0.5);
    box-shadow: 0 12px 24px rgba(7, 22, 40, 0.18);
}

.nav-link span,
.panel-label {
    display: block;
    font-weight: 700;
}

.nav-link small {
    display: block;
    margin-top: 6px;
    color: rgba(216, 234, 249, 0.76);
}

.sidebar-panel {
    padding: 16px 16px 18px;
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
    border: 1px solid rgba(191, 220, 246, 0.14);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.sidebar-panel strong {
    display: block;
    margin-top: 8px;
    font-size: 17px;
}

.sidebar-file-panel p {
    margin-bottom: 0;
    line-height: 1.6;
}

.sidebar-font-dock {
    display: grid;
    grid-template-columns: 44px 1fr 44px;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 18px;
    background: rgba(7, 22, 40, 0.36);
    border: 1px solid rgba(191, 220, 246, 0.14);
    backdrop-filter: blur(10px);
}

.sidebar-admin-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(78, 147, 220, 0.22), rgba(58, 117, 190, 0.16));
    border: 1px solid rgba(115, 182, 246, 0.34);
    color: #eef7ff;
    text-decoration: none;
    font-weight: 700;
}

.font-dock-label {
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    color: rgba(229, 241, 255, 0.92);
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.font-tool-button {
    min-height: 38px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.08));
    color: #f4f9ff;
    font-weight: 800;
    cursor: pointer;
    transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.font-tool-button:hover {
    transform: translateY(-1px);
    background: linear-gradient(180deg, rgba(104, 171, 244, 0.28), rgba(76, 132, 196, 0.18));
    box-shadow: 0 10px 20px rgba(7, 22, 40, 0.18);
}

.content {
    padding: 34px;
    min-width: 0;
    font-size: calc(16px * var(--content-font-scale));
}

.auth-shell .content {
    min-height: 100vh;
    display: grid;
    align-content: center;
    justify-items: center;
    padding: 48px 24px;
}

.content .eyebrow {
    font-size: calc(12px * var(--content-font-scale));
}

.content .muted,
.content label,
.content th,
.content td,
.content input,
.content select,
.content button,
.content .badge,
.content .status-pill,
.content .table-link,
.content .ghost-button,
.content .primary-button {
    font-size: calc(1rem * var(--content-font-scale));
}

.content .hero h2 {
    font-size: calc(2rem * var(--content-font-scale));
}

.content .section-head h3 {
    font-size: calc(1.35rem * var(--content-font-scale));
}

.content .stat-card strong {
    font-size: calc(30px * var(--content-font-scale));
}

.topbar-form {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 16px;
}

.content-topbar {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 16px;
}

.topbar-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 14px;
    border: 1px solid rgba(75, 143, 216, 0.18);
    background: rgba(255, 255, 255, 0.7);
    color: var(--accent-deep);
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.topbar-link:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(75, 143, 216, 0.32);
}

.topbar-link-accent {
    background: linear-gradient(180deg, rgba(75, 143, 216, 0.96), rgba(44, 111, 183, 0.96));
    border-color: rgba(44, 111, 183, 0.36);
    color: #f8fbff;
}

.topbar-link-accent:hover {
    background: linear-gradient(180deg, rgba(86, 154, 228, 1), rgba(44, 111, 183, 1));
}

.card {
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(14px);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    padding: 28px;
    margin-bottom: 22px;
}

.hero {
    background:
        linear-gradient(140deg, rgba(248, 252, 255, 0.96), rgba(229, 241, 255, 0.9)),
        var(--surface);
}

.split,
.section-head,
.action-row,
.filter-row,
.compare-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.badge-stack,
.stat-grid,
.compare-grid,
.content-grid,
.grid-form,
.mode-grid {
    display: grid;
    gap: 16px;
}

.stat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    min-width: 280px;
}

.stat-card {
    padding: 18px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid var(--line);
}

.stat-card span,
.badge {
    color: var(--muted);
    font-size: 13px;
}

.stat-card strong {
    display: block;
    margin-top: 8px;
    font-size: 30px;
}

.badge-stack {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 12px;
}

.badge-stack-end {
    margin-left: auto;
    justify-content: flex-end;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-deep);
    font-weight: 700;
    white-space: nowrap;
}

.badge-link {
    text-decoration: none;
}

.badge-accent {
    background: linear-gradient(135deg, #2c6fb7 0%, #4b8fd8 100%);
    color: #f7fbff;
    box-shadow: 0 12px 24px rgba(44, 111, 183, 0.18);
}

.per-page-badge {
    gap: 8px;
    padding-right: 10px;
}

.per-page-badge select {
    width: auto;
    min-height: 32px;
    border: 0;
    background: transparent;
    color: inherit;
    padding: 0 20px 0 4px;
    box-shadow: none;
}

.per-page-badge select:focus {
    box-shadow: none;
}

.content-grid {
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.8fr);
    align-items: start;
}

.stack,
.stack-form {
    display: grid;
    gap: 22px;
}

.grid-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-form .full {
    grid-column: 1 / -1;
}

label {
    display: grid;
    gap: 10px;
    font-weight: 600;
    color: var(--text);
}

input,
select,
button {
    font: inherit;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="file"],
select {
    width: 100%;
    border: 1px solid var(--line);
    background: #fcfeff;
    color: var(--text);
    border-radius: 14px;
    min-height: 48px;
    padding: 0 14px;
    outline: none;
}

input[type="date"] {
    appearance: none;
    -webkit-appearance: none;
}

input[type="date"]::-webkit-date-and-time-value {
    text-align: left;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    opacity: 0.72;
    cursor: pointer;
}

input:focus,
select:focus {
    border-color: rgba(75, 143, 216, 0.65);
    box-shadow: 0 0 0 4px rgba(75, 143, 216, 0.12);
}

.mode-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mode-card {
    position: relative;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.52);
    cursor: pointer;
    transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.mode-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.mode-card span {
    display: block;
    margin-top: 24px;
    font-weight: 800;
}

.mode-card small {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    line-height: 1.5;
}

.mode-card::before {
    content: "";
    position: absolute;
    top: 18px;
    left: 18px;
    width: 14px;
    height: 14px;
    border-radius: 999px;
    border: 2px solid rgba(75, 143, 216, 0.42);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.95);
}

.mode-card:hover {
    transform: translateY(-1px);
    border-color: rgba(75, 143, 216, 0.32);
    background: rgba(255, 255, 255, 0.72);
}

.mode-card:has(input:checked) {
    border-color: rgba(75, 143, 216, 0.58);
    background: linear-gradient(180deg, rgba(245, 250, 255, 0.98), rgba(228, 240, 255, 0.94));
    box-shadow: 0 12px 28px rgba(86, 145, 214, 0.14);
}

.mode-card:has(input:checked)::before {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: inset 0 0 0 3px #f7fbff, 0 0 0 6px rgba(75, 143, 216, 0.12);
}

.inline-check {
    display: flex;
    align-items: center;
    gap: 10px;
}

.inline-check input {
    width: 18px;
    height: 18px;
}

.primary-button,
.ghost-button,
.table-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 18px;
    border-radius: 14px;
    border: 0;
    text-decoration: none;
    cursor: pointer;
}

.primary-button {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
    color: #f7fbff;
    font-weight: 700;
}

.ghost-button,
.table-link {
    background: rgba(255, 255, 255, 0.72);
    color: var(--text);
    border: 1px solid var(--line);
}

.danger-button {
    color: var(--danger);
    border-color: rgba(161, 63, 90, 0.22);
    background: rgba(255, 244, 247, 0.82);
}

.filter-row {
    margin-bottom: 18px;
}

.filter-row > * {
    flex: 1;
}

.filter-row button {
    flex: 0 0 auto;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 14px 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}



.compare-results-table th,
.compare-results-table td {
    padding: 12px 8px;
    text-align:center;
}

.compare-results-table th:nth-child(1),
.compare-results-table td:nth-child(1) {
    width: 48px;
}

.compare-results-table th:nth-child(2),
.compare-results-table td:nth-child(2) {
    width: 120px;
}

.compare-results-table th:nth-child(3),
.compare-results-table td:nth-child(3),
.compare-results-table th:nth-child(4),
.compare-results-table td:nth-child(4),
.compare-results-table th:nth-child(5),
.compare-results-table td:nth-child(5),
.compare-results-table th:nth-child(7),
.compare-results-table td:nth-child(7),
.compare-results-table th:nth-child(8),
.compare-results-table td:nth-child(8),
.compare-results-table th:nth-child(9),
.compare-results-table td:nth-child(9),
.compare-results-table th:nth-child(10),
.compare-results-table td:nth-child(10),
.compare-results-table th:nth-child(11),
.compare-results-table td:nth-child(11) {
    white-space: nowrap;
}

.procedure-cell {
    min-width: 280px;
    line-height: 1.45;
}

.compare-results-table .table-link {
    min-height: 40px;
    padding: 0 14px;
}

th {
    color: var(--muted);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.empty-cell {
    text-align: center;
    color: var(--muted);
    padding: 48px 20px;
}

.flash,
.danger-box {
    padding: 15px 18px;
    border-radius: 16px;
    margin-bottom: 16px;
    font-weight: 600;
}

.flash.success {
    background: var(--success-bg);
    color: var(--success);
}

.flash.error,
.danger-box {
    background: var(--danger-bg);
    color: var(--danger);
}

.login-shell {
    min-height: calc(100vh - 68px);
    display: grid;
    place-items: center;
}

.login-panel {
    width: min(1120px, 100%);
    display: grid;
    grid-template-columns: minmax(420px, 1.05fr) minmax(360px, 0.95fr);
    background: rgba(247, 251, 255, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 34px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.login-copy {
    padding: 40px;
    background:
        radial-gradient(circle at top left, rgba(148, 214, 255, 0.22), transparent 36%),
        linear-gradient(145deg, #123659 0%, #1f568f 52%, #5da6ea 100%);
    color: #f3faff;
}

.login-eyebrow,
.login-copy .muted {
    color: rgba(233, 245, 255, 0.82);
}

.login-copy h2 {
    font-size: clamp(34px, 3.8vw, 54px);
    line-height: 1.14;
    letter-spacing: -0.03em;
    word-break: keep-all;
    overflow-wrap: normal;
    margin-bottom: 16px;
}

.login-copy p {
    line-height: 1.7;
}

.login-form {
    padding: 40px;
    display: grid;
    gap: 18px;
    align-content: center;
    background: rgba(252, 254, 255, 0.96);
}

.full-button {
    width: 100%;
}

.compare-sheet {
    border-top: 1px solid var(--line);
    padding-top: 20px;
    margin-top: 20px;
}

.compare-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 14px;
}

.compare-column {
    padding: 18px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.58);
    border: 1px solid var(--line);
}

.guide-grid,
.upload-grid,
.detail-grid,
.detail-memos {
    display: grid;
    gap: 16px;
}

.guide-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.guide-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.guide-card,
.upload-card,
.memo-entry {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.62);
    padding: 18px;
}

.guide-card p,
.upload-card p,
.memo-entry p,
.compare-column p {
    margin: 8px 0 0;
    line-height: 1.6;
}

.guide-card {
    color: inherit;
    text-decoration: none;
}

.guide-card.clickable,
.guide-chip {
    transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.guide-card.clickable:hover,
.guide-card.active,
.guide-chip:hover,
.guide-chip.active {
    transform: translateY(-1px);
    border-color: rgba(75, 143, 216, 0.38);
    background: rgba(242, 248, 255, 0.92);
    box-shadow: 0 16px 32px rgba(86, 145, 214, 0.12);
}

.guide-chip {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.72);
    color: inherit;
    text-decoration: none;
    white-space: nowrap;
}

.guide-chip strong {
    color: var(--text);
    font-size: 15px;
}

.guide-chip::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 10px);
    transform: translateX(-50%) translateY(6px);
    min-width: 220px;
    max-width: 320px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(10, 26, 46, 0.94);
    color: #f4f9ff;
    font-size: 13px;
    line-height: 1.5;
    white-space: normal;
    opacity: 0;
    pointer-events: none;
    box-shadow: 0 16px 32px rgba(6, 19, 35, 0.24);
    transition: opacity 140ms ease, transform 140ms ease;
    z-index: 5;
}

.guide-chip:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.guide-head,
.detail-stage-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.guide-head strong {
    font-size: 18px;
    color: var(--text);
}

.upload-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.upload-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.upload-card:hover,
.upload-card.active {
    transform: translateY(-1px);
    border-color: rgba(75, 143, 216, 0.38);
    background: rgba(242, 248, 255, 0.92);
    box-shadow: 0 16px 32px rgba(86, 145, 214, 0.12);
}

.upload-card-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.upload-card-actions {
    display: flex;
    justify-content: flex-end;
}

.upload-card strong {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(75, 143, 216, 0.1);
    color: var(--accent-deep);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 10px !important;
    font-weight: 800;
    border: 1px solid transparent;
}

.status-match {
    background: rgba(42, 156, 128, 0.12);
    color: #1d7865;
    border-color: rgba(42, 156, 128, 0.18);
}

.status-name-only-match {
    background: rgba(38, 151, 180, 0.13);
    color: #1d6f8a;
    border-color: rgba(38, 151, 180, 0.2);
}

.status-combine-procedure {
    background: rgba(34, 129, 153, 0.14);
    color: #1b7085;
    border-color: rgba(34, 129, 153, 0.2);
}

.status-combine-incomplete {
    background: rgba(217, 145, 45, 0.16);
    color: #ab6c14;
    border-color: rgba(217, 145, 45, 0.24);
}

.status-mismatch {
    background: rgba(194, 76, 103, 0.12);
    color: #ad3757;
    border-color: rgba(194, 76, 103, 0.18);
}

.status-memo-missing {
    background: rgba(83, 126, 176, 0.12);
    color: #356594;
    border-color: rgba(83, 126, 176, 0.18);
}

.status-memo-no-doctor {
    background: rgba(101, 98, 180, 0.12);
    color: #5754a8;
    border-color: rgba(101, 98, 180, 0.18);
}

.status-memo-staff-missing {
    background: rgba(128, 111, 184, 0.12);
    color: #685aa8;
    border-color: rgba(128, 111, 184, 0.18);
}

.status-doctor-optional-ok {
    background: rgba(58, 154, 110, 0.12);
    color: #247652;
    border-color: rgba(58, 154, 110, 0.18);
}

.status-receipt-unassigned {
    background: rgba(109, 122, 137, 0.14);
    color: #516173;
    border-color: rgba(109, 122, 137, 0.18);
}

.status-staff-missing-review {
    background: rgba(207, 126, 55, 0.14);
    color: #a55b14;
    border-color: rgba(207, 126, 55, 0.2);
}

.status-staff-mismatch-review {
    background: rgba(103, 132, 168, 0.12);
    color: #56708d;
    border-color: rgba(103, 132, 168, 0.2);
}

.status-review {
    background: rgba(217, 145, 45, 0.14);
    color: #ab6c14;
    border-color: rgba(217, 145, 45, 0.2);
}

.detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 18px;
}

.detail-stage {
    border: 1px solid rgba(75, 143, 216, 0.24);
    background: linear-gradient(180deg, rgba(246, 250, 255, 0.98), rgba(236, 244, 255, 0.92));
}

.list-stage {
    scroll-margin-top: 24px;
}

.memo-box {
    margin-top: 12px;
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(238, 246, 255, 0.88);
    border: 1px solid rgba(75, 143, 216, 0.16);
    line-height: 1.7;
    white-space: normal;
    word-break: break-word;
}

.detail-memos {
    margin-top: 22px;
}

.memo-entry-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.memo-entry-head span {
    color: var(--muted);
    font-size: 14px;
}

.compare-filter {
    align-items: end;
}

.result-row td {
    background: rgba(255, 255, 255, 0.42);
}

.result-row.status-match td {
    background: rgba(42, 156, 128, 0.04);
}

.result-row.status-name-only-match td {
    background: rgba(38, 151, 180, 0.05);
}

.result-row.status-combine-procedure td {
    background: rgba(34, 129, 153, 0.05);
}

.result-row.status-combine-incomplete td {
    background: rgba(217, 145, 45, 0.07);
}

.result-row.status-mismatch td {
    background: rgba(194, 76, 103, 0.05);
}

.result-row.status-memo-missing td {
    background: rgba(83, 126, 176, 0.05);
}

.result-row.status-memo-no-doctor td {
    background: rgba(101, 98, 180, 0.05);
}

.result-row.status-staff-mismatch-review td {
    background: rgba(103, 132, 168, 0.06);
}

.result-row.status-memo-staff-missing td {
    background: rgba(128, 111, 184, 0.05);
}

.result-row.status-doctor-optional-ok td {
    background: rgba(58, 154, 110, 0.05);
}

.result-row.status-receipt-unassigned td {
    background: rgba(109, 122, 137, 0.05);
}

.result-row.status-staff-missing-review td {
    background: rgba(207, 126, 55, 0.06);
}

.result-row.status-review td {
    background: rgba(217, 145, 45, 0.06);
}

.upload-selected-row td {
    background: rgba(75, 143, 216, 0.08);
}

.pager {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 18px;
}

body.modal-open {
    overflow: hidden;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: grid;
    place-items: center;
    padding: 28px;
    background: rgba(9, 27, 48, 0.42);
    backdrop-filter: blur(8px);
}

.modal-backdrop[hidden] {
    display: none !important;
}

.modal-sheet {
    width: min(1040px, 100%);
    max-height: min(84vh, 920px);
    overflow: auto;
    padding: 24px;
    border-radius: 26px;
    background: linear-gradient(180deg, rgba(251, 253, 255, 0.98), rgba(241, 247, 255, 0.96));
    border: 1px solid rgba(75, 143, 216, 0.16);
    box-shadow: 0 28px 70px rgba(21, 53, 89, 0.22);
}

.modal-sheet-sm {
    width: min(520px, 100%);
}

.modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.modal-head h3 {
    margin-top: 4px;
}

.modal-close {
    min-width: 68px;
    height: 42px;
    padding: 0 14px;
    border: 1px solid rgba(75, 143, 216, 0.18);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.82);
    color: var(--accent-deep);
    font-weight: 700;
    cursor: pointer;
}

.modal-summary-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}

.modal-table-wrap {
    max-height: min(58vh, 640px);
    overflow: auto;
}

.badge-link {
    text-decoration: none;
}

.diff-list {
    margin: 0;
    padding-left: 18px;
    display: grid;
    gap: 8px;
    line-height: 1.55;
}

@media (max-width: 1100px) {
    .content-grid,
    .split,
    .filter-row,
    .compare-grid,
    .grid-form,
    .mode-grid {
        grid-template-columns: 1fr;
        display: grid;
    }

    .sidebar {
        position: static;
        min-height: auto;
    }

    .stat-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .login-panel {
        grid-template-columns: 1fr;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .badge-stack {
        flex-wrap: wrap;
    }
}

@media (max-width: 760px) {
    .shell {
        grid-template-columns: 260px minmax(0, 1fr);
    }

    .content {
        padding: 18px;
    }

    .card,
    .sidebar {
        padding: 22px;
    }

    .stat-grid {
        grid-template-columns: 1fr;
    }
}
