:root {
  --ink: #26221e;
  --muted: #7a746d;
  --line: #e6e1d9;
  --bg: #faf8f4;
  --accent: #8a4b33;
  --danger: #a03020;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font: 14px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
}
a { color: var(--accent); text-decoration: none; }
.muted { color: var(--muted); }

.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 230px; flex: 0 0 230px;
  background: #2b2622; color: #f0ece6;
  padding: 18px 14px; display: flex; flex-direction: column; gap: 6px;
}
.brand { font-weight: 700; font-size: 17px; margin-bottom: 14px; letter-spacing: .3px; }
.menu-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 1px;
  color: #a89f94; margin: 10px 0 4px;
}
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar nav a {
  color: #e8e2da; padding: 7px 10px; border-radius: 6px;
  display: flex; justify-content: space-between; align-items: center;
}
.sidebar nav a:hover { background: #3a342e; }
.sidebar nav a.active { background: var(--accent); color: #fff; }
.count { background: rgba(255,255,255,.15); border-radius: 9px; padding: 0 7px; font-size: 12px; }
.new-niche { margin-top: 16px; display: flex; gap: 6px; }
.new-niche input {
  flex: 1; background: #3a342e; border: 1px solid #4a433c; color: #fff;
  border-radius: 6px; padding: 7px 8px; min-width: 0;
}
.new-niche button { background: var(--accent); color: #fff; border: 0; border-radius: 6px; padding: 7px 12px; cursor: pointer; }
.sidebar-footer { margin-top: auto; font-size: 13px; }
.sidebar-footer a { color: #a89f94; }

.content { flex: 1; padding: 26px 32px; max-width: 1100px; }
.page-head h1 { margin: 0 0 2px; font-size: 22px; }
.stats { color: var(--muted); font-size: 13px; margin-bottom: 14px; }

.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin: 14px 0 18px; }
.tab {
  padding: 8px 16px; border: 1px solid transparent; border-bottom: 0;
  border-radius: 8px 8px 0 0; color: var(--muted);
}
.tab.active { background: #fff; border-color: var(--line); color: var(--ink); font-weight: 600; }

.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.search input { padding: 7px 10px; border: 1px solid var(--line); border-radius: 6px; min-width: 240px; }
button, .btn {
  padding: 7px 12px; border: 1px solid var(--line); background: #fff;
  border-radius: 6px; cursor: pointer; font-size: 13px; color: var(--ink);
}
button:hover, .btn:hover { border-color: var(--accent); color: var(--accent); }
button.danger, .btn.danger { color: var(--danger); border-color: #e5c9c4; }
.inline { display: inline; }

table {
  width: 100%; border-collapse: collapse; background: #fff;
  border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
}
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); font-size: 13px; vertical-align: middle; }
th {
  background: #f4f0e9; font-size: 12px; text-transform: uppercase;
  letter-spacing: .5px; color: var(--muted);
}
tr:last-child td { border-bottom: 0; }
.empty { text-align: center; color: var(--muted); padding: 26px; }
.actions form { display: inline; }

.seq-card { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 16px; margin-bottom: 14px; }
.seq-row { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.seq-row input[type=number] { width: 64px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; }
.seq-row .pos-input { width: 56px; }
.pos-label { font-weight: 600; color: var(--muted); }
.chk { display: inline-flex; gap: 5px; align-items: center; }
.subject { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; margin-bottom: 8px; font-weight: 600; }
textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; font: 13px/1.5 inherit; }
.seq-actions { display: flex; gap: 8px; margin-top: 10px; }
.seq-card h3 { margin: 0 0 10px; font-size: 15px; }

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); }
.login-card {
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 28px; width: 320px;
}
.login-card h1 { margin: 0 0 16px; font-size: 20px; }
.login-card input { width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 6px; margin-bottom: 10px; }
.login-card button { width: 100%; background: var(--accent); color: #fff; border: 0; padding: 10px; border-radius: 6px; cursor: pointer; }
.error { color: var(--danger); font-size: 13px; margin-bottom: 10px; }

.card { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 16px; margin-bottom: 18px; }
.card h3 { margin: 0 0 12px; font-size: 15px; }
.card table { margin-top: 10px; }
.chip {
  display: inline-block; background: var(--accent); color: #fff;
  border-radius: 9px; padding: 1px 8px; font-size: 11px; margin-right: 4px;
}
.row-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row-form input { padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; }

