:root {
  --bg: #faf8f5;
  --surface: #ffffff;
  --border: #e8e2da;
  --text: #2b2420;
  --text-soft: #6b6258;
  --accent: #7a2e3d;
  --accent-hover: #5e2230;
  --accent-soft: #f3e6e9;
  --success: #2f7a4f;
  --success-soft: #e6f2ea;
  --warning: #b8762b;
  --warning-soft: #f7ecdd;
  --danger: #b8392f;
  --danger-soft: #f9e6e4;
  --info: #4a6fa5;
  --info-soft: #e8eef6;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(43, 36, 32, 0.06), 0 4px 12px rgba(43, 36, 32, 0.04);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  font-family: "Outfit", "Inter", sans-serif;
  font-weight: 600;
  margin: 0 0 0.4em;
  color: var(--text);
}

h1 {
  font-size: 1.7rem;
  letter-spacing: -0.01em;
}

h2 {
  font-size: 1.25rem;
}

h3 {
  font-size: 1.02rem;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

p {
  color: var(--text-soft);
}

/* Layout */

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "Outfit", sans-serif;
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text);
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), #a0455a);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 0.85rem;
  font-family: "Outfit", sans-serif;
}

.nav-links {
  display: flex;
  gap: 4px;
  align-items: center;
}

.nav-links a {
  color: var(--text-soft);
  font-size: 0.92rem;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 8px;
}

.nav-links a:hover {
  background: var(--accent-soft);
  color: var(--accent);
  text-decoration: none;
}

.nav-links a.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.nav-right span {
  color: var(--text-soft);
  font-size: 0.88rem;
}

.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.page-header p {
  margin: 4px 0 0;
}

/* Cards */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 20px;
}

.card-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}

.stat-card .stat-value {
  font-family: "Outfit", sans-serif;
  font-size: 1.7rem;
  font-weight: 600;
  color: var(--accent);
}

.stat-card .stat-label {
  font-size: 0.82rem;
  color: var(--text-soft);
  margin-top: 2px;
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 9px 16px;
  font-size: 0.9rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  background: var(--accent);
  color: white;
  text-decoration: none;
  transition: background 0.15s ease;
}

.btn:hover {
  background: var(--accent-hover);
  text-decoration: none;
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: var(--bg);
}

.btn-danger {
  background: var(--surface);
  color: var(--danger);
  border-color: var(--danger-soft);
}

.btn-danger:hover {
  background: var(--danger-soft);
}

.btn-sm {
  padding: 6px 11px;
  font-size: 0.81rem;
}

.btn-block {
  width: 100%;
  justify-content: center;
}

/* Forms */

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 5px;
}

.field {
  margin-bottom: 16px;
}

.field-hint {
  font-size: 0.78rem;
  color: var(--text-soft);
  margin-top: 4px;
}

input[type="text"],
input[type="password"],
input[type="datetime-local"],
input[type="file"],
select,
textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.92rem;
  color: var(--text);
  background: var(--surface);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

textarea {
  resize: vertical;
  min-height: 90px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 640px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* Badges */

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-scheduled {
  background: var(--warning-soft);
  color: var(--warning);
}

.badge-publishing {
  background: var(--info-soft);
  color: var(--info);
}

.badge-published {
  background: var(--success-soft);
  color: var(--success);
}

.badge-failed {
  background: var(--danger-soft);
  color: var(--danger);
}

.badge-platform {
  background: var(--bg);
  color: var(--text-soft);
  border: 1px solid var(--border);
}

/* Lists */

.list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.list-item:last-child {
  border-bottom: none;
}

.list-thumb {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--bg);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.list-main {
  flex: 1;
  min-width: 0;
}

.list-main .list-title {
  font-weight: 500;
  font-size: 0.92rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-main .list-sub {
  font-size: 0.8rem;
  color: var(--text-soft);
  margin-top: 2px;
}

.list-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-soft);
}

.empty-state .empty-icon {
  font-size: 1.8rem;
  margin-bottom: 8px;
}

/* Alerts */

.alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.88rem;
  margin-bottom: 18px;
}

.alert-success {
  background: var(--success-soft);
  color: var(--success);
}

.alert-error {
  background: var(--danger-soft);
  color: var(--danger);
}

/* Login page */

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}

.login-card {
  width: 100%;
  max-width: 360px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
}

.login-card .brand-mark {
  display: flex;
  margin: 0 auto 16px;
}

.login-card h1 {
  text-align: center;
  font-size: 1.3rem;
}

.login-card .login-sub {
  text-align: center;
  margin-bottom: 22px;
  font-size: 0.88rem;
}

.client-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.client-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: block;
  color: var(--text);
}

.client-card:hover {
  border-color: var(--accent);
  text-decoration: none;
}

.client-card .client-name {
  font-weight: 600;
  font-family: "Outfit", sans-serif;
  margin-bottom: 4px;
}

.client-card .client-meta {
  font-size: 0.8rem;
  color: var(--text-soft);
}

.tag-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.filter-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.filter-tabs a {
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 0.83rem;
  font-weight: 500;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-soft);
}

.filter-tabs a.active {
  background: var(--text);
  color: white;
  border-color: var(--text);
}

.section-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 26px 0;
}
