:root {
  color-scheme: dark;
  --bg: #0d1015;
  --panel: #151922;
  --panel-2: #1c2330;
  --stroke: #2a3342;
  --text: #f0f6fb;
  --muted: #9aa8b8;
  --accent: #36d399;
  --blue: #58a6ff;
  --bad: #ff6b7a;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-height: 100%; }
body {
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

.dashboard-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  grid-template-rows: 64px 1fr;
  height: 100vh;
}
.dash-topbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
  border-bottom: 1px solid var(--stroke);
  background: rgba(14,17,23,.9);
  backdrop-filter: blur(16px);
}
.dash-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 190px;
  font-weight: 850;
}
.logo-mark {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background:
    radial-gradient(circle at 6px 6px, #0d1015 0 2px, transparent 2px),
    radial-gradient(circle at 16px 16px, #0d1015 0 2px, transparent 2px),
    linear-gradient(135deg, var(--accent), var(--blue));
}
.search-box {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 1;
  max-width: 620px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  background: #10151d;
  color: var(--muted);
}
.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
}
.primary-btn, .icon-btn, .avatar, .view-controls button, .side-nav button, .menu-popover button, dialog button {
  min-height: 34px;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  background: #202735;
}
.primary-btn {
  border-color: rgba(54,211,153,.5);
  background: linear-gradient(135deg, #2fc98f, #4f9eff);
  color: #071016;
  font-weight: 800;
  padding: 0 14px;
}
.icon-btn, .avatar { width: 36px; padding: 0; }
.avatar {
  border-radius: 50%;
  background: #27384e;
  font-weight: 800;
  overflow: hidden;
}
.avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.tier-badge {
  padding: 5px 10px;
  border: 1px solid rgba(54,211,153,.3);
  border-radius: 999px;
  color: #bdfbe5;
  background: rgba(54,211,153,.08);
}

.dash-sidebar {
  min-height: 0;
  padding: 16px;
  border-right: 1px solid var(--stroke);
  background: #11161e;
}
.side-nav {
  display: grid;
  gap: 6px;
}
.side-nav button {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 40px;
  padding: 0 10px;
  text-align: left;
  color: var(--muted);
}
.side-nav button.active {
  border-color: rgba(54,211,153,.35);
  background: #17372f;
  color: #eafff7;
}
.side-nav small {
  color: #687789;
}
.usage-card {
  margin-top: 20px;
  padding: 14px;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.02));
  color: var(--muted);
}
.usage-card strong {
  display: block;
  color: var(--text);
}
.usage-bar {
  height: 8px;
  margin: 14px 0;
  overflow: hidden;
  border-radius: 999px;
  background: #253042;
}
.usage-bar i {
  display: block;
  width: 28%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--blue));
}

.dash-main {
  min-width: 0;
  overflow: auto;
  padding: 26px clamp(20px, 4vw, 46px);
}
.welcome-band {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: 28px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 16px;
  background:
    radial-gradient(circle at 80% 20%, rgba(88,166,255,.18), transparent 28%),
    linear-gradient(135deg, rgba(255,255,255,.065), rgba(255,255,255,.02));
}
.eyebrow {
  margin: 0 0 8px;
  color: #8eeac8;
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .08em;
}
h1, h2, p { margin-top: 0; }
h1 {
  margin-bottom: 0;
  max-width: 720px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1;
}
.view-controls {
  display: flex;
  gap: 8px;
}
.view-controls button {
  padding: 0 12px;
  color: var(--muted);
}
.view-controls button.active {
  color: #eafff7;
  background: #17372f;
}
.project-section {
  margin-top: 28px;
}
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}
.section-title h2 { margin: 0; }
.section-title span { color: var(--muted); }
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}
.project-card {
  position: relative;
  display: grid;
  gap: 12px;
  min-height: 245px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.022));
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}
.project-card:hover {
  transform: translateY(-4px);
  border-color: rgba(54,211,153,.35);
  background: linear-gradient(180deg, rgba(54,211,153,.08), rgba(255,255,255,.025));
}
.thumb {
  position: relative;
  min-height: 118px;
  overflow: hidden;
  border-radius: 10px;
  background:
    linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px),
    #0f141c;
  background-size: 18px 18px;
}
.thumb::before {
  content: "";
  position: absolute;
  inset: 24px 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #137c59, #25b889);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.14);
  transform: rotate(-5deg);
}
.thumb::after {
  content: "";
  position: absolute;
  left: 42%;
  top: 44%;
  width: 78px;
  height: 5px;
  border-radius: 99px;
  background: #f2c14e;
  transform: rotate(18deg);
}
.project-card h3 {
  margin: 0;
  font-size: 17px;
}
.project-meta, .project-stats {
  color: var(--muted);
}
.project-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.project-stats span {
  padding: 4px 7px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 999px;
  background: rgba(255,255,255,.035);
}
.card-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}
.card-actions button, .card-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--stroke);
  border-radius: 7px;
  background: #202735;
}
.favorite {
  position: absolute;
  right: 18px;
  top: 18px;
  z-index: 1;
  color: #ffd66b;
}
.empty-state {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  min-height: 280px;
  border: 1px dashed rgba(255,255,255,.16);
  border-radius: 16px;
  color: var(--muted);
  text-align: center;
}

.menu-popover {
  position: fixed;
  top: 58px;
  right: 16px;
  z-index: 30;
  display: grid;
  gap: 5px;
  width: 240px;
  padding: 7px;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: #161b24;
  box-shadow: 0 20px 60px rgba(0,0,0,.36);
}
.menu-popover button {
  width: 100%;
  text-align: left;
  padding: 0 10px;
}
.account-summary {
  padding: 8px;
  border-bottom: 1px solid var(--stroke);
  color: var(--muted);
}
.account-summary strong {
  display: block;
  color: var(--text);
}
.account-summary img {
  width: 28px;
  height: 28px;
  margin-right: 8px;
  border-radius: 50%;
  vertical-align: middle;
}

.project-dialog {
  width: min(520px, calc(100vw - 28px));
  border: 1px solid var(--stroke);
  border-radius: 16px;
  background: #141922;
  color: var(--text);
  box-shadow: 0 30px 90px rgba(0,0,0,.48);
}
.project-dialog::backdrop {
  background: rgba(0,0,0,.56);
  backdrop-filter: blur(6px);
}
.dialog-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
}
.dialog-head h2 { margin: 0 0 12px; }
.form-field {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
  color: var(--muted);
}
.form-field input, .form-field select {
  width: 100%;
  height: 40px;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  background: #0f141c;
  padding: 0 10px;
}
.board-defaults {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}
.board-defaults span {
  padding: 5px 8px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 999px;
  color: var(--muted);
}
dialog menu {
  display: flex;
  justify-content: end;
  gap: 8px;
  padding: 0;
  margin: 20px 0 0;
}

@media (max-width: 860px) {
  body { overflow: auto; }
  .dashboard-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 1fr;
    min-height: 100vh;
  }
  .dash-topbar {
    flex-wrap: wrap;
    min-height: auto;
    padding-block: 12px;
  }
  .dash-brand { min-width: 0; }
  .search-box { order: 3; min-width: 100%; }
  .dash-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--stroke);
  }
  .side-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .welcome-band {
    align-items: start;
    flex-direction: column;
  }
}
