* {
    box-sizing: border-box;
}


:root {
    --bg: #f4f6f8;
    --surface: #fff;
    --border: #dfe4ea;
    --text: #17202a;
    --muted: #6b7280;
    --primary: #1f2937;
    --sidebar: #111827;
    --shadow: 0 8px 24px rgba(15, 23, 42, .06);
}


html {
    scroll-behavior: smooth;
}


body {
    margin: 0;

    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        "Noto Sans JP",
        "Hiragino Kaku Gothic ProN",
        "Yu Gothic",
        Meiryo,
        sans-serif;

    color: var(--text);
    background: var(--bg);
}


button {
    font: inherit;
}


a {
    color: inherit;
    text-decoration: none;
}


/* =========================================
   Layout
========================================= */

.app-shell {
    min-height: 100vh;
    display: flex;
}


/* =========================================
   Sidebar
========================================= */

.sidebar {
    position: fixed;

    inset: 0 auto 0 0;

    width: 260px;

    padding: 28px 18px 20px;

    background: var(--sidebar);
    color: #e5e7eb;

    display: flex;
    flex-direction: column;

    z-index: 20;
}


.brand {
    display: flex;
    align-items: center;

    gap: 12px;

    padding: 0 10px 30px;
}


.brand-mark {
    width: 42px;
    height: 42px;

    border-radius: 12px;

    display: grid;
    place-items: center;

    background: #fff;
    color: #111827;

    font-size: 22px;
}


.brand strong,
.brand span {
    display: block;
}


.brand strong {
    font-size: 15px;
}


.brand span {
    margin-top: 3px;

    color: #9ca3af;

    font-size: 12px;
}


/* Navigation */

.nav {
    display: grid;
    gap: 6px;
}


.nav-item {
    padding: 12px 14px;

    border-radius: 9px;

    color: #cbd5e1;

    font-size: 14px;
}


.nav-item:hover,
.nav-item.active {
    background: #1f2937;
    color: #fff;
}


/* Sidebar footer */

.sidebar-footer {
    margin-top: auto;

    padding: 16px 10px 4px;

    border-top: 1px solid #293241;
}


.access-badge {
    display: inline-block;

    padding: 4px 7px;

    border: 1px solid #4b5563;
    border-radius: 5px;

    color: #d1d5db;

    font-size: 9px;
    letter-spacing: .08em;
}


.sidebar-footer small {
    display: block;

    margin-top: 8px;

    color: #9ca3af;

    font-size: 10px;
    line-height: 1.6;
}


/* =========================================
   Main
========================================= */

.main {
    width: 100%;

    margin-left: 260px;

    min-width: 0;
}


/* =========================================
   Topbar
========================================= */

.topbar {
    min-height: 94px;

    padding: 18px 34px;

    background: var(--surface);

    border-bottom: 1px solid var(--border);

    display: flex;
    align-items: center;

    gap: 16px;
}


.menu-button {
    display: none;

    border: 1px solid var(--border);

    background: #fff;

    border-radius: 8px;

    width: 42px;
    height: 42px;

    cursor: pointer;
}


.eyebrow {
    margin: 0 0 5px;

    color: #7b8491;

    font-size: 10px;

    font-weight: 700;

    letter-spacing: .12em;
}


.topbar h1,
.page-intro h2,
.facility-card h3 {
    margin: 0;
}


.topbar h1 {
    font-size: 24px;
}


.topbar-actions {
    margin-left: auto;

    display: flex;
    align-items: center;

    gap: 10px;
}


.auth-status {
    color: var(--muted);

    font-size: 12px;
}


.auth-status.ok {
    color: #16803c;

    font-weight: 600;
}


/* =========================================
   Buttons
========================================= */

.secondary-button {
    border: 1px solid #cfd6df;

    background: #fff;

    color: #303945;

    border-radius: 8px;

    padding: 9px 14px;

    cursor: pointer;

    font-size: 13px;
}


.secondary-button:hover {
    background: #f6f8fa;
}


/* =========================================
   Content
========================================= */

.content {
    max-width: 1400px;

    margin: 0 auto;

    padding: 34px;
}


.page-intro {
    margin-bottom: 24px;
}


.page-intro h2 {
    font-size: 20px;
}


.page-intro p:not(.eyebrow) {
    margin: 7px 0 0;

    color: var(--muted);

    font-size: 13px;
}


/* =========================================
   Message
========================================= */

.message-area {
    margin-bottom: 14px;
}


.message {
    padding: 11px 13px;

    border-radius: 8px;

    font-size: 13px;

    background: #eef6ff;

    border: 1px solid #cfe2ff;
}


.message.error {
    background: #fff1f0;

    border-color: #f2c5c0;

    color: #9f2d24;
}


/* =========================================
   Loading
========================================= */

.loading {
    padding: 40px 20px;

    text-align: center;

    color: var(--muted);

    font-size: 13px;
}


/* =========================================
   Empty state
========================================= */

.empty-state {
    background: var(--surface);

    border: 1px solid var(--border);

    border-radius: 12px;

    box-shadow: var(--shadow);

    padding: 50px 24px;

    text-align: center;
}


.empty-icon {
    font-size: 34px;

    margin-bottom: 12px;
}


.empty-state h3 {
    margin: 0;

    font-size: 17px;
}


.empty-state p {
    margin: 8px 0 0;

    color: var(--muted);

    font-size: 13px;
}


/* =========================================
   Facility list
========================================= */

.facility-list {
    display: grid;

    grid-template-columns:
        repeat(
            2,
            minmax(0, 1fr)
        );

    gap: 18px;
}


/* =========================================
   Facility card
========================================= */

.facility-card {
    background: var(--surface);

    border: 1px solid var(--border);

    border-radius: 12px;

    box-shadow: var(--shadow);

    padding: 22px;

    transition:
        border-color .15s ease,
        transform .15s ease,
        box-shadow .15s ease;
}


.facility-card:hover {
    border-color: #c7d0da;

    transform: translateY(-1px);

    box-shadow:
        0 10px 28px rgba(15, 23, 42, .08);
}


.facility-card-header {
    display: flex;

    align-items: flex-start;

    justify-content: space-between;

    gap: 15px;

    margin-bottom: 18px;
}


.facility-icon {
    width: 44px;
    height: 44px;

    border-radius: 10px;

    display: grid;
    place-items: center;

    background: #eef2f7;

    font-size: 21px;

    flex-shrink: 0;
}


.facility-title {
    flex: 1;
}


.facility-title h3 {
    font-size: 17px;

    line-height: 1.4;
}


.facility-code {
    display: block;

    margin-top: 5px;

    color: var(--muted);

    font-size: 11px;
}


.facility-info {
    display: grid;

    gap: 9px;

    margin-bottom: 20px;
}


.info-row {
    display: flex;

    justify-content: space-between;

    gap: 20px;

    padding-bottom: 9px;

    border-bottom: 1px solid #edf0f3;
}


.info-row:last-child {
    border-bottom: 0;

    padding-bottom: 0;
}


.info-label {
    color: var(--muted);

    font-size: 11px;
}


.info-value {
    font-size: 12px;

    font-weight: 600;

    text-align: right;

    overflow-wrap: anywhere;
}


.facility-action {
    display: flex;

    justify-content: flex-end;
}


.detail-button {
    display: inline-flex;

    align-items: center;

    gap: 6px;

    padding: 8px 12px;

    border: 1px solid #cfd6df;

    border-radius: 8px;

    background: #fff;

    font-size: 12px;

    color: #303945;
}


.detail-button:hover {
    background: #f6f8fa;
}


/* =========================================
   Responsive
========================================= */

@media (max-width: 1000px) {

    .sidebar {
        transform: translateX(-100%);

        transition:
            transform .2s;
    }


    .sidebar.open {
        transform: translateX(0);
    }


    .main {
        margin-left: 0;
    }


    .menu-button {
        display: block;
    }


    .facility-list {
        grid-template-columns: 1fr;
    }

}


@media (max-width: 700px) {

    .topbar {
        padding: 15px 16px;
    }


    .topbar h1 {
        font-size: 20px;
    }


    .auth-status {
        display: none;
    }


    .content {
        padding: 22px 16px 34px;
    }


    .facility-card {
        padding: 18px;
    }

}


@media (max-width: 430px) {

    .facility-card-header {
        gap: 10px;
    }


    .facility-icon {
        width: 40px;
        height: 40px;

        font-size: 19px;
    }


    .facility-title h3 {
        font-size: 15px;
    }

}