:root {
  --bg: #f1f3f6;
  --panel: #ffffff;
  --ink: #101828;
  --muted: #64748b;
  --line: #cfd7e3;
  --primary: #3d5afe;
  --soft: #eef3ff;
  --danger: #b42318;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: Arial, "Segoe UI", Tahoma, sans-serif;
}

button,
input,
textarea,
select {
  font: inherit;
}

.app-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 180px;
  background: #0f0f10;
  color: #fff;
  padding: 14px 0;
}

.sidebar-brand {
  padding: 0 14px 14px;
  color: #fff;
  font-size: 16px;
  font-weight: 800;
}

.app-sidebar nav {
  display: grid;
  gap: 2px;
}

.app-sidebar a,
.menu-label {
  display: flex;
  min-height: 36px;
  align-items: center;
  padding: 0 14px;
  color: #c9c9d1;
  font-size: 14px;
  text-decoration: none;
}

.app-sidebar a.active {
  color: #fff;
  background: var(--primary);
  font-weight: 800;
}

.app-sidebar a.disabled {
  opacity: 0.45;
  pointer-events: none;
}

.menu-label {
  min-height: 28px;
  margin-top: 8px;
  color: #fff;
  font-weight: 800;
}

.page-shell {
  width: min(1480px, calc(100% - 180px));
  margin-left: 180px;
  padding: 18px;
}

.page-header,
.panel {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
}

.page-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
  padding: 18px 22px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 26px;
}

h2 {
  font-size: 18px;
}

p,
td {
  color: var(--muted);
  line-height: 1.6;
}

.primary-link,
.primary-btn,
.secondary-btn,
.panel-heading button,
.article-actions button {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 3px;
  color: var(--primary);
  background: var(--soft);
  padding: 0 14px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.primary-btn {
  color: #fff;
  background: var(--primary);
}

.secondary-btn {
  background: #fff;
}

.hidden {
  display: none;
}

.grid-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) 420px;
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}

.panel {
  padding: 20px;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
}

.article-list {
  display: grid;
  gap: 10px;
}

.article-item {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 12px;
}

.article-title {
  margin-bottom: 6px;
  font-weight: 800;
}

.article-meta {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
}

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

.publish-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 160px auto;
  gap: 8px;
  align-items: center;
  margin: 10px 0;
  border: 1px solid #e2e8f0;
  background: #f8fbff;
  padding: 10px;
}

.publish-row button {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 3px;
  color: #fff;
  background: var(--primary);
  padding: 0 14px;
  font-weight: 800;
  cursor: pointer;
}

.publish-row button:disabled,
.publish-row select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.publish-status {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 8px 0;
  color: #166534;
  font-size: 13px;
  font-weight: 800;
}

.publish-status a {
  color: var(--primary);
}

.site-form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  font-weight: 800;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid #9aa4b2;
  padding: 9px 12px;
}

input,
select {
  min-height: 40px;
}

textarea {
  resize: vertical;
}

.note {
  margin-top: 12px;
  font-size: 13px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--ink);
  font-size: 13px;
  text-transform: uppercase;
}

.danger {
  color: var(--danger);
}

.empty-box {
  border: 1px dashed var(--line);
  border-radius: 4px;
  padding: 16px;
  color: var(--muted);
  background: #fbfdff;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  max-width: min(360px, calc(100vw - 44px));
  border-radius: 4px;
  color: #fff;
  background: var(--ink);
  padding: 12px 14px;
  opacity: 0;
  transform: translateY(10px);
  transition: 180ms ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 900px) {
  .app-sidebar {
    position: static;
    width: 100%;
  }

  .app-sidebar nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .page-shell {
    width: 100%;
    margin-left: 0;
    padding: 10px;
  }

  .page-header,
  .grid-layout,
  .panel-heading,
  .publish-row {
    display: grid;
    grid-template-columns: 1fr;
  }
}
