:root {
  --bg: #f4efe7;
  --panel: rgba(255, 255, 255, 0.84);
  --panel-strong: #ffffff;
  --border: rgba(17, 49, 61, 0.12);
  --text: #16333f;
  --muted: #647683;
  --accent: #d66853;
  --secondary: #245c73;
  --success: #2c7a62;
  --danger: #a94442;
  --shadow: 0 18px 48px rgba(17, 49, 61, 0.12);
  --radius: 24px;
  --font: "Segoe UI", "Helvetica Neue", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(214, 104, 83, 0.18), transparent 28%),
    radial-gradient(circle at right, rgba(36, 92, 115, 0.16), transparent 24%),
    var(--bg);
}

body {
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.auth-shell,
.app-shell,
.admin-page,
.error-page {
  min-height: 100vh;
}

.auth-shell {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
}

.auth-panel,
.sidebar,
.main-layout,
.admin-sidebar,
.admin-main,
.error-page {
  padding: 28px;
}

.brand-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: white;
  background:
    linear-gradient(145deg, rgba(17, 49, 61, 0.94), rgba(36, 92, 115, 0.88)),
    #11313d;
}

.brand-panel h1 {
  max-width: 12ch;
  margin: 0;
  font-size: clamp(2.7rem, 5vw, 4.8rem);
  line-height: 0.95;
}

.lede {
  max-width: 38ch;
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.78);
}

.brand-mark img,
.brand-inline img {
  width: 56px;
  height: 56px;
}

.brand-mark img {
  width: min(100%, 620px);
  height: auto;
  filter: drop-shadow(0 22px 44px rgba(10, 27, 34, 0.18));
}

.brand-inline {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
}

.brand-inline img {
  object-fit: cover;
  border-radius: 18px;
}

.form-brand {
  margin-bottom: 12px;
}

.form-brand img {
  width: 68px;
  height: 68px;
}

.form-panel,
.error-page {
  display: grid;
  place-items: center;
}

.card,
.panel,
.profile-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.card {
  width: min(100%, 480px);
  padding: 32px;
}

.panel {
  padding: 22px;
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  color: var(--muted);
}

.stack {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 8px;
}

.field input,
.field textarea,
.field select,
.search-shell input,
.quick-add input,
.inline-form input,
.mobile-topbar select,
.share-box select {
  width: 100%;
  border: 1px solid rgba(17, 49, 61, 0.12);
  border-radius: 16px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
}

.password-input {
  position: relative;
}

.password-input input {
  padding-right: 52px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  transform: translateY(-50%);
  display: inline-grid;
  place-items: center;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.password-toggle:hover {
  background: rgba(17, 49, 61, 0.06);
  color: var(--text);
}

.password-toggle svg {
  width: 18px;
  height: 18px;
}

.btn {
  border: 0;
  border-radius: 999px;
  padding: 13px 18px;
  cursor: pointer;
  transition: transform 0.16s ease, background 0.16s ease, opacity 0.16s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--accent);
  color: white;
}

.btn-secondary {
  background: rgba(36, 92, 115, 0.12);
  color: var(--secondary);
}

.btn-danger {
  background: rgba(169, 68, 66, 0.12);
  color: var(--danger);
}

.btn-block {
  width: 100%;
}

.alert {
  padding: 14px 16px;
  border-radius: 16px;
  margin-bottom: 16px;
}

.alert-error {
  background: rgba(169, 68, 66, 0.14);
  color: var(--danger);
}

.alert-success {
  background: rgba(44, 122, 98, 0.14);
  color: var(--success);
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 20px;
  padding: 20px;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 20px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 18px;
  height: calc(100vh - 40px);
  padding: 22px;
  background: rgba(17, 49, 61, 0.94);
  color: white;
}

.sidebar-top,
.sidebar-actions,
.panel-head,
.toolbar,
.hero-actions,
.row-actions,
.detail-head,
.detail-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-top,
.panel-head,
.toolbar,
.detail-head {
  justify-content: space-between;
}

.sidebar-actions {
  margin-left: auto;
}

.sidebar-top {
  align-items: center;
}

.icon-btn,
.ghost-link {
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 16px;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, opacity 0.18s ease;
}

.icon-btn {
  background: rgba(17, 49, 61, 0.08);
  color: var(--text);
}

.ghost-link,
.sidebar .icon-btn,
.sidebar .icon-btn.subtle {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.icon-btn.accent {
  background: var(--accent);
  color: #fff;
}

.icon-btn.danger {
  background: rgba(169, 68, 66, 0.14);
  color: var(--danger);
}

.icon-btn.large {
  width: 62px;
  height: 62px;
  border-radius: 20px;
}

.icon-btn svg,
.ghost-link svg {
  width: 20px;
  height: 20px;
}

.icon-btn:hover,
.ghost-link:hover {
  transform: translateY(-1px);
}

.icon-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.search-shell {
  position: relative;
  margin-top: -2px;
}

.search-shell input {
  padding-left: 42px;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.search-shell input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.search-icon {
  position: absolute;
  top: 50%;
  left: 14px;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.7);
  display: inline-grid;
  place-items: center;
}

.search-icon svg {
  width: 16px;
  height: 16px;
}

.list-nav {
  display: grid;
  gap: 10px;
  align-content: start;
  overflow-y: auto;
  min-height: 0;
  margin-top: -4px;
}

.list-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 14px;
  border: 0;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
  color: white;
  cursor: pointer;
}

.list-pill.is-active,
.list-pill:hover {
  background: rgba(255, 255, 255, 0.16);
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.list-pill-copy {
  display: grid;
  gap: 2px;
}

.list-pill-copy strong {
  line-height: 1.15;
}

.list-pill-copy small {
  color: rgba(255, 255, 255, 0.72);
}

.sidebar-logout {
  margin-top: auto;
}

.main-layout {
  display: grid;
  gap: 20px;
  min-width: 0;
  padding: 0;
}

.content-panel {
  display: grid;
  gap: 18px;
}

.mobile-topbar {
  display: none;
}

.hero-head {
  border-radius: 26px;
  background:
    linear-gradient(140deg, color-mix(in srgb, var(--list-color), white 72%), white),
    white;
}

.app-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  padding-left: 30px;
}

.hero-copy {
  min-width: 0;
  padding-left: 4px;
}

.hero-copy h1 {
  margin: 0 0 8px;
  font-size: clamp(1.7rem, 2vw, 2.4rem);
  line-height: 1;
}

.hero-copy p {
  margin: 0;
  color: var(--muted);
}

.share-status {
  margin-top: 12px;
}

.share-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(17, 49, 61, 0.08);
  color: var(--text);
  font-size: 0.88rem;
}

.share-badge.share-on {
  background: rgba(36, 92, 115, 0.12);
  color: var(--secondary);
}

.hero-actions {
  flex-wrap: wrap;
}

.toolbar {
  flex-wrap: wrap;
  align-items: flex-start;
  margin: 20px 0;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-chip {
  border: 0;
  border-radius: 999px;
  min-height: 42px;
  padding: 0 14px;
  background: rgba(17, 49, 61, 0.07);
  color: var(--text);
  cursor: pointer;
}

.filter-chip.is-active {
  background: var(--secondary);
  color: #fff;
}

.share-box {
  display: grid;
  grid-template-columns: minmax(280px, 360px) auto;
  gap: 10px;
  align-items: start;
  margin-left: auto;
}

.share-box select {
  min-height: 104px;
}

.share-panel {
  display: grid;
  gap: 8px;
}

.share-help {
  display: grid;
  gap: 2px;
}

.share-help strong {
  font-size: 0.92rem;
}

.share-help span {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.shared-users {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -4px 0 16px;
}

.shared-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(36, 92, 115, 0.1);
  color: var(--secondary);
  font-size: 0.88rem;
}

.quick-add {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.task-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 20px;
  align-items: start;
}

.task-list,
.subtask-list,
.notification-panel {
  display: grid;
  gap: 14px;
}

.task-card {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 18px;
  border: 1px solid rgba(17, 49, 61, 0.08);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.task-card:hover,
.task-card.is-selected {
  transform: translateY(-2px);
  box-shadow: 0 18px 32px rgba(17, 49, 61, 0.08);
}

.task-card.is-complete {
  opacity: 0.7;
}

.task-copy {
  min-width: 0;
}

.task-copy strong {
  display: block;
  line-height: 1.2;
  font-size: 1rem;
}

.task-copy p,
.notification-item p {
  margin: 6px 0 0;
  color: var(--muted);
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  font-size: 0.86rem;
  color: var(--muted);
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(17, 49, 61, 0.06);
}

.meta-pill svg {
  width: 14px;
  height: 14px;
}

.meta-pill i {
  font-style: normal;
}

.check {
  width: 34px;
  height: 34px;
  margin-top: 2px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid rgba(36, 92, 115, 0.3);
  background: white;
  display: grid;
  place-items: center;
}

.check span {
  display: grid;
  place-items: center;
}

.check.checked {
  background: var(--success);
  border-color: var(--success);
}

.check.checked span svg {
  width: 16px;
  height: 16px;
  color: white;
}

.detail-panel,
.notification-panel {
  align-content: start;
}

.detail-panel {
  position: sticky;
  top: 20px;
}

.detail-actions {
  margin-left: auto;
}

.subtask-section {
  display: grid;
  gap: 14px;
  margin-top: 14px;
  padding-top: 18px;
  border-top: 1px solid rgba(17, 49, 61, 0.08);
}

.subtask-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(17, 49, 61, 0.045);
  border: 1px solid rgba(17, 49, 61, 0.05);
}

.subtask-check {
  flex: 0 0 auto;
  margin-top: 0;
}

.subtask-title {
  flex: 1 1 auto;
  min-width: 0;
}

.subtask-delete-btn {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 12px;
}

.subtask-row.is-complete span {
  text-decoration: line-through;
  opacity: 0.6;
}

.inline-form,
.grid-form {
  display: grid;
  gap: 14px;
}

.inline-form {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.subtask-section .inline-form {
  margin-bottom: 4px;
}

.grid-form.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.notification-item {
  padding: 16px;
  border-radius: 20px;
  background: rgba(17, 49, 61, 0.05);
}

.notification-item.is-new {
  border-left: 4px solid var(--accent);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(9, 24, 30, 0.42);
  backdrop-filter: blur(6px);
}

.modal-card {
  width: min(100%, 440px);
  padding: 24px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(17, 49, 61, 0.08);
  box-shadow: 0 28px 80px rgba(17, 49, 61, 0.22);
}

.modal-card h2 {
  margin: 0 0 10px;
  line-height: 1.1;
}

.modal-copy {
  margin: 0;
  color: var(--muted);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.mobile-detail-backdrop {
  position: fixed;
  inset: 0;
  z-index: 950;
  display: none;
  align-items: start;
  padding: 0;
  background: rgba(9, 24, 30, 0.32);
  backdrop-filter: blur(4px);
}

.mobile-detail-sheet {
  width: 100%;
  max-height: 100vh;
  min-height: 100vh;
  overflow: auto;
  padding: 12px 12px 20px;
  border-radius: 0;
  background: rgba(244, 239, 231, 0.98);
  box-shadow: none;
}

.mobile-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.mobile-detail-head .eyebrow {
  margin: 0;
}

.admin-page {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
  padding: 20px;
}

.admin-sidebar {
  background: rgba(17, 49, 61, 0.94);
  color: white;
  border-radius: var(--radius);
}

.admin-main {
  display: grid;
  gap: 20px;
  padding: 0;
}

.table-wrap {
  overflow: auto;
}

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

.data-table th,
.data-table td {
  padding: 14px 10px;
  border-bottom: 1px solid rgba(17, 49, 61, 0.08);
  text-align: left;
}

.inline-select {
  padding: 8px 12px;
  border-radius: 12px;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.empty-state,
.empty-copy {
  display: grid;
  place-items: center;
  min-height: 220px;
  text-align: center;
  color: var(--muted);
}

.auth-points {
  list-style: none;
  padding: 0;
  margin: auto 0 0;
  display: grid;
  gap: 12px;
}

.auth-points li::before {
  content: "•";
  margin-right: 10px;
  color: #ffd1c8;
}

@media (max-width: 1180px) {
  .app-shell,
  .task-grid,
  .admin-page,
  .auth-shell {
    grid-template-columns: 1fr;
  }

  .sidebar,
  .detail-panel {
    position: static;
    height: auto;
  }

  .share-box {
    margin-left: 0;
  }
}

@media (max-width: 720px) {
  .app-shell,
  .admin-page,
  .auth-panel,
  .sidebar,
  .main-layout,
  .admin-sidebar,
  .admin-main {
    padding: 16px;
  }

  .panel,
  .card {
    padding: 18px;
  }

  .content-panel {
    gap: 12px;
  }

  .sidebar {
    display: none;
  }

  .mobile-topbar {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    margin-bottom: 12px;
  }

  .mobile-logout {
    background: rgba(17, 49, 61, 0.08);
    color: var(--text);
  }

  .app-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 10px;
    padding: 14px 14px 14px 18px;
  }

  .hero-actions {
    display: grid;
    grid-auto-flow: column;
    gap: 8px;
    justify-items: end;
  }

  .hero-actions #push-subscribe-btn,
  .hero-actions #install-btn {
    display: none;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
    margin: 0;
  }

  .share-box {
    grid-template-columns: 1fr auto;
    width: 100%;
  }

  .share-help span {
    display: none;
  }

  .share-box,
  .shared-users {
    display: none;
  }

  .hero-copy h1 {
    font-size: 1.65rem;
    margin-bottom: 0;
  }

  .hero-copy > p:not(.eyebrow),
  .share-status {
    display: none;
  }

  .hero-copy .eyebrow {
    margin-bottom: 4px;
  }

  .share-box select {
    min-height: 72px;
  }

  .shared-users {
    margin: 2px 0 12px;
  }

  .filter-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
  }

  .filter-chip {
    width: 100%;
    min-height: 40px;
    padding: 0 8px;
    font-size: 0.95rem;
  }

  .task-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .detail-panel,
  .notification-panel {
    display: none;
  }

  .mobile-detail-backdrop {
    display: flex;
  }

  .mobile-detail-sheet .detail-panel {
    display: grid;
    position: static;
  }

  .task-list {
    gap: 10px;
  }

  .task-copy p {
    display: none;
  }

  .task-card {
    padding: 14px 16px;
    border-radius: 18px;
  }

  .subtask-delete-btn {
    display: none;
  }

  .check {
    width: 32px;
    height: 32px;
  }

  .hero-actions .icon-btn,
  .share-box .icon-btn,
  .quick-add .icon-btn {
    width: 42px;
    height: 42px;
  }
}
