:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-strong: #f8fbff;
  --border: #d8e2ef;
  --text: #1f2937;
  --muted: #5b6b7a;
  --primary: #3a6df0;
  --primary-strong: #2f5bcc;
  --danger: #d64550;
  --success: #32a852;
  --shadow: 0 20px 36px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top left, rgba(58, 109, 240, 0.12), transparent 36%),
    linear-gradient(180deg, #fdfcff 0%, #f4f7fb 100%);
  color: var(--text);
}

body {
  line-height: 1.5;
}

img,
svg {
  max-width: 100%;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.site-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  width: 100%;
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 1.25rem;
}

.brand {
  font-weight: 700;
  font-size: 1.15rem;
}

.brand a {
  color: var(--primary);
}

.profile {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
}

.topnav {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.topnav a {
  display: inline-flex;
  align-items: center;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  border: 1px solid transparent;
  background: rgba(58, 109, 240, 0.1);
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.topnav a:hover,
.topnav a:focus {
  background: rgba(58, 109, 240, 0.18);
  border-color: rgba(58, 109, 240, 0.35);
}

.topnav a.active {
  background: var(--primary);
  color: #fff;
  border-color: transparent;
}

.profile-dropdown {
  position: relative;
}

.profile-dropdown summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.profile-dropdown summary::-webkit-details-marker {
  display: none;
}

.profile-dropdown a {
  display: block;
  padding: 0.5rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  position: absolute;
  top: 100%;
  right: 0;
  white-space: nowrap;
  box-shadow: var(--shadow);
}

.profile-dropdown[open] a {
  display: block;
}

.page-content {
  flex: 1;
  width: min(1200px, 100%);
  margin: 0 auto;
  padding: 1.5rem 1rem 2rem;
}

.container {
  width: 100%;
  margin: 0 auto;
}

.page-title {
  margin: 0 0 1.25rem;
  font-size: clamp(1.75rem, 2.3vw, 2.3rem);
  letter-spacing: -0.03em;
}

.form-card,
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1.4rem;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.col {
  flex: 1;
  min-width: 220px;
}

.btn,
button,
input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: none;
  border-radius: 999px;
  background: var(--primary);
  color: #ffffff;
  padding: 0.9rem 1.4rem;
  font: inherit;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.btn:hover,
button:hover,
input[type="submit"]:hover {
  background: var(--primary-strong);
  transform: translateY(-1px);
}

.form-control,
input,
select,
textarea {
  width: 100%;
  min-height: 48px;
  padding: 0.95rem 1rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
  margin-bottom: 1rem;
}

input:focus,
select:focus,
textarea:focus,
.form-control:focus {
  outline: none;
  border-color: rgba(58, 109, 240, 0.55);
  box-shadow: 0 0 0 5px rgba(58, 109, 240, 0.12);
}

form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  background: var(--surface);
  border-radius: 20px;
  overflow: hidden;
}

.table th,
.table td {
  padding: 0.95rem 1rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.table th {
  background: #f5f8fb;
  color: var(--text);
  font-weight: 700;
}

.table tr:last-child td {
  border-bottom: none;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.85rem;
  color: #ffffff;
  text-transform: capitalize;
}

.badge.bg-success {
  background: var(--success);
}

.badge.bg-danger {
  background: var(--danger);
}

.footer {
  padding: 1rem 1rem 1.25rem;
  text-align: center;
  font-size: 0.95rem;
  color: var(--muted);
}

@media (max-width: 900px) {
  .topbar-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .page-content {
    padding: 1rem;
  }
}

@media (max-width: 640px) {
  .profile-dropdown summary span {
    display: none;
  }
}

.message {
  padding: 1rem;
  margin-bottom: 1rem;
  border-radius: 16px;
  font-weight: 500;
}

.message.success {
  background: rgba(50, 168, 82, 0.1);
  color: var(--success);
  border: 1px solid rgba(50, 168, 82, 0.2);
}

.message.error {
  background: rgba(214, 69, 80, 0.1);
  color: var(--danger);
  border: 1px solid rgba(214, 69, 80, 0.2);
}
