:root {
  color-scheme: dark;
  font-family: "Segoe UI", Arial, sans-serif;
  background: #080d18;
  color: #e8eefb;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --surface: #111a2b;
  --surface-raised: #162238;
  --border: #263750;
  --muted: #98a9c2;
  --blue: #4c8dff;
  --blue-bright: #67a3ff;
  --danger: #ff647c;
}

* { box-sizing: border-box; }

body {
  min-height: 100vh;
  margin: 0;
  padding: 24px;
  background:
    radial-gradient(ellipse at 15% 12%, rgb(30 87 170 / 20%), transparent 40%),
    radial-gradient(ellipse at 88% 85%, rgb(22 110 160 / 12%), transparent 36%),
    #080d18;
  color: #e8eefb;
  font-family: "Segoe UI", Arial, sans-serif;
}

body.centered-page {
  display: grid;
  place-items: center;
}

main {
  width: min(100%, 520px);
  padding: 44px;
  background: linear-gradient(145deg, rgb(19 29 47 / 97%), rgb(13 21 35 / 98%));
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 26px 80px rgb(0 0 0 / 42%), inset 0 1px 0 rgb(255 255 255 / 3%);
}

.page-login main { width: min(100%, 430px); }
.page-welcome main { text-align: center; }
.page-manage main { width: min(100%, 960px); margin: 28px auto; padding: 38px; }

h1, h2 { color: #f4f7ff; letter-spacing: -0.035em; }
h1 { margin: 0 0 10px; font-size: clamp(1.75rem, 4vw, 2.2rem); }
h2 { margin: 30px 0 14px; font-size: 1.2rem; }

p { color: var(--muted); line-height: 1.6; }
.intro { margin: 0 0 28px; }
.admin-note { color: var(--muted); font-size: 0.9rem; }

a {
  color: var(--blue-bright);
  text-decoration: none;
}
a:hover { color: #a3c6ff; text-decoration: underline; }

label {
  display: block;
  margin: 18px 0 7px;
  color: #dce7f8;
  font-size: 0.94rem;
  font-weight: 600;
}

input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #30435f;
  border-radius: 9px;
  outline: none;
  background: #0b1322;
  color: #f0f5ff;
  font: inherit;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}
input::placeholder { color: #71829c; }
input:focus {
  border-color: var(--blue);
  background: #0d1729;
  box-shadow: 0 0 0 3px rgb(76 141 255 / 18%);
}

button {
  padding: 11px 17px;
  border: 1px solid rgb(137 184 255 / 24%);
  border-radius: 9px;
  background: linear-gradient(135deg, #3478ed, #245bc4);
  box-shadow: 0 7px 20px rgb(31 98 212 / 23%);
  color: #fff;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  transition: transform 150ms ease, filter 150ms ease, box-shadow 150ms ease;
}
button:hover {
  transform: translateY(-1px);
  filter: brightness(1.12);
  box-shadow: 0 10px 25px rgb(31 98 212 / 32%);
}
button:focus-visible, a:focus-visible {
  outline: 3px solid rgb(103 163 255 / 70%);
  outline-offset: 3px;
}
.page-login button { width: 100%; margin-top: 25px; }
.page-welcome button { margin-top: 18px; }
button.delete {
  border-color: rgb(255 100 124 / 26%);
  background: linear-gradient(135deg, #a7354a, #78283c);
  box-shadow: 0 7px 18px rgb(139 36 57 / 20%);
}

.error, .message {
  padding: 12px 14px;
  border: 1px solid rgb(255 100 124 / 28%);
  border-radius: 9px;
  background: rgb(114 30 49 / 24%);
  color: #ffb0bd;
}
.page-login .error { margin: 0 0 18px; }
.success {
  border-color: rgb(61 205 151 / 28%);
  background: rgb(20 105 76 / 23%);
  color: #9aebc9;
}

.create-form, .user-row {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgb(14 23 38 / 75%);
}
.create-form { box-shadow: inset 0 1px 0 rgb(255 255 255 / 2%); }
.create-form .admin-note { margin: 14px 0 2px; }
.user-list { display: grid; gap: 14px; margin-top: 18px; }
.user-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: end;
}
.user-row form:first-child {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}
.user-row form:first-child label { margin-top: 0; }
.user-row form:first-child button { grid-column: 1 / -1; justify-self: start; }
.user-row > form:last-of-type button { white-space: nowrap; }

.page-dashboard {
  min-height: 100vh;
  padding: 0;
}
.dashboard-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  grid-template-rows: 76px minmax(0, 1fr);
  width: 100%;
  min-height: 100vh;
}
.dashboard-sidebar {
  display: flex;
  grid-column: 1;
  grid-row: 1 / span 2;
  flex-direction: column;
  padding: 28px 18px;
  border-right: 1px solid rgb(150 174 210 / 12%);
  background: rgb(9 15 27 / 88%);
}
.brand {
  margin: 0 12px 42px;
  color: #f4f7ff;
  font-size: 1.25rem;
  font-weight: 750;
  letter-spacing: -0.04em;
}
.brand:hover { color: #fff; text-decoration: none; }
.sidebar-label {
  margin: 0 12px 10px;
  color: #71829c;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.future-label { margin-top: 32px; }
.sidebar-nav { display: grid; gap: 5px; }
.nav-link {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: 9px;
  color: #aab9d0;
  font-size: 0.92rem;
}
.nav-link:hover {
  background: rgb(117 153 205 / 9%);
  color: #f4f7ff;
  text-decoration: none;
}
.nav-link.active {
  background: rgb(76 141 255 / 15%);
  color: #9cc3ff;
  font-weight: 650;
}
.nav-icon {
  width: 18px;
  color: #8195b3;
  font-size: 1.15rem;
  text-align: center;
}
.future-link { gap: 9px; font-size: 0.86rem; }
.project-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #70c6a3;
  box-shadow: 0 0 12px rgb(112 198 163 / 35%);
}
.project-dot-muted { background: #8195b3; box-shadow: none; }
.soon-label {
  margin-left: auto;
  color: #7889a3;
  font-size: 0.7rem;
}
.sidebar-footer { margin-top: auto; padding-top: 24px; }
.dashboard-content {
  display: flex;
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
  flex-direction: column;
}
.dashboard-header {
  display: flex;
  grid-column: 2;
  grid-row: 1;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px clamp(22px, 5vw, 64px);
  border-bottom: 1px solid rgb(150 174 210 / 12%);
  background: rgb(8 13 24 / 40%);
}
.header-context { color: #8fa1bb; font-size: 0.88rem; }
.account-area { display: flex; align-items: center; gap: 11px; }
.account-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgb(103 163 255 / 34%);
  border-radius: 50%;
  background: rgb(76 141 255 / 17%);
  color: #a8cbff;
  font-size: 0.88rem;
  font-weight: 700;
}
.account-name { color: #e2eaf8; font-size: 0.9rem; font-weight: 600; }
.account-area form { margin-left: 8px; }
.logout-button {
  padding: 8px 12px;
  border-color: var(--border);
  background: var(--surface-raised);
  box-shadow: none;
  color: #d0d9e8;
  font-size: 0.82rem;
}
.logout-button:hover { box-shadow: none; }
.dashboard-main {
  flex: 1;
  width: min(100%, 1120px);
  margin: 0 auto;
  padding: clamp(38px, 7vw, 82px) clamp(22px, 5vw, 64px);
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
}
.dashboard-intro { margin-bottom: 58px; }
.dashboard-intro h1 { margin-bottom: 8px; }
.dashboard-intro > p:last-child { margin: 0; }
.eyebrow {
  margin: 0 0 12px;
  color: #81aef1;
  font-size: 0.73rem;
  font-weight: 750;
  letter-spacing: 0.12em;
}
.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 19px;
}
.section-heading h2 { margin: 0; font-size: 1.45rem; }
.coming-soon-badge {
  padding: 6px 10px;
  border: 1px solid rgb(140 158 187 / 20%);
  border-radius: 20px;
  color: #9aaac0;
  font-size: 0.75rem;
}
.project-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.project-card {
  display: block;
  min-height: 190px;
  padding: 23px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(145deg, rgb(19 29 47 / 90%), rgb(13 21 35 / 94%));
  color: inherit;
}
a.project-card:hover {
  border-color: rgb(103 163 255 / 48%);
  color: inherit;
  text-decoration: none;
  transform: translateY(-2px);
}
.project-card-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 10px;
  background: rgb(76 141 255 / 13%);
  color: #83b2ff;
  font-size: 1.35rem;
}
.project-card-icon-muted { background: rgb(141 158 187 / 10%); color: #a2b1c8; }
.project-card h3 { margin: 19px 0 5px; color: #e7eefb; font-size: 1rem; }
.project-card p { margin: 0; font-size: 0.88rem; }

@media (max-width: 650px) {
  body { padding: 12px; }
  body.centered-page { padding: 16px; }
  main, .page-manage main { padding: 26px 18px; }
  .user-row, .user-row form:first-child { grid-template-columns: 1fr; }
  .user-row form:first-child button { grid-column: auto; justify-self: stretch; }
  .user-row > form:last-of-type button { width: 100%; }
  .user-row form:first-child input,
  .create-form input { min-width: 0; }
  .page-manage h2 { margin-top: 24px; }

  .page-dashboard { padding: 0; }
  .dashboard-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto minmax(0, 1fr);
  }
  .dashboard-header { grid-column: 1; grid-row: 1; }
  .dashboard-sidebar { display: none; }
  .dashboard-header { min-height: 64px; padding: 12px 16px; }
  .header-context { display: none; }
  .account-area { margin-left: auto; }
  .account-name { max-width: 125px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .dashboard-main { padding: 38px 18px; }
  .dashboard-content { grid-column: 1; grid-row: 3; }
  .dashboard-intro { margin-bottom: 42px; }
  .dashboard-intro h1 { overflow-wrap: anywhere; }
  .section-heading { align-items: flex-start; }
  .project-cards { grid-template-columns: 1fr; }
  .project-card { min-height: 165px; }
  .create-form, .user-row { padding: 16px; }
  .page-login button, .page-welcome button { min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}
