:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --text: #1c2430;
  --muted: #6b7686;
  --border: #e1e6ed;
  --primary: #1f5fae;
  --primary-hover: #184d8f;
  --danger: #c0392b;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(16, 24, 40, 0.08), 0 4px 16px rgba(16, 24, 40, 0.06);
}

* { box-sizing: border-box; }

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

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.4;
}

button, input { font: inherit; }

/* ---------- Login ---------- */
.login-wrap {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px 28px;
}

.brand {
  text-align: center;
  margin-bottom: 24px;
}
.brand h1 { margin: 0; font-size: 1.5rem; letter-spacing: 0.2px; }
.brand p { margin: 4px 0 0; color: var(--muted); font-size: 0.95rem; }

.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
}
.field input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(31, 95, 174, 0.15);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 8px;
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.15s, opacity 0.15s;
}
.btn-primary { background: var(--primary); color: #fff; width: 100%; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:disabled { opacity: 0.6; cursor: default; }

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 8px 14px;
}
.btn-ghost:hover { color: var(--text); background: var(--bg); }

.msg {
  min-height: 1.4em;
  margin: 12px 0 0;
  text-align: center;
  color: var(--danger);
  font-size: 0.9rem;
}

/* ---------- App header ---------- */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.topbar .app-name { font-weight: 700; }
.user {
  display: flex;
  align-items: center;
  gap: 12px;
}
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  text-transform: uppercase;
}
.user-name { font-weight: 600; }

/* ---------- Dashboard ---------- */
.dashboard {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 16px;
  text-align: center;
}
.dashboard h2 { margin: 0 0 6px; font-size: 1.4rem; }
.dashboard .sub { margin: 0 0 32px; color: var(--muted); }

.actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
}
.action {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 16px;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  transition: transform 0.12s, border-color 0.12s;
}
.action:hover { transform: translateY(-2px); border-color: var(--primary); }
.action svg { width: 36px; height: 36px; color: var(--primary); }
.action span { font-weight: 600; font-size: 1.05rem; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: var(--text);
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 0.9rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.toast.show { opacity: 1; }

@media (max-width: 480px) {
  .user-name { display: none; }
  .dashboard { padding-top: 32px; }
}
