/* =========================================
   共通レイアウト / ベーススタイル
   ========================================= */

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f5f5f5;
    color: #333;
    font-size: 14px;
}

/* ページ全体の共通コンテナ */
.page-main {
    max-width: 1080px;
    margin: 24px auto 40px;
    padding: 0 16px;
}

/* セクション見出し */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.page-title {
    font-size: 20px;
    font-weight: bold;
    margin: 0;
}

/* =========================================
   ヘッダー
   ========================================= */

header {
    background: #1976d2;
    color: #fff;
    padding: 10px 16px;
}

.header-inner {
    max-width: 1080px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-title {
    font-size: 18px;
    font-weight: bold;
}

.header-tools {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-muted {
    font-size: 12px;
    opacity: 0.9;
}

/* =========================================
   カード
   ========================================= */

.card {
    background: #fff;
    border-radius: 6px;
    padding: 20px 24px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    margin-bottom: 20px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.card-title {
    font-size: 16px;
    font-weight: bold;
    margin: 0;
}

/* =========================================
   ボタン
   ========================================= */

.btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
    border: none;
    box-sizing: border-box;
}

/* メインボタン */
.btn-primary {
    background: #1976d2;
    color: #fff;
}
.btn-primary:hover {
    background: #125ea8;
}

/* サブボタン（グレー） */
.btn-secondary {
    background: #eee;
    color: #333;
}
.btn-secondary:hover {
    background: #e0e0e0;
}

/* ライトボタン（ヘッダーなど） */
.btn-light {
    background: #ffffff;
    color: #333;
    border: 1px solid #ddd;
}
.btn-light:hover {
    background: #f6f6f6;
}

/* 危険操作ボタン */
.btn-danger {
    background: #c62828;
    color: #fff;
}
.btn-danger:hover {
    background: #b71c1c;
}

/* 小サイズ（ヘッダー用等） */
.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

/* フル幅ボタン（フォームの送信など） */
.btn-block {
    display: block;
    width: 100%;
    text-align: center;
}

/* =========================================
   テーブル
   ========================================= */

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

th, td {
    padding: 8px 6px;
    border-bottom: 1px solid #e0e0e0;
    text-align: left;
}

th {
    background: #fafafa;
    font-weight: 600;
}

/* テーブルの補助クラス */
.table-narrow th,
.table-narrow td {
    padding-top: 4px;
    padding-bottom: 4px;
}

/* =========================================
   ステータスピル
   ========================================= */

.pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    color: #333;
}

.pill-green { background: #e8f5e9; color: #2e7d32; }
.pill-red   { background: #ffebee; color: #c62828; }
.pill-blue  { background: #e3f2fd; color: #1a237e; }
.pill-gray  { background: #eceff1; color: #455a64; }

/* 運営ダッシュボードで使うステータス表示（共通化用） */
.status-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
}

.status-pending_email { background:#fff3e0; color:#bf360c; }
.status-trial         { background:#e3f2fd; color:#0d47a1; }
.status-active        { background:#e8f5e9; color:#1b5e20; }
.status-past_due      { background:#ffebee; color:#b71c1c; }
.status-canceled      { background:#eceff1; color:#455a64; }

/* =========================================
   メッセージ / アラート
   ========================================= */

.alert {
    padding: 10px 12px;
    border-radius: 4px;
    font-size: 13px;
    margin-bottom: 12px;
}

.alert ul {
    margin: 0;
    padding-left: 20px;
}

.alert-info {
    background: #e3f2fd;
    color: #0d47a1;
    border: 1px solid #90caf9;
}

.alert-success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.alert-warning {
    background: #fff8e1;
    color: #f57f17;
    border: 1px solid #ffe082;
}

.alert-error {
    background: #ffebee;
    color: #b71c1c;
    border: 1px solid #f44336;
}

/* =========================================
   フォーム共通スタイル
   ========================================= */

.form-field {
    margin-bottom: 12px;
}

.form-label {
    display: block;
    font-size: 13px;
    color: #555;
    margin-bottom: 4px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 6px 8px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

.form-textarea {
    min-height: 80px;
    resize: vertical;
}

/* ラベル＋値の縦並び（詳細画面など） */
.dl-table {
    margin: 0;
}

.dl-table dt {
    font-size: 12px;
    color: #777;
    margin-top: 6px;
}

.dl-table dd {
    margin: 0;
    font-size: 14px;
}

/* =========================================
   サマリーカード（ダッシュボード）
   ========================================= */

.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.summary-item {
    background: #fafafa;
    border-radius: 4px;
    padding: 12px 14px;
    font-size: 14px;
}

.summary-title {
    font-size: 13px;
    color: #555;
    margin-bottom: 4px;
}

.summary-value {
    font-size: 20px;
    font-weight: bold;
}

.summary-muted {
    color: #777;
    font-size: 12px;
}

/* 狭い画面でのレスポンシブ対応 */
@media (max-width: 768px) {
    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .header-inner,
    .page-main {
        padding-left: 12px;
        padding-right: 12px;
    }

    .card {
        padding: 16px 16px;
    }
}
