/* ディスク台帳（disc.askmedia.co.jp）2026-11-14  スマホが先、パソコンでは一覧を広く */
:root {
    --ink: #0f172a; --sub: #475569; --mute: #64748b; --line: #e2e8f0; --bg: #f1f5f9; --card: #fff;
    --navy: #0f172a; --blue: #1d4ed8; --red: #b91c1c; --amber: #b45309; --green: #15803d;
    --s-unused: #64748b; --s-lent: #1d4ed8; --s-returned: #15803d; --s-disposed: #334155; --s-lost: #b91c1c;
    color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: system-ui, -apple-system, "Hiragino Sans", "Noto Sans JP", "Segoe UI", sans-serif; color: var(--ink); background: var(--bg); line-height: 1.6; -webkit-text-size-adjust: 100%; }
a { color: var(--blue); }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ヘッダー */
.d-head { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--navy); color: #fff; }
.d-brand { color: #fff; text-decoration: none; font-weight: 900; letter-spacing: .02em; display: flex; align-items: center; gap: 8px; }
.d-brand small { font-weight: 700; color: #94a3b8; font-size: .75rem; }
.d-company { margin-left: auto; font-size: .8rem; color: #cbd5e1; text-align: right; line-height: 1.3; max-width: 50%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-menu-btn { background: none; border: 1px solid rgba(255,255,255,.3); color: #fff; border-radius: 10px; padding: 6px 10px; cursor: pointer; }
.d-menu { position: absolute; right: 12px; top: 54px; background: #fff; color: var(--ink); border-radius: 14px; box-shadow: 0 18px 40px rgba(15,23,42,.25); min-width: 220px; padding: 6px; z-index: 30; }
.d-menu a, .d-menu button { display: flex; width: 100%; gap: 10px; align-items: center; padding: 11px 12px; border-radius: 10px; color: var(--ink); text-decoration: none; background: none; border: 0; cursor: pointer; text-align: left; font-weight: 700; font-size: .92rem; }
.d-menu a:hover, .d-menu button:hover { background: var(--bg); }
.d-menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }

.d-main { width: min(1080px, 100%); margin: 0 auto; padding: 16px 16px 96px; }
.d-title { font-size: 1.35rem; font-weight: 900; margin: 4px 0 12px; }
.d-sub { color: var(--sub); margin: -6px 0 14px; font-size: .9rem; }

/* 下のタブ（スマホ）・上のタブ（パソコン） */
.d-tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(4, 1fr); background: #fff; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.d-tabs a { display: grid; justify-items: center; gap: 2px; padding: 8px 4px 9px; color: var(--mute); text-decoration: none; font-size: .72rem; font-weight: 800; }
.d-tabs a svg { width: 24px; height: 24px; }
.d-tabs a.on { color: var(--blue); }
.d-tabs a.scan { color: #fff; }
.d-tabs a.scan span.ic { background: var(--red); border-radius: 16px; padding: 6px 14px; margin-top: -2px; display: grid; place-items: center; }
.d-tabs a.scan.on span.ic { background: #7f1d1d; }
.d-tabs a.scan b { color: var(--red); }
@media (min-width: 900px) {
    .d-tabs { position: static; display: flex; justify-content: center; gap: 4px; border: 0; border-bottom: 1px solid var(--line); padding: 4px; }
    .d-tabs a { grid-auto-flow: column; gap: 6px; padding: 8px 16px; border-radius: 10px; font-size: .88rem; }
    .d-tabs a svg { width: 18px; height: 18px; }
    .d-tabs a.on { background: #eff6ff; }
    .d-tabs a.scan span.ic { padding: 3px 8px; border-radius: 8px; }
    .d-main { padding-bottom: 48px; }
}

/* お知らせ */
.d-flash { border-radius: 12px; padding: 10px 14px; margin-bottom: 12px; font-weight: 700; font-size: .92rem; }
.d-flash.ok { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.d-flash.ng { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.d-flash ul { margin: 0; padding-left: 1.2em; }

/* カード */
.d-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; margin-bottom: 14px; }
.d-card h2 { font-size: 1rem; margin: 0 0 10px; font-weight: 900; }

/* ボタン */
.d-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 18px; border-radius: 12px; border: 1px solid transparent; font-weight: 800; cursor: pointer; text-decoration: none; font-size: .95rem; line-height: 1.2; }
.d-btn.block { display: flex; width: 100%; }
.d-btn.big { padding: 18px; font-size: 1.1rem; border-radius: 16px; }
.d-btn.red { background: var(--red); color: #fff; }
.d-btn.blue { background: var(--blue); color: #fff; }
.d-btn.navy { background: var(--navy); color: #fff; }
.d-btn.green { background: var(--green); color: #fff; }
.d-btn.line { background: #fff; color: var(--ink); border-color: #cbd5e1; }
.d-btn.ghost { background: none; color: var(--sub); }
.d-btn:disabled { opacity: .5; cursor: default; }
.d-btn svg { width: 20px; height: 20px; flex: none; }

/* 入力 */
.d-field { display: grid; gap: 4px; margin-bottom: 12px; }
.d-field label, .d-label { font-weight: 800; font-size: .88rem; }
.d-field input, .d-field select, .d-field textarea { width: 100%; padding: 12px; border: 1px solid #cbd5e1; border-radius: 12px; background: #fff; font-size: 16px; }
.d-field input:focus, .d-field select:focus, .d-field textarea:focus { outline: 3px solid #bfdbfe; border-color: var(--blue); }
.d-help { color: var(--mute); font-size: .8rem; }
.d-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.d-check { display: flex; gap: 8px; align-items: center; font-size: .92rem; }
.d-check input { width: 20px; height: 20px; }

/* 状態のしるし */
.st { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-weight: 800; font-size: .78rem; color: #fff; white-space: nowrap; }
.st-unused { background: var(--s-unused); } .st-lent { background: var(--s-lent); } .st-returned { background: var(--s-returned); }
.st-disposed { background: var(--s-disposed); } .st-lost { background: var(--s-lost); }
.st-overdue { background: #fef3c7; color: var(--amber); border: 1px solid #fcd34d; }

/* ホーム */
.d-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
.d-stat { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; text-decoration: none; color: var(--ink); }
.d-stat b { display: block; font-size: 1.6rem; font-weight: 900; line-height: 1.2; }
.d-stat span { color: var(--mute); font-size: .8rem; font-weight: 700; }
.d-stat.lent b { color: var(--s-lent); } .d-stat.overdue b { color: var(--amber); } .d-stat.lost b { color: var(--s-lost); }
@media (min-width: 700px) { .d-stats { grid-template-columns: repeat(6, 1fr); } }

/* 一覧 */
.d-filter { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 8px; -webkit-overflow-scrolling: touch; }
.d-filter a { flex: none; padding: 7px 12px; border-radius: 999px; border: 1px solid #cbd5e1; background: #fff; color: var(--ink); text-decoration: none; font-size: .82rem; font-weight: 800; }
.d-filter a.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.d-search { display: flex; gap: 6px; margin-bottom: 12px; }
.d-search input { flex: 1; min-width: 0; padding: 11px 12px; border: 1px solid #cbd5e1; border-radius: 12px; font-size: 16px; }
.d-list { display: grid; gap: 8px; }
.d-item { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 12px 14px; background: #fff; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); text-decoration: none; }
.d-item .no { font-weight: 900; font-size: 1.05rem; font-family: ui-monospace, "Roboto Mono", monospace; }
.d-item .who { grid-column: 1 / -1; color: var(--sub); font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-item:hover { border-color: #93c5fd; }
.d-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 14px; overflow: hidden; font-size: .9rem; }
.d-table th { background: #f8fafc; text-align: left; padding: 10px; border-bottom: 1px solid var(--line); white-space: nowrap; font-size: .8rem; color: var(--sub); }
.d-table td { padding: 10px; border-bottom: 1px solid #f1f5f9; vertical-align: top; }
.d-table td.no a { font-weight: 900; font-family: ui-monospace, "Roboto Mono", monospace; text-decoration: none; }
.d-table tr:hover td { background: #f8fafc; }
.only-pc { display: none; } .only-sp { display: block; }
@media (min-width: 900px) { .only-pc { display: block; } .only-sp { display: none; } }
.d-pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 14px 0; font-size: .88rem; }

/* 1枚の画面 */
.d-disc-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.d-disc-no { font-size: 1.8rem; font-weight: 900; font-family: ui-monospace, "Roboto Mono", monospace; letter-spacing: .02em; }
.d-facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 8px 0 0; font-size: .95rem; }
.d-facts dt { color: var(--mute); font-weight: 700; font-size: .85rem; }
.d-facts dd { margin: 0; font-weight: 700; word-break: break-word; }
.d-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.d-actions .wide { grid-column: 1 / -1; }
.d-panel { border-top: 1px dashed var(--line); margin-top: 12px; padding-top: 12px; }
.d-tl { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.d-tl li { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; font-size: .88rem; }
.d-tl time { color: var(--mute); font-size: .78rem; grid-column: 2; }
.d-tl .act { font-weight: 900; }
.d-tl .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--blue); margin-top: 6px; grid-row: span 3; }
.d-tl .what { grid-column: 2; color: var(--sub); }

/* 読み取り */
.d-scan-wrap { position: relative; background: #000; border-radius: 18px; overflow: hidden; aspect-ratio: 1 / 1; max-width: 520px; margin: 0 auto 12px; }
#d-reader { width: 100%; height: 100%; }
#d-reader video { object-fit: cover; }
.d-scan-msg { position: absolute; left: 0; right: 0; bottom: 0; padding: 10px; text-align: center; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.7)); font-weight: 700; font-size: .9rem; }
.d-scan-start { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: #fff; padding: 20px; }
.d-mode { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: #e2e8f0; padding: 4px; border-radius: 12px; margin-bottom: 12px; max-width: 520px; margin-left: auto; margin-right: auto; }
.d-mode button { border: 0; padding: 9px; border-radius: 9px; font-weight: 800; background: none; cursor: pointer; font-size: .88rem; }
.d-mode button.on { background: #fff; box-shadow: 0 1px 4px rgba(15,23,42,.15); }
.d-found { max-width: 520px; margin: 0 auto; }
.d-batch li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid #f1f5f9; }
ul.d-batch { list-style: none; padding: 0; margin: 0 0 10px; }

/* ログイン */
.d-auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(120% 80% at 100% 0%, #1e3a8a 0%, #0f172a 60%); }
.d-auth-box { width: min(420px, 100%); background: #fff; border-radius: 20px; padding: 26px 22px; box-shadow: 0 24px 60px rgba(0,0,0,.35); }
.d-auth-brand { text-align: center; margin-bottom: 16px; }
.d-auth-brand b { display: block; font-size: 1.3rem; font-weight: 900; }
.d-auth-brand span { color: var(--mute); font-size: .82rem; font-weight: 700; }
.d-auth-note { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e3a8a; border-radius: 12px; padding: 10px 12px; font-size: .85rem; margin-bottom: 14px; }
.d-auth-foot { text-align: center; margin-top: 14px; font-size: .85rem; }

/* 印刷 */
@media print {
    .d-head, .d-tabs, .d-noprint { display: none !important; }
    body { background: #fff; }
    .d-main { padding: 0; width: 100%; }
    .d-table { font-size: 9pt; }
    .d-table th, .d-table td { padding: 4px 6px; border: 1px solid #94a3b8; }
}
