/* GT Mail Hub 管理画面 — WP風サイドバー標準UI */
:root {
  --side-bg: #3c4250; --side-line: #474e5e; --side-txt: #cdd3e0;
  --accent: #2b6cb0; --bg: #f6f7f9; --line: #c3c4c7;
  --txt: #1d2327; --muted: #787c82; --danger: #b32d2e; --ok: #1a7a3c;
  --green: #3f8f4f;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: "Yu Gothic UI", "Hiragino Sans", Meiryo, sans-serif;
  background: var(--bg); color: var(--txt); font-size: 14px; }
a { color: var(--accent); text-decoration: none; }

.layout { display: flex; min-height: 100vh; }
.side { width: 200px; flex-shrink: 0; background: var(--side-bg); color: #fff;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.side .app { font-size: 15px; font-weight: 700; padding: 16px; border-bottom: 1px solid var(--side-line); }
.side a { display: block; padding: 11px 16px; color: var(--side-txt);
  border-bottom: 1px solid var(--side-line); font-size: 13px; }
.side a:hover { background: #474e5e; color: #fff; }
.side a.cur { background: var(--accent); color: #fff; font-weight: 700; }
.side .grp { font-size: 10px; color: #8a91a0; padding: 12px 16px 4px; letter-spacing: .08em; }
.side .user { margin-top: auto; padding: 12px 16px; font-size: 11px; color: #9aa2b5;
  border-top: 1px solid var(--side-line); }
.side .user a { display: inline; padding: 0; border: 0; color: #9aa2b5; text-decoration: underline; }

.main { flex: 1; min-width: 0; padding: 24px 32px 60px; }
.sphead { display: none; }

h1 { font-size: 20px; margin-bottom: 4px; }
.pgcap { font-size: 12px; color: var(--muted); margin-bottom: 16px; }
h2 { font-size: 15px; margin: 0 0 10px; }

.card { background: #fff; border: 1px solid var(--line); border-radius: 3px;
  padding: 16px; margin-bottom: 16px; }
.flash { background: #e7f2e8; border-left: 4px solid var(--ok); padding: 10px 14px;
  margin-bottom: 14px; border-radius: 2px; }

.kpi { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.kpi > div { background: #fff; border: 1px solid var(--line); border-radius: 3px;
  padding: 14px; text-align: center; }
.kpi .num { font-size: 28px; font-weight: 700; }
.kpi .num.warn { color: var(--danger); }
.kpi .lbl { font-size: 11px; color: var(--muted); margin-top: 2px; }

table { width: 100%; border-collapse: collapse; background: #fff; font-size: 13px; }
th, td { border: 1px solid var(--line); padding: 9px 12px; text-align: left; vertical-align: top; line-height: 1.6; }
th { background: #f0f0f1; font-weight: 600; white-space: nowrap; }
tr.clickable { cursor: pointer; }
tr.clickable:hover { background: #f0f6fc; }
.tblwrap { overflow-x: auto; margin-bottom: 16px; }

.badge { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 3px;
  background: #dcdcde; white-space: nowrap; }
.badge.high { background: var(--danger); color: #fff; }
.badge.st-未対応 { background: #1d2327; color: #fff; }
.badge.st-対応中 { background: #dba617; color: #fff; }
.badge.st-完了 { background: var(--ok); color: #fff; }
.badge.st-対応不要 { background: #dcdcde; }

.filter { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; align-items: center; }
.filter select, .filter input[type=text] { width: auto; padding: 7px 8px;
  border: 1px solid var(--line); border-radius: 3px; font-size: 13px; background: #fff; }
.filter input[type=text] { min-width: 220px; }
.filter form, form.inline-form { display: inline-flex; gap: 8px; align-items: center; margin: 0; }
.filter form select, form.inline-form select { width: auto; }
.nw { white-space: nowrap; }

/* 担当の割り振り行: 余白を広めに */
.filter.assign { gap: 16px; row-gap: 12px; margin: 6px 0 12px; }
.filter.assign .badge { padding: 8px 14px; font-size: 12px; }
.filter.assign form { gap: 10px; }
.filter.assign select { padding: 9px 10px; }

/* 添付画像のプレビューギャラリー */
.att-gallery { display: flex; gap: 14px; flex-wrap: wrap; margin: 12px 0 14px; }
.att-gallery:empty { display: none; }
.att-gallery a { display: block; text-align: center; text-decoration: none; }
.att-gallery img { max-height: 150px; max-width: 220px; border: 1px solid var(--line);
  border-radius: 3px; background: #fff; padding: 5px; display: block; }
.att-gallery span { display: block; font-size: 11px; color: var(--muted); margin-top: 4px;
  max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-table td { padding-top: 10px; padding-bottom: 10px; }

button, .btn { display: inline-block; padding: 9px 18px; font-size: 13px; font-weight: 700;
  border: 1px solid var(--accent); border-radius: 3px; background: var(--accent); color: #fff;
  cursor: pointer; font-family: inherit; }
button:hover, .btn:hover { opacity: .9; }
button.sub, .btn.sub { background: #fff; color: var(--accent); }
button.danger { background: #fff; color: var(--danger); border-color: var(--danger); }
button.small { padding: 5px 12px; font-weight: 600; }

textarea, input[type=text], input[type=password], select {
  width: 100%; padding: 8px; border: 1px solid var(--line); border-radius: 3px;
  font-size: 13px; font-family: inherit; background: #fff; }
textarea { min-height: 90px; line-height: 1.6; }
textarea.draft { min-height: 240px; }
label { display: block; font-size: 12px; font-weight: 600; margin: 10px 0 4px; }
.inline-form { display: inline; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }

.mailbody { background: #fbfbfd; border: 1px solid var(--line); border-radius: 3px;
  padding: 12px; white-space: pre-wrap; font-size: 13px; line-height: 1.7;
  max-height: 480px; overflow-y: auto; }
.meta { font-size: 12px; color: var(--muted); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

.login-wrap { max-width: 380px; margin: 80px auto; }
.login-wrap .card { padding: 30px; }
.login-wrap h1 { text-align: center; }
.login-wrap .cap { text-align: center; font-size: 12px; color: var(--muted); margin-bottom: 18px; }
.login-wrap button { width: 100%; margin-top: 16px; }

@media (max-width: 782px) {
  .sphead { display: flex; align-items: center; gap: 12px; background: var(--side-bg);
    color: #fff; padding: 12px 16px; font-weight: 700; position: sticky; top: 0; z-index: 20; }
  .burger { width: 30px; height: 24px; display: flex; flex-direction: column;
    justify-content: space-between; background: none; border: none; padding: 2px; }
  .burger i { display: block; height: 2px; background: #fff; }
  .side { position: fixed; left: -210px; top: 0; z-index: 30; transition: left .2s; height: 100vh; }
  .side.open { left: 0; box-shadow: 2px 0 12px rgba(0,0,0,.3); }
  .main { padding: 16px; }
  .kpi { grid-template-columns: repeat(2, 1fr); }
  .row2 { grid-template-columns: 1fr; }
}
