:root {
  --bg: #f3efe4;
  --bg-strong: #e7dcc6;
  --panel: rgba(255, 252, 246, 0.84);
  --panel-strong: #fff9ef;
  --text: #1f1e1a;
  --muted: #6e6657;
  --border: rgba(67, 51, 23, 0.12);
  --accent: #b6572f;
  --accent-strong: #8f3d1d;
  --accent-soft: rgba(182, 87, 47, 0.12);
  --shadow: 0 24px 70px rgba(81, 53, 19, 0.13);
  --success: #0f7b44;
  --danger: #a12626;
}

body[data-theme="dark"] {
  --bg: #11151b;
  --bg-strong: #1a222c;
  --panel: rgba(21, 27, 35, 0.84);
  --panel-strong: #1b2430;
  --text: #f3f1eb;
  --muted: #a5afbc;
  --border: rgba(255, 255, 255, 0.08);
  --accent: #f2b134;
  --accent-strong: #f4c662;
  --accent-soft: rgba(242, 177, 52, 0.14);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
  --success: #4cd089;
  --danger: #ff7878;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(182, 87, 47, 0.16), transparent 30%),
    radial-gradient(circle at bottom right, rgba(15, 123, 68, 0.12), transparent 28%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-strong) 100%);
  color: var(--text);
  transition: background 180ms ease, color 180ms ease;
}

.page-shell {
  position: relative;
  min-height: 100vh;
  padding: 28px;
  overflow: hidden;
}

.ambient {
  position: absolute;
  width: 26rem;
  height: 26rem;
  border-radius: 50%;
  filter: blur(26px);
  opacity: 0.7;
  pointer-events: none;
}

.ambient-a {
  top: -8rem;
  right: -10rem;
  background: rgba(182, 87, 47, 0.18);
}

.ambient-b {
  bottom: -10rem;
  left: -8rem;
  background: rgba(15, 123, 68, 0.12);
}

.app-card {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
}

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

.login-layout {
  min-height: calc(100vh - 56px);
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 24px;
}

.hero,
.login-panel,
.dashboard-shell {
  border-radius: 28px;
}

.hero {
  padding: 42px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.8rem, 6vw, 5.4rem);
  line-height: 0.92;
  letter-spacing: -0.05em;
}

.hero p,
.muted {
  color: var(--muted);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  font-size: 0.82rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 800;
}

.eyebrow::before {
  content: "";
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 999px;
  background: var(--accent);
}

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

.mini-card {
  padding: 18px;
  border-radius: 20px;
  background: var(--panel-strong);
  border: 1px solid var(--border);
}

.mini-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1rem;
}

.login-panel {
  padding: 36px;
}

.login-panel h2,
.section-title {
  margin: 0 0 8px;
  font-size: 1.4rem;
}

.form-grid {
  display: grid;
  gap: 18px;
}

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

.field label {
  font-weight: 700;
}

.field input,
.field select {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.55);
  color: var(--text);
  font-size: 1rem;
}

body[data-theme="dark"] .field input,
body[data-theme="dark"] .field select {
  background: rgba(255, 255, 255, 0.04);
}

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.check input {
  width: 18px;
  height: 18px;
}

.actions,
.top-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  min-height: 48px;
  border-radius: 16px;
  border: 0;
  padding: 0 18px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, opacity 160ms ease, background 160ms ease;
}

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

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

.btn-secondary {
  background: var(--accent-soft);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-danger {
  background: rgba(161, 38, 38, 0.12);
  color: var(--danger);
  border: 1px solid rgba(161, 38, 38, 0.18);
}

.status {
  min-height: 24px;
  color: var(--muted);
}

.status.error {
  color: var(--danger);
}

.status.success {
  color: var(--success);
}

.dashboard-shell {
  padding: 22px;
}

.dashboard-topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 20px;
}

.dashboard-topbar h1 {
  margin: 6px 0 0;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
}

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

.sidebar,
.panel {
  border-radius: 24px;
  padding: 20px;
  background: var(--panel-strong);
  border: 1px solid var(--border);
}

.sidebar nav {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.nav-btn {
  text-align: left;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
}

.nav-btn.active {
  background: var(--accent-soft);
  border-color: var(--border);
}

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

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

.stat-card {
  padding: 18px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.45);
}

body[data-theme="dark"] .stat-card {
  background: rgba(255, 255, 255, 0.02);
}

.stat-card strong,
.profile-card strong {
  display: block;
  font-size: 1.4rem;
  margin-bottom: 6px;
}

.empty-state {
  padding: 28px;
  border-radius: 20px;
  border: 1px dashed var(--border);
  color: var(--muted);
}

.table-wrap {
  overflow-x: auto;
}

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

th,
td {
  text-align: left;
  padding: 14px 12px;
  border-bottom: 1px solid var(--border);
}

th {
  color: var(--muted);
  font-size: 0.9rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.8rem;
  font-weight: 700;
}

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

.profile-card {
  padding: 18px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.45);
}

body[data-theme="dark"] .profile-card {
  background: rgba(255, 255, 255, 0.02);
}

@media (max-width: 980px) {
  .login-layout,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .cards,
  .profile-grid {
    grid-template-columns: 1fr;
  }

  .page-shell {
    padding: 16px;
  }
}
