:root {
  --bg: #eef3f8;
  --ink: #0c1524;
  --muted: #697586;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-solid: #ffffff;
  --line: rgba(26, 38, 58, 0.12);
  --nav: #08111f;
  --nav-2: #111d31;
  --blue: #2474e8;
  --cyan: #17a7b8;
  --green: #12a66a;
  --red: #d14b4b;
  --yellow: #f2b84b;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(36, 116, 232, 0.10), transparent 32%),
    linear-gradient(315deg, rgba(18, 166, 106, 0.10), transparent 34%),
    repeating-linear-gradient(90deg, rgba(12, 21, 36, 0.035) 0 1px, transparent 1px 72px),
    repeating-linear-gradient(0deg, rgba(12, 21, 36, 0.028) 0 1px, transparent 1px 72px),
    var(--bg);
  font-family: "Manrope", sans-serif;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px;
  background:
    linear-gradient(180deg, rgba(36, 116, 232, 0.18), transparent 34%),
    linear-gradient(135deg, var(--nav), var(--nav-2));
  color: #fff;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 900;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  box-shadow: 0 12px 24px rgba(36, 116, 232, 0.28);
}

.nav-list {
  display: grid;
  gap: 8px;
  margin-top: 34px;
}

.nav-list a {
  padding: 12px 13px;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.76);
  font-weight: 800;
  text-decoration: none;
}

.nav-list a:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
}

.main-area {
  width: min(1280px, 100%);
  padding: 30px;
}

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

.eyebrow {
  margin: 0 0 5px;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 2.1rem;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 14px;
  font-size: 1.18rem;
}

h3 {
  margin-bottom: 4px;
  font-size: 1.04rem;
}

.userbox,
.login-panel,
.panel,
.stat-card,
.channel-card,
.empty-panel {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.userbox {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border-radius: 12px;
}

.userbox img {
  width: 42px;
  height: 42px;
  border-radius: 10px;
}

.userbox strong,
.userbox span {
  display: block;
}

.userbox span,
.note,
.channel-head p,
.task-row span {
  color: var(--muted);
  font-size: 0.9rem;
}

.login-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: 820px;
  padding: 30px;
  border-radius: 16px;
}

.login-panel p {
  margin-bottom: 0;
  color: var(--muted);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.stat-card {
  position: relative;
  overflow: hidden;
  padding: 20px;
  border-radius: 16px;
}

.stat-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: linear-gradient(180deg, var(--blue), var(--green));
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.stat-card strong {
  font-size: 1.85rem;
}

.section-block,
.work-grid {
  margin-bottom: 24px;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.section-head.compact {
  margin-bottom: 2px;
}

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

.channel-card,
.empty-panel,
.panel {
  border-radius: 16px;
  padding: 18px;
}

.channel-card {
  position: relative;
  overflow: hidden;
}

.channel-card::after {
  content: "";
  position: absolute;
  inset: auto 18px 0 18px;
  height: 3px;
  border-radius: 999px 999px 0 0;
  background: linear-gradient(90deg, var(--blue), var(--cyan), var(--green));
}

.channel-head {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.channel-logo {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, #6441a5, var(--blue));
  font-weight: 900;
}

.platform,
.status,
.pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(36, 116, 232, 0.10);
  color: var(--blue);
  font-size: 0.76rem;
  font-weight: 900;
}

.status,
.pill {
  background: rgba(18, 166, 106, 0.10);
  color: var(--green);
}

.channel-metric {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 18px 0 8px;
}

.channel-metric strong {
  font-size: 1.7rem;
}

.channel-metric span {
  color: var(--muted);
}

.sync-note {
  margin: -2px 0 10px;
  color: var(--muted);
  font-size: 0.82rem;
}

.sync-note span {
  display: block;
  margin-top: 2px;
}

.sync-error {
  color: var(--red);
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.work-grid {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 14px;
}

.stack-form {
  display: grid;
  gap: 12px;
}

.stack-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(150px, 0.9fr) minmax(220px, 1.5fr) minmax(150px, 0.8fr) minmax(140px, 0.8fr) auto;
  gap: 10px;
  margin-bottom: 14px;
}

.task-form {
  grid-template-columns: minmax(260px, 1fr) 180px auto;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(36, 116, 232, 0.55);
  box-shadow: 0 0 0 4px rgba(36, 116, 232, 0.12);
}

textarea {
  resize: vertical;
}

.primary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 10px;
  border: 0;
  padding: 10px 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.primary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.ghost-button {
  border: 1px solid var(--line);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.78);
}

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

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

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

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

th {
  color: var(--muted);
  font-size: 0.86rem;
}

.empty-state,
.empty-list {
  color: var(--muted);
  text-align: center;
}

.task-list {
  display: grid;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.task-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.62);
}

.task-row strong,
.task-row span {
  display: block;
}

.narrow {
  max-width: 640px;
}

@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
  }

  .nav-list {
    display: flex;
    margin-top: 0;
  }

  .stats-grid,
  .channel-grid,
  .work-grid {
    grid-template-columns: 1fr 1fr;
  }

  .inline-form {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .main-area {
    padding: 18px;
  }

  .topbar,
  .login-panel,
  .task-row,
  .sidebar {
    align-items: stretch;
    flex-direction: column;
  }

  .stats-grid,
  .channel-grid,
  .work-grid,
  .inline-form,
  .task-form {
    grid-template-columns: 1fr;
  }

  .channel-head {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .channel-head .status {
    grid-column: 2;
  }

  .nav-list {
    width: 100%;
    overflow-x: auto;
  }

  .userbox {
    width: 100%;
  }
}
