.auth-body {
  background:
    linear-gradient(135deg, rgba(46, 204, 113, 0.13), transparent 34%),
    var(--bg);
}

.auth-main {
  min-height: calc(100vh - 76px);
}

.auth-shell,
.dashboard-shell {
  width: min(100% - 32px, 1120px);
  margin: 0 auto;
  padding: 70px 0;
}

.auth-shell {
  display: grid;
  place-items: center;
}

.auth-card,
.dashboard-hero,
.dashboard-grid article,
.recent-card,
.profile-card {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-md);
}

.auth-card {
  width: min(100%, 520px);
  padding: clamp(24px, 5vw, 42px);
  animation: fadeUp 0.32s ease both;
}

.auth-card-wide {
  width: min(100%, 760px);
}

.auth-card h1,
.dashboard-hero h1,
.profile-card h1 {
  margin-bottom: 12px;
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 1.02;
}

.auth-lede,
.dashboard-hero p,
.recent-card p {
  color: var(--muted);
  line-height: 1.62;
}

.auth-form {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.auth-two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"] {
  width: 100%;
  min-height: 52px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
}

.field-error {
  display: block;
  min-height: 18px;
  margin-top: 6px;
  color: var(--red);
  font-size: 0.82rem;
  font-weight: 800;
}

.auth-row,
.check-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.check-row {
  justify-content: flex-start;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
}

.check-row input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--primary);
}

.auth-row a,
.auth-switch a {
  color: var(--primary);
  font-weight: 900;
}

.auth-button,
.nav-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #fff;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 14px 30px rgba(30, 130, 76, 0.22);
}

.auth-button {
  width: 100%;
}

.auth-button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.auth-link-button {
  margin-top: 10px;
}

.secondary-auth-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  box-shadow: none;
}

.danger-auth-button {
  background: var(--red);
}

.nav-logout {
  width: auto;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
}

.auth-message {
  margin: 20px 0 0;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  font-weight: 850;
  line-height: 1.45;
}

.auth-message-error {
  color: #7c2018;
  background: #fff0ee;
  border-color: #ffd1cc;
}

.auth-message-warning {
  color: #634100;
  background: #fff6db;
  border-color: #ffe2a3;
}

.auth-message-success {
  color: #0c4b2c;
  background: #e5f8ed;
  border-color: #bfe8cf;
}

.auth-switch {
  margin: 22px 0 0;
  color: var(--muted);
  text-align: center;
}

.success-card {
  text-align: center;
}

.success-icon {
  display: inline-grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: 18px;
  border-radius: 50%;
  background: #e5f8ed;
  color: var(--primary);
  font-size: 2rem;
  font-weight: 950;
}

.auth-highlight {
  display: inline-flex;
  margin: 0 0 16px;
  padding: 10px 14px;
  border-radius: 999px;
  background: #eef7f1;
  color: var(--ink);
  font-weight: 900;
}

.dashboard-shell {
  display: grid;
  gap: 24px;
}

.dashboard-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: clamp(24px, 5vw, 42px);
}

.dashboard-search {
  width: auto;
  min-width: 180px;
}

.hero-actions,
.section-heading-row,
.page-heading,
.card-title-row,
.pagination-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.hero-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.page-heading h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.05;
}

.compact-button {
  width: auto;
  min-height: 44px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

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

.dashboard-grid article,
.recent-card,
.profile-card {
  padding: 24px;
}

.dashboard-grid span {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 14px;
  border-radius: 14px;
  background: #e8f7ee;
  font-size: 1.25rem;
}

.dashboard-grid h2,
.recent-card h2 {
  margin-bottom: 8px;
  font-size: 1.15rem;
}

.dashboard-grid p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.dashboard-card-link {
  display: block;
  height: 100%;
}

.dashboard-card-link article {
  height: 100%;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.dashboard-card-link:hover article {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.card-body {
  display: grid;
  gap: 8px;
  margin: 12px 0 16px;
}

.card-body p,
.mini-row span,
.management-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.text-action {
  color: var(--primary);
  font-weight: 900;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.stat-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.stat-card strong {
  display: block;
  font-size: 1.9rem;
  line-height: 1;
}

.stat-card span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 850;
}

.dashboard-loading,
.dashboard-toast,
.empty-state {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--muted);
  font-weight: 850;
}

.dashboard-toast-success {
  color: #0c4b2c;
  background: #e5f8ed;
  border-color: #bfe8cf;
}

.dashboard-toast-error {
  color: #7c2018;
  background: #fff0ee;
  border-color: #ffd1cc;
}

.mini-list,
.management-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.mini-row,
.management-card,
.notification-preferences,
.planner-panel {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.mini-row {
  grid-template-columns: minmax(160px, 0.5fr) 1fr auto;
  align-items: center;
}

.management-card {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.management-card h2,
.profile-card h2 {
  margin: 0 0 8px;
  font-size: 1.2rem;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.row-actions a,
.row-actions button,
.pagination-row button {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-weight: 850;
}

.row-actions a:first-child {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.management-toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(160px, 220px) auto;
  gap: 12px;
}

.management-toolbar input,
.management-toolbar select,
.planner-panel input,
.planner-panel select,
.profile-form input {
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
}

.notification-preferences {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
}

.notification-preferences label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 850;
}

.notification-preferences input {
  min-height: 38px;
  accent-color: var(--primary);
}

.notification-preferences input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
}

.notification-preferences select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
}

.unread-card {
  border-color: #bfe8cf;
  background: #fbfffd;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #eef5f1;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 900;
}

.status-triggered {
  background: #fff6db;
  color: var(--amber);
}

.status-disabled {
  background: #f2f3f2;
  color: var(--muted);
}

.planner-panel {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.planner-panel label,
.profile-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 850;
}

.full-span {
  grid-column: 1 / -1;
}

.profile-card {
  max-width: 820px;
  margin: 0 auto;
}

.profile-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.75fr);
  gap: 18px;
  align-items: start;
}

.profile-layout .profile-card {
  width: 100%;
  max-width: none;
}

.profile-list {
  display: grid;
  gap: 12px;
  margin: 28px 0;
}

.profile-list div {
  display: grid;
  grid-template-columns: minmax(150px, 0.35fr) 1fr;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fbfdfc;
}

.profile-list dt {
  color: var(--muted);
  font-weight: 850;
}

.profile-list dd {
  margin: 0;
  font-weight: 900;
}

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

.stacked-actions {
  grid-template-columns: 1fr;
}

@media (max-width: 820px) {
  .auth-shell,
  .dashboard-shell {
    width: min(100% - 24px, 720px);
    padding: 44px 0;
  }

  .auth-two-col,
  .dashboard-grid,
  .profile-actions,
  .stat-grid,
  .management-toolbar,
  .notification-preferences,
  .planner-panel,
  .profile-layout,
  .mini-row,
  .management-card {
    grid-template-columns: 1fr;
  }

  .dashboard-hero,
  .page-heading,
  .section-heading-row {
    display: grid;
  }

  .dashboard-search,
  .compact-button {
    width: 100%;
  }

  .row-actions,
  .hero-actions {
    justify-content: stretch;
  }

  .row-actions a,
  .row-actions button {
    flex: 1 1 140px;
    text-align: center;
  }

  .profile-list div {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}
