/* カスタムスタイル */
body {
    background-color: #f8f9fa;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* PDF用スタイル */
.pdf-container {
    width: 750px !important;
    min-height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    padding: 15px !important;
    font-size: 10pt !important;
    color: #000000 !important;
    background: white !important;
    font-family: 'Arial', 'Hiragino Sans', 'Yu Gothic', sans-serif !important;
    line-height: 1.2 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    margin: 0 auto !important;
    display: block !important;
}

/* PDF用ページ */
.pdf-page {
    width: 100% !important;
    max-width: 720px !important;
    margin: 0 auto !important;
    padding: 0 !important;
    background: white !important;
}

/* PDF用ヘッダー */
.pdf-header {
    text-align: center !important;
    margin-bottom: 15px !important;
    padding-bottom: 10px !important;
    border-bottom: 2px solid #333333 !important;
    width: 100% !important;
}

.pdf-title {
    font-size: 18pt !important;
    font-weight: bold !important;
    color: #000000 !important;
    margin-bottom: 6px !important;
}

.pdf-date {
    font-size: 12pt !important;
    font-weight: bold !important;
    color: #000000 !important;
}

/* PDF用セクション */
.pdf-section {
    margin-bottom: 15px !important;
    width: 100% !important;
}

.pdf-section-title {
    font-size: 12pt !important;
    font-weight: bold !important;
    color: #000000 !important;
    margin-bottom: 10px !important;
    padding: 8px 12px !important;
    background: #f8f9fa !important;
    border-left: 4px solid #333333 !important;
    border-radius: 4px !important;
}

/* PDF用総件数統計（月報と同じスタイル） */
.pdf-total-stats-container {
    margin-bottom: 15px !important;
}

.pdf-total-stats-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 12px !important;
}

.pdf-total-stat-item {
    background: white !important;
    border: 2px solid #333333 !important;
    border-radius: 8px !important;
    padding: 12px !important;
    text-align: center !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

.pdf-total-stat-number {
    font-size: 14pt !important;
    font-weight: bold !important;
    color: #000000 !important;
    margin-bottom: 6px !important;
}

.pdf-total-stat-label {
    font-size: 10pt !important;
    font-weight: bold !important;
    color: #000000 !important;
}

/* PDF用地区統計 */
.pdf-region-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
    margin-bottom: 15px !important;
}

.pdf-region-card {
    background: white !important;
    border: 2px solid #333333 !important;
    border-radius: 8px !important;
    padding: 12px !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
    min-height: 160px !important;
}

.pdf-region-name {
    font-size: 10pt !important;
    font-weight: bold !important;
    color: #000000 !important;
    text-align: center !important;
    margin-bottom: 8px !important;
    padding: 6px !important;
    background: #e9ecef !important;
    border-radius: 4px !important;
    border-bottom: 2px solid #333333 !important;
}

.pdf-region-stats {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
}

.pdf-region-stat-item {
    text-align: center !important;
    padding: 4px !important;
}

.pdf-region-stat-label {
    font-size: 8pt !important;
    font-weight: bold !important;
    color: #000000 !important;
    margin-bottom: 2px !important;
}

.pdf-region-stat-value {
    font-size: 10pt !important;
    font-weight: bold !important;
    color: #000000 !important;
}

/* PDF用年齢統計 */
.pdf-age-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
    margin-bottom: 15px !important;
}

.pdf-age-card {
    background: white !important;
    border: 2px solid #333333 !important;
    border-radius: 8px !important;
    padding: 12px !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

.pdf-age-title {
    font-size: 10pt !important;
    font-weight: bold !important;
    color: #000000 !important;
    text-align: center !important;
    margin-bottom: 8px !important;
    padding: 6px !important;
    background: #e9ecef !important;
    border-radius: 4px !important;
    border-bottom: 2px solid #333333 !important;
}

.pdf-age-stats {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
}

.pdf-age-stat-item {
    text-align: center !important;
    padding: 4px !important;
}

.pdf-age-stat-label {
    font-size: 8pt !important;
    font-weight: bold !important;
    color: #000000 !important;
    margin-bottom: 2px !important;
}

.pdf-age-stat-value {
    font-size: 10pt !important;
    font-weight: bold !important;
    color: #000000 !important;
}

/* PDF用ランキング */
.pdf-ranking-section {
    margin-bottom: 20px !important;
    page-break-inside: avoid !important;
}

.pdf-ranking-title {
    font-size: 12pt !important;
    font-weight: bold !important;
    color: #000000 !important;
    margin-bottom: 12px !important;
    padding: 8px 12px !important;
    background: #e9ecef !important;
    border-left: 4px solid #333333 !important;
    border-bottom: 1px solid #333333 !important;
}

/* PDF用ランキングテーブル */
.pdf-ranking-table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin-bottom: 15px !important;
}

.pdf-ranking-header,
.pdf-ranking-row {
    display: grid !important;
    grid-template-columns: 60px 60px 60px 160px 60px !important;
    gap: 2px !important;
    width: 100% !important;
}

.pdf-ranking-header {
    background: #f8f9fa !important;
    border-bottom: 2px solid #333333 !important;
    font-weight: bold !important;
}

.pdf-ranking-row {
    border-bottom: 1px solid #333333 !important;
}

.pdf-ranking-row:nth-child(even) {
    background: #f8f9fa !important;
}

.pdf-ranking-cell {
    padding: 4px 2px !important;
    text-align: center !important;
    font-size: 8pt !important;
    font-weight: bold !important;
    color: #000000 !important;
    border-right: 1px solid #333333 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1.1 !important;
}

.pdf-ranking-cell:last-child {
    border-right: none !important;
}

.pdf-ranking-header .pdf-ranking-cell {
    background-color: #e9ecef !important;
    font-weight: bold !important;
}

/* PDF用ページ区切り */
.pdf-page-break {
    page-break-before: always !important;
    margin-top: 20px !important;
    width: 100% !important;
}

/* PDF用ページヘッダー */
.pdf-page-header {
    text-align: center !important;
    margin-bottom: 20px !important;
    padding-bottom: 15px !important;
    border-bottom: 2px solid #333333 !important;
    width: 100% !important;
}

.pdf-page-title {
    font-size: 16pt !important;
    font-weight: bold !important;
    color: #000000 !important;
    margin-bottom: 8px !important;
}

.pdf-page-subtitle {
    font-size: 12pt !important;
    font-weight: bold !important;
    color: #000000 !important;
}

/* PDF用フォント設定 */
.pdf-container * {
    font-family: 'Arial', 'Hiragino Sans', 'Yu Gothic', sans-serif !important;
    color: #000000 !important;
}

/* PDF用ボーダー設定 */
.pdf-container table,
.pdf-container th,
.pdf-container td {
    border: 1px solid #333333 !important;
    border-collapse: collapse !important;
}

/* PDF用背景色設定 */
.pdf-container .bg-primary,
.pdf-container .bg-success,
.pdf-container .bg-warning,
.pdf-container .bg-danger {
    background-color: #f0f0f0 !important;
    color: #000000 !important;
}

/* PDF用アイコン設定 */
.pdf-container .fas,
.pdf-container .fa {
    color: #000000 !important;
}

/* 印刷時のスタイル調整 */
@media print {
    .pdf-container {
        width: 100% !important;
        margin: 0 !important;
        padding: 10mm !important;
    }
    
    .pdf-container * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}

.drop-zone {
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    background-color: #f8f9fa;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.drop-zone.dragover {
    border-color: #0d6efd;
    background-color: #e7f3ff;
    transform: scale(1.02);
}

.drop-zone-content {
    width: 100%;
}

.drop-zone i {
    color: #6c757d;
    margin-bottom: 1rem;
}

.card {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    border: none;
    border-radius: 0.5rem;
}

.card-header {
    border-radius: 0.5rem 0.5rem 0 0 !important;
    font-weight: 600;
}

.nav-tabs .nav-link {
    border: none;
    border-radius: 0.5rem 0.5rem 0 0;
    margin-right: 0.25rem;
    font-weight: 500;
}

.nav-tabs .nav-link.active {
    background-color: #0d6efd;
    color: white;
    border: none;
}

.nav-tabs .nav-link:hover {
    border: none;
    background-color: #e9ecef;
}

.report-section {
    background-color: white;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.report-title {
    color: #495057;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e9ecef;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

.region-card {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.region-title {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
}

.region-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.5rem;
}

.region-stat {
    background-color: white;
    padding: 0.75rem;
    border-radius: 0.25rem;
    text-align: center;
    border: 1px solid #e9ecef;
}

.region-stat-number {
    font-size: 1.25rem;
    font-weight: bold;
    color: #0d6efd;
}

.region-stat-label {
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

.btn-export {
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

.loading {
    display: none;
    text-align: center;
    padding: 2rem;
}

.loading.show {
    display: block;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
}

.data-table {
    font-size: 0.9rem;
}

.data-table th {
    background-color: #f8f9fa;
    font-weight: 600;
}

.alert {
    border-radius: 0.5rem;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .container-fluid {
        padding: 0.5rem;
    }
    
    .drop-zone {
        padding: 1rem;
        min-height: 150px;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .region-stats {
        grid-template-columns: 1fr;
    }
}

/* アニメーション */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* カスタムスクロールバー */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 公休日・禁止日設定用のカレンダースタイル */
.calendar-container {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    background: #fff;
}

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

.calendar-month {
    font-weight: bold;
    font-size: 1.1em;
    color: #495057;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e9ecef;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.2s ease;
    position: relative;
}

.calendar-day:hover {
    background-color: #f8f9fa;
    border-color: #007bff;
}

.calendar-day.weekday {
    background-color: #f8f9fa;
    color: #6c757d;
}

.calendar-day.weekend {
    background-color: #fff3cd;
    color: #856404;
}

.calendar-day.selected-public {
    background-color: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.calendar-day.selected-prohibited {
    background-color: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

.calendar-day.today {
    border: 2px solid #007bff;
    font-weight: bold;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 5px;
}

.calendar-weekday {
    text-align: center;
    font-weight: bold;
    font-size: 0.8em;
    color: #495057;
    padding: 5px;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.calendar-day.other-month {
    color: #adb5bd;
    background-color: #f8f9fa;
}

.holiday-list {
    max-height: 200px;
    overflow-y: auto;
}

.holiday-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    margin: 4px 0;
    border-radius: 4px;
    background-color: #f8f9fa;
    border-left: 4px solid;
}

.holiday-item.public {
    border-left-color: #28a745;
    background-color: #d4edda;
}

.holiday-item.prohibited {
    border-left-color: #dc3545;
    background-color: #f8d7da;
}

.holiday-date {
    font-weight: 500;
}

.holiday-remove {
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 3px;
    transition: all 0.2s ease;
}

.holiday-remove:hover {
    background-color: #dc3545;
    color: white;
}

/* 総件数セクション - コールブロック風デザイン */
.total-stats-container {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    padding: 2rem;
    color: white;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    margin-bottom: 2rem;
}

.total-stats-title {
    color: white;
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
    font-weight: 600;
    text-align: center;
}

.total-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
    align-items: center;
}

.total-stat-item {
    text-align: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.total-stat-item:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.total-stat-number {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: white;
}

.total-stat-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.2;
}

/* PDF用ランキングセクション */
.pdf-ranking-section {
    margin-bottom: 20px !important;
    width: 100% !important;
}

.pdf-ranking-title {
    font-size: 14pt !important;
    font-weight: bold !important;
    color: #000000 !important;
    text-align: center !important;
    margin-bottom: 15px !important;
    padding: 10px !important;
    background: #f8f9fa !important;
    border: 2px solid #333333 !important;
    border-radius: 6px !important;
}

.pdf-ranking-table {
    border: 1px solid #dee2e6;
    border-radius: 4px;
    overflow: hidden;
}

.pdf-ranking-header {
    display: grid;
    grid-template-columns: 55px 55px 55px 140px 55px;
    background-color: #e9ecef;
    font-weight: bold;
    font-size: 11px;
}

.pdf-ranking-row {
    display: grid;
    grid-template-columns: 55px 55px 55px 140px 55px;
    border-top: 1px solid #dee2e6;
    font-size: 11px;
}

.pdf-ranking-cell {
    padding: 5px 3px;
    text-align: center;
    font-size: 8pt;
    font-weight: bold;
    color: #000000;
    border-right: 1px solid #333333;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.1;
}

.pdf-ranking-cell:last-child {
    border-right: none;
}

.pdf-ranking-header .pdf-ranking-cell {
    background-color: #e9ecef;
    font-weight: bold;
}

/* HTML表示用ランキングセクション */
.ranking-section {
    margin-bottom: 2rem;
}

.ranking-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: linear-gradient(90deg, #f8f9fa 0%, #e9ecef 100%);
    border-left: 4px solid #007bff;
    border-radius: 0.25rem;
}

.ranking-section .table {
    margin-bottom: 0;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    border-radius: 0.375rem;
    overflow: hidden;
}

.ranking-section .table th {
    background: linear-gradient(90deg, #343a40 0%, #495057 100%);
    color: white;
    font-weight: 600;
    border: none;
    padding: 0.875rem 0.75rem;
}

.ranking-section .table td {
    padding: 0.75rem;
    vertical-align: middle;
    border-color: #e9ecef;
}

.ranking-section .table tbody tr:hover {
    background-color: #f8f9fa;
    transform: translateY(-1px);
    transition: all 0.2s ease;
}

.ranking-section .badge {
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
}