/* 株式会社Prime 業務ポータル — スマホ優先 */
/* ThinkBeautyポータルと取り違えないよう、アクセント色は紺にしてある */
:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --line: #dfe2e7;
  --text: #23282e;
  --muted: #79818b;
  --accent: #33526f;
  --accent-soft: #e6ecf3;
  --good: #2f7d5a;
  --bad: #b4483c;
  --radius: 12px;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: "Segoe UI", "Yu Gothic UI", "Hiragino Sans", sans-serif;
  font-size: 15px; line-height: 1.6;
}
.hidden { display: none !important; }

/* ---- ログイン ---- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px 24px; width: 100%; max-width: 360px;
}
.login-card h1 { margin: 0 0 20px; font-size: 20px; letter-spacing: .04em; }
.login-card h1 span { display: block; font-size: 13px; color: var(--muted); font-weight: normal; letter-spacing: .1em; }

/* ---- 共通パーツ ---- */
label { display: block; margin-bottom: 12px; font-size: 13px; color: var(--muted); }
input, select, textarea {
  width: 100%; padding: 10px 12px; margin-top: 4px; font: inherit; color: var(--text);
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
}
input:focus, select:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
button { font: inherit; cursor: pointer; border-radius: 8px; }
button.primary { width: 100%; padding: 11px; background: var(--accent); color: #fff; border: none; font-weight: 600; }
button.primary:hover { filter: brightness(1.12); }
button.ghost { padding: 8px 14px; background: #fff; border: 1px solid var(--line); color: var(--text); }
button.ghost:hover { background: var(--accent-soft); }
button.ghost.danger { color: var(--bad); border-color: #e8c5c1; }
button.link { background: none; border: none; color: var(--muted); text-decoration: underline; padding: 0; font-size: 13px; }
.error { color: var(--bad); font-size: 13px; margin: 0 0 12px; }
.msg { font-size: 13px; margin: 10px 0 0; }
.msg.ok { color: var(--good); }
.msg.ng { color: var(--bad); }
.note { font-size: 12px; color: var(--muted); margin: 10px 0 0; }

/* ---- ヘッダ・タブ ---- */
header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; background: var(--card); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.brand { font-weight: 600; letter-spacing: .04em; }
.brand span { color: var(--muted); font-weight: normal; font-size: 12px; }
.user { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }

.tabs { display: flex; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 49px; z-index: 9; }
.tab { flex: 1; padding: 12px 4px; background: none; border: none; border-bottom: 2px solid transparent; color: var(--muted); font-size: 14px; }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

.subtabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.subtab { padding: 6px 14px; background: #fff; border: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.subtab.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }

main { padding: 16px; max-width: 1100px; margin: 0 auto; }
.toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.toolbar input { margin-top: 0; flex: 1; max-width: 280px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 16px; margin-bottom: 16px; }
.card h3 { margin: 0 0 14px; font-size: 15px; }
.actions { display: flex; gap: 10px; margin-top: 6px; }
.actions .ghost { flex: 0 0 auto; }
.actions .primary { flex: 1; }

/* ---- リンク集（カテゴリ×タイル） ---- */
.link-cat { margin-bottom: 22px; }
.link-cat h2 {
  margin: 0 0 8px; font-size: 13px; color: var(--muted); font-weight: 600;
  letter-spacing: .06em; border-bottom: 1px solid var(--line); padding-bottom: 6px;
}
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.tile {
  position: relative; display: block; background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px 34px 12px 12px; text-decoration: none; color: var(--text);
  font-size: 14px; line-height: 1.35; min-height: 56px;
}
.tile:hover { border-color: var(--accent); background: var(--accent-soft); }
.tile .t-note { display: block; font-size: 11px; color: var(--muted); margin-top: 4px; }
.tile .t-badge { display: inline-block; font-size: 10px; color: var(--accent); border: 1px solid var(--accent-soft); background: var(--accent-soft); border-radius: 4px; padding: 0 4px; margin-left: 4px; vertical-align: 1px; }
.tile-edit {
  position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; padding: 0;
  background: none; border: none; color: var(--muted); font-size: 13px; line-height: 24px;
}
.tile-edit:hover { color: var(--accent); }
.empty { color: var(--muted); font-size: 14px; padding: 24px 0; text-align: center; }

/* ---- テーブル ---- */
.table-scroll { overflow-x: auto; }
.vis-table, .log-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.vis-table th { text-align: left; white-space: nowrap; padding: 6px 12px 6px 0; color: var(--accent); vertical-align: top; }
.vis-table td { padding: 6px 0; color: var(--muted); }
.log-table th, .log-table td { padding: 6px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.log-table th { color: var(--muted); font-weight: normal; }

/* ---- モーダル ---- */
.modal { position: fixed; inset: 0; background: rgba(20, 26, 33, .45); display: grid; place-items: center; padding: 16px; z-index: 50; overflow-y: auto; }
.modal-card { background: var(--card); border-radius: var(--radius); padding: 22px 20px; width: 100%; max-width: 420px; }
.modal-card h3 { margin: 0 0 16px; font-size: 16px; }

@media (max-width: 480px) {
  .tiles { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .toolbar input { max-width: none; }
}
