﻿:root {
  --bg: #f4f0e8;
  --bg-accent: #efe1cf;
  --panel: rgba(255, 252, 246, 0.9);
  --panel-strong: #fff9f0;
  --line: rgba(85, 54, 27, 0.14);
  --text: #2d241f;
  --muted: #6f6257;
  --brand: #c35d3a;
  --brand-dark: #8f3f25;
  --success: #28684a;
  --warning: #ae7c12;
  --danger: #8f2f3a;
  --danger-dark: #6d1f28;
  --shadow: 0 24px 60px rgba(76, 46, 26, 0.16);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(195, 93, 58, 0.18), transparent 26rem),
    radial-gradient(circle at bottom right, rgba(143, 63, 37, 0.14), transparent 24rem),
    linear-gradient(160deg, #f8f2e8 0%, #f2e7d7 48%, #efe1cf 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.18) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: radial-gradient(circle at center, black 30%, transparent 95%);
  opacity: 0.35;
}

.login-body,
.dashboard-body {
  position: relative;
}

.login-shell,
.page-shell {
  position: relative;
  z-index: 1;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(100%, 520px);
  padding: 36px;
  border-radius: var(--radius-xl);
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.page-shell {
  max-width: 1320px;
  margin: 0 auto;
  padding: 28px 20px 40px;
}

.hero,
.panel,
.stat-card {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 28px;
  border-radius: var(--radius-xl);
  align-items: flex-start;
}

.hero h1,
.login-card h1,
.panel h2 {
  margin: 0;
  letter-spacing: -0.03em;
}

.hero h1,
.login-card h1 {
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 0.95;
}

.hero-copy,
.login-copy,
.current-user,
.meta-label,
.hint-box,
.flash,
.empty-state {
  color: var(--muted);
}

.hero-actions {
  display: grid;
  gap: 12px;
  justify-items: end;
}

.eyebrow {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  font-size: 0.73rem;
  color: var(--brand-dark);
}

.stats-grid,
.panel-grid,
.accounts-grid {
  display: grid;
  gap: 18px;
}

.stats-grid {
  margin-top: 18px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat-card {
  padding: 20px;
  border-radius: var(--radius-lg);
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 0.95rem;
}

.stat-card strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(2rem, 4vw, 2.8rem);
}

.panel-grid {
  margin-top: 18px;
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  align-items: start;
}

.panel {
  padding: 22px;
  border-radius: var(--radius-lg);
}

.panel-wide {
  min-height: 420px;
}

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

.counter-pill,
.reset-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 8px 14px;
  background: var(--bg-accent);
  border: 1px solid rgba(143, 63, 37, 0.12);
}

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

label {
  display: grid;
  gap: 8px;
  font-size: 0.96rem;
}

input {
  width: 100%;
  padding: 13px 14px;
  border-radius: 14px;
  border: 1px solid rgba(111, 98, 87, 0.22);
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
  font: inherit;
}

input:focus {
  outline: 2px solid rgba(195, 93, 58, 0.25);
  border-color: rgba(195, 93, 58, 0.42);
}

button {
  border: 0;
  border-radius: 999px;
  padding: 13px 18px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

button,
.secondary-button:hover:not(:disabled),
.ghost-button:hover:not(:disabled),
.danger-button:hover:not(:disabled) {
  box-shadow: 0 14px 30px rgba(143, 63, 37, 0.14);
}

button {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff8f2;
}

.secondary-button {
  background: #f8ede1;
  color: var(--brand-dark);
}

.ghost-button {
  background: rgba(255, 249, 240, 0.78);
  color: var(--text);
}

.danger-button {
  background: linear-gradient(135deg, var(--danger), var(--danger-dark));
  color: #fff6f7;
}

.flash {
  margin: 0;
  border-radius: 14px;
  padding: 12px 14px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.7);
}

.flash-inline {
  margin-top: 14px;
}

.flash-error {
  color: var(--danger);
  border-color: rgba(143, 47, 58, 0.16);
  background: rgba(255, 239, 240, 0.9);
}

.flash-success {
  color: var(--success);
  border-color: rgba(40, 104, 74, 0.16);
  background: rgba(239, 251, 244, 0.95);
}

.flash-info {
  color: var(--muted);
  border-color: rgba(85, 54, 27, 0.12);
}

.hint-box {
  margin-top: 18px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 248, 240, 0.7);
  border: 1px dashed rgba(111, 98, 87, 0.22);
}

.accounts-grid {
  grid-template-columns: minmax(0, 1fr);
}

.account-card {
  display: grid;
  gap: 18px;
  padding: 22px 24px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 250, 244, 0.98), rgba(248, 239, 227, 0.96));
  border: 1px solid rgba(85, 54, 27, 0.12);
  border-left: 8px solid transparent;
  box-shadow: 0 18px 34px rgba(76, 46, 26, 0.1);
}

.account-card.status-green {
  border-left-color: #2c8f5d;
  background: linear-gradient(180deg, rgba(245, 255, 249, 0.98), rgba(233, 248, 239, 0.96));
}

.account-card.status-yellow {
  border-left-color: #d3a323;
  background: linear-gradient(180deg, rgba(255, 251, 238, 0.98), rgba(250, 241, 214, 0.96));
}

.account-card.status-red {
  border-left-color: #bf4a57;
  background: linear-gradient(180deg, rgba(255, 245, 246, 0.98), rgba(251, 231, 234, 0.96));
}

.account-header {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.9fr);
  gap: 18px;
  align-items: start;
}

.account-title-block {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.account-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.account-email {
  margin: 0;
  font-size: clamp(1.18rem, 2.2vw, 1.6rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.account-note {
  margin: 0;
  max-width: 50ch;
  color: #56483e;
  font-size: 0.98rem;
  line-height: 1.45;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  white-space: nowrap;
  flex-shrink: 0;
}

.status-badge.status-green {
  background: rgba(44, 143, 93, 0.14);
  color: #1f6844;
  border-color: rgba(44, 143, 93, 0.24);
}

.status-badge.status-yellow {
  background: rgba(211, 163, 35, 0.18);
  color: #8a6510;
  border-color: rgba(174, 124, 18, 0.24);
}

.status-badge.status-red {
  background: rgba(191, 74, 87, 0.14);
  color: #8d2b38;
  border-color: rgba(143, 47, 58, 0.22);
}

.account-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-content: flex-start;
  gap: 12px;
}

.summary-box {
  flex: 1 1 190px;
  max-width: 250px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(85, 54, 27, 0.08);
}

.summary-box strong {
  display: block;
  margin-top: 6px;
  font-size: 1rem;
  line-height: 1.3;
}

.meta-label {
  display: block;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.account-users {
  display: grid;
  gap: 10px;
  max-width: 56ch;
}

.user-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.user-pill {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(85, 54, 27, 0.1);
  color: #3f352e;
  font-weight: 700;
}

.user-pill-empty {
  color: var(--muted);
  font-weight: 600;
}

.account-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 4px;
}

.empty-state {
  margin: 0;
  padding: 32px 18px;
  text-align: center;
  border-radius: 18px;
  border: 1px dashed rgba(111, 98, 87, 0.25);
  background: rgba(255, 248, 240, 0.55);
}

@media (max-width: 1120px) {
  .account-header {
    grid-template-columns: 1fr;
  }

  .account-summary {
    justify-content: flex-start;
  }
}

@media (max-width: 900px) {
  .hero,
  .panel-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    flex-direction: column;
  }

  .hero-actions {
    justify-items: start;
  }

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

@media (max-width: 720px) {
  .account-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .summary-box {
    max-width: none;
  }
}

@media (max-width: 640px) {
  .page-shell {
    padding-inline: 14px;
  }

  .login-card,
  .hero,
  .panel,
  .stat-card,
  .account-card {
    padding: 20px;
  }

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

  .account-actions button {
    width: 100%;
  }
}
