/**
 * 防災管理アプリケーション - カスタムCSS
 * 
 * ダークモード基調のプレミアムUI。
 * 訓練モード/本番モードで背景色を大きく変化させ誤認を防止。
 */

/* ── CSS変数（デザイントークン） ── */
:root {
    /* カラーパレット */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-card: #1e293b;
    --bg-card-hover: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: #334155;
    --accent-blue: #3b82f6;
    --accent-emerald: #10b981;
    --accent-amber: #f59e0b;
    --accent-red: #ef4444;
    --accent-purple: #8b5cf6;
    --gradient-primary: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    --gradient-warning: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    --gradient-danger: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.4);
    --shadow-glow-blue: 0 0 20px rgba(59, 130, 246, 0.3);
    --shadow-glow-emerald: 0 0 20px rgba(16, 185, 129, 0.3);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── 基本スタイル ── */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── 訓練モード背景 ── */
body.mode-drill {
    --bg-primary: #1c1209;
    --bg-secondary: #2a1d0e;
    --bg-card: #2a1d0e;
    --bg-card-hover: #3d2b14;
    --border-color: #4a3520;
    background: linear-gradient(180deg, #1c1209 0%, #0f0a04 100%);
}

body.mode-drill::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 40px,
        rgba(217, 119, 6, 0.02) 40px,
        rgba(217, 119, 6, 0.02) 80px
    );
    pointer-events: none;
    z-index: 0;
}

/* ── 本番モード背景 ── */
body.mode-production {
    background: linear-gradient(180deg, #0f172a 0%, #020617 100%);
}

/* ── モードバナー ── */
.mode-banner {
    position: sticky;
    top: 0;
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 10px 20px;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.mode-banner-drill {
    background: linear-gradient(90deg, #d97706, #f59e0b, #d97706);
    color: #1c1209;
    animation: bannerPulse 3s ease-in-out infinite;
}

.mode-banner-production {
    background: linear-gradient(90deg, #dc2626, #ef4444, #dc2626);
    color: #fff;
    animation: bannerPulse 2s ease-in-out infinite;
}

@keyframes bannerPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.85; }
}

/* ── メインコンテンツ ── */
#app-content {
    position: relative;
    z-index: 1;
    min-height: calc(100vh - 44px);
}

/* ── カードコンポーネント ── */
.glass-card {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(148, 163, 184, 0.1);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
}

.glass-card:hover {
    border-color: rgba(148, 163, 184, 0.2);
    box-shadow: var(--shadow-lg), 0 0 30px rgba(59, 130, 246, 0.05);
}

.mode-drill .glass-card {
    background: rgba(42, 29, 14, 0.85);
    border-color: rgba(217, 119, 6, 0.15);
}

/* ── ログイン画面 ── */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 44px);
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 440px;
}

.login-logo {
    width: 80px;
    height: 80px;
    background: var(--gradient-primary);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 2.2rem;
    color: #fff;
    box-shadow: var(--shadow-glow-blue);
}

.mode-drill .login-logo {
    background: var(--gradient-warning);
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.3);
}

.login-title {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 8px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.mode-drill .login-title {
    background: var(--gradient-warning);
    -webkit-background-clip: text;
    background-clip: text;
}

.login-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 32px;
}

/* ── フォーム要素 ── */
.form-control-dark {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 14px 16px;
    font-size: 1.1rem;
    transition: var(--transition);
}

.form-control-dark:focus {
    background: rgba(15, 23, 42, 0.8);
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    color: var(--text-primary);
}

.mode-drill .form-control-dark:focus {
    border-color: var(--accent-amber);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.form-control-dark::placeholder {
    color: var(--text-muted);
}

.form-label-light {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.85rem;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ── ボタン ── */
.btn-primary-gradient {
    background: var(--gradient-primary);
    border: none;
    color: #fff;
    font-weight: 600;
    padding: 14px 28px;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.btn-primary-gradient:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow-blue);
    color: #fff;
}

.btn-primary-gradient:active {
    transform: translateY(0);
}

.mode-drill .btn-primary-gradient {
    background: var(--gradient-warning);
}

/* リップルエフェクト */
.ripple-effect {
    position: relative;
    overflow: hidden;
}

.ripple-effect .ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: scale(0);
    animation: rippleAnim 0.6s ease-out;
    pointer-events: none;
}

@keyframes rippleAnim {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* ── ステップ1：巨大ステータスボタン ── */
.step1-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 44px);
    padding: 24px;
    gap: 0;
}

.step1-header {
    text-align: center;
    margin-bottom: 20px;
}

.step1-header h1 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 4px;
}

.step1-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.step1-buttons {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    max-width: 500px;
}

.status-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 32px 24px;
    border: 2px solid transparent;
    border-radius: var(--radius-xl);
    font-size: 1.6rem;
    font-weight: 800;
    color: #fff;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    min-height: 100px;
}

.status-button:hover {
    transform: scale(1.03);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.status-button:active {
    transform: scale(0.98);
}

.status-button .status-icon {
    font-size: 2.5rem;
}

.status-button.sending {
    opacity: 0.7;
    pointer-events: none;
}

/* ── ステップ2：詳細入力 ── */
.step2-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 24px;
}

.step2-header {
    text-align: center;
    margin-bottom: 24px;
}

.step2-header h1 {
    font-size: 1.3rem;
    font-weight: 700;
}

.detail-item-card {
    margin-bottom: 16px;
    padding: 20px;
}

.detail-item-label {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 12px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.detail-item-label i {
    color: var(--accent-blue);
}

/* トグルスイッチ */
.toggle-switch {
    display: flex;
    background: rgba(15, 23, 42, 0.5);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.toggle-option {
    flex: 1;
    padding: 14px 16px;
    text-align: center;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: var(--transition);
    border: none;
    background: transparent;
    color: var(--text-secondary);
}

.toggle-option.active {
    color: #fff;
}

.toggle-option.active.toggle-normal {
    background: var(--accent-emerald);
}

.toggle-option.active.toggle-abnormal {
    background: var(--accent-red);
}

/* ラジオボタンカード */
.radio-card-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.radio-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: rgba(15, 23, 42, 0.5);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

.radio-card:hover {
    border-color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.08);
}

.radio-card.selected {
    border-color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.15);
}

.radio-card .radio-dot {
    width: 22px;
    height: 22px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: var(--transition);
}

.radio-card.selected .radio-dot {
    border-color: var(--accent-blue);
}

.radio-card.selected .radio-dot::after {
    content: '';
    width: 12px;
    height: 12px;
    background: var(--accent-blue);
    border-radius: 50%;
}

/* テキストエリア（条件付き表示） */
.conditional-textarea {
    display: none;
    margin-top: 12px;
    animation: slideDown 0.3s ease;
}

.conditional-textarea.visible {
    display: block;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.memo-textarea {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 14px;
    width: 100%;
    min-height: 100px;
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
    transition: var(--transition);
}

.memo-textarea:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    outline: none;
}

/* ── 報告完了画面 ── */
.done-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 44px);
    padding: 24px;
    text-align: center;
}

.done-icon {
    width: 120px;
    height: 120px;
    background: var(--gradient-success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    color: #fff;
    margin-bottom: 24px;
    box-shadow: var(--shadow-glow-emerald);
    animation: bounceIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes bounceIn {
    0% { transform: scale(0); }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.done-title {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 12px;
}

.done-message {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 32px;
}

/* ── ダッシュボード ── */
.dashboard-container {
    height: calc(100vh - 44px);
    display: flex;
    flex-direction: column;
}

.dashboard-header {
    padding: 16px 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.dashboard-header h1 {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

/* 統計カード */
.stats-bar {
    display: flex;
    gap: 12px;
    padding: 12px 20px;
    overflow-x: auto;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.stat-card {
    flex: 1;
    min-width: 120px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    text-align: center;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border-color);
}

.stat-card .stat-number {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1;
}

.stat-card .stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-card.stat-total .stat-number { color: var(--accent-blue); }
.stat-card.stat-reported .stat-number { color: var(--accent-emerald); }
.stat-card.stat-unreported .stat-number { color: var(--text-muted); }
.stat-card.stat-support .stat-number { color: var(--accent-red); }

/* フィルターバー */
.filter-bar {
    display: flex;
    gap: 8px;
    padding: 12px 20px;
    overflow-x: auto;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
    flex-wrap: wrap;
}

.filter-pill {
    padding: 6px 16px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.filter-pill:hover {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.filter-pill.active {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: #fff;
}

.filter-pill.filter-status {
    position: relative;
    padding-left: 28px;
}

.filter-pill.filter-status::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--pill-color, #6b7280);
}

/* ダッシュボードメインコンテンツ */
.dashboard-main {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.dashboard-list-pane {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    min-width: 0;
}

.dashboard-map-pane {
    flex: 1;
    min-width: 0;
    position: relative;
}

#dashboard-map {
    width: 100%;
    height: 100%;
}

/* ダッシュボードのDataTablesスタイル調整 */
.dashboard-list-pane .dataTables_wrapper {
    color: var(--text-primary);
}

.dashboard-list-pane table.dataTable {
    border-collapse: collapse !important;
}

.dashboard-list-pane table.dataTable thead th {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-color) !important;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 10px 12px;
    white-space: nowrap;
}

.dashboard-list-pane table.dataTable tbody td {
    background: transparent;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color) !important;
    padding: 10px 12px;
    font-size: 0.88rem;
    vertical-align: middle;
}

.dashboard-list-pane table.dataTable tbody tr {
    cursor: pointer;
    transition: var(--transition);
}

.dashboard-list-pane table.dataTable tbody tr:hover {
    background: var(--bg-card-hover) !important;
}

.dashboard-list-pane table.dataTable tbody tr.selected-row {
    background: rgba(59, 130, 246, 0.15) !important;
    outline: 2px solid var(--accent-blue);
    outline-offset: -2px;
}

/* ステータスバッジ */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
}

.status-badge::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.5;
}

.status-badge-unreported {
    background: rgba(107, 114, 128, 0.3);
    color: #9ca3af;
}

/* 詳細ポップアップ */
.detail-popup {
    max-width: 350px;
}

.detail-popup h6 {
    font-weight: 700;
    margin-bottom: 8px;
}

.detail-popup .detail-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 0.85rem;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

/* モバイルタブ切替 */
.mobile-tabs {
    display: none;
}

.mobile-tab-btn {
    flex: 1;
    padding: 12px;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
    border: none;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 3px solid transparent;
}

.mobile-tab-btn.active {
    color: var(--accent-blue);
    border-bottom-color: var(--accent-blue);
}

/* ── 設定画面 ── */
.settings-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 24px;
}

.settings-container h1 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.settings-section {
    margin-bottom: 32px;
}

.settings-section h2 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    transition: var(--transition);
}

.settings-item:hover {
    border-color: var(--accent-blue);
}

.settings-item .item-color {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    flex-shrink: 0;
}

.settings-item .item-label {
    flex: 1;
    font-weight: 500;
}

.settings-item .item-score {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.settings-item .item-actions {
    display: flex;
    gap: 4px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    background: transparent;
    color: var(--text-secondary);
}

.btn-icon:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.btn-icon.btn-icon-danger:hover {
    background: rgba(239, 68, 68, 0.2);
    color: var(--accent-red);
}

/* モーダル（ダークテーマ） */
.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
}

.modal-header {
    border-bottom-color: var(--border-color);
}

.modal-footer {
    border-top-color: var(--border-color);
}

.modal-title {
    font-weight: 700;
}

.btn-close {
    filter: invert(1);
}

/* CSVインポート */
.csv-drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: rgba(15, 23, 42, 0.3);
}

.csv-drop-zone:hover,
.csv-drop-zone.dragover {
    border-color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.08);
}

.csv-drop-zone i {
    font-size: 3rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.csv-mapping-table {
    width: 100%;
}

.csv-mapping-table th,
.csv-mapping-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
}

.csv-mapping-table select {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    width: 100%;
}

/* ── サジェストドロップダウン ── */
.suggest-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    max-height: 250px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}

.suggest-dropdown.visible {
    display: block;
    animation: slideDown 0.2s ease;
}

.suggest-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 1px solid rgba(51, 65, 85, 0.5);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.suggest-item:hover {
    background: var(--bg-card-hover);
}

.suggest-item .suggest-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.suggest-item .suggest-info {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ── DataTables検索ボックス・ページネーション ── */
.dataTables_filter input {
    background: rgba(15, 23, 42, 0.6) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    border-radius: var(--radius-sm) !important;
    padding: 6px 12px !important;
}

.dataTables_filter label {
    color: var(--text-secondary) !important;
}

.dataTables_length select {
    background: rgba(15, 23, 42, 0.6) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    border-radius: var(--radius-sm) !important;
}

.dataTables_length label {
    color: var(--text-secondary) !important;
}

.dataTables_info {
    color: var(--text-muted) !important;
    font-size: 0.8rem !important;
}

.dataTables_paginate .paginate_button {
    color: var(--text-secondary) !important;
    background: transparent !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-sm) !important;
    margin: 0 2px !important;
}

.dataTables_paginate .paginate_button.current {
    background: var(--accent-blue) !important;
    border-color: var(--accent-blue) !important;
    color: #fff !important;
}

.dataTables_paginate .paginate_button:hover {
    background: var(--bg-card-hover) !important;
    color: var(--text-primary) !important;
}

/* ── 確認ダイアログ（モード切替用） ── */
.confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.confirm-dialog {
    background: var(--bg-secondary);
    border: 2px solid var(--accent-red);
    border-radius: var(--radius-lg);
    padding: 32px;
    max-width: 440px;
    width: 90%;
    text-align: center;
    animation: scaleIn 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes scaleIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* ── スクロールバー ── */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ── ローディングスピナー ── */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ── レスポンシブ対応 ── */
@media (max-width: 768px) {
    /* モバイルではタブ切替UI */
    .mobile-tabs {
        display: flex;
        background: var(--bg-secondary);
        border-bottom: 1px solid var(--border-color);
    }
    
    .dashboard-main {
        flex-direction: column;
    }
    
    .dashboard-list-pane,
    .dashboard-map-pane {
        display: none;
    }
    
    .dashboard-list-pane.active,
    .dashboard-map-pane.active {
        display: block;
        flex: 1;
    }
    
    .dashboard-map-pane.active {
        min-height: 50vh;
    }
    
    .stats-bar {
        gap: 8px;
        padding: 8px 12px;
    }
    
    .stat-card {
        min-width: 80px;
        padding: 8px 10px;
    }
    
    .stat-card .stat-number {
        font-size: 1.4rem;
    }
    
    .filter-bar {
        padding: 8px 12px;
    }
    
    .status-button {
        padding: 24px 20px;
        font-size: 1.3rem;
        min-height: 80px;
    }
    
    .status-button .status-icon {
        font-size: 2rem;
    }
    
    .settings-container {
        padding: 16px;
    }
}

@media (min-width: 769px) {
    /* PC・タブレット横画面では左右分割 */
    .dashboard-list-pane,
    .dashboard-map-pane {
        display: block !important;
    }
    
    .dashboard-main {
        flex-direction: row;
    }
    
    .dashboard-list-pane {
        flex: 0 0 55%;
        max-width: 55%;
        border-right: 1px solid var(--border-color);
    }
    
    .dashboard-map-pane {
        flex: 0 0 45%;
        max-width: 45%;
    }
}

/* ── Leafletマップのカスタムスタイル ── */
.leaflet-popup-content-wrapper {
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border-radius: var(--radius-md) !important;
    box-shadow: var(--shadow-lg) !important;
}

.leaflet-popup-tip {
    background: var(--bg-secondary) !important;
}

.leaflet-popup-content {
    margin: 12px 16px !important;
}

/* ── ユーティリティ ── */
.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 16px; }
.gap-4 { gap: 24px; }

.hidden { display: none !important; }

/* ── 管理者ログインへの導線 ── */
.admin-link {
    position: fixed;
    bottom: 16px;
    right: 16px;
    width: 48px;
    height: 48px;
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition);
    z-index: 100;
}

.admin-link:hover {
    color: var(--accent-blue);
    border-color: var(--accent-blue);
    transform: scale(1.1);
}

/* ── Leaflet カスタムマーカー ── */
.custom-marker {
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s ease;
}

.custom-marker:hover {
    transform: scale(1.3);
}

.custom-marker.highlighted {
    animation: markerPulse 1s ease-in-out infinite;
    z-index: 1000 !important;
}

@keyframes markerPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7); }
    50% { transform: scale(1.2); box-shadow: 0 0 0 15px rgba(59, 130, 246, 0); }
}
