:root {
    color-scheme: light;
    --ink: #182a39;
    --muted: #657889;
    --canvas: #eaf6fb;
    --panel: rgba(255, 255, 255, 0.94);
    --line: #d9e8ef;
    --cyan: #16b8b5;
    --green: #1db878;
    --blue: #5b7cff;
    --indigo: #4b64d8;
    --violet: #8c6fd8;
    --amber: #e4a72c;
    --slate: #718093;
    --coral: #ff735c;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    margin: 0;
    font-family: "Yu Gothic", "Meiryo", "Segoe UI", sans-serif;
    color: var(--ink);
}

body {
    background: var(--canvas);
    font-size: 17px;
}

a {
    color: inherit;
}

button,
input,
select {
    font: inherit;
}

.app-shell {
    min-height: 100vh;
}

.login-page {
    min-height: 100vh;
    background-image:
        linear-gradient(90deg, rgba(8, 31, 50, 0.52), rgba(238, 250, 255, 0.3), rgba(8, 31, 50, 0.48)),
        url("/images/production-portal-bg.png");
    background-size: cover;
    background-position: center;
}

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px;
}

.login-panel {
    width: min(560px, 100%);
    padding: 42px 46px;
    border: 1px solid rgba(129, 214, 230, 0.45);
    border-radius: 14px;
    background: rgba(247, 252, 255, 0.92);
    box-shadow: 0 30px 90px rgba(4, 32, 51, 0.32);
    backdrop-filter: blur(14px);
}

.login-brand-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

.brand-mark {
    display: grid;
    width: 58px;
    height: 58px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 14px;
    color: white;
    background: linear-gradient(135deg, #0bb6c8, #3577ff);
    font-size: 1.35rem;
    font-weight: 800;
}

.eyebrow {
    margin: 0 0 5px;
    color: #16839d;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.login-panel h1 {
    margin: 0;
    font-size: 2.35rem;
    font-weight: 800;
    letter-spacing: 0;
}

.login-copy {
    margin: 22px 0 28px;
    color: #486171;
    font-size: 1.03rem;
}

.login-form {
    display: grid;
    gap: 12px;
}

.login-form label {
    color: #274960;
    font-weight: 800;
}

.login-form input {
    min-height: 56px;
    border: 1px solid #8D8D8D;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.96);
    color: var(--ink);
    padding: 0 16px;
    font-size: 1.08rem;
    outline: none;
}

.login-form input:focus,
.search-actions input:focus {
    border-color: #0d8fac;
    box-shadow: 0 0 0 5px rgba(20, 171, 199, 0.35);
}

.field-error,
.form-error {
    color: #b22134;
    font-size: 0.9rem;
}

.form-error {
    padding: 12px 14px;
    margin-bottom: 14px;
    border: 1px solid rgba(178, 33, 52, 0.24);
    border-radius: 10px;
    background: rgba(255, 235, 238, 0.94);
}

.primary-button {
    min-height: 58px;
    margin-top: 12px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, #008fc0, #1bb9b4);
    color: white;
    font-size: 1.08rem;
    font-weight: 800;
    cursor: pointer;
}

.primary-button:hover {
    filter: brightness(1.2);
}

.portal-page {
    min-height: 100vh;
    background-image:
        linear-gradient(90deg, rgba(8, 31, 50, 0.52), rgba(238, 250, 255, 0.3), rgba(8, 31, 50, 0.48)),
        url("/images/production-portal-bg.png");
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    padding-bottom: 28px;
}

.portal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 68px;
    padding: 0 28px;
    border-bottom: 1px solid #dbeaf1;
    background: rgba(255, 255, 255, 0.96);
}

.portal-title {
    display: flex;
    align-items: baseline;
    gap: 14px;
    cursor:default;
}

.portal-title h1,
.portal-title span {
    margin: 0;
    font-size: 1.42rem;
    font-weight: 800;
}

.portal-title span {
    color: #173a59;
}

.user-area {
    display: grid;
    grid-template-columns: auto auto auto;
    align-items: center;
    gap: 10px;
    color: #324d60;
    font-size: 0.95rem;
}

.user-area span {
    font-weight: 800;
}

.user-area small {
    color: #6c7f8d;
}

.user-area a {
    padding: 7px 10px;
    border: 1px solid #8D8D8D;
    border-radius: 8px;
    color: #315e78;
    text-decoration: none;
}

.user-area a:hover {
    border-color: #a9cfe0;
    background: #eaf6fb;
}

.search-stage {
    display: grid;
    grid-template-columns: minmax(320px, 1fr) minmax(340px, 480px);
    align-items: start;
    gap: 20px;
    padding: 14px 28px 16px;
}

.search-stage > div:first-child {
    width: fit-content;
    max-width: 100%;
    padding: 10px 12px 12px;
    border: 1px solid rgba(10, 79, 142, 0.28);
    border-radius: 8px;
    background: rgba(8, 92, 165, 0.88);
    box-shadow: 0 8px 20px rgba(7, 43, 78, 0.16);
    cursor:default;
}

.search-stage h2 {
    margin: 0 0 6px;
    font-size: 1.48rem;
    font-weight: 800;
    color: #ffffff;
}

.search-stage p {
    margin: 0 0 12px;
    color: #e9f7ff;
    font-size: 1rem;
}

.department-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.department-tabs button {
    min-width: 75px;
    min-height: 30px;
    border: 0;
    border-radius: 999px;
    background: white;
    color: #446172;
    font-size: 0.92rem;
    font-weight: 800;
    cursor: pointer;
    padding: 2px 10px 0 10px;
}

.department-tabs button:hover {
    background: #dcefff;
    color: #167ac8;
}

.department-tabs button.active {
    background: #167ac8;
    color: white;
}

.department-tabs button.active:hover {
    background: #1179c9;
}

.search-actions {
    display: grid;
    grid-template-columns: 1fr 74px 76px;
    gap: 10px;
    align-items: center;
}

.search-actions input {
    min-height: 40px;
    border: 1px solid #cfe1eb;
    border-radius: 999px;
    background: white;
    padding: 0 18px;
    outline: none;
}

.search-actions button {
    min-height: 40px;
    border: 0;
    border-radius: 8px;
    background: #1179c9;
    color: white;
    font-size: 0.96rem;
    font-weight: 800;
    cursor: pointer;
}

.search-actions button:hover {
    background: #0d63a8;
}

.search-actions span {
    display: grid;
    min-height: 40px;
    place-items: center;
    border-radius: 999px;
    background: #dcefff;
    color: #2872aa;
    font-size: 0.9rem;
    font-weight: 800;
    width: 85px;
}

.portal-grid {
    display: grid;
    grid-template-columns: minmax(560px, 1fr) minmax(280px, 0.52fr);
    gap: 18px;
    padding: 0 28px;
}

.menu-board,
.detail-panel,
.operation-note {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 8px 22px rgba(71, 111, 134, 0.08);
    cursor: default;
}

.menu-board {
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.board-title {
    display: none;
}

.main-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(150px, 1fr));
    gap: 12px;
}

.main-card {
    position: relative;
    display: grid;
    grid-template-columns: 38px 1fr auto;
    gap: 6px 12px;
    min-height: 116px;
    padding: 16px 14px 14px;
    overflow: hidden;
    border: 1px solid #d6e5ee;
    border-top: 4px solid var(--coral);
    border-radius: 8px;
    --card-accent: #ff735c;
    --card-accent-dark: #ce4f3d;
    --card-accent-soft: #fff0ed;
    --card-accent-rgb: 255, 115, 92;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.82));
    color: var(--ink);
    text-align: left;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(72, 111, 132, 0.08);
}

.main-card::before {
    content: none;
}

.main-card:hover {
    z-index: 2;
    transform: translateY(-4px);
    border-color: var(--card-accent);
    box-shadow: 0 0 0 0.2px var(--card-accent), 0 5px 10px rgba(var(--card-accent-rgb), 0.65);
}

    .main-card.selected {
        z-index: 1;
        border-color: var(--card-accent);
        box-shadow: 0 0 0 0.2px var(--card-accent);
    }

        .main-card.selected:hover {
            z-index: 2;
            box-shadow: 0 0 0 0.2px var(--card-accent), 0 5px 10px rgba(var(--card-accent-rgb), 0.65);
        }

.main-card.accent-cyan {
    --card-accent: #16b8b5;
    --card-accent-dark: #008b88;
    --card-accent-soft: #ddfbfa;
    --card-accent-rgb: 22, 184, 181;
    border-top-color: #16b8b5;
    background: linear-gradient(135deg, rgba(238, 255, 254, 0.96), rgba(255, 255, 255, 0.84));
}

.main-card.accent-green {
    --card-accent: #20b66f;
    --card-accent-dark: #0b8d50;
    --card-accent-soft: #dff9ec;
    --card-accent-rgb: 32, 182, 111;
    border-top-color: #20b66f;
    background: linear-gradient(135deg, rgba(239, 255, 246, 0.96), rgba(255, 255, 255, 0.84));
}

.main-card.accent-blue {
    --card-accent: #2484ce;
    --card-accent-dark: #0d6fb9;
    --card-accent-soft: #e2f1ff;
    --card-accent-rgb: 36, 132, 206;
    border-top-color: #2484ce;
    background: linear-gradient(135deg, rgba(238, 247, 255, 0.96), rgba(255, 255, 255, 0.84));
}

.main-card.accent-indigo {
    --card-accent: #4b64d8;
    --card-accent-dark: #3650c3;
    --card-accent-soft: #e8ecff;
    --card-accent-rgb: 75, 100, 216;
    border-top-color: #4b64d8;
    background: linear-gradient(135deg, rgba(240, 243, 255, 0.96), rgba(255, 255, 255, 0.84));
}

.main-card.accent-violet {
    --card-accent: #e84b84;
    --card-accent-dark: #cf2f6f;
    --card-accent-soft: #ffe5ef;
    --card-accent-rgb: 232, 75, 132;
    border-top-color: #e84b84;
    background: linear-gradient(135deg, rgba(255, 240, 247, 0.96), rgba(255, 255, 255, 0.84));
}

.main-card.accent-amber {
    --card-accent: #ed9a38;
    --card-accent-dark: #c86700;
    --card-accent-soft: #fff1d7;
    --card-accent-rgb: 237, 154, 56;
    border-top-color: #ed9a38;
    background: linear-gradient(135deg, rgba(255, 248, 232, 0.96), rgba(255, 255, 255, 0.84));
}

.main-card.accent-slate {
    --card-accent: #2d8f99;
    --card-accent-dark: #147982;
    --card-accent-soft: #e1f6f8;
    --card-accent-rgb: 45, 143, 153;
    border-top-color: #2d8f99;
    background: linear-gradient(135deg, rgba(239, 250, 252, 0.96), rgba(255, 255, 255, 0.84));
}

.card-icon {
    display: grid;
    position: relative;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 1px solid rgba(var(--card-accent-rgb), 0.22);
    border-radius: 12px;
    background:
        linear-gradient(135deg, rgba(var(--card-accent-rgb), 0.18), rgba(255, 255, 255, 0.88)),
        var(--card-accent-soft);
    color: var(--card-accent-dark);
    font-size: 0;
    font-weight: 800;
    box-shadow: inset 0 -8px 14px rgba(var(--card-accent-rgb), 0.12);
}

:is(.card-icon, .detail-icon)::before,
:is(.card-icon, .detail-icon)::after {
    position: absolute;
    content: "";
}

.card-icon::before {
    position: absolute;
    top: 8px;
    left: 9px;
    width: 15px;
    height: 15px;
    border: 2px solid currentColor;
    border-radius: 5px;
}

.card-icon::after {
    position: absolute;
    right: 7px;
    bottom: 7px;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--card-accent);
}

.main-card.accent-amber .card-icon {
    border-color: rgba(237, 154, 56, 0.28);
    color: #c86700;
}

.main-card.accent-cyan .card-icon {
    border-color: rgba(22, 184, 181, 0.28);
    color: #008b88;
}

.main-card.accent-indigo .card-icon {
    border-color: rgba(75, 100, 216, 0.28);
    color: #3650c3;
}

.main-card.accent-blue .card-icon {
    border-color: rgba(36, 132, 206, 0.28);
    color: #0d6fb9;
}

.main-card.accent-green .card-icon {
    border-color: rgba(32, 182, 111, 0.28);
    color: #0b8d50;
}

.main-card.accent-violet .card-icon {
    border-color: rgba(232, 75, 132, 0.28);
    color: #cf2f6f;
}

.main-card.accent-slate .card-icon {
    border-color: rgba(45, 143, 153, 0.28);
    color: #147982;
}

.card-status {
    grid-column: 3;
    justify-self: end;
    min-width: 50px;
    padding: 3px 8px;
    border-radius: 999px;
    background: #edf3f7;
    color: #6a7d8b;
    font-size: 0.78rem;
    font-weight: 800;
    text-align: center;
}

.card-department {
    grid-column: 2;
    color: #3872de;
    font-size: 0.8rem;
    font-weight: 800;
}

.main-card.accent-amber .card-department { color: #c86700; }
.main-card.accent-cyan .card-department { color: #008b88; }
.main-card.accent-indigo .card-department { color: #3650c3; }
.main-card.accent-blue .card-department { color: #0d6fb9; }
.main-card.accent-green .card-department { color: #0b8d50; }
.main-card.accent-violet .card-department { color: #cf2f6f; }
.main-card.accent-slate .card-department { color: #147982; }

.main-card strong {
    grid-column: 2 / 4;
    font-size: 1.12rem;
    font-weight: 800;
}

.card-summary {
    grid-column: 2 / 4;
    color: #4f6170;
    font-size: 0.86rem;
    line-height: 1.42;
}

.card-open {
    grid-column: 2;
    width: 56px;
    margin-top: 2px;
    padding: 5px 0;
    border-radius: 6px;
    background: #17a88d;
    color: white;
    font-size: 0.82rem;
    font-weight: 800;
    text-align: center;
}

.main-card.accent-amber .card-open { background: #de7d1b; }
.main-card.accent-cyan .card-open { background: #0ea29d; }
.main-card.accent-indigo .card-open { background: #4b64d8; }
.main-card.accent-blue .card-open { background: #1577bd; }
.main-card.accent-green .card-open { background: #159960; }
.main-card.accent-violet .card-open { background: #d93b7a; }
.main-card.accent-slate .card-open { background: #23828b; }

.detail-panel {
    min-height: 300px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.88);
}

.selected-label {
    margin: 0 0 6px;
    color: #ff715f;
    font-size: 0.8rem;
    font-weight: 800;
}

.selected-summary {
    margin-bottom: 12px;
    padding: 0 0 10px;
    border-bottom: 1px solid #d8e7ef;
}

.selected-summary span {
    color: #63798a;
    font-size: 0.8rem;
    font-weight: 800;
}

.selected-summary h2 {
    margin: 4px 0;
    font-size: 1.28rem;
    font-weight: 800;
}

.selected-summary p {
    margin: 0 0 8px;
    color: #4d6170;
    font-size: 0.88rem;
    line-height: 1.45;
}

.selected-summary button {
    min-height: 26px;
    padding: 0 10px;
    border: 1px solid #bfe5d8;
    border-radius: 6px;
    background: white;
    color: #15906f;
    font-size: 0.68rem;
    font-weight: 800;
    cursor: pointer;
}

.selected-summary button:hover {
    background: #e5f7f0;
    border-color: #8fd6bc;
}

.detail-panel h3 {
    margin: 0 0 8px;
    font-size: 1rem;
    font-weight: 800;
}

.detail-card-grid {
    display: grid;
    gap: 6px;
}

.detail-card {
    display: grid;
    grid-template-columns: 36px 1fr;
    gap: 10px;
    min-height: 58px;
    padding: 10px;
    border: 1px solid #d9e7ef;
    border-left: 4px solid #ff735c;
    border-radius: 8px;
    --detail-accent: #ff735c;
    --detail-accent-dark: #ce4f3d;
    --detail-accent-soft: #fff0ed;
    --detail-accent-rgb: 255, 115, 92;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(var(--detail-accent-rgb), 0.06));
    color: var(--ink);
    text-decoration: none;
}

.detail-card:hover {
    border-color: var(--detail-accent);
    background: linear-gradient(135deg, rgba(var(--detail-accent-rgb), 0.16), var(--detail-accent-soft));
    box-shadow: 0 0 0 0.1px var(--detail-accent), 0 9px 18px rgba(var(--detail-accent-rgb), 0.32);
}

.detail-card.disabled {
    cursor: not-allowed;
    opacity: 0.88;
    filter: grayscale(0.04);
    pointer-events: none;
}

.detail-card.accent-amber {
    --detail-accent: #ed9a38;
    --detail-accent-dark: #c86700;
    --detail-accent-soft: #fff1d7;
    --detail-accent-rgb: 237, 154, 56;
    border-left-color: #ed9a38;
}

.detail-card.accent-cyan {
    --detail-accent: #16b8b5;
    --detail-accent-dark: #008b88;
    --detail-accent-soft: #ddfbfa;
    --detail-accent-rgb: 22, 184, 181;
    border-left-color: #16b8b5;
}

.detail-card.accent-indigo {
    --detail-accent: #4b64d8;
    --detail-accent-dark: #3650c3;
    --detail-accent-soft: #e8ecff;
    --detail-accent-rgb: 75, 100, 216;
    border-left-color: #4b64d8;
}

.detail-card.accent-blue {
    --detail-accent: #2484ce;
    --detail-accent-dark: #0d6fb9;
    --detail-accent-soft: #e2f1ff;
    --detail-accent-rgb: 36, 132, 206;
    border-left-color: #2484ce;
}

.detail-card.accent-green {
    --detail-accent: #20b66f;
    --detail-accent-dark: #0b8d50;
    --detail-accent-soft: #dff9ec;
    --detail-accent-rgb: 32, 182, 111;
    border-left-color: #20b66f;
}

.detail-card.accent-violet {
    --detail-accent: #e84b84;
    --detail-accent-dark: #cf2f6f;
    --detail-accent-soft: #ffe5ef;
    --detail-accent-rgb: 232, 75, 132;
    border-left-color: #e84b84;
}

.detail-card.accent-slate {
    --detail-accent: #2d8f99;
    --detail-accent-dark: #147982;
    --detail-accent-soft: #e1f6f8;
    --detail-accent-rgb: 45, 143, 153;
    border-left-color: #2d8f99;
}

.detail-icon {
    display: grid;
    position: relative;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 1px solid rgba(var(--detail-accent-rgb), 0.24);
    border-radius: 12px;
    background:
        linear-gradient(135deg, rgba(var(--detail-accent-rgb), 0.2), rgba(255, 255, 255, 0.9)),
        var(--detail-accent-soft);
    color: var(--detail-accent-dark);
    font-size: 0;
    font-weight: 800;
    box-shadow: inset 0 -7px 12px rgba(var(--detail-accent-rgb), 0.12);
}

.detail-icon::before {
    top: 8px;
    left: 9px;
    width: 15px;
    height: 15px;
    border: 2px solid currentColor;
    border-radius: 5px;
}

.detail-icon::after {
    right: 7px;
    bottom: 7px;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--detail-accent);
}

:is(.card-icon, .detail-icon).icon-design-master::before {
    top: 6px;
    left: 10px;
    width: 14px;
    height: 20px;
    border: 2px solid currentColor;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.45);
}

:is(.card-icon, .detail-icon).icon-design-master::after {
    top: 12px;
    left: 14px;
    width: 7px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    box-shadow: 0 5px 0 currentColor, 0 10px 0 currentColor;
}

:is(.card-icon, .detail-icon).icon-production::before {
    top: 10px;
    left: 9px;
    width: 4px;
    height: 15px;
    border: 0;
    border-radius: 2px;
    background: currentColor;
    box-shadow: 7px -5px 0 currentColor, 14px -9px 0 currentColor;
}

:is(.card-icon, .detail-icon).icon-production::after {
    left: 8px;
    bottom: 7px;
    width: 21px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
}

:is(.card-icon, .detail-icon).icon-sales::before {
    left: 8px;
    bottom: 8px;
    width: 20px;
    height: 15px;
    border: 0;
    border-left: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    border-radius: 0;
    background: currentColor;
    clip-path: polygon(0 100%, 0 88%, 18% 88%, 18% 74%, 39% 74%, 39% 55%, 61% 55%, 61% 34%, 82% 34%, 82% 15%, 100% 15%, 100% 100%);
}

:is(.card-icon, .detail-icon).icon-sales::after {
    top: 7px;
    right: 6px;
    width: 9px;
    height: 9px;
    border-top: 3px solid currentColor;
    border-right: 3px solid currentColor;
    border-radius: 0;
    background: transparent;
    transform: rotate(12deg);
}

:is(.card-icon, .detail-icon).icon-purchasing::before {
    left: 7px;
    top: 9px;
    width: 19px;
    height: 11px;
    border: 2px solid currentColor;
    border-top-width: 3px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.35);
}

:is(.card-icon, .detail-icon).icon-purchasing::after {
    left: 8px;
    bottom: 6px;
    width: 4px;
    height: 4px;
    border: 0;
    border-radius: 999px;
    background: currentColor;
    box-shadow: 15px 0 0 currentColor, -2px -16px 0 -1px currentColor;
}

:is(.card-icon, .detail-icon).icon-manufacturing::before {
    left: 7px;
    bottom: 8px;
    width: 21px;
    height: 12px;
    border: 0;
    border-radius: 3px;
    background: currentColor;
    clip-path: polygon(0 40%, 25% 40%, 25% 20%, 45% 40%, 45% 20%, 67% 40%, 100% 40%, 100% 100%, 0 100%);
}

:is(.card-icon, .detail-icon).icon-manufacturing::after {
    top: 8px;
    left: 10px;
    width: 5px;
    height: 10px;
    border-radius: 2px 2px 0 0;
    background: currentColor;
}

:is(.card-icon, .detail-icon).icon-inventory::before {
    top: 8px;
    left: 7px;
    width: 9px;
    height: 9px;
    border: 2px solid currentColor;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.35);
    box-shadow: 11px 0 0 rgba(255, 255, 255, 0.35), 11px 0 0 0 currentColor;
}

:is(.card-icon, .detail-icon).icon-inventory::after {
    left: 11px;
    bottom: 7px;
    width: 13px;
    height: 11px;
    border: 2px solid currentColor;
    border-radius: 2px;
    background:
        linear-gradient(90deg, transparent 45%, currentColor 46%, currentColor 54%, transparent 55%),
        rgba(255, 255, 255, 0.45);
}

:is(.card-icon, .detail-icon).icon-quality::before {
    top: 6px;
    left: 9px;
    width: 17px;
    height: 20px;
    border: 0;
    border-radius: 0;
    background: currentColor;
    clip-path: polygon(50% 0, 94% 18%, 84% 72%, 50% 100%, 16% 72%, 6% 18%);
}

:is(.card-icon, .detail-icon).icon-quality::after {
    top: 13px;
    left: 14px;
    width: 8px;
    height: 4px;
    border-right: 2px solid #fff;
    border-bottom: 2px solid #fff;
    border-radius: 0;
    background: transparent;
    transform: rotate(38deg);
}

:is(.card-icon, .detail-icon).icon-accounting-general::before {
    top: 6px;
    left: 9px;
    width: 17px;
    height: 21px;
    border: 2px solid currentColor;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.35);
}

:is(.card-icon, .detail-icon).icon-accounting-general::after {
    top: 10px;
    left: 13px;
    width: 9px;
    height: 3px;
    border-radius: 999px;
    background: currentColor;
    box-shadow:
        -1px 6px 0 -1px currentColor,
        5px 6px 0 -1px currentColor,
        11px 6px 0 -1px currentColor,
        -1px 12px 0 -1px currentColor,
        5px 12px 0 -1px currentColor,
        11px 12px 0 -1px currentColor;
}

:is(.card-icon, .detail-icon).icon-administration::before {
    left: 7px;
    bottom: 8px;
    width: 22px;
    height: 15px;
    border: 2px solid currentColor;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.35);
}

:is(.card-icon, .detail-icon).icon-administration::after {
    top: 8px;
    left: 9px;
    width: 11px;
    height: 5px;
    border-radius: 3px 3px 0 0;
    background: currentColor;
}


.detail-card strong {
    color: var(--detail-accent-dark);
}

.detail-card strong,
.detail-card small,
.detail-card em {
    display: block;
}

.detail-card strong {
    font-size: 0.94rem;
    font-weight: 800;
}

.detail-card small {
    margin: 2px 0;
    color: #5a6c7a;
    font-size: 0.8rem;
    line-height: 1.3;
}

.detail-card em {
    color: #607685;
    font-size: 0.78rem;
    font-style: normal;
}

.operation-note {
    display: flex;
    gap: 14px;
    align-items: center;
    margin: 14px 28px 0;
    padding: 12px 18px;
    color: #526879;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.9);
}

.operation-note strong {
    color: #26475e;
}

.empty-state {
    display: grid;
    min-height: 280px;
    place-items: center;
    border: 1px dashed #bfd4df;
    border-radius: 8px;
    color: var(--muted);
}

.app-loading {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, rgba(234, 246, 251, 0.97), rgba(210, 234, 243, 0.97));
    opacity: 1;
    visibility: visible;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.app-loading--hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.app-loading__panel {
    display: grid;
    justify-items: center;
    gap: 18px;
    padding: 32px 44px;
}

.app-loading__spinner {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 5px solid rgba(22, 184, 181, 0.22);
    border-top-color: var(--cyan);
    animation: app-loading-spin 0.9s linear infinite;
}

.app-loading__text {
    margin: 0;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--ink);
}

@keyframes app-loading-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .app-loading {
        transition: none;
    }

    .app-loading__spinner {
        animation-duration: 2.4s;
    }
}

#blazor-error-ui {
    display: none;
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 1000;
    max-width: min(420px, calc(100vw - 32px));
    padding: 14px 16px;
    border-radius: 8px;
    background: #7f1d2a;
    color: white;
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.22);
}

#blazor-error-ui .reload {
    margin-left: 8px;
    color: white;
    font-weight: 800;
}

#blazor-error-ui .dismiss {
    margin-left: 12px;
    cursor: pointer;
}

@media (max-width: 1180px) {
    .portal-grid,
    .search-stage {
        grid-template-columns: 1fr;
    }

    .detail-panel {
        min-height: auto;
    }
}

@media (max-width: 820px) {
    .portal-header,
    .portal-title,
    .operation-note {
        align-items: flex-start;
        flex-direction: column;
    }

    .portal-header {
        gap: 12px;
        padding: 16px 18px;
    }

    .search-stage,
    .portal-grid {
        padding-inline: 18px;
    }

    .search-actions,
    .main-card-grid {
        grid-template-columns: 1fr;
    }

    .user-area {
        grid-template-columns: auto auto;
    }
}

@media (max-width: 560px) {
    .login-shell {
        padding: 18px;
    }

    .login-panel {
        padding: 28px 22px;
    }

    .login-brand-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .login-panel h1 {
        font-size: 1.85rem;
    }
}
