/* app.css : 生徒管理システム モック2。モック1（ui.css）の配色・部品を引き継いで拡張 */
@font-face { font-family: "Google Sans Flex"; src: url("../fonts/GoogleSansFlex-subset.woff2") format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Noto Sans JP"; src: url("../fonts/NotoSansJP-subset.woff2") format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }

:root {
  --bg: #f3f4f6; --card: #fff; --line: #e5e7eb; --line2: #f3f4f6; --text: #1a1d23; --sub: #4b5563; --mut: #6b7280;
  --nav: #1f2937; --nav2: #111827; --pri: #1d4ed8; --pri2: #1e40af; --red: #b91c1c; --org: #c2410c; --grn: #166534;
  --font: "Google Sans Flex", "Noto Sans JP", system-ui, -apple-system, "Segoe UI", sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.55 var(--font); }
a { color: var(--pri); } a:hover { color: #1e3a8a; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2 { margin: 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #93c5fd; outline-offset: 1px; }
.sp { flex: 1 1 auto; }
.muted { color: var(--mut); font-size: 12px; }
.fw4 { font-weight: 400; }
.nowrap { white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.pre { white-space: pre-wrap; }
.neg { color: var(--red); } .pos { color: var(--grn); } .warn-t { color: var(--org); }
.lead { margin: 0; font-size: 16px; font-weight: 600; }

/* ---------- デモ用バー ---------- */
#demobar { position: sticky; top: 0; z-index: 60; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 6px 16px; background: #111827; color: #e5e7eb; font-size: 12px; }
#demobar .demo-label { background: #f59e0b; color: #111; font-weight: 700; border-radius: 4px; padding: 1px 8px; }
#demobar .demo-item { display: inline-flex; align-items: center; gap: 6px; }
#demobar select { background: #1f2937; color: #fff; border: 1px solid #374151; border-radius: 6px; padding: 3px 6px; font-size: 12px; max-width: 190px; }
.dbtn { display: inline-flex; align-items: center; gap: 4px; border: 1px solid #4b5563; background: #1f2937; color: #e5e7eb; border-radius: 6px; padding: 3px 10px; font-size: 12px; cursor: pointer; min-height: 28px; }
.dbtn:hover { background: #374151; } .dbtn.warn { border-color: #92400e; color: #fcd34d; }
.dbtn .ic, #demobar .ic { width: 14px; height: 14px; }
.ic { width: 18px; height: 18px; flex: none; vertical-align: -3px; }

/* ---------- 全体レイアウト ---------- */
.app { display: flex; align-items: flex-start; min-height: calc(100vh - 40px); }
.nav { position: sticky; top: 40px; align-self: flex-start; width: 224px; flex: none; height: calc(100vh - 40px); overflow-y: auto; background: var(--nav); color: #e5e7eb; padding: 16px 0; display: flex; flex-direction: column; gap: 2px; }
.nav .brand { padding: 8px 20px 16px; font-weight: 700; font-size: 15px; color: #fff; }
.nav .brand small { display: block; font-weight: 400; font-size: 11px; color: #9ca3af; margin-top: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 10px 20px; color: #d1d5db; text-decoration: none; min-height: 44px; }
.nav a:hover { background: #374151; color: #fff; }
.nav a.on { background: var(--nav2); color: #fff; font-weight: 600; box-shadow: inset 3px 0 0 #60a5fa; }
.nav .sec { padding: 14px 20px 4px; font-size: 11px; color: #9ca3af; letter-spacing: .08em; }
.nav .cnt { margin-left: auto; background: #dc2626; color: #fff; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 7px; }
.nav-back { display: none; }
.main { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 40px; z-index: 30; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 10px 28px; background: #fff; border-bottom: 1px solid var(--line); min-height: 60px; }
.top h1 { font-size: 18px; font-weight: 700; }
.menu-btn { display: none; }
.content { padding: 22px 28px 60px; display: flex; flex-direction: column; gap: 18px; }
.pill { display: inline-flex; align-items: center; gap: 6px; border: 1px solid #d1d5db; border-radius: 8px; padding: 5px 12px; background: #fff; font-size: 13px; color: #374151; min-height: 36px; }
.seg { display: inline-flex; border: 1px solid #d1d5db; border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: #fff; padding: 6px 12px; font-size: 13px; color: var(--mut); cursor: pointer; min-height: 36px; }
.seg button.on { background: var(--nav); color: #fff; font-weight: 600; }
.icon-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 1px solid #d1d5db; background: #fff; border-radius: 8px; cursor: pointer; color: #374151; }
.icon-btn:hover { background: #f9fafb; }
.badge { position: absolute; top: -5px; right: -5px; background: #dc2626; color: #fff; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 0 5px; min-width: 18px; line-height: 18px; }
.bell-wrap { position: relative; }
.bell-panel { position: absolute; right: 0; top: 46px; width: 340px; max-width: 92vw; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.18); z-index: 40; max-height: 70vh; overflow: auto; }
.bp-h { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.bp-item { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border-bottom: 1px solid var(--line2); color: var(--text); text-decoration: none; }
.bp-item.unread { background: #eff6ff; font-weight: 600; } .bp-item:hover { background: #f3f4f6; }
.bp-f { padding: 8px 14px; }

/* ---------- 部品 ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid #d1d5db; border-radius: 8px; padding: 8px 14px; background: #fff; font-size: 13px; font-weight: 600; color: #1f2937; cursor: pointer; min-height: 40px; text-decoration: none; }
.btn:hover { background: #f9fafb; color: #111827; }
.btn.pri { background: var(--pri); border-color: var(--pri); color: #fff; } .btn.pri:hover { background: var(--pri2); color: #fff; }
.btn.dng { background: var(--red); border-color: var(--red); color: #fff; } .btn.dng:hover { background: #991b1b; color: #fff; }
.btn.sm { padding: 4px 10px; min-height: 32px; font-size: 12px; white-space: nowrap; }
.btn:disabled, .btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.more { margin-left: auto; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; }
.card.flush { padding: 0; overflow: hidden; }
.card h2, .side-h h2 { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.card h2 .more { margin-left: auto; font-size: 12px; font-weight: 500; }
.side-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; } .side-h h2 { margin: 0; }
.tag { display: inline-block; border-radius: 6px; padding: 2px 8px; font-size: 12px; font-weight: 600; white-space: nowrap; background: #f3f4f6; color: #374151; }
.tag.g { background: #dcfce7; color: #166534; } .tag.b { background: #dbeafe; color: #1e40af; } .tag.o { background: #ffedd5; color: #9a3412; }
.tag.r { background: #fee2e2; color: #991b1b; } .tag.gr { background: #e5e7eb; color: #374151; } .tag.p { background: #ede9fe; color: #5b21b6; } .tag.t { background: #ccfbf1; color: #115e59; }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 8px; background: #dbeafe; color: #1e40af; font-weight: 700; font-size: 12px; flex: none; }
.empty { padding: 22px; text-align: center; color: var(--mut); }
.alert { border-radius: 8px; padding: 10px 14px; border: 1px solid; }
.alert.bad { background: #fef2f2; border-color: #fca5a5; color: #7f1d1d; } .alert.warn { background: #fff7ed; border-color: #fdba74; color: #7c2d12; } .alert.ok { background: #f0fdf4; border-color: #86efac; color: #14532d; }
.actions-row, .row-btns { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.legend { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-right: 4px; background: #f3f4f6; border: 1px solid #d1d5db; }
.legend.d { background: #16a34a; border-color: #16a34a; } .legend.w { background: #fff; border: 2px solid #ea580c; }
.legend-row { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; font-size: 12px; color: var(--sub); }
ul.plain, ol.plain { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }

/* テーブル */
.wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t th { text-align: left; font-weight: 600; color: var(--sub); font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--line); background: #f9fafb; white-space: nowrap; }
table.t td { padding: 9px 10px; border-bottom: 1px solid var(--line2); vertical-align: middle; }
table.t tr:hover td { background: #fafafa; }
table.t th.num { text-align: right; }
.thbtn { border: 0; background: none; padding: 0; cursor: pointer; color: inherit; font-weight: 600; font-size: 12px; }
.pager, .bulk { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bulk { padding: 12px 18px; border-top: 1px solid var(--line); }
.list-meta { padding: 10px 18px; border-bottom: 1px solid var(--line); }

/* フォーム */
.field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--sub); min-width: 0; }
.field input, .field select, .field textarea { font-size: 13px; color: #111827; border: 1px solid #d1d5db; border-radius: 8px; padding: 8px 10px; min-height: 40px; background: #fff; width: 100%; }
.field textarea { resize: vertical; }
.field small { font-size: 11px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px 14px; }
.form-grid .span2 { grid-column: span 2; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; min-height: 36px; cursor: pointer; }
.check input { width: 18px; height: 18px; }
.checks { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.fs { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin: 10px 0 0; } .fs legend { font-size: 12px; color: var(--sub); padding: 0 6px; }
.form-err { background: #fef2f2; border: 1px solid #fca5a5; color: #7f1d1d; border-radius: 8px; padding: 8px 12px; margin: 10px 0; font-weight: 600; }
.stu-form { display: flex; flex-direction: column; gap: 16px; }
.filters { padding: 14px 20px; }
.filter-grid { display: grid; grid-template-columns: 2fr repeat(5, 1fr) auto; gap: 12px; align-items: end; }
.att-tool { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; padding: 12px 16px; }
.datenav { display: flex; gap: 4px; align-items: center; } .datenav input { min-height: 40px; border: 1px solid #d1d5db; border-radius: 8px; padding: 6px 8px; }
.att-meta { align-self: center; line-height: 1.4; }
.picker { position: relative; } .pk-list { position: absolute; z-index: 20; left: 0; right: 0; top: 100%; background: #fff; border: 1px solid #d1d5db; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.15); max-height: 260px; overflow: auto; }
.pk-item { display: block; width: 100%; text-align: left; border: 0; background: #fff; padding: 8px 12px; cursor: pointer; border-bottom: 1px solid var(--line2); }
.pk-item:hover { background: #eff6ff; } .pk-none { padding: 10px 12px; }
.num-in { width: 70px; border: 1px solid #d1d5db; border-radius: 6px; padding: 5px 6px; min-height: 34px; }

/* モーダル・トースト */
.mback { position: fixed; inset: 0; z-index: 100; background: rgba(17,24,39,.5); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 12px 12px; overflow: auto; }
.modal { background: #fff; border-radius: 12px; width: 100%; max-width: 480px; box-shadow: 0 20px 50px rgba(0,0,0,.3); } .modal.wide { max-width: 720px; }
.mh { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); } .mh h2 { font-size: 16px; }
.mh .x { border: 0; background: none; cursor: pointer; width: 36px; height: 36px; border-radius: 8px; color: var(--mut); } .mh .x:hover { background: #f3f4f6; }
.mb { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 12px; } .mb form { display: flex; flex-direction: column; gap: 12px; }
.mf { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
#toast-root { position: fixed; z-index: 200; left: 50%; bottom: 20px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: 92vw; }
.toast { background: #111827; color: #fff; padding: 10px 16px; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.3); font-weight: 600; transition: opacity .4s; }
.toast.warn { background: #92400e; } .toast.info { background: #1e40af; } .toast.out { opacity: 0; }
.bigpw { font-size: 28px; font-weight: 700; letter-spacing: .12em; text-align: center; background: #f3f4f6; border-radius: 8px; padding: 10px; font-variant-numeric: tabular-nums; }

/* ---------- ダッシュボード ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: inherit; }
.kpi:hover { box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.kpi .l { font-size: 12px; color: var(--sub); } .kpi .n { font-size: 30px; font-weight: 700; line-height: 1.1; } .kpi .d { font-size: 12px; color: var(--mut); }
.kpi.red { border-color: #fca5a5; background: #fef2f2; } .kpi.red .n { color: var(--red); } .kpi.org { border-color: #fdba74; background: #fff7ed; } .kpi.org .n { color: var(--org); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 430px), 1fr)); gap: 18px; align-items: start; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 18px; align-items: start; }
.stiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.stile { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; color: inherit; text-decoration: none; } a.stile:hover { background: #f9fafb; }
.stile .big { font-size: 22px; font-weight: 700; } .stile.total { background: #f9fafb; }
.mbars { display: flex; align-items: flex-end; gap: 8px; height: 130px; padding-top: 6px; }
.mbar { flex: 1 1 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; position: relative; font-size: 11px; color: var(--mut); }
.mbar i { display: block; width: 100%; max-width: 34px; background: #93c5fd; border-radius: 4px 4px 0 0; min-height: 2px; } .mbar b { position: absolute; top: 0; font-size: 11px; color: var(--sub); font-weight: 600; display: none; } .mbar:hover b { display: block; }
.tdash { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.tcell { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.tcell .l { font-size: 12px; color: var(--sub); } .tcell .n { font-size: 24px; font-weight: 700; } .tcell .d { font-size: 12px; color: var(--mut); }
.tcell.todo { border-color: #93c5fd; background: #eff6ff; } .tcell.ok { border-color: #86efac; background: #f0fdf4; } .tcell.warn { border-color: #fdba74; background: #fff7ed; } .tcell.bad { border-color: #fca5a5; background: #fef2f2; }

/* ---------- 生徒詳細 ---------- */
.detail-head { display: flex; flex-wrap: wrap; gap: 12px 14px; align-items: center; }
.dh-main { flex: 1 1 280px; min-width: 0; } .dh-name { font-size: 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 2px; }
.dh-act { display: flex; flex-wrap: wrap; gap: 8px; }
.tabs { display: flex; flex-wrap: wrap; border-bottom: 1px solid var(--line); background: #fff; border-radius: 10px 10px 0 0; padding: 0 12px; border: 1px solid var(--line); overflow-x: auto; }
.tabs a { padding: 12px 14px; text-decoration: none; color: var(--sub); font-size: 13px; font-weight: 500; min-height: 44px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.tabs a.on { color: #111827; font-weight: 700; box-shadow: inset 0 -3px 0 var(--pri); }
.tabs.inline { border: 0; background: none; padding: 0; }
.tab-body { display: flex; flex-direction: column; gap: 18px; margin-top: -2px; }
.kv { display: grid; grid-template-columns: 124px 1fr; gap: 6px 12px; font-size: 13px; margin: 0; } .kv dt { color: var(--mut); } .kv dd { margin: 0; overflow-wrap: anywhere; }
.steps { display: flex; gap: 4px; align-items: flex-start; overflow-x: auto; padding-bottom: 4px; }
.step { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 1 0 74px; min-width: 0; font-size: 11px; text-align: center; color: var(--mut); }
.step .c { width: 28px; height: 28px; border-radius: 50%; border: 2px solid #d1d5db; background: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; }
.step.done .c { background: var(--grn); border-color: var(--grn); color: #fff; } .step.now .c { border-color: var(--pri); color: var(--pri); background: #dbeafe; } .step.now { color: var(--pri); font-weight: 700; }
.daystrip { display: flex; flex-wrap: wrap; gap: 4px; }
.dcell { width: 42px; height: 46px; border-radius: 6px; background: #f3f4f6; color: #9ca3af; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 13px; }
.dcell small { font-size: 9px; color: inherit; opacity: .8; } .dcell.p { background: #dcfce7; color: #166534; } .dcell.l { background: #ffedd5; color: #9a3412; } .dcell.a { background: #fee2e2; color: #991b1b; } .dcell.e { background: #e5e7eb; color: #374151; }
.ugrid { display: flex; flex-wrap: wrap; gap: 5px; }
.ucell { min-width: 38px; height: 34px; padding: 0 4px; border-radius: 6px; border: 1px solid #d1d5db; background: #fff; cursor: pointer; font-size: 11px; font-weight: 600; color: #6b7280; }
.ucell:disabled { cursor: default; } .ucell.d { background: #16a34a; border-color: #16a34a; color: #fff; } .ucell.w { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #ea580c; }
.ugrid-wrap { max-height: 70vh; } .ugrid-t th, .ugrid-t td { padding: 4px 3px; text-align: center; } .ugrid-t th small { font-weight: 400; color: var(--mut); }
.ugrid-t .stick { position: sticky; left: 0; background: #fff; text-align: left; min-width: 150px; padding-left: 10px; z-index: 2; } .ugrid-t thead .stick { background: #f9fafb; }
.ugrid-t td.uc .ucell { min-width: 24px; width: 24px; height: 24px; padding: 0; } .ugrid-t .kcol { border-left: 1px solid var(--line); } .ugrid-t th.kcol + th.kcol, .ugrid-t td.kcol + td.kcol { border-left: 0; }

/* ---------- 出欠 ---------- */
.att-list { display: flex; flex-direction: column; }
.att-row { display: grid; grid-template-columns: minmax(180px, 1.4fr) auto minmax(220px, 1.6fr); gap: 10px 16px; align-items: center; padding: 10px 18px; border-bottom: 1px solid var(--line2); }
.att-row.todo { background: #fffbeb; } .ar-name { display: flex; flex-direction: column; min-width: 0; } .ar-name > span { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.ab { display: inline-flex; gap: 6px; }
.ab button { border: 1px solid #d1d5db; background: #fff; border-radius: 8px; min-width: 64px; min-height: 42px; font-size: 13px; font-weight: 600; color: #374151; cursor: pointer; padding: 0 8px; }
.ab button:hover { background: #f3f4f6; } .ab button .short { display: none; }
.ab button.p { background: #166534; border-color: #166534; color: #fff; } .ab button.l { background: #b45309; border-color: #b45309; color: #fff; } .ab button.a { background: #b91c1c; border-color: #b91c1c; color: #fff; } .ab button.e { background: #374151; border-color: #374151; color: #fff; }
.ar-extra { display: flex; gap: 8px; flex-wrap: wrap; } .ar-extra .reason, .ar-extra .note { border: 1px solid #d1d5db; border-radius: 8px; padding: 6px 8px; min-height: 40px; font-size: 13px; background: #fff; } .ar-extra .note { flex: 1 1 130px; min-width: 0; }
.dirty { color: #f59e0b; } .badge-btn { border: 1px solid #fcd34d; background: #fffbeb; color: #92400e; border-radius: 6px; font-size: 11px; font-weight: 700; padding: 1px 6px; cursor: pointer; }
.att-foot { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 12px 18px; background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -4px 12px rgba(0,0,0,.05); }
.att-sum { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center; flex: 1 1 auto; font-size: 13px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; background: #9ca3af; } .dot.p { background: #166534; } .dot.l { background: #b45309; } .dot.a { background: #b91c1c; } .dot.e { background: #374151; }

/* ---------- 緊急 ---------- */
.split { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 22px; align-items: start; }
.ulist, .side { display: flex; flex-direction: column; gap: 12px; }
.ucard { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; background: #fff; }
.ucard.open { border-color: #fca5a5; background: #fff5f5; } .ucard .who { font-weight: 700; font-size: 15px; } .ucard .meta { font-size: 12px; color: var(--sub); } .ucard .meta.span { grid-column: 1 / -1; font-size: 13px; color: #1f2937; }
.ucard-act { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; } .ucard .log { grid-column: 1 / -1; font-size: 13px; border-top: 1px dashed var(--line); padding-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.bars { display: flex; flex-direction: column; gap: 10px; } .bar-l { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.bar { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; } .bar i { display: block; height: 100%; background: var(--org); }

/* ---------- 工程表・書類 ---------- */
table.g { border-collapse: separate; border-spacing: 0; font-size: 12px; width: 100%; }
table.g th { background: #f9fafb; border-bottom: 1px solid var(--line); padding: 8px 6px; font-weight: 600; color: var(--sub); text-align: center; white-space: nowrap; }
table.g th:first-child, table.g td:first-child { text-align: left; position: sticky; left: 0; background: #fff; min-width: 170px; padding-left: 12px; z-index: 1; } table.g th:first-child { background: #f9fafb; }
table.g td { border-bottom: 1px solid var(--line2); padding: 5px 6px; text-align: center; vertical-align: middle; }
.cell { display: inline-flex; align-items: center; justify-content: center; min-width: 64px; height: 32px; padding: 0 6px; border-radius: 6px; font-weight: 600; font-size: 11px; white-space: nowrap; }
.c-done { background: #dcfce7; color: #166534; } .c-now { background: #dbeafe; color: #1e40af; box-shadow: inset 0 0 0 2px var(--pri); } .c-stuck { background: #fee2e2; color: #991b1b; box-shadow: inset 0 0 0 2px #dc2626; } .c-todo { background: #f3f4f6; color: #9ca3af; }
.dcc { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 28px; border-radius: 6px; border: 0; font-weight: 700; font-size: 14px; } button.dcc { cursor: pointer; }
.dcc.ok { background: #dcfce7; color: #166534; } .dcc.ng { background: #fee2e2; color: #991b1b; } .dcc.na { background: #f3f4f6; color: #9ca3af; } button.dcc:hover { filter: brightness(.95); }
.exp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; } .exp { border: 1px solid var(--line); border-radius: 8px; padding: 12px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; } .exp select { max-width: 100%; border: 1px solid #d1d5db; border-radius: 8px; padding: 6px 8px; min-height: 36px; }
table.perm td, table.perm th { text-align: center; } table.perm td:first-child, table.perm th:first-child { text-align: left; }

/* ---------- ログイン・スマホ表示 ---------- */
.login { min-height: calc(100vh - 40px); display: flex; align-items: center; justify-content: center; padding: 24px 12px; }
.login-card { width: 100%; max-width: 520px; display: flex; flex-direction: column; gap: 12px; } .login-card h1 { font-size: 22px; } .login-card form { display: flex; flex-direction: column; gap: 12px; }
.demo-accts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; } .demo-accts .btn { flex-direction: column; align-items: flex-start; gap: 0; }
.phone-back { position: fixed; inset: 0; z-index: 90; background: rgba(17,24,39,.55); }
.phone-wrap { position: fixed; z-index: 95; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.phone-dev { width: 398px; height: min(820px, 88vh); background: #111; border-radius: 36px; padding: 10px; box-shadow: 0 20px 60px rgba(0,0,0,.5); } .phone-dev iframe { width: 100%; height: 100%; border: 0; border-radius: 26px; background: #fff; }
.phone-x { position: absolute; right: -14px; top: -14px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: #fff; cursor: pointer; z-index: 2; display: flex; align-items: center; justify-content: center; } .phone-note { color: #e5e7eb; font-size: 12px; margin: 0; }

/* ---------- 画面幅が狭いとき（スマホ） ---------- */
@media (max-width: 960px) { .filter-grid { grid-template-columns: repeat(2, 1fr); } .split { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .app { display: block; } .menu-btn { display: inline-flex; }
  .nav { position: fixed; left: 0; top: 0; bottom: 0; z-index: 80; height: 100vh; transform: translateX(-102%); transition: transform .2s; width: 260px; }
  .nav-open .nav { transform: none; box-shadow: 8px 0 24px rgba(0,0,0,.3); } .nav-open .nav-back { display: block; position: fixed; inset: 0; z-index: 70; background: rgba(0,0,0,.4); }
  .top { top: 0; padding: 8px 14px; } #demobar { position: static; }
  .content { padding: 14px 12px 50px; } .hide-s { display: none !important; }
  .top h1 { font-size: 16px; flex: 1 1 100%; order: 5; }
  .att-row { grid-template-columns: 1fr auto; padding: 10px 12px; } .ar-extra { grid-column: 1 / -1; }
  .ab button { min-width: 46px; width: 46px; min-height: 46px; padding: 0; } .ab button .full { display: none; } .ab button .short { display: inline; font-weight: 700; }
  .att-foot { padding: 10px 12px; } .att-tool { padding: 10px 12px; } .kv { grid-template-columns: 100px 1fr; }
  .ucard { grid-template-columns: 1fr; } .ucard-act { justify-content: flex-start; } .detail-head { padding: 14px; } .dh-name { font-size: 18px; }
  .filter-grid { grid-template-columns: 1fr 1fr; } .form-grid .span2 { grid-column: auto; } .bell-panel { right: -60px; }
}
@media (max-width: 480px) { .filter-grid { grid-template-columns: 1fr; } .kpi .n { font-size: 26px; } #demobar { gap: 6px 8px; padding: 6px 10px; } .modal { border-radius: 10px; } .mback { padding-top: 3vh; } }

/* ---------- 印刷（PDF出力） ---------- */
@media print {
  #demobar, .nav, .nav-back, .top, .actions-row, .att-tool, .bulk, .btn, .icon-btn, #toast-root, #phone-root, #modal-root, .att-foot { display: none !important; }
  body { background: #fff; } .content { padding: 0; } .card { border: 0; } .wrap { overflow: visible; } table.g th:first-child, table.g td:first-child { position: static; }
  .app { display: block; min-height: 0; } @page { size: A4 landscape; margin: 10mm; }
}
