:root {
  --bg: #f6f7f8;
  --card: #ffffff;
  --line: #dfe3e6;
  --text: #1f2933;
  --muted: #667085;
  --accent: #263238;
  --accent2: #eef2f4;
  --danger: #b42318;
  --plus: #087443;
  --minus: #b42318;
  --soon: #fff7e6;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
}

a { color: #175cd3; text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 12px 18px;
  background: #111827;
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand a {
  color: #fff;
  font-weight: 700;
  font-size: 16px;
}

.topbar nav {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.topbar nav a {
  color: #e5e7eb;
}

.topbar .user {
  margin-left: auto;
  color: #cbd5e1;
  font-size: 13px;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 22px 16px 50px;
}

h1 {
  font-size: 24px;
  margin: 0 0 18px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}

.narrow {
  max-width: 420px;
}

label {
  display: block;
  font-weight: 600;
  color: #344054;
}

input, select, textarea, button {
  width: 100%;
  margin-top: 6px;
  padding: 10px 11px;
  border: 1px solid #cfd6dc;
  border-radius: 8px;
  font: inherit;
  background: #fff;
}

button, .button {
  display: inline-block;
  width: auto;
  border: 0;
  background: var(--accent);
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
}

button:hover, .button:hover { opacity: .9; text-decoration: none; }

.button.secondary {
  background: #e5e7eb;
  color: #111827;
}

.actions {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.filter {
  display: flex;
  gap: 10px;
  align-items: end;
  margin: 0 0 14px;
  flex-wrap: wrap;
}

.filter input,
.filter select {
  min-width: 180px;
}

.table-wrap {
  overflow-x: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}

th, td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  background: #f2f4f7;
  text-align: left;
  font-size: 12px;
  color: #475467;
  white-space: nowrap;
}

tr.soon td {
  background: var(--soon);
}

.title {
  font-weight: 700;
  margin-bottom: 4px;
  min-width: 240px;
}

.badge {
  display: inline-block;
  background: #eef2f4;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
}

.profit-plus { color: var(--plus); font-weight: 700; }
.profit-minus { color: var(--minus); font-weight: 700; }
.danger { color: var(--danger); margin-left: 8px; }

.errors {
  background: #fef3f2;
  color: #b42318;
  border: 1px solid #fecdca;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 14px;
}

.success {
  background: #ecfdf3;
  border-color: #abefc6;
}

.grid-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 14px;
}

.grid-form .wide {
  grid-column: 1 / -1;
}

@media (max-width: 760px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    position: static;
  }
  .topbar .user {
    margin-left: 0;
  }
  .container {
    padding: 16px 10px 40px;
  }
  h1 {
    font-size: 20px;
  }
  .grid-form {
    grid-template-columns: 1fr;
  }
  .filter {
    display: block;
  }
  .filter input, .filter select, .filter button {
    width: 100%;
    margin-bottom: 8px;
  }
}
