/* src/public/css/style.css */

:root {
  --color-bg: #F6F7F9;
  --color-surface: #FFFFFF;
  --color-border: #E2E5EA;
  --color-text: #1B2430;
  --color-text-muted: #6B7280;
  --color-primary: #2C5F8A;
  --color-primary-dark: #20486A;
  --color-primary-soft: #E8F0F7;
  --color-success: #2E7D5B;
  --color-success-soft: #E5F3ED;
  --color-warn: #B7791F;
  --color-warn-soft: #FBF1DC;
  --color-danger: #B3392B;
  --color-danger-soft: #FBEAE7;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(20, 30, 45, 0.06), 0 1px 2px rgba(20, 30, 45, 0.04);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.55;
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1100px; margin: 0 auto; padding: 24px; }
.container-narrow { max-width: 520px; margin: 0 auto; padding: 24px; }

/* ---------- Top bar (admin) ---------- */
.topbar {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.topbar .brand {
  font-weight: 700;
  font-size: 16px;
  color: var(--color-primary-dark);
}
.topbar .brand span { color: var(--color-text-muted); font-weight: 400; font-size: 13px; margin-left: 8px; }
.topbar form { margin: 0; }

/* ---------- Card ---------- */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 20px;
}
.card-title {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 16px;
  color: var(--color-text);
}

/* ---------- Forms ---------- */
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--color-text); }
.field { margin-bottom: 18px; }
.hint { font-size: 12px; color: var(--color-text-muted); margin-top: 4px; }

input[type="text"], input[type="password"], input[type="tel"],
input[type="datetime-local"], input[type="url"], textarea, select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: var(--color-text);
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-soft);
}
textarea { resize: vertical; min-height: 80px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
}
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: var(--color-primary-dark); }
.btn-secondary { background: var(--color-surface); color: var(--color-text); border-color: var(--color-border); }
.btn-secondary:hover { background: var(--color-bg); }
.btn-danger { background: var(--color-danger); color: #fff; }
.btn-block { width: 100%; }
.btn-lg { padding: 14px 18px; font-size: 16px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ---------- Table ---------- */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--color-border); white-space: nowrap; }
th { color: var(--color-text-muted); font-weight: 600; background: #FAFBFC; }
.table-wrap { overflow-x: auto; }

/* ---------- Badge ---------- */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.badge-pending { background: #EEF0F3; color: var(--color-text-muted); }
.badge-sent { background: var(--color-warn-soft); color: var(--color-warn); }
.badge-confirmed { background: var(--color-success-soft); color: var(--color-success); }
.badge-updated { background: var(--color-primary-soft); color: var(--color-primary-dark); }
.badge-failed { background: var(--color-danger-soft); color: var(--color-danger); }
.badge-auto_closed { background: #EEF0F3; color: var(--color-text-muted); }

/* ---------- Stat grid ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat-box { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 16px; text-align: center; }
.stat-box .num { font-size: 24px; font-weight: 700; color: var(--color-text); }
.stat-box .label { font-size: 12px; color: var(--color-text-muted); margin-top: 4px; }

/* ---------- Alert ---------- */
.alert { padding: 12px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; }
.alert-error { background: var(--color-danger-soft); color: var(--color-danger); }
.alert-success { background: var(--color-success-soft); color: var(--color-success); }
.alert-info { background: var(--color-primary-soft); color: var(--color-primary-dark); }

/* ---------- List actions ---------- */
.campaign-row { display: flex; justify-content: space-between; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--color-border); }
.campaign-row:last-child { border-bottom: none; }
.campaign-row .name { font-weight: 700; font-size: 15px; }
.campaign-row .meta { font-size: 12px; color: var(--color-text-muted); margin-top: 4px; }
.row-actions { display: flex; gap: 8px; }

/* ---------- Mobile recipient page ---------- */
.mobile-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
}
.mobile-header {
  background: var(--color-primary-dark);
  color: #fff;
  padding: 28px 24px 24px;
  text-align: center;
}
.mobile-header .org { font-size: 13px; opacity: 0.85; margin-bottom: 6px; }
.mobile-header .title { font-size: 19px; font-weight: 700; }
.mobile-body { flex: 1; padding: 24px; max-width: 480px; margin: 0 auto; width: 100%; }

.info-box {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 18px;
}
.info-box .row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; }
.info-box .row .k { color: var(--color-text-muted); }
.info-box .row .v { font-weight: 600; text-align: right; }

.choice-buttons { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }

.status-icon { font-size: 40px; text-align: center; margin-bottom: 16px; }
.center-text { text-align: center; }

.deadline-note { font-size: 12px; color: var(--color-text-muted); text-align: center; margin-top: 16px; }
