@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap");

:root {
  --bg: #f3f6fb;
  --bg-strong: #eaf0f8;
  --ink: #0f172a;
  --muted: #5f6f87;
  --card: #ffffff;
  --surface: #f8fbff;
  --line: #d8e2f0;
  --line-strong: #c4d3e6;
  --primary: #0f7cf5;
  --primary-strong: #0a64cb;
  --danger: #cf3d5b;
  --danger-soft: #ffe9ee;
  --shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.06);
  --shadow-focus: 0 0 0 4px rgba(15, 124, 245, 0.18);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  color: var(--ink);
  background:
    radial-gradient(1400px 700px at -5% -20%, #d8e9ff 0%, transparent 65%),
    radial-gradient(900px 500px at 110% -15%, #e6fff7 0%, transparent 55%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-strong) 100%);
  font-family: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  letter-spacing: -0.01em;
}

.bg-shape {
  position: fixed;
  border-radius: 999px;
  z-index: 0;
  pointer-events: none;
  filter: blur(24px);
  opacity: 0.35;
}

.bg-shape--one {
  width: 280px;
  height: 280px;
  right: -100px;
  top: -90px;
  background: #b8d7ff;
}

.bg-shape--two {
  width: 320px;
  height: 320px;
  left: -110px;
  bottom: -120px;
  background: #bbf0e2;
}

.app-shell {
  position: relative;
  z-index: 1;
  max-width: 1220px;
  margin: 0 auto;
  padding: 22px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
}

.card--auth {
  max-width: 460px;
  margin: 8vh auto 0;
  padding: 26px;
}

.brand-logo {
  display: block;
  border-radius: 12px;
  object-fit: cover;
  border: 0;
  background: transparent;
  mix-blend-mode: multiply;
}

.brand-logo--login {
  width: 100%;
  margin-bottom: 14px;
}

.brand-logo--app {
  width: 112px;
  height: 112px;
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 20px;
}

.app-brand strong {
  display: block;
  font-size: 0.98rem;
  line-height: 1.3;
  letter-spacing: 0.02em;
}

.app-brand p {
  margin: 6px 0 0;
  font-size: 1rem;
  color: var(--muted);
}

#app-greeting {
  margin-top: 8px;
  font-size: 1.05rem;
  font-weight: 700;
  color: #13233f;
}

.app-meta {
  margin-top: 6px;
  font-size: 0.86rem !important;
  color: #6f84a4 !important;
}

.logout-btn {
  width: auto;
  margin-left: auto;
  min-width: 120px;
  align-self: center;
}

.tabs {
  margin-top: 12px;
  padding: 6px;
  display: flex;
  gap: 8px;
  background: #f0f5fc;
}

.tab {
  width: auto;
  min-width: 160px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
}

.tab.active {
  border-color: #d1dded;
  background: #ffffff;
  color: #13233f;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.panel {
  margin-top: 12px;
  padding: 18px;
}

h1,
h2,
h3 {
  margin: 0 0 8px;
  line-height: 1.2;
}

h1 {
  font-size: 1.7rem;
}

h2 {
  font-size: 1.35rem;
}

h3 {
  font-size: 1.02rem;
}

p {
  margin: 0 0 16px;
  color: var(--muted);
}

label {
  display: block;
  margin-bottom: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #1e2a3e;
}

fieldset {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

legend {
  padding: 0 6px;
  color: var(--muted);
  font-weight: 600;
}

input,
select,
textarea,
button {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line);
  font-family: inherit;
  font-size: 0.95rem;
}

input,
select,
textarea {
  margin-top: 6px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #7cb5ff;
  box-shadow: var(--shadow-focus);
}

input::placeholder,
textarea::placeholder {
  color: #8fa2c0;
}

button {
  cursor: pointer;
  border: 1px solid transparent;
  padding: 11px 12px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-strong) 100%);
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(15, 124, 245, 0.25);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(0.35);
  transform: none;
  box-shadow: none;
}

.button-secondary {
  background: #eef4fc;
  color: #12335d;
  border-color: #d5e2f2;
}

.button-secondary:hover {
  box-shadow: 0 6px 14px rgba(18, 51, 93, 0.12);
}

.button-danger {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: #ffd0da;
}

.button-danger:hover {
  box-shadow: 0 6px 14px rgba(207, 61, 91, 0.15);
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.weekday-picker {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.weekday-picker label {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.weekday-picker input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.weekday-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

.weekday-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 8px 10px;
  background: #f6f9fe;
  border: 1px solid #dce7f5;
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 600;
  color: #30435f;
}

.settings-block {
  margin: 16px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfdff;
}

.settings-block--advanced {
  border-style: dashed;
}

.block-desc {
  margin-bottom: 14px;
  color: #667a98;
  font-size: 0.86rem;
}

.advanced-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.button-link {
  background: transparent;
  color: var(--primary);
  border: 0;
  width: auto;
  padding: 0;
  font-weight: 700;
}

.help-text {
  margin: 14px 0 0;
  color: #7388a8;
  font-size: 0.78rem;
}

.actions {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.actions.two {
  grid-template-columns: repeat(2, 1fr);
}

.actions.three {
  grid-template-columns: repeat(3, 1fr);
}

.schedule-summary {
  margin-top: 10px;
  padding: 11px 12px;
  border: 1px solid #d9e6f7;
  border-radius: 10px;
  background: #f3f8ff;
  display: grid;
  gap: 3px;
  color: #2a4266;
  font-size: 0.86rem;
}

.auto-generate-row {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #223856;
}

.auto-generate-row input {
  width: 17px;
  height: 17px;
  margin: 0;
}

.keyword-groups {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.groups-list {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.group-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #ffffff;
}

.group-item.active {
  border-color: #7db7ff;
  box-shadow: 0 0 0 3px rgba(15, 124, 245, 0.12);
}

.group-item h4 {
  margin: 0 0 6px;
}

.group-actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.group-actions button {
  width: auto;
  padding: 8px 12px;
}

.layout {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 14px;
}

.card--list,
.card--detail {
  min-height: 72vh;
  padding: 16px;
}

.list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.list-actions {
  display: flex;
  gap: 8px;
}

.list-tip {
  margin: 8px 0 0;
  font-size: 0.8rem;
  color: #7286a4;
}

#post-list {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.post-item {
  border: 1px solid #d7e3f4;
  border-radius: 12px;
  padding: 12px;
  background: #fbfdff;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.post-item:hover {
  border-color: #b9cde8;
}

.post-item.active {
  border-color: #74b2ff;
  box-shadow: 0 0 0 3px rgba(15, 124, 245, 0.12);
}

.post-item strong {
  display: block;
  margin-bottom: 6px;
  line-height: 1.25;
  font-size: 1rem;
}

.meta {
  font-size: 0.78rem;
  color: #6f84a4;
}

.empty-state {
  height: 100%;
  display: grid;
  place-items: center;
  color: #7b8da8;
}

.hidden {
  display: none !important;
}

.dashboard-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.dashboard-filters {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.dashboard-filters select,
.dashboard-filters input {
  width: auto;
  min-width: 150px;
  margin: 0;
}

.dashboard-filters button {
  width: auto;
  min-width: 100px;
}

.dash-cards {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.dash-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #fbfdff;
  display: grid;
  gap: 6px;
}

.dash-card span {
  font-size: 0.8rem;
  color: #6b7f9f;
}

.dash-card strong {
  font-size: 1.35rem;
  color: #102443;
}

.dashboard-note {
  margin-top: 10px;
  color: #6f84a4;
  font-size: 0.82rem;
}

.dash-table-wrap {
  margin-top: 12px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.dash-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.dash-table th,
.dash-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid #e6edf7;
  font-size: 0.88rem;
}

.dash-table th {
  background: #f6f9fe;
  color: #30435f;
}

.dash-table tr:last-child td {
  border-bottom: 0;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #13243f;
  color: #f5f9ff;
  box-shadow: 0 10px 24px rgba(7, 16, 30, 0.24);
}

.app-footer {
  margin: 14px 2px 0;
  padding: 10px 6px 4px;
  border-top: 1px solid #d8e2f0;
  color: #6f84a4;
  text-align: center;
}

.app-footer p {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.45;
}

@media (max-width: 980px) {
  .settings-grid,
  .layout {
    grid-template-columns: 1fr;
  }

  .card--list,
  .card--detail {
    min-height: auto;
  }

  .weekday-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .dash-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .brand-logo--app {
    width: 84px;
    height: 84px;
  }

  .app-brand strong {
    font-size: 1.15rem;
  }

  .app-brand p {
    font-size: 0.9rem;
  }
}
