/* ================================================================
   Google Maps API 課金状況ページ
   ================================================================ */

.tehai-api-usage-page {
    padding-bottom: 60px;
}

/* 月ナビ */
.api-usage-month-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0 20px;
    max-width: 860px;
    margin-left: auto;
    margin-right: auto;
}

.api-month-nav {
    width: 36px;
    height: 36px;
    border: 1.5px solid #ccd3de;
    border-radius: 50%;
    background: #fff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    color: #1e3a5f;
    transition: background 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.api-month-nav:hover { background: #eaf2fb; }
.api-month-nav:disabled { opacity: 0.3; cursor: default; }

.api-month-label {
    font-size: 22px;
    font-weight: 700;
    color: #1e3a5f;
    min-width: 120px;
    text-align: center;
}

/* セクション区切り */
.api-usage-section {
    margin-bottom: 36px;
    max-width: 860px;
    margin-left: auto;
    margin-right: auto;
}
.api-section-title {
    font-size: 16px;
    font-weight: 700;
    color: #1e3a5f;
    margin: 0 0 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid #dce4ef;
}
.api-section-subtitle {
    font-size: 13px;
    font-weight: 700;
    color: #444;
    margin: 20px 0 8px;
    padding-left: 10px;
    border-left: 3px solid #2c6fad;
}

/* 自分セクション（控えめなスタイル） */
.api-self-section {
    background: #f9fafc;
    border: 1px solid #e4eaf2;
    border-radius: 10px;
    padding: 16px 20px;
}
.api-self-section .api-section-title {
    font-size: 14px;
    border-bottom-color: #c8d5e8;
    color: #4a6080;
}

/* ── サマリーカード ───────────────────────────────────────────── */
.api-usage-summary {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 14px;
    margin-bottom: 4px;
}
.api-usage-summary--mini {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 0;
}

@media (max-width: 660px) {
    .api-usage-summary { grid-template-columns: 1fr; }
    .api-usage-summary--mini { grid-template-columns: 1fr 1fr; }
}

.api-usage-card {
    background: #fff;
    border: 1.5px solid #dce4ef;
    border-radius: 12px;
    padding: 18px 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    transition: border-color 0.2s;
}
.api-usage-card.api-over {
    border-color: #e74c3c;
    box-shadow: 0 2px 12px rgba(231,76,60,0.15);
}
.api-usage-card--mini {
    padding: 10px 14px;
    border-radius: 8px;
    box-shadow: none;
}

.api-card-label {
    font-size: 12px;
    font-weight: 700;
    color: #7a8fa6;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 8px;
}
.api-usage-card--mini .api-card-label {
    font-size: 11px;
    margin-bottom: 4px;
}

.api-card-count {
    font-size: 28px;
    font-weight: 700;
    color: #1e3a5f;
    line-height: 1;
    margin-bottom: 4px;
}
.api-usage-card--mini .api-card-count {
    font-size: 20px;
}
.api-card-count small {
    font-size: 14px;
    font-weight: normal;
    color: #888;
}
.api-card-free {
    font-size: 12px;
    color: #888;
    margin-bottom: 8px;
}
.api-card-cost {
    font-size: 16px;
    font-weight: 700;
    color: #27ae60;
    margin-bottom: 10px;
}
.api-over .api-card-cost { color: #e74c3c; }

/* プログレスバー */
.api-card-bar-wrap {
    height: 6px;
    background: #eef1f5;
    border-radius: 3px;
    overflow: hidden;
}
.api-card-bar {
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s ease, background 0.4s;
    background: #27ae60;
    width: 0;
}

/* 合計カード */
.api-usage-card--total {
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: linear-gradient(135deg, #1e3a5f 0%, #2c6fad 100%);
    border-color: transparent;
    color: #fff;
}
.api-usage-card--total .api-card-label { color: rgba(255,255,255,0.7); }
.api-card-total-cost {
    font-size: 36px;
    font-weight: 700;
    color: #fff;
    line-height: 1;
    margin-bottom: 4px;
}
.api-usage-card--total.api-over .api-card-total-cost { color: #ffb3ae; }
.api-card-yen {
    font-size: 16px;
    color: rgba(255,255,255,0.8);
    margin-bottom: 10px;
}
.api-card-note {
    font-size: 10px;
    color: rgba(255,255,255,0.5);
}

/* ── テーブル共通 ─────────────────────────────────────────────── */
.api-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 6px rgba(0,0,0,0.07);
    font-size: 14px;
}
.api-table th {
    background: #2c3e50;
    color: #fff;
    padding: 10px 14px;
    text-align: left;
    font-weight: 700;
}
.api-table td {
    padding: 9px 14px;
    border-bottom: 1px solid #f0f0f0;
    color: #333;
}
.api-table tr:last-child td { border-bottom: none; }
.api-table tr:hover td { background: #f8f9fb; }
.api-row-over td { background: #fff5f5; }
.api-row-over td:last-child { color: #e74c3c; font-weight: 700; }

/* ── ユーザー別内訳テーブル ─────────────────────────────────── */
.api-user-table .api-td-user {
    font-weight: 600;
    color: #2c3e50;
    min-width: 100px;
}
.api-th-pct {
    width: 120px;
}
.api-td-pct {
    position: relative;
    padding-left: 14px !important;
    white-space: nowrap;
}
.api-pct-bar {
    display: inline-block;
    height: 8px;
    background: #2c6fad;
    border-radius: 3px;
    vertical-align: middle;
    margin-right: 6px;
    opacity: 0.35;
    min-width: 2px;
    max-width: 60px;
}

/* ── 日別グラフ ──────────────────────────────────────────────── */
.api-chart-wrap {
    background: #fff;
    border: 1px solid #dce4ef;
    border-radius: 10px;
    padding: 16px;
}
.api-chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 120px;
    overflow-x: auto;
    scrollbar-gutter: stable;
    padding-bottom: 4px;
}
.api-bar-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 22px;
    flex: 1;
    cursor: default;
}
.api-bar-pair {
    display: flex;
    gap: 1px;
    align-items: flex-end;
    height: 100px;
}
.api-bar {
    width: 7px;
    border-radius: 3px 3px 0 0;
    min-height: 2px;
    transition: height 0.3s ease;
}
.api-bar--gc { background: #2c6fad; }
.api-bar--rt { background: #27ae60; }
.api-bar-label {
    font-size: 9px;
    color: #aaa;
    margin-top: 3px;
}
.api-chart-legend {
    display: flex;
    gap: 16px;
    margin-top: 10px;
    font-size: 12px;
    color: #666;
}
.api-legend-gc { color: #2c6fad; }
.api-legend-rt { color: #27ae60; }

.api-monthly-table { }

.api-loading {
    color: #aaa;
    font-size: 14px;
    padding: 16px 0;
}

/* ── ページ間ナビリンク ──────────────────────────────────────── */
.report-back-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 32px;
    justify-content: flex-end;
}

.report-back-btn {
    display: inline-block;
    padding: 8px 16px;
    font-size: 13px;
    color: #666;
    border: 1px solid #ccc;
    border-radius: 6px;
    text-decoration: none;
    background: #f9f9f9;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}
.report-back-btn:hover {
    background: #eee;
    color: #333;
}
.report-back-btn--active {
    background: #1e3a5f;
    color: #fff;
    border-color: #1e3a5f;
}
.report-back-btn--active:hover {
    background: #2c5282;
    color: #fff;
}

@media (max-width: 600px) {
    .report-back-links {
        flex-direction: column;
        align-items: stretch;
    }
    .report-back-btn {
        text-align: center;
    }
}
