@charset "UTF-8";

/* =========================================================
   Base
========================================================= */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    font-family: "Segoe UI", "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif;
    color: #f3f6ff;
    background:
        linear-gradient(rgba(7, 14, 32, 0.70), rgba(7, 14, 32, 0.78)),
        url("../images/bkscreen/Franchise1.png") center center / cover no-repeat fixed;
    overflow-x: hidden;
}

/* =========================================================
   Page
========================================================= */
.franchise-detail-page {
    position: relative;
    min-height: 100vh;
    width: 100%;
}

.page-shell {
    position: relative;
    z-index: 2;
    width: min(1400px, calc(100% - 40px));
    margin: 0 auto;
    padding: 78px 0 40px;
}

/* =========================================================
   Common Card
========================================================= */
.glass-card {
    background: linear-gradient(180deg, rgba(18, 30, 62, 0.78) 0%, rgba(12, 21, 46, 0.88) 100%);
    border: 1px solid rgba(173, 196, 255, 0.16);
    border-radius: 18px;
    box-shadow:
        0 18px 40px rgba(0, 0, 0, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* =========================================================
   Top Logo / Top Button
========================================================= */
.franchise-site-logo-link {
    position: fixed;
    top: 10px;
    left: 12px;
    z-index: 1000;
    display: inline-flex;
    text-decoration: none;
}

.franchise-site-logo-wrap {
    width: 1.5cm;
    height: 1.5cm;
    border-radius: 14px;
    background: rgba(10, 18, 40, 0.72);
    border: 1px solid rgba(170, 195, 255, 0.28);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.franchise-site-logo-link:hover .franchise-site-logo-wrap {
    transform: translateY(-1px);
    box-shadow: 0 12px 22px rgba(0, 0, 0, 0.34);
    border-color: rgba(207, 221, 255, 0.42);
}

.franchise-site-logo {
    width: 82%;
    height: 82%;
    object-fit: contain;
    display: block;
}

.franchise-site-logo-wrap.logo-fallback {
    color: #ffffff;
    font-weight: 800;
    font-size: 0.95rem;
    letter-spacing: 0.08em;
}

.franchise-top-btn {
    position: fixed;
    top: 12px;
    right: 14px;
    z-index: 1000;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 18px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(71, 114, 255, 0.32), rgba(88, 216, 255, 0.22));
    border: 1px solid rgba(187, 213, 255, 0.30);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.24);
    color: #f7fbff;
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 0.05em;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.franchise-top-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.30);
    border-color: rgba(222, 235, 255, 0.44);
    background: linear-gradient(135deg, rgba(87, 127, 255, 0.42), rgba(101, 223, 255, 0.28));
}

/* =========================================================
   Header
========================================================= */
.page-header {
    margin-bottom: 20px;
    padding: 26px 28px 24px;
}

.page-header-inner {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.page-eyebrow {
    margin: 0;
    color: #8ed8ff;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.page-title {
    margin: 0;
    color: #ffffff;
    font-size: clamp(1.9rem, 3vw, 2.6rem);
    font-weight: 800;
    line-height: 1.18;
    letter-spacing: 0.02em;
}

.page-subtitle {
    margin: 0;
    max-width: 920px;
    color: #d7e4ff;
    font-size: 0.98rem;
    line-height: 1.8;
}

/* =========================================================
   Section Title
========================================================= */
.section-head,
.chart-head,
.table-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.section-title {
    margin: 0;
    color: #ffffff;
    font-size: 1.08rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.section-note {
    margin: 4px 0 0;
    color: #c8d8fb;
    font-size: 0.88rem;
    line-height: 1.6;
}

/* =========================================================
   Filter Section
========================================================= */
.filter-section {
    margin-bottom: 22px;
    padding: 22px 22px 20px;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.filter-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-item label {
    color: #dce7ff;
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.filter-item select {
    width: 100%;
    min-height: 46px;
    padding: 0 14px;
    border: 1px solid rgba(168, 191, 255, 0.20);
    border-radius: 12px;
    background: rgba(7, 15, 34, 0.74);
    color: #f5f8ff;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.filter-item select:focus {
    border-color: rgba(124, 186, 255, 0.52);
    box-shadow: 0 0 0 3px rgba(86, 157, 255, 0.14);
    background: rgba(8, 17, 38, 0.86);
}

.filter-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 18px;
}

.primary-btn,
.secondary-btn {
    min-width: 132px;
    min-height: 44px;
    padding: 10px 18px;
    border-radius: 12px;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.primary-btn {
    border: 1px solid rgba(167, 210, 255, 0.26);
    color: #f8fbff;
    background: linear-gradient(135deg, rgba(47, 108, 255, 0.84), rgba(65, 183, 255, 0.84));
    box-shadow: 0 12px 24px rgba(15, 63, 150, 0.28);
}

.primary-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 28px rgba(15, 63, 150, 0.36);
}

.secondary-btn {
    border: 1px solid rgba(170, 190, 235, 0.18);
    color: #e7efff;
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.14);
}

.secondary-btn:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(185, 205, 245, 0.28);
}

/* =========================================================
   KPI
========================================================= */
.kpi-section {
    margin-bottom: 22px;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 16px;
}

.kpi-card {
    min-height: 138px;
    padding: 18px 18px 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.kpi-label {
    color: #cfe0ff;
    font-size: 0.84rem;
    font-weight: 700;
    line-height: 1.5;
    letter-spacing: 0.03em;
}

.kpi-value {
    margin: 10px 0 8px;
    color: #ffffff;
    font-size: clamp(1.35rem, 2vw, 1.9rem);
    font-weight: 800;
    line-height: 1.25;
    word-break: break-word;
}

.kpi-sub {
    color: #9fb6ea;
    font-size: 0.78rem;
    line-height: 1.55;
}

/* =========================================================
   Charts
========================================================= */
.chart-section {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-bottom: 22px;
}

.chart-card {
    padding: 20px 22px 18px;
}

.chart-body {
    position: relative;
    margin-top: 16px;
    width: 100%;
}

.chart-body-lg {
    height: 360px;
}

.chart-body-md {
    height: 300px;
}

.chart-body-sm {
    height: 360px;
    max-width: 720px;
}

/* =========================================================
   Table
========================================================= */
.table-section {
    padding: 20px 22px 22px;
}

.table-meta {
    color: #bcd0f8;
    font-size: 0.84rem;
    font-weight: 700;
    white-space: nowrap;
}

.table-wrap {
    margin-top: 16px;
    width: 100%;
    overflow-x: auto;
    border-radius: 14px;
    border: 1px solid rgba(173, 196, 255, 0.10);
    background: rgba(6, 13, 30, 0.48);
}

.detail-table {
    width: 100%;
    min-width: 940px;
    border-collapse: collapse;
}

.detail-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 14px 12px;
    background: rgba(17, 30, 62, 0.94);
    border-bottom: 1px solid rgba(173, 196, 255, 0.14);
    color: #eef4ff;
    font-size: 0.84rem;
    font-weight: 800;
    text-align: left;
    white-space: nowrap;
}

.detail-table tbody td {
    padding: 13px 12px;
    border-bottom: 1px solid rgba(173, 196, 255, 0.08);
    color: #dbe7ff;
    font-size: 0.9rem;
    line-height: 1.55;
    vertical-align: middle;
}

.detail-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.035);
}

.detail-table tbody tr:last-child td {
    border-bottom: none;
}

.table-empty {
    text-align: center !important;
    color: #adc2ee !important;
    padding: 30px 16px !important;
}

/* =========================================================
   Loading
========================================================= */
.loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(3, 8, 20, 0.54);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 1;
    visibility: visible;
    transition: opacity 0.18s ease, visibility 0.18s ease;
}

.loading-overlay.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-box {
    min-width: 220px;
    padding: 24px 22px 20px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(18, 30, 62, 0.92), rgba(10, 19, 43, 0.96));
    border: 1px solid rgba(173, 196, 255, 0.16);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
    text-align: center;
}

.loading-box p {
    margin: 0;
    color: #eef5ff;
    font-size: 0.92rem;
    font-weight: 700;
}

.loading-spinner {
    width: 42px;
    height: 42px;
    margin: 0 auto 14px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.18);
    border-top-color: #7fcfff;
    animation: franchiseDetailSpin 0.8s linear infinite;
}

@keyframes franchiseDetailSpin {
    to {
        transform: rotate(360deg);
    }
}

/* =========================================================
   Responsive
========================================================= */
@media (max-width: 1320px) {
    .kpi-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 1100px) {
    .page-shell {
        width: min(100%, calc(100% - 24px));
        padding-top: 76px;
    }

    .filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .chart-body-lg {
        height: 320px;
    }

    .chart-body-md {
        height: 280px;
    }

    .chart-body-sm {
        height: 320px;
        max-width: 100%;
    }
}

@media (max-width: 700px) {
    .page-shell {
        width: min(100%, calc(100% - 16px));
        padding-top: 72px;
        padding-bottom: 24px;
    }

    .page-header {
        padding: 20px 18px 18px;
        margin-bottom: 16px;
    }

    .filter-section,
    .chart-card,
    .table-section {
        padding-left: 16px;
        padding-right: 16px;
    }

    .filter-grid {
        grid-template-columns: 1fr;
    }

    .filter-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .primary-btn,
    .secondary-btn {
        width: 100%;
    }

    .kpi-grid {
        grid-template-columns: 1fr;
    }

    .kpi-card {
        min-height: 116px;
    }

    .chart-body-lg {
        height: 280px;
    }

    .chart-body-md {
        height: 250px;
    }

    .chart-body-sm {
        height: 280px;
    }

    .franchise-top-btn {
        top: 10px;
        right: 10px;
        min-height: 34px;
        padding: 7px 14px;
        font-size: 0.76rem;
    }

    .franchise-site-logo-link {
        top: 8px;
        left: 8px;
    }

    .detail-table {
        min-width: 820px;
    }
}