* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Hiragino Sans", sans-serif;
    background: #f4f6f8;
    color: #1a1a1a;
    line-height: 1.5;
    min-height: 100vh;
}

.container {
    width: 95%;
    max-width: 2000px;
    margin: 0 auto;
    padding: 16px;
}

.container.narrow {
    width: 95%;
    max-width: 560px;
    margin: 0 auto;
}

header.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

header.page-header h1 {
    flex: 1 1 100%;
}

header.page-header .actions {
    width: 100%;
}

h1 {
    margin: 0;
    font-size: clamp(1.25rem, 4vw, 1.5rem);
}

h2 {
    margin: 28px 0 12px;
    font-size: clamp(1rem, 3.5vw, 1.15rem);
}

.section {
    margin-bottom: 8px;
}

.card {
    background: #fff;
    border: 1px solid #dde3ea;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 16px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 40px;
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid #c5cdd6;
    background: #fff;
    color: #1a1a1a;
    text-decoration: none;
    font-size: 0.9rem;
    cursor: pointer;
    touch-action: manipulation;
}

.btn:hover {
    background: #f0f3f6;
}

.btn-primary {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-danger {
    background: #dc2626;
    border-color: #dc2626;
    color: #fff;
}

.btn-danger:hover {
    background: #b91c1c;
}

.btn-success {
    background: #16a34a;
    border-color: #16a34a;
    color: #fff;
}

.btn-success:hover {
    background: #15803d;
}

.btn-muted {
    background: #64748b;
    border-color: #64748b;
    color: #fff;
}

.btn-muted:hover {
    background: #475569;
}

.btn-sm {
    min-height: 36px;
    padding: 6px 12px;
    font-size: 0.8rem;
}

label {
    display: block;
    margin-bottom: 14px;
    font-size: 0.9rem;
    font-weight: 600;
}

input[type="text"],
input[type="url"],
input[type="password"],
select,
textarea {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 12px;
    border: 1px solid #c5cdd6;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 400;
}

textarea {
    min-height: 100px;
    resize: vertical;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 400;
}

.checkbox-label input {
    width: 20px;
    height: 20px;
    margin: 0;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.log-scroll-panel {
    width: 100%;
    max-height: min(252px, 35vh);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid #dde3ea;
    border-radius: 10px;
    background: #fff;
}

/* タスク実行ログは cron ログの約130%の高さ */
.task-log-panel {
    max-height: min(328px, 45vh);
}

.log-scroll-panel .log-table {
    border: none;
    border-radius: 0;
    margin: 0;
}

.log-scroll-panel .log-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f8fafc;
    box-shadow: 0 1px 0 #dde3ea;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid #dde3ea;
    border-radius: 10px;
    overflow: hidden;
    font-size: 0.85rem;
}

th, td {
    padding: 10px 12px;
    border-bottom: 1px solid #eef2f6;
    text-align: left;
    vertical-align: top;
}

th {
    background: #f8fafc;
    font-weight: 600;
    white-space: nowrap;
}

tr:last-child td {
    border-bottom: none;
}

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-on { background: #dcfce7; color: #166534; }
.badge-off { background: #fee2e2; color: #991b1b; }
.badge-ok { background: #dcfce7; color: #166534; }
.badge-ng { background: #fee2e2; color: #991b1b; }

.actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.actions-inline {
    flex-wrap: nowrap;
}

@media (min-width: 901px) {
    .task-list-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .task-list-table {
        min-width: 1200px;
    }

    .task-list-table .col-category,
    .task-list-table .col-frequency,
    .task-list-table .col-status,
    .task-list-table .col-last-run,
    .task-list-table .col-actions,
    .task-list-table .col-id {
        white-space: nowrap;
    }

    .task-list-table .col-category {
        min-width: 5.5em;
    }

    .task-list-table .col-actions {
        min-width: 280px;
    }

    .task-list-table .actions-inline {
        flex-wrap: nowrap;
    }

    .task-list-table .actions-inline .btn-sm {
        flex-shrink: 0;
        white-space: nowrap;
    }
}

.header-actions .btn {
    flex: 1 1 calc(50% - 4px);
}

.error {
    color: #dc2626;
    background: #fee2e2;
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.flash {
    background: #dbeafe;
    color: #1e40af;
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
    word-break: break-word;
}

.status-banner {
    padding: 14px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.6;
    word-break: break-word;
}

.status-ok { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.status-warn { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.status-error { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.status-unknown { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; }

.note {
    color: #64748b;
    font-size: 0.85rem;
    line-height: 1.7;
    word-break: break-word;
}

.note code {
    display: inline-block;
    max-width: 100%;
    padding: 2px 6px;
    background: #e2e8f0;
    border-radius: 4px;
    font-size: 0.8rem;
    word-break: break-all;
}

.message-list {
    background: #fff;
    border: 1px solid #dde3ea;
    border-radius: 10px;
    padding: 16px 16px 16px 32px;
}

.url-cell {
    word-break: break-all;
}

.url-cell a {
    color: #2563eb;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.form-actions .btn {
    flex: 1 1 auto;
    min-width: 120px;
}

.empty-row td {
    text-align: center;
    color: #64748b;
    padding: 24px 16px;
}

/* モバイル: テーブル → カード */
@media (max-width: 900px) {
    .container {
        padding: 12px;
    }

    header.page-header h1 {
        flex: 1 1 auto;
    }

    .header-actions .btn {
        flex: 1 1 100%;
    }

    .responsive-table thead {
        display: none;
    }

    .responsive-table tbody {
        display: block;
    }

    .responsive-table tr {
        display: block;
        margin-bottom: 12px;
        background: #fff;
        border: 1px solid #dde3ea;
        border-radius: 10px;
        overflow: hidden;
    }

    .responsive-table tr.empty-row {
        border: 1px dashed #cbd5e1;
        background: #f8fafc;
    }

    .responsive-table td {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px;
        padding: 10px 14px;
        border-bottom: 1px solid #eef2f6;
        text-align: right;
    }

    .responsive-table td:last-child {
        border-bottom: none;
    }

    .responsive-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #475569;
        text-align: left;
        flex: 0 0 38%;
        max-width: 38%;
        font-size: 0.8rem;
    }

    .responsive-table td.empty-cell {
        display: block;
        text-align: center;
    }

    .responsive-table td.empty-cell::before {
        display: none;
    }

    .responsive-table .actions {
        justify-content: flex-end;
        width: 100%;
    }

    .task-list-table .actions-inline {
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .responsive-table td .inline-edit-input {
        max-width: 68%;
    }

    .responsive-table .actions .btn {
        flex: 0 0 auto;
    }

    .table-wrap {
        overflow-x: visible;
    }

    .log-scroll-panel {
        max-height: min(294px, 38vh);
    }

    .task-log-panel {
        max-height: min(382px, 49vh);
    }

    .log-scroll-panel .log-table thead th {
        position: static;
        box-shadow: none;
    }

    table.responsive-table {
        border: none;
        background: transparent;
        border-radius: 0;
    }
}

@media (min-width: 901px) {
    header.page-header h1 {
        flex: 1 1 auto;
    }

    header.page-header .actions {
        width: auto;
    }

    .header-actions .btn {
        flex: 0 0 auto;
    }
}

@media (min-width: 1200px) {
    .container {
        padding: 24px 0;
    }
}

.form-page .card,
.form-page .error {
    max-width: 720px;
}

.link-btn {
    background: none;
    border: none;
    padding: 0;
    color: #2563eb;
    font: inherit;
    text-align: left;
    cursor: pointer;
    text-decoration: underline;
    word-break: break-word;
}

.link-btn:hover {
    color: #1d4ed8;
}

.inline-edit {
    display: inline-block;
    cursor: pointer;
    border-bottom: 1px dashed #94a3b8;
    padding: 2px 0;
    word-break: break-word;
    min-width: 2em;
}

.inline-edit:hover {
    color: #2563eb;
    border-bottom-color: #2563eb;
}

.inline-edit.is-empty {
    color: #94a3b8;
    font-style: italic;
}

.inline-edit-saved {
    background: #dcfce7;
    border-radius: 4px;
    transition: background 0.6s ease;
}

.inline-edit-input {
    display: inline-block;
    width: auto;
    max-width: 100%;
    padding: 1px 6px;
    border: 1px solid #2563eb;
    border-radius: 4px;
    font: inherit;
    font-size: inherit;
    line-height: 1.4;
    vertical-align: baseline;
    box-sizing: border-box;
}

input.inline-edit-input {
    max-width: min(100%, 32em);
}

textarea.inline-edit-input {
    width: min(100%, 240px);
    min-height: 2.4em;
    max-height: 96px;
    resize: vertical;
}

/* 分類: チップ風のインライン編集 */
.cat-chip.inline-edit {
    padding: 2px 8px;
    border: 1px dashed transparent;
    border-radius: 6px;
    background: #eef2f7;
    color: #334155;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}

.cat-chip.inline-edit:hover {
    color: #2563eb;
    border-color: #2563eb;
}

.cat-chip.inline-edit.is-empty {
    background: #f1f5f9;
    color: #94a3b8;
    font-style: normal;
}

.task-list-table .col-title,
.task-list-table .col-remarks {
    min-width: 120px;
}

.swal-meta {
    margin: 0 0 12px;
    font-size: 0.85rem;
    color: #64748b;
    text-align: left;
}

.swal-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.swal-tab {
    padding: 6px 14px;
    border: 1px solid #c5cdd6;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-size: 0.85rem;
}

.swal-tab.active {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

.response-iframe {
    width: 100%;
    height: min(60vh, 520px);
    border: 1px solid #dde3ea;
    border-radius: 8px;
    background: #fff;
}

.response-pre {
    width: 100%;
    max-height: min(60vh, 520px);
    overflow: auto;
    margin: 0;
    padding: 12px;
    border: 1px solid #dde3ea;
    border-radius: 8px;
    background: #f8fafc;
    font-size: 0.75rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-all;
    text-align: left;
}

/* ===== 起動リスト 高密度レイアウト ===== */

/* 極小ボタン（操作列が1行に収まる） */
.btn-xs {
    min-height: 26px;
    padding: 2px 9px;
    font-size: 0.72rem;
    border-radius: 6px;
}

/* 分類チップ */
.chip {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    background: #eef2f7;
    color: #334155;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}

/* 運行ランプ */
.health {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.health-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex: 0 0 auto;
}

.health-ok      { color: #166534; }
.health-fail    { color: #991b1b; }
.health-overdue { color: #92400e; }
.health-off     { color: #475569; }
.health-idle    { color: #64748b; }

.health-ok      .health-dot { background: #16a34a; }
.health-fail    .health-dot { background: #dc2626; }
.health-overdue .health-dot { background: #f59e0b; }
.health-off     .health-dot { background: #94a3b8; }
.health-idle    .health-dot { background: #cbd5e1; }

.health-sub {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 7px;
    border-radius: 999px;
    background: #fee2e2;
    color: #991b1b;
    font-size: 0.68rem;
    font-weight: 700;
    white-space: nowrap;
}

/* 直近10回スパークライン（失敗=赤で目立たせる） */
.spark {
    display: inline-flex;
    gap: 3px;
    align-items: center;
}

.spark-dot {
    width: 7px;
    height: 7px;
    border-radius: 2px;
    flex: 0 0 auto;
}

.spark-dot.is-ok { background: #86efac; }
.spark-dot.is-ng { background: #dc2626; }

/* 最終実行の HTTP バッジ */
.last-run-time { white-space: nowrap; }

.http-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 0 6px;
    border-radius: 5px;
    font-size: 0.68rem;
    font-weight: 700;
}

.http-badge.is-ok { background: #dcfce7; color: #166534; }
.http-badge.is-ng { background: #fee2e2; color: #991b1b; }

.muted { color: #94a3b8; }

/* 「⋯」ボタンとプルダウン */
.btn-more {
    font-weight: 700;
    letter-spacing: 1px;
    padding: 2px 9px;
    line-height: 1;
}

.action-menu {
    position: fixed;
    z-index: 1000;
    min-width: 128px;
    padding: 4px;
    background: #fff;
    border: 1px solid #c5cdd6;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
}

.action-menu-item {
    display: block;
    width: 100%;
    padding: 9px 12px;
    border: none;
    border-radius: 6px;
    background: none;
    color: #1a1a1a;
    font: inherit;
    font-size: 0.85rem;
    text-align: left;
    cursor: pointer;
}

.action-menu-item:hover {
    background: #f0f3f6;
}

.action-menu-item.is-danger {
    color: #dc2626;
}

.action-menu-item.is-danger:hover {
    background: #fee2e2;
}

/* 異常・遅延の行を目立たせる */
.task-row.state-fail td,
.task-row.state-overdue td { background: #fff7f7; }

.task-row.state-fail td:first-child { border-left: 3px solid #dc2626; }
.task-row.state-overdue td:first-child { border-left: 3px solid #f59e0b; }

/* 無効（停止）の行は薄いグレーで沈める（定期バッチ／サイト監視 共通） */
.task-row.state-off td { background: #f1f5f9; }
.task-row.state-off td:first-child { border-left: 3px solid #cbd5e1; }
.task-row.state-off .inline-edit,
.task-row.state-off .col-url a,
.task-row.state-off .last-run-time,
.task-row.state-off .got-title { color: #94a3b8; }
.task-row.state-off .cat-chip { opacity: 0.6; }

/* ⋯メニュー: 「有効化」状態は緑で目立たせる */
.action-menu-item.is-enable { color: #16a34a; }

/* デスクトップ: 1行=1行高に圧縮（タイトル/URL/備考は省略表示） */
@media (min-width: 901px) {
    .task-list-table td {
        vertical-align: middle;
        padding: 6px 10px;
    }

    .task-list-table .col-health,
    .task-list-table .col-spark,
    .task-list-table .col-frequency,
    .task-list-table .col-last-run,
    .task-list-table .col-id,
    .task-list-table .col-category {
        white-space: nowrap;
    }

    .task-list-table .col-title {
        min-width: 22em;
    }

    .task-list-table .col-title .inline-edit {
        display: inline-block;
        max-width: 40ch;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        vertical-align: middle;
        border-bottom: 1px dashed #94a3b8;
    }

    .task-list-table .col-url a {
        display: inline-block;
        max-width: 24ch;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        vertical-align: middle;
    }

    .task-list-table .col-remarks .inline-edit {
        display: inline-block;
        max-width: 16ch;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        vertical-align: middle;
    }

    .task-list-table .col-actions {
        min-width: 0;
    }

    .task-list-table .actions-inline {
        flex-wrap: nowrap;
        gap: 5px;
    }
}

/* ===== ドラッグ&ドロップ並び替え ===== */

/* ⋯メニュー項目のアイコン位置 */
.action-menu-item i {
    width: 1em;
    margin-right: 6px;
    text-align: center;
}

/* ドラッグハンドル */
.drag-handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    cursor: grab;
    padding: 2px 4px;
    touch-action: none;
}

.drag-handle:hover {
    color: #475569;
}

.drag-handle:active {
    cursor: grabbing;
}

/* ドラッグ中の見た目 */
.row-ghost td {
    background: #eff6ff !important;
}

.row-chosen {
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.18);
}

@media (min-width: 901px) {
    .task-list-table .col-drag {
        width: 28px;
        white-space: nowrap;
        text-align: center;
    }
}

/* ===== 死活監視ページ ===== */
@media (min-width: 901px) {
    .monitor-table .col-title {
        min-width: 10em;
    }
    .monitor-table .col-title .inline-edit,
    .monitor-table .got-title {
        display: inline-block;
        max-width: 22ch;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        vertical-align: middle;
    }
    /* 案件名は余白を活かして広く取り、極端に長い時だけ省略 */
    .monitor-table .col-name {
        width: 26%;
        min-width: 16em;
    }
    .monitor-table .col-name .inline-edit {
        display: inline-block;
        max-width: 100%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        vertical-align: middle;
    }
    /* チェックURL: 折り返さず1行省略にして、編集ペンを同じ行に保つ */
    .monitor-table .col-url {
        white-space: nowrap;
        word-break: normal;
    }
    .monitor-table .col-url a {
        display: inline-block;
        max-width: 28ch;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        vertical-align: middle;
    }
    .monitor-table .col-url .url-edit {
        vertical-align: middle;
    }
}

/* URL セルの編集ペン */
.url-edit {
    margin-left: 6px;
    color: #94a3b8;
    cursor: pointer;
    border-bottom: none;
    font-size: 0.85em;
}
.url-edit:hover { color: #2563eb; }

.got-title { color: #475569; }

/* 「結果」モーダル（取得title 等） */
.mon-result { text-align: left; }
.mon-result-label {
    margin: 12px 0 4px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #334155;
}
.mon-result-label:first-child { margin-top: 0; }
.mon-result-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 0.9rem;
    color: #1a1a1a;
    word-break: break-word;
}

/* 監視サイト追加フォーム */
.monitor-add-form .monitor-add-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}
.monitor-add-form label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #334155;
}
.monitor-add-form input {
    padding: 8px 10px;
    border: 1px solid #c5cdd6;
    border-radius: 8px;
    font: inherit;
    font-weight: 400;
}

/* ===== ポータル: グローバルナビ / ログイン / ダッシュボード ===== */
/* ===== グローバルナビ（全ページ共通トップバー） ===== */
.global-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #0f172a;
    color: #e2e8f0;
    padding: 10px 18px;
    flex-wrap: wrap;
}
.global-brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    margin-right: 12px;
}
.global-brand i { color: #fbbf24; }
.global-brand span { color: #cbd5e1; font-weight: 600; }
.global-links {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    flex: 1 1 auto;
}
.global-links a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #cbd5e1;
    text-decoration: none;
    padding: 7px 12px;
    border-radius: 7px;
    font-size: 0.88rem;
    white-space: nowrap;
}
.global-links a:hover { background: #1e293b; color: #fff; }
.global-links a.is-active { background: #2563eb; color: #fff; }
.global-logout {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #cbd5e1;
    text-decoration: none;
    padding: 7px 12px;
    border-radius: 7px;
    font-size: 0.85rem;
    white-space: nowrap;
}
.global-logout:hover { background: #1e293b; color: #fff; }

@media (max-width: 600px) {
    .global-nav { padding: 8px 12px; }
    .global-brand { font-size: 0.92rem; width: 100%; margin-right: 0; }
    .global-links a, .global-logout { padding: 6px 9px; font-size: 0.82rem; }
}

/* ===== ログイン画面（ポータル共用） ===== */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}
.login-wrap {
    width: 90%;
    max-width: 380px;
    text-align: center;
}
.login-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 20px;
}
.login-brand i { color: #fbbf24; }
.login-brand strong { color: #93c5fd; }
.login-card { text-align: left; margin-bottom: 12px; }
.login-card label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 14px;
}
.login-card input {
    padding: 10px 12px;
    border: 1px solid #c5cdd6;
    border-radius: 8px;
    font: inherit;
    font-weight: 400;
}
.login-foot { color: #94a3b8; font-size: 0.8rem; margin: 0; }

/* ===== ダッシュボード（アプリ一覧カード） ===== */
.dash-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}
.dash-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #fff;
    border: 1px solid #dde3ea;
    border-radius: 12px;
    padding: 20px;
    text-decoration: none;
    color: #1a1a1a;
    transition: box-shadow .15s, transform .15s, border-color .15s;
}
.dash-card:hover {
    box-shadow: 0 6px 20px rgba(15, 23, 42, .1);
    transform: translateY(-2px);
    border-color: #c5cdd6;
}
.dash-icon {
    flex: 0 0 auto;
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #fff;
}
.dash-icon-blue { background: #2563eb; }
.dash-icon-rose { background: #e11d48; }
.dash-body { flex: 1 1 auto; }
.dash-body h2 { margin: 0; font-size: 1.05rem; }
.dash-body p { margin: 0; font-size: 0.85rem; color: #64748b; }
.dash-arrow { color: #cbd5e1; font-size: 0.9rem; }

/* ダッシュボードの表示時刻 */
.dash-shown {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #eef2f7;
    border: 1px solid #dde3ea;
    border-radius: 999px;
    padding: 7px 14px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #334155;
    white-space: nowrap;
}
.dash-shown i { color: #2563eb; }
.dash-card-top { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.dash-stats strong { color: #1a1a1a; }
.dash-stat-bad { color: #dc2626; font-weight: 700; }

/* 状態ピル */
.dash-pill {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: 999px;
    white-space: nowrap;
}
.dash-pill-ok { background: #dcfce7; color: #15803d; }
.dash-pill-warn { background: #fef9c3; color: #a16207; }
.dash-pill-error { background: #fee2e2; color: #b91c1c; }
.dash-pill-unknown { background: #e2e8f0; color: #475569; }

/* エラーアラート（見逃し防止・最上部に目立たせる） */
.dash-alert {
    background: #fef2f2;
    border: 2px solid #dc2626;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 16px;
}
.dash-alert-head {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #b91c1c;
    font-size: 1.05rem;
}
.dash-alert-head i { font-size: 1.2rem; }
.dash-alert-list {
    margin: 10px 0 0;
    padding-left: 26px;
}
.dash-alert-list li { margin: 4px 0; }
.dash-alert-list a { color: #991b1b; text-decoration: none; }
.dash-alert-list a:hover { text-decoration: underline; }

.dash-ok-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f0fdf4;
    border: 1px solid #86efac;
    color: #15803d;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-weight: 600;
}
