@charset "UTF-8";
:root {
  --primary: #2b6cb0;
  --primary-dark: #2c5282;
  --danger: #c53030;
  --ok: #2f855a;
  --bg: #f7f8fa;
  --border: #d9dee5;
  --text: #2d3340;
  --muted: #6b7280;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 62.5%;
}

body {
  margin: 0;
  font-family: "Zen Kaku Gothic Antique", "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
  font-size: 1.4rem;
  background: #f7f8fa;
  color: #2d3340;
  line-height: 1.5;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 16px;
}
.container.main, .container[role=main] {
  padding-bottom: 48px;
}

main.container {
  padding-bottom: 48px;
}

.layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: #1a2433;
  color: #fff;
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  padding: 18px 20px 14px;
}

.brand {
  color: #fff;
  font-size: 2rem;
  font-weight: bold;
  text-decoration: none;
  line-height: 1.3;
}
.brand small {
  display: block;
  color: #cbd5e0;
  font-size: 1.2rem;
  font-weight: normal;
}

.nav-toggle, .nav-toggle-btn {
  display: none;
}

.side-nav {
  padding: 0 10px 20px;
}
.side-nav a {
  display: block;
  padding: 8px 12px;
  border-radius: 6px;
  color: #cbd5e0;
  font-size: 1.5rem;
  text-decoration: none;
}
.side-nav a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.side-nav a.active {
  background: #2b6cb0;
  color: #fff;
}

.side-nav-group {
  margin: 16px 12px 4px;
  color: rgba(203, 213, 224, 0.6);
  font-size: 1.2rem;
  letter-spacing: 0.08em;
}

.side-nav-user {
  margin-top: 24px;
  padding: 12px 12px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.side-nav-user .side-nav-username {
  display: block;
  color: #fff;
  font-size: 1.4rem;
}
.side-nav-user a {
  padding: 4px 0;
  font-size: 1.3rem;
}
.side-nav-user a:hover {
  background: none;
}

.content {
  width: 100%;
  max-width: 1100px;
  padding: 24px 32px 48px;
}

@media (max-width: 768px) {
  .layout {
    display: block;
  }
  .sidebar {
    position: static;
    height: auto;
    overflow: visible;
  }
  .sidebar-head {
    padding: 12px 16px;
  }
  .brand small {
    display: inline;
    margin-left: 6px;
  }
  .nav-toggle-btn {
    display: block;
    color: #fff;
    font-size: 2.2rem;
    line-height: 1;
    cursor: pointer;
  }
  .side-nav {
    display: none;
    padding: 0 10px 12px;
  }
  .nav-toggle:checked + .side-nav {
    display: block;
  }
  .content {
    padding: 16px 16px 48px;
  }
}
.brand-large {
  font-size: 3.2rem;
  margin: 0 0 4px;
}

h1 {
  font-size: 2.4rem;
}

h2 {
  font-size: 1.8rem;
  border-bottom: 1px solid #d9dee5;
  padding-bottom: 6px;
}

.inline-h2 {
  display: inline;
  border: none;
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.muted {
  color: #6b7280;
  font-size: 1.4rem;
}

.card, .form-card {
  background: #fff;
  border: 1px solid #d9dee5;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}

.login-box {
  background: #fff;
  border: 1px solid #d9dee5;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  max-width: 380px;
  margin: 80px auto;
  text-align: center;
}
.login-box form {
  text-align: left;
}

label {
  display: block;
  margin: 12px 0;
  font-weight: 600;
  font-size: 1.5rem;
}
label .muted {
  font-weight: normal;
  display: block;
}

input[type=text],
input[type=email],
input[type=password],
input[type=number],
input[type=datetime-local],
input[type=file],
input[type=url],
select,
textarea {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 8px 10px;
  border: 1px solid #d9dee5;
  border-radius: 6px;
  font-size: 1.6rem;
  font-family: inherit;
  font-weight: normal;
}

textarea {
  resize: vertical;
}

select.select-inline {
  display: inline-block;
  width: auto;
  margin-top: 0;
}

.checkbox-label {
  font-weight: normal;
}
.checkbox-label input {
  margin-right: 6px;
}

.form-row {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 16px;
}
.form-row label {
  flex: 1;
  min-width: 200px;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: nowrap;
  gap: 10px;
  margin-top: 16px;
}

.req {
  color: #c53030;
  font-size: 1.3rem;
  font-weight: normal;
}

.btn {
  display: inline-block;
  padding: 8px 16px;
  border: 1px solid #d9dee5;
  border-radius: 6px;
  background: #fff;
  color: #2d3340;
  font-size: 1.5rem;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
}
.btn:hover {
  background: #eef1f5;
}
.btn-primary {
  background: #2b6cb0;
  border-color: #2b6cb0;
  color: #fff;
}
.btn-primary:hover {
  background: #2c5282;
}
.btn-danger {
  background: #c53030;
  border-color: #c53030;
  color: #fff;
}
.btn-danger:hover {
  background: #9b2c2c;
}
.btn-success {
  background: #2f855a;
  border-color: #2f855a;
  color: #fff;
}
.btn-success:hover {
  background: #276749;
}
.btn-block {
  width: 100%;
  margin-top: 12px;
}
.btn-small {
  padding: 2px 10px;
  font-size: 1.4rem;
}
.btn-action {
  width: 280px;
  text-align: center;
}
.btn-common {
  background: #ebedf0;
  border-color: #ebedf0;
  color: #2d3340;
}
.btn-common:hover {
  background: #eef1f5;
}

.inline-form {
  display: inline-block;
  margin: 0;
}

.actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 10px;
}

.actions-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.action-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 14px;
}
.action-row form {
  margin: 0;
}

.action-note {
  color: #6b7280;
  font-size: 1.4rem;
  flex: 1;
  min-width: 240px;
}

.action-gap {
  margin-top: 18px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: 1.5rem;
  margin-bottom: 20px;
}
.card .table {
  margin-bottom: 0;
}
.table th, .table td {
  border: 1px solid #d9dee5;
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}
.table th {
  background: #eef1f5;
  white-space: nowrap;
}
.table th.date {
  width: 100px;
}
.table td.date {
  font-size: 1.4rem;
}

.kv-table {
  border-collapse: collapse;
  margin-bottom: 12px;
}
.kv-table th, .kv-table td {
  border: 1px solid #d9dee5;
  padding: 6px 12px;
  text-align: left;
}
.kv-table th {
  background: #eef1f5;
  white-space: nowrap;
}

.error-cell {
  color: #c53030;
  font-size: 0.85rem;
  word-break: break-all;
}

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 99px;
  font-size: 1.3rem;
  font-weight: 600;
  vertical-align: middle;
}
.badge-draft, .badge-cancelled, .badge-skipped, .badge-pending, .badge-optout {
  background: #e2e8f0;
  color: #4a5568;
}
.badge-queued {
  background: #fefcbf;
  color: #975a16;
}
.badge-running {
  background: #bee3f8;
  color: #2c5282;
}
.badge-paused {
  background: #fed7aa;
  color: #9c4221;
}
.badge-done, .badge-sent {
  background: #c6f6d5;
  color: #276749;
}
.badge-failed, .badge-bounced {
  background: #fed7d7;
  color: #9b2c2c;
}

.progress {
  background: #e2e8f0;
  border-radius: 99px;
  height: 18px;
  overflow: hidden;
  margin: 10px 0;
}
.progress-small {
  height: 8px;
  margin: 4px 0 0;
}
.progress-bar {
  background: #2b6cb0;
  height: 100%;
  transition: width 0.5s;
}

.stats {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 24px;
  margin: 10px 0;
}

.stat {
  display: flex;
  flex-direction: column;
}
.stat-label {
  font-size: 1.3rem;
  color: #6b7280;
}
.stat-value {
  font-size: 1.9rem;
  font-weight: bold;
}
.stat-value.ok {
  color: #2f855a;
}

.ng {
  color: #c53030;
}

.stat-value.ng {
  color: #c53030;
}

.flash {
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 12px;
}
.flash-success {
  background: #c6f6d5;
  color: #276749;
}
.flash-error {
  background: #fed7d7;
  color: #9b2c2c;
}
.flash-warning {
  background: #fefcbf;
  color: #975a16;
}

.hint-box {
  background: #ebf4ff;
  border: 1px solid #c3dafe;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 1.4rem;
  margin: 12px 0;
}
.hint-box.hint-warn {
  background: #fffbeb;
  border-color: #fbd38d;
}

.empty-state {
  margin-bottom: 20px;
  background: #fff;
  border: 1px dashed #d9dee5;
  border-radius: 8px;
  padding: 40px;
  text-align: center;
  color: #6b7280;
}

.mail-body {
  background: #f7f8fa;
  border: 1px solid #d9dee5;
  border-radius: 6px;
  padding: 14px;
  white-space: pre-wrap;
  word-break: break-all;
  font-family: inherit;
  font-size: 1.5rem;
}

.filter-tabs {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 10px;
}

.tab {
  padding: 4px 14px;
  border-radius: 99px;
  text-decoration: none;
  color: #2d3340;
  font-size: 1.4rem;
  border: 1px solid #d9dee5;
  background: #fff;
}
.tab.active {
  background: #2b6cb0;
  border-color: #2b6cb0;
  color: #fff;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 16px;
  margin-top: 12px;
}

.password-wrap {
  position: relative;
  display: block;
  margin-top: 4px;
}
.password-wrap input {
  padding-right: 42px;
  margin-top: 0;
}

.toggle-password {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  width: 30px;
  height: 30px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  color: #6b7280;
}
.toggle-password:hover {
  color: #2d3340;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  z-index: 100;
}
.modal-overlay[hidden] {
  display: none;
}

.modal {
  background: #fff;
  border-radius: 8px;
  padding: 24px;
  max-width: 520px;
  width: calc(100% - 32px);
  max-height: 90vh;
  overflow-y: auto;
}

details.card summary {
  cursor: pointer;
}

/* ---- bulkpost 追加分 ---- */
.btn-small {
  padding: 4px 10px;
  font-size: 0.85em;
}

.inline-form input[type=email] {
  display: inline-block;
  width: auto;
  min-width: 280px;
  margin: 0 8px 0 0;
  vertical-align: middle;
}

textarea.code {
  font-family: Menlo, Consolas, monospace;
  font-size: 0.85em;
}

details.html-fields {
  margin: 0 0 16px;
  padding: 12px 16px;
  border: 1px dashed var(--border, #d9dee5);
  border-radius: 8px;
}

details.html-fields summary {
  cursor: pointer;
  font-weight: bold;
  margin-bottom: 8px;
}

.preview-tabs {
  margin-top: 12px;
}

iframe.mail-html {
  width: 100%;
  height: 600px;
  border: 1px solid #d9dee5;
  border-radius: 6px;
  background: #fff;
}
