/* public/assets/app.css  本番パス: /var/www/mail.nexer.jp/public/assets/app.css
   NEXERメール 共通スタイル(承認済みデザイン案: 黒帯+青帯の2段ヘッダー) */

:root {
  --ink: #1f2937;
  --muted: #5b6472;
  --line: #dfe3ea;
  --line-soft: #eef0f4;
  --bg: #f4f6f9;
  --card: #ffffff;
  --top: #1a1a1a;
  --blue: #1e5bb8;
  --blue-dark: #174a96;
  --blue-soft: #eaf1fc;
  --ok: #18794e;
  --ng: #b42318;
  --warn-bg: #fff7e6;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Noto Sans JP', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--blue); }
a:hover { color: #123f82; }

/* ---- ヘッダー ---- */
.topbar {
  background: var(--top);
  color: #fff;
  min-height: 52px;
  padding: 0 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.brand:hover { color: #fff; }
.brand-name { font-weight: 700; font-size: 17px; letter-spacing: .02em; }
.badge-admin { font-size: 12px; background: #b45309; color: #fff; border-radius: 4px; padding: 2px 8px; }
.topbar-right { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.topuser { font-size: 13px; color: #e5e7eb; }
.toplink { color: #fff; font-size: 13px; text-decoration: none; }
.toplink:hover { color: #fff; text-decoration: underline; }
.toplink.is-outline { border: 1px solid #5b616b; border-radius: 6px; padding: 6px 12px; }
.toplink.is-outline:hover { text-decoration: none; background: #2a2a2a; }

.bluebar {
  background: var(--blue);
  color: #fff;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 8px 24px;
  min-height: 52px;
}
.bluebar.is-thin { min-height: 8px; padding: 0; }
.bluebar-title { font-weight: 700; font-size: 15px; padding: 6px 0; }
.tab { color: #fff; text-decoration: none; border-radius: 6px; padding: 8px 14px; }
.tab:hover { color: #fff; background: var(--blue-dark); }
.tab.is-active { background: #fff; color: var(--blue); font-weight: 700; }

/* ---- 本文 ---- */
.main { flex: 1; width: 100%; max-width: 1280px; margin: 0 auto; padding: 20px 24px; }
.main.is-center { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 16px; }
.footer {
  padding: 10px 24px 16px; font-size: 12px; color: var(--muted);
  display: flex; flex-wrap: wrap; gap: 6px 18px; max-width: 1280px; width: 100%; margin: 0 auto;
}

.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 20px 24px; margin-bottom: 16px; }
.card.is-flush { padding: 0; overflow: hidden; }
.card-head {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.card-body { padding: 16px 20px; margin: 0; }
.card-title { margin: 0 0 14px; font-size: 18px; }
.card-head .card-title { margin: 0; }
.card-title.small { font-size: 15px; margin-bottom: 10px; }
.card.empty { text-align: center; padding: 48px 24px; }

.cols { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.col-main { flex: 999 1 560px; min-width: 0; }
.col-side { flex: 1 1 300px; max-width: 420px; }
.col-side .card { margin-bottom: 16px; }

.back { margin: 0 0 12px; font-size: 13px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.strong { font-weight: 500; }
.nowrap { white-space: nowrap; }
.pre { white-space: pre-line; line-height: 1.7; }
.text-ok { color: var(--ok); }
.text-ng { color: var(--ng); }

/* ---- お知らせ ---- */
.flash { border-radius: 8px; padding: 10px 14px; margin-bottom: 16px; font-size: 13px; }
.flash.is-ok { background: #e8f5ee; border: 1px solid #a7d7bd; color: #11603d; }
.flash.is-ng { background: #fdecea; border: 1px solid #f1b3ac; color: #8a1c12; }

/* ---- ボタン ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-family: inherit; font-size: 14px; line-height: 1.4;
  background: #fff; color: var(--ink); border: 1px solid #c3cad5; border-radius: 6px;
  padding: 9px 16px; min-height: 40px; text-decoration: none; cursor: pointer;
}
.btn:hover { background: #f7f8fa; color: var(--ink); }
.btn.is-primary { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 500; }
.btn.is-primary:hover { background: var(--blue-dark); }
.btn.is-danger { color: var(--ng); border-color: #e7a29b; }
.btn.is-outline-primary { color: var(--blue); border-color: var(--blue); font-weight: 500; }
.btn.is-block { width: 100%; }
.actions { display: flex; gap: 10px; margin-top: 8px; }
.actions.is-wrap { flex-wrap: wrap; margin: 10px 0; }

/* ---- 表 ---- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 640px; }
.table th { background: #f7f8fa; color: var(--muted); text-align: left; font-weight: 500; padding: 10px 16px; }
.table td { border-top: 1px solid var(--line-soft); padding: 12px 16px; vertical-align: top; }

.kind { border-radius: 4px; padding: 2px 8px; font-size: 12px; white-space: nowrap; }
.kind.is-employee { background: #e7eefb; color: #123f82; }
.kind.is-contractor { background: #fdf0e1; color: #8a4b08; }
.state { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; font-size: 13px; }
.state::before { content: ""; width: 8px; height: 8px; border-radius: 4px; background: currentColor; }
.state.is-on { color: var(--ok); }
.state.is-off { color: #6b7280; }

/* ---- フォーム ---- */
.form { display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; border: none; margin: 0; padding: 0; min-width: 0; }
.field > label, .field > legend { font-size: 13px; color: #4b5563; padding: 0; }
.field > legend { margin-bottom: 6px; }
.field input[type=text], .field input[type=email], .field input[type=password], .field input[type=number], .field textarea {
  font-family: inherit; font-size: 14px; color: var(--ink);
  padding: 8px 10px; border: 1px solid #c3cad5; border-radius: 6px; min-height: 40px; width: 100%;
}
.field textarea { line-height: 1.7; resize: vertical; }
.field input:focus, .field textarea:focus { outline: 2px solid #9bb8e6; outline-offset: 0; border-color: var(--blue); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.host-port { display: flex; gap: 8px; }
.host-port input[type=text] { flex: 1; min-width: 0; }
input.num { width: 86px !important; }
.radio, .check { display: flex; align-items: center; gap: 8px; min-height: 32px; }
.radio input, .check input, .switch-row input[type=checkbox] { width: 18px; height: 18px; }
.options { border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px; }
.options > legend { padding: 0 6px; }
.switch-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 36px; }
.inline { display: inline-flex; align-items: center; gap: 6px; }

/* ---- 一覧 ---- */
.mailbox-list { list-style: none; margin: 0 0 12px; padding: 0; }
.mailbox-list li { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.log-list { list-style: none; margin: 0; padding: 0; }
.log-list li { padding: 8px 0; border-bottom: 1px solid var(--line-soft); display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.log-list li > div { flex-basis: 100%; }

/* ---- ログイン画面 ---- */
.login-card {
  width: 100%; max-width: 440px; background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 40px 36px; display: flex; flex-direction: column; gap: 22px;
}
.login-head { text-align: center; }
.login-head h1 { margin: 0 0 8px; font-size: 22px; }
.login-head p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.btn-login {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  border-radius: 8px; padding: 13px 16px; text-decoration: none; font-weight: 500; font-size: 15px; text-align: center;
}
.btn-login.is-google { border: 1px solid #c3cad5; color: var(--ink); background: #fff; }
.btn-login.is-google:hover { background: #f7f8fa; color: var(--ink); }
.btn-login.is-primary { background: var(--blue); color: #fff; }
.btn-login.is-primary:hover { background: var(--blue-dark); color: #fff; }
.btn-login.is-disabled { color: var(--muted); background: #f4f6f9; cursor: not-allowed; font-size: 13px; }
.login-note { background: #f4f6f9; border-radius: 8px; padding: 14px 16px; font-size: 12px; color: #4b5563; line-height: 1.8; }

@media (max-width: 720px) {
  .topbar, .bluebar { padding-left: 16px; padding-right: 16px; }
  .main { padding: 16px; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .col-side { max-width: none; }
  .login-card { padding: 28px 20px; }
}
