/* ── 共通レイアウト ──────────────────────────────────────── */
body {
    background-color: #f4f6f9;
    font-family: 'Liberation Sans', 'IPAexGothic', sans-serif;
}

.main-content {
    margin-top: 56px; /* navbar の高さ分 */
    min-height: calc(100vh - 56px);
}

/* ── ログイン画面 ───────────────────────────────────────── */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

.login-card {
    width: 100%;
    max-width: 420px;
    border-radius: 12px;
}

.login-icon {
    font-size: 3rem;
    color: #0d6efd;
}

/* ── ポータル: 部署セクション ──────────────────────────── */
.department-header {
    font-weight: 600;
    color: #2c3e50;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e9ecef;
}

/* ── ポータル: ツールカード ─────────────────────────────── */
.tool-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-radius: 12px;
    cursor: pointer;
}

.tool-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12) !important;
}

.tool-placeholder {
    opacity: 0.5;
    cursor: default;
}

.tool-placeholder:hover {
    transform: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
}

.tool-icon-wrapper {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

/* ── アップロードゾーン ─────────────────────────────────── */
.border-dashed {
    border-style: dashed !important;
    border-color: #adb5bd !important;
}

.upload-zone {
    background-color: #f8f9fa;
    transition: background-color 0.2s ease;
}

.upload-zone.drag-over {
    background-color: #e7f1ff;
    border-color: #0d6efd !important;
}

/* ── アップロードゾーン（強化） ─────────────────────────── */
.upload-zone {
    cursor: pointer;
    background-color: #f8f9fa;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.upload-zone:hover {
    background-color: #eef3f8;
}

.upload-zone.drag-over {
    background-color: #e7f1ff;
    border-color: #0d6efd !important;
}

/* ── プログレス ────────────────────────────────────────── */
.progress {
    border-radius: 12px;
    overflow: hidden;
}

/* ── スピナーアニメーション（処理中バッジ用） ──────────── */
@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
.spin {
    display: inline-block;
    animation: spin 1s linear infinite;
}

/* ── ステータスバッジ ───────────────────────────────────── */
.badge-pending   { background-color: #6c757d; }
.badge-processing { background-color: #0d6efd; }
.badge-completed { background-color: #198754; }
.badge-error     { background-color: #dc3545; }

/* ── 履歴テーブル ───────────────────────────────────────── */
.table th {
    font-weight: 600;
    font-size: 0.875rem;
    white-space: nowrap;
}
.table td {
    vertical-align: middle;
}

/* ── 工事日報集計: 左サイドバーナビ (SmartGreen スタイル) ──────────
   _nav.html の inline JS が container-fluid 直下を
     .cc-page-header / .cc-sidebar / .cc-main-col
   の 3 ブロックに自動ラップし、親に .cc-grid-layout を付ける。
   このグリッドで「上部 = タイトル全幅」「下部 = サイドバー + 本文」を実現。 */
:root {
    --cc-sb-width: 168px;
    /* ダッシュボードの .pf-sidebar と同じ濃紺トーンへ揃える (pf-* 変数を参照)。
       HTML/JS/クラス名は不変。値のみ変更。 */
    --cc-sb-text: #c4d6ec;
    --cc-sb-text-hover: #ffffff;
    --cc-sb-active-bg: var(--pf-navy-600);
    --cc-sb-active-text: #ffffff;
    --cc-sb-active-icon: #ffffff;
}

/* 親コンテナを CSS Grid 2 列に */
.cc-grid-layout {
    display: grid;
    grid-template-columns: var(--cc-sb-width) 1fr;
    column-gap: 1.5rem;
    align-items: start;
}

/* タイトル/説明など、サイドバーより前にあった要素群（全幅）*/
.cc-grid-layout > .cc-page-header {
    grid-column: 1 / -1;
    /* H3 と説明文の見栄えを SmartGreen 風に */
    margin-bottom: 0.5rem;
}
.cc-grid-layout > .cc-page-header h3 {
    font-weight: 700;
    margin-bottom: 0.35rem;
}

/* サイドバー本体 (静的フロー、Grid 列 1) */
.cc-grid-layout > .cc-sidebar {
    grid-column: 1;
    padding: 0.25rem 0 1rem;
}

/* メインコンテンツ (Grid 列 2) */
.cc-grid-layout > .cc-main-col {
    grid-column: 2;
    min-width: 0;                    /* テーブルがはみ出さないように */
}

/* 縦並びタブ。ダッシュボードの .pf-sidebar と同じ濃紺グラデパネルへ。 */
.cc-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    list-style: none;
    margin: 0;
    padding: 8px;
    background: linear-gradient(180deg, var(--pf-navy-700), var(--pf-navy-800));
    border-radius: 16px;
    box-shadow: 0 8px 24px -14px rgba(16, 40, 90, .5);
}

.cc-sidebar-nav .nav-item { width: 100%; }

.cc-sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.75rem;
    color: var(--cc-sb-text);
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 6px;
    transition: background-color 0.15s ease, color 0.15s ease;
    text-decoration: none;
    white-space: nowrap;
}

.cc-sidebar-nav .nav-link i {
    color: var(--cc-sb-text);
    font-size: 1rem;
    flex-shrink: 0;
    transition: color 0.15s ease;
}

.cc-sidebar-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, .09);
    color: var(--cc-sb-text-hover);
}
.cc-sidebar-nav .nav-link:hover i { color: var(--cc-sb-text-hover); }

/* アクティブ: 濃紺パネル上で navy-600 に浮かせる (.pf-nav-link.active と同調)。 */
.cc-sidebar-nav .nav-link.active,
.cc-sidebar-nav .nav-link.active:hover {
    background-color: var(--cc-sb-active-bg);
    color: var(--cc-sb-active-text);
    font-weight: 600;
    box-shadow: 0 2px 8px -2px rgba(0, 0, 0, .25);
}
.cc-sidebar-nav .nav-link.active i { color: var(--cc-sb-active-icon); }

/* ── 各種マスタ アコーディオン ────────── */
.cc-accordion-toggle {
    width: 100%;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
}
/* トグル右端のキャレット */
.cc-accordion-toggle .cc-accordion-caret {
    margin-left: auto;
    font-size: 0.8rem;
    transition: transform 0.18s ease;
}
.cc-accordion.open > .cc-accordion-toggle .cc-accordion-caret {
    transform: rotate(180deg);
}

/* 子メニュー: 既定は閉じる (高さ 0)、.open で展開 */
.cc-submenu {
    list-style: none;
    margin: 2px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.22s ease;
}
.cc-accordion.open > .cc-submenu {
    max-height: 320px;
}

/* 子リンクは左に少しインデントして階層を表現 */
.cc-submenu .nav-link {
    padding-left: 1.6rem;
    font-size: 0.86rem;
}

/* 画面が狭いとき (980px 以下) はアイコンのみ表示 */
@media (max-width: 980px) {
    :root { --cc-sb-width: 56px; }
    .cc-sidebar-nav .nav-link span { display: none; }
    .cc-sidebar-nav .nav-link {
        justify-content: center;
        padding: 0.55rem 0;
    }
    .cc-accordion-toggle .cc-accordion-caret { display: none; }
    .cc-submenu .nav-link { padding-left: 0; }
}

/* ── アプリバージョン表示（画面右下に常時表示） ────────── */
.app-version-badge {
    position: fixed;
    right: 8px;
    bottom: 6px;
    z-index: 1030;           /* Bootstrap navbar は 1030、ここは同値で前面に */
    padding: 2px 8px;
    font-size: 0.72rem;
    font-family: "Consolas", "Menlo", monospace;
    color: #6c757d;
    background-color: rgba(255, 255, 255, 0.85);
    border: 1px solid #dee2e6;
    border-radius: 4px;
    pointer-events: none;    /* 下のコンテンツの操作を邪魔しない */
    user-select: none;
    opacity: 0.75;
}
