@charset "UTF-8";
/* ==========================================================================
   業務システム向け管理画面スタイル
   - PC: 左固定サイドメニュー
   - スマートフォン: サイドメニューはドロワー表示
   ========================================================================== */

:root {
    --sidebar-w: 220px;
    --header-h: 52px;
    --c-bg: #f4f6f8;
    --c-panel: #ffffff;
    --c-border: #d7dde4;
    --c-border-strong: #b9c3ce;
    --c-text: #212a33;
    --c-muted: #6b7784;
    --c-primary: #1f6fb2;
    --c-primary-dark: #17578c;
    --c-danger: #c0392b;
    --c-success: #1e8e5a;
    --c-warning: #b7791f;
    --c-head: #263445;
    --radius: 4px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--c-text);
    background: var(--c-bg);
}

a { color: var(--c-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- サイドメニュー ---------- */
.sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: var(--sidebar-w);
    background: var(--c-head);
    color: #cfd8e3;
    overflow-y: auto;
    z-index: 200;
}
.sidebar .brand {
    display: block;
    padding: 14px 16px;
    font-size: 15px;
    font-weight: bold;
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,.12);
}
.sidebar .brand:hover { text-decoration: none; }
.sidebar nav a {
    display: block;
    padding: 10px 16px;
    color: #cfd8e3;
    border-left: 3px solid transparent;
    font-size: 14px;
}
.sidebar nav a:hover { background: rgba(255,255,255,.07); color: #fff; text-decoration: none; }
.sidebar nav a.active { background: rgba(255,255,255,.12); color: #fff; border-left-color: var(--c-primary); font-weight: bold; }
.sidebar .nav-sep { margin: 8px 16px; border-top: 1px solid rgba(255,255,255,.12); }
.sidebar .sidebar-foot { padding: 12px 16px; font-size: 11px; color: #8b98a8; }

/* ---------- ヘッダー ---------- */
.header {
    position: sticky;
    top: 0;
    height: var(--header-h);
    background: var(--c-panel);
    border-bottom: 1px solid var(--c-border);
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 12px;
    z-index: 100;
}
.header h1 { font-size: 16px; margin: 0; font-weight: bold; }
.header .spacer { flex: 1; }
.header .user { font-size: 12px; color: var(--c-muted); }
.menu-toggle {
    display: none;
    background: none;
    border: 1px solid var(--c-border-strong);
    border-radius: var(--radius);
    padding: 4px 9px;
    font-size: 16px;
    cursor: pointer;
}

/* ---------- 本体 ---------- */
.wrapper { margin-left: var(--sidebar-w); min-height: 100vh; }
.content { padding: 16px; }
.backdrop { display: none; }

/* ---------- パネル ---------- */
.panel {
    background: var(--c-panel);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    margin-bottom: 16px;
}
.panel > .panel-head {
    padding: 10px 14px;
    border-bottom: 1px solid var(--c-border);
    font-weight: bold;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.panel > .panel-body { padding: 14px; }
.panel > .panel-foot {
    padding: 10px 14px;
    border-top: 1px solid var(--c-border);
    background: #fafbfc;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

/* ---------- ボタン ---------- */
.btn {
    display: inline-block;
    padding: 6px 14px;
    font-size: 13px;
    line-height: 1.5;
    border: 1px solid var(--c-border-strong);
    background: #fff;
    color: var(--c-text);
    border-radius: var(--radius);
    cursor: pointer;
    text-align: center;
    white-space: nowrap;
}
.btn:hover { background: #eef2f6; text-decoration: none; }
.btn-primary { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.btn-primary:hover { background: var(--c-primary-dark); border-color: var(--c-primary-dark); color: #fff; }
.btn-danger { background: var(--c-danger); border-color: var(--c-danger); color: #fff; }
.btn-danger:hover { background: #a03225; color: #fff; }
.btn-sm { padding: 3px 9px; font-size: 12px; }
.btn-lg { padding: 11px 26px; font-size: 15px; font-weight: bold; }
.btn:disabled, .btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- フォーム ---------- */
label { font-size: 13px; }
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=datetime-local], input[type=search], select, textarea {
    width: 100%;
    padding: 6px 8px;
    font-size: 13px;
    font-family: inherit;
    border: 1px solid var(--c-border-strong);
    border-radius: var(--radius);
    background: #fff;
    color: var(--c-text);
    touch-action: manipulation;
}
textarea { line-height: 1.7; }
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--c-primary);
    box-shadow: 0 0 0 2px rgba(31,111,178,.15);
}
.form-row { margin-bottom: 12px; }
.form-row > label { display: block; margin-bottom: 4px; font-weight: bold; color: #3c4855; }
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 10px 14px;
}
.form-note { font-size: 12px; color: var(--c-muted); margin-top: 3px; }
.required { color: var(--c-danger); font-size: 11px; margin-left: 3px; }
.inline-check { display: inline-flex; align-items: center; gap: 5px; margin-right: 14px; font-size: 13px; }
.inline-check input { width: auto; }

/* ---------- テーブル ---------- */
.table-wrap {
    overflow: auto;
    max-height: 70vh;
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    background: #fff;
}
table.data {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
    white-space: nowrap;
}
table.data th, table.data td {
    padding: 6px 9px;
    border-bottom: 1px solid var(--c-border);
    border-right: 1px solid #eceff2;
    text-align: left;
    vertical-align: middle;
}
table.data thead th {
    position: sticky;
    top: 0;
    background: #eef2f6;
    color: #3c4855;
    font-weight: bold;
    z-index: 2;
    border-bottom: 2px solid var(--c-border-strong);
}
table.data tbody tr:nth-child(even) { background: #fafbfc; }
table.data tbody tr:hover { background: #eaf3fb; }
table.data td.num, table.data th.num { text-align: right; }
table.data td.center, table.data th.center { text-align: center; }
table.data .col-check { width: 34px; text-align: center; }
table.data a.row-link { font-weight: bold; }
.table-scroll-x { overflow-x: auto; }

/* ---------- バッジ ---------- */
.badge {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 11px;
    line-height: 1.7;
    border: 1px solid transparent;
    white-space: nowrap;
}
.badge-gray    { background: #eceff2; color: #5b6773; border-color: #dde2e8; }
.badge-blue    { background: #e3f0fa; color: #1f6fb2; border-color: #c5e0f4; }
.badge-green   { background: #e4f4ec; color: #1e8e5a; border-color: #c3e8d4; }
.badge-red     { background: #fbe9e7; color: #c0392b; border-color: #f5cdc8; }
.badge-yellow  { background: #fdf3e0; color: #b7791f; border-color: #f6e2bd; }

/* ---------- アラート ---------- */
.alert {
    padding: 10px 14px;
    border-radius: var(--radius);
    margin-bottom: 14px;
    font-size: 13px;
    border: 1px solid;
}
.alert-success { background: #e4f4ec; border-color: #b7e0c9; color: #14663f; }
.alert-error   { background: #fbe9e7; border-color: #f0bdb6; color: #9b2c1e; }
.alert-warning { background: #fdf3e0; border-color: #f0d9a8; color: #8a5b12; }
.alert-info    { background: #e9f1f8; border-color: #c3d9ec; color: #1a5f96; }
.alert ul { margin: 6px 0 0; padding-left: 18px; }

/* ---------- 統計カード ---------- */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}
.stat {
    background: var(--c-panel);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: 12px 14px;
}
.stat .label { font-size: 12px; color: var(--c-muted); }
.stat .value { font-size: 24px; font-weight: bold; line-height: 1.3; }
.stat .value.small { font-size: 18px; }
.stat.accent { border-left: 3px solid var(--c-primary); }
.stat.danger .value { color: var(--c-danger); }
.stat.success .value { color: var(--c-success); }


/* ---------- 添付ファイル ---------- */
.attachment-list {
    display: grid;
    gap: 6px;
}
.attachment-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    background: #f8fafc;
    cursor: default;
}
.attachment-name {
    min-width: 0;
    overflow-wrap: anywhere;
}
.attachment-remove {
    margin-left: auto;
    white-space: nowrap;
    font-size: 12px;
    color: var(--c-danger);
}

/* ---------- ページネーション ---------- */
.pager {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 10px;
    font-size: 13px;
}
.pager a, .pager span.cur, .pager span.gap {
    display: inline-block;
    min-width: 32px;
    padding: 4px 8px;
    text-align: center;
    border: 1px solid var(--c-border-strong);
    border-radius: var(--radius);
    background: #fff;
}
.pager span.cur { background: var(--c-primary); border-color: var(--c-primary); color: #fff; font-weight: bold; }
.pager span.gap { border-color: transparent; background: none; }
.pager .summary { margin-right: auto; color: var(--c-muted); }

/* ---------- 進捗バー ---------- */
.progress {
    height: 22px;
    background: #e6eaee;
    border-radius: 11px;
    overflow: hidden;
    border: 1px solid var(--c-border);
}
.progress > span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #2b86cd, #1f6fb2);
    color: #fff;
    font-size: 12px;
    text-align: center;
    line-height: 20px;
    transition: width .4s ease;
}

/* ---------- 大きい件数表示（誤送信防止の最終確認） ---------- */
.big-count {
    text-align: center;
    padding: 22px 12px;
    background: #fffaf0;
    border: 2px solid #e8c98a;
    border-radius: 6px;
    margin-bottom: 16px;
}
.big-count .label { font-size: 14px; color: #8a5b12; }
.big-count .num { font-size: 46px; font-weight: bold; color: #b7791f; line-height: 1.2; }
.big-count .num small { font-size: 20px; }

/* ---------- 定義リスト ---------- */
table.kv { width: 100%; border-collapse: collapse; font-size: 13px; }
table.kv th, table.kv td { padding: 7px 10px; border-bottom: 1px solid var(--c-border); text-align: left; vertical-align: top; }
table.kv th { width: 190px; background: #f7f9fb; font-weight: bold; color: #3c4855; white-space: nowrap; }
table.kv td .wrap { white-space: pre-wrap; word-break: break-all; }

/* ---------- ログイン画面 ---------- */
.login-wrap {
    max-width: 380px;
    margin: 9vh auto;
    padding: 0 16px;
}
.login-wrap h1 { font-size: 18px; text-align: center; margin-bottom: 18px; }
.login-wrap .panel-body { padding: 20px; }

/* ---------- ユーティリティ ---------- */
.muted { color: var(--c-muted); }
.small { font-size: 12px; }
.mono { font-family: "SFMono-Regular", Consolas, "Courier New", monospace; font-size: 12px; }
.mb0 { margin-bottom: 0; }
.mb8 { margin-bottom: 8px; }
.mb16 { margin-bottom: 16px; }
.mt8 { margin-top: 8px; }
.mt16 { margin-top: 16px; }
.flex { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.flex-end { margin-left: auto; }
.nowrap { white-space: nowrap; }
.break { word-break: break-all; white-space: normal; }
.text-right { text-align: right; }
.hidden { display: none; }
.filter-toggle { display: none; }

/* ---------- スマートフォン ---------- */
@media (max-width: 900px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform .2s ease;
        width: 240px;
    }
    body.nav-open .sidebar { transform: translateX(0); }
    body.nav-open .backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.4);
        z-index: 150;
    }
    .wrapper { margin-left: 0; }
    .menu-toggle { display: inline-block; }
    .content { padding: 12px; }
    .form-grid { grid-template-columns: 1fr 1fr; }
    .table-wrap { max-height: 62vh; }
    .stat-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
    .big-count .num { font-size: 36px; }
    table.kv th { width: 110px; }
}

@media (max-width: 560px) {
    .form-grid { grid-template-columns: 1fr; }
    .header h1 { font-size: 14px; }
    .stat .value { font-size: 20px; }
}
