/* =========================================================
   倉庫在庫管理デモ  共通スタイル
   業務システムらしい落ち着いた配色（生成り + 濃色アクセント）
   ========================================================= */
:root {
    --bg:        #fafaf7;
    --panel:     #ffffff;
    --line:      #e5e5e0;
    --line-dark: #ccccc4;
    --ink:       #1a1a1a;
    --ink-sub:   #666660;
    --blue:      #1a5cb0;
    --orange:    #b35900;
    --green:     #2a7a3e;
    --green-dk:  #1f5d2e;
    --purple:    #6c3483;
    --amber:     #d97706;
    --red:       #c02626;
    --tint-blue: #f0f7ff;
    --tint-warm: #fff7e6;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, system-ui, sans-serif;
    font-size: 13px;
    line-height: 1.6;
}

/* ---------- ヘッダー ---------- */
.hdr {
    position: sticky; top: 0; z-index: 50;
    background: var(--bg);
    box-shadow: 0 4px 10px -4px rgba(0,0,0,.12);
}
.hdr-in {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    padding: 9px 14px;
}
.hdr-logo { font-weight: 700; font-size: 14px; white-space: nowrap; }
.hdr-logo em {
    font-style: normal; font-size: 10px; letter-spacing: .08em;
    background: var(--ink); color: #fff; border-radius: 3px; padding: 1px 5px; margin-left: 4px;
    vertical-align: 2px;
}
.hdr-nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.hdr-nav a {
    background: #fff; border: 1px solid var(--line-dark); border-radius: 6px;
    padding: 6px 11px; font-size: 13px; color: var(--ink); text-decoration: none; white-space: nowrap;
}
.hdr-nav a:hover { background: #f0f0f0; }
.hdr-nav a.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.hdr-nav a.hdr-cta {
    background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 700;
    margin-left: 6px;
}
.hdr-nav a.hdr-cta:hover { background: #164e95; }
.hdr-nav a.hdr-cta.active { background: #0f3f7d; border-color: #0f3f7d; }

/* ---------- ページ ---------- */
.page { padding: 14px; }
.page-title { margin: 0 0 12px; font-size: 16px; font-weight: 700; }
.page-title small { font-weight: 400; font-size: 12px; color: var(--ink-sub); margin-left: 8px; }

.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }

/* ---------- 汎用パーツ ---------- */
.btn {
    background: #fff; border: 1px solid var(--line-dark); border-radius: 6px;
    padding: 6px 12px; font: inherit; font-size: 13px; color: var(--ink); cursor: pointer;
}
.btn:hover { background: #f0f0f0; }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-primary:hover { background: #164e95; }
.btn-danger  { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { background: #a11f1f; }
.btn-ghost { background: transparent; }
.btn.is-on { background: var(--red); border-color: var(--red); color: #fff; }

.field { display: flex; flex-direction: column; gap: 3px; }
.field label { font-size: 11px; color: var(--ink-sub); }
input[type=text], input[type=number], input[type=date], select, textarea {
    border: 1px solid var(--line-dark); border-radius: 5px; padding: 5px 8px;
    font: inherit; font-size: 13px; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(26,92,176,.35); outline-offset: -1px; }

.panel {
    background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
    padding: 12px; margin-bottom: 14px;
}
.panel-title { font-weight: 700; font-size: 13px; margin: 0 0 8px; }

.tag {
    display: inline-block; font-size: 10px; line-height: 1.5;
    padding: 0 5px; border-radius: 3px; border: 1px solid currentColor;
}
.badge {
    display: inline-block; min-width: 17px; text-align: center;
    font-size: 10px; padding: 0 4px; border-radius: 9px;
    background: var(--orange); color: #fff;
}

/* ---------- テーブル ---------- */
.tbl { width: 100%; border-collapse: collapse; background: #fff; font-size: 12.5px; }
.tbl th, .tbl td { border: 1px solid var(--line); padding: 5px 8px; text-align: left; }
.tbl th {
    background: #f4f4ef; font-weight: 700; white-space: nowrap;
    position: sticky; top: 0; z-index: 1;
}
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tbody tr:hover { background: var(--tint-blue); }
.tbl-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 8px; max-height: 70vh; }

/* ---------- モーダル ---------- */
.modal-bg {
    position: fixed; inset: 0; z-index: 100;
    background: rgba(0,0,0,.42);
    display: grid; place-items: center;
    padding: 16px;
}
.modal-bg[hidden] { display: none !important; }
.modal {
    background: #fff; border-radius: 10px; width: min(760px, 100%);
    max-height: 86vh; display: flex; flex-direction: column;
    box-shadow: 0 18px 50px rgba(0,0,0,.3);
}
.modal-hd {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 14px; border-bottom: 1px solid var(--line);
}
.modal-hd h3 { margin: 0; font-size: 14px; flex: 1; }
.modal-bd { padding: 14px; overflow: auto; }
.modal-ft { padding: 11px 14px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; }
.modal-x { background: none; border: 0; font-size: 20px; line-height: 1; cursor: pointer; color: var(--ink-sub); }

/* ---------- トースト ---------- */
#toast {
    position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(10px);
    background: var(--ink); color: #fff; padding: 9px 18px; border-radius: 20px;
    font-size: 13px; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s;
    z-index: 300;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.demo-note {
    background: var(--tint-warm); border: 1px solid #f0d9a8; border-radius: 6px;
    padding: 7px 11px; font-size: 12px; color: #7a5a10; margin-bottom: 12px;
}
