* {
    box-sizing: border-box;
}

html {
    width: 100%;
    overflow-x: hidden;
}

body {
    width: 100%;
    min-width: 0;
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: url('/images/bkscreen/POS-image1.jpg') no-repeat center center fixed;
    background-size: cover;
    color: #fff;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.58);
    backdrop-filter: blur(3px);
    z-index: -1;
}

.page-shell {
    width: min(1480px, calc(100% - 32px));
    margin: 0 auto;
    padding: 18px 0 40px;
}

.topbar {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
}

.logo-card {
    width: 1.5cm;
    height: 1.5cm;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.92);
    display: grid;
    place-items: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    flex-shrink: 0;
}

.logo-card img {
    width: 86%;
    height: 86%;
    object-fit: contain;
}

.title-block {
    min-width: 0;
    text-align: center;
    line-height: 1.25;
}

.main-title {
    font-size: clamp(24px, 3vw, 40px);
    font-weight: 800;
    letter-spacing: 0.06em;
}

.sub-title {
    font-size: 13px;
    opacity: 0.82;
    margin-top: 4px;
}

.top-link {
    color: #fff;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.35);
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    font-weight: 700;
    white-space: nowrap;
}

.dashboard {
    display: grid;
    gap: 16px;
}

.filter-card,
.kpi-card,
.chart-card,
.table-card,
.detail-card {
    min-width: 0;
    background: rgba(12, 18, 28, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 20px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.32);
}

.filter-card {
    padding: 16px 20px 18px;
    overflow: visible;
}

.filter-grid {
    display: grid;
    grid-template-columns: 140px 260px minmax(260px, 1fr) 150px 150px 150px 120px;
    gap: 12px 14px;
    align-items: end;
}

.filter-category,
.filter-maker,
.filter-product,
.filter-date {
    min-width: 0;
}

.button-row {
    display: grid;
    grid-template-columns: 150px 120px;
    gap: 10px;
    min-width: 0;
}

.button-row button {
    height: 40px;
}

label {
    display: grid;
    gap: 6px;
    min-width: 0;
    font-size: 12px;
    opacity: 0.92;
}

select,
input,
button {
    width: 100%;
    height: 40px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    padding: 0 12px;
    font-size: 14px;
}

select,
input {
    background: rgba(255, 255, 255, 0.92);
    color: #172033;
}

.suggest-wrap {
    position: relative;
    min-width: 0;
    z-index: 10000;
}

.suggest-list {
    display: none;
    position: absolute;
    z-index: 10001;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    max-height: 280px;
    overflow-y: auto;
    background: #ffffff;
    opacity: 1;
    backdrop-filter: none;
    border: 1px solid rgba(23, 32, 51, 0.28);
    border-radius: 12px;
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.55);
}

.suggest-list.is-open {
    display: block;
}

.suggest-item {
    display: block;
    width: 100%;
    height: auto;
    min-height: 38px;
    padding: 9px 12px;
    border: 0;
    border-radius: 0;
    background: #ffffff;
    color: #172033;
    text-align: left;
    font-weight: 800;
    line-height: 1.35;
}

.suggest-item:hover {
    background: #dfe9ff;
}

.suggest-empty {
    padding: 12px;
    background: #ffffff;
    color: #172033;
    font-size: 13px;
    font-weight: 800;
}

button {
    cursor: pointer;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, #2563eb, #0891b2);
    white-space: nowrap;
}

#resetButton {
    background: rgba(255, 255, 255, 0.16);
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
}

.kpi-card {
    padding: 14px 16px;
    min-height: 86px;
    display: grid;
    align-content: center;
    gap: 6px;
}

.kpi-card span {
    font-size: 12px;
    opacity: 0.78;
}

.kpi-card strong {
    font-size: clamp(22px, 2.2vw, 34px);
    line-height: 1;
    word-break: break-word;
}

.chart-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.chart-grid-main {
    grid-template-columns: minmax(0, 1.45fr) minmax(0, 0.9fr);
}

.chart-card,
.table-card,
.detail-card {
    padding: 16px;
}

.card-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 10px;
}

.card-head h2 {
    margin: 0;
    font-size: 18px;
}

.card-head p {
    margin: 4px 0 0;
    font-size: 12px;
    opacity: 0.72;
}

.chart-box {
    position: relative;
    width: 100%;
    height: 360px;
}

.chart-card.large .chart-box {
    height: 390px;
}

.table-head {
    align-items: center;
}

.sort-label {
    width: 170px;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1000px;
    font-size: 13px;
}

th,
td {
    padding: 10px 9px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: right;
    white-space: nowrap;
}

th {
    font-size: 12px;
    opacity: 0.8;
    background: rgba(255, 255, 255, 0.08);
}

td:nth-child(2),
td:nth-child(3),
td:nth-child(4),
th:nth-child(2),
th:nth-child(3),
th:nth-child(4) {
    text-align: left;
}

tbody tr {
    cursor: pointer;
}

tbody tr:hover {
    background: rgba(255, 255, 255, 0.08);
}

.detail-chart-box {
    height: 340px;
}

@media (max-width: 1180px) {
    .filter-grid {
        grid-template-columns: 150px minmax(240px, 1fr) minmax(280px, 1.2fr) 150px 150px 150px 120px;
    }

    .button-row {
        grid-template-columns: minmax(180px, 1fr) 140px;
    }

    .kpi-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .chart-grid,
    .chart-grid-main {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 820px) {
    body {
        background-attachment: scroll;
    }

    .page-shell {
        width: calc(100% - 16px);
        padding: 10px 0 28px;
    }

    .topbar {
        grid-template-columns: auto 1fr;
        gap: 10px;
        margin-bottom: 12px;
    }

    .logo-card {
        width: 46px;
        height: 46px;
        border-radius: 12px;
    }

    .title-block {
        text-align: left;
    }

    .main-title {
        font-size: 22px;
        letter-spacing: 0.03em;
    }

    .sub-title {
        font-size: 11px;
        line-height: 1.35;
    }

    .top-link {
        grid-column: 1 / -1;
        width: 100%;
        padding: 9px 12px;
        text-align: center;
        font-size: 13px;
    }

    .dashboard {
        gap: 12px;
    }

    .filter-card,
    .chart-card,
    .table-card,
    .detail-card {
        border-radius: 16px;
        padding: 12px;
    }

    .filter-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .button-row {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
    }

    select,
    input,
    button {
        height: 42px;
        font-size: 16px;
    }

    .suggest-list {
        max-height: 240px;
    }

    .kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .kpi-card {
        min-height: 74px;
        padding: 12px;
        border-radius: 16px;
    }

    .kpi-card span {
        font-size: 11px;
    }

    .kpi-card strong {
        font-size: 21px;
    }

    .chart-grid,
    .chart-grid-main {
        gap: 12px;
    }

    .card-head {
        display: block;
        margin-bottom: 8px;
    }

    .card-head h2 {
        font-size: 16px;
    }

    .card-head p {
        font-size: 11px;
    }

    .chart-box,
    .chart-card.large .chart-box,
    .detail-chart-box {
        height: 300px;
    }

    .table-head {
        display: grid;
        gap: 10px;
    }

    .sort-label {
        width: 100%;
    }

    table {
        min-width: 900px;
        font-size: 12px;
    }

    th,
    td {
        padding: 9px 8px;
    }
}

@media (max-width: 430px) {
    .page-shell {
        width: calc(100% - 12px);
    }

    .main-title {
        font-size: 20px;
    }

    .sub-title {
        font-size: 10px;
    }

    .kpi-grid {
        grid-template-columns: 1fr 1fr;
    }

    .kpi-card strong {
        font-size: 19px;
    }

    .chart-box,
    .chart-card.large .chart-box,
    .detail-chart-box {
        height: 280px;
    }
}
/* =========================================================
   モバイルサジェスト修正
   - 半透明化を完全停止
   - モバイルでは下の入力欄に被せず、縦に押し下げる
========================================================= */

label {
    opacity: 1;
    color: rgba(255, 255, 255, 0.92);
}

label select,
label input,
label button,
label .suggest-wrap,
label .suggest-list,
label .suggest-item,
label .suggest-empty {
    opacity: 1;
}

.suggest-list {
    background: #fff;
    color: #071326;
}

.suggest-item {
    background: #fff;
    color: #071326;
}

@media (max-width: 820px) {
    .suggest-wrap {
        position: relative;
        z-index: auto;
    }

    .suggest-list {
        position: static;
        display: none;
        width: 100%;
        margin-top: 6px;
        max-height: 220px;
        overflow-y: auto;
        background: #fff;
        border-radius: 12px;
        box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
    }

    .suggest-list.is-open {
        display: block;
    }

    .suggest-item {
        min-height: 42px;
        padding: 10px 12px;
        font-size: 15px;
        line-height: 1.35;
    }
}