:root {
  --bg: #fdf2f8;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --brand: #9d174d;
  --brand-dark: #be185d;
  --line: #fce7f3;
  --ok: #059669;
  --ok-bg: #d1fae5;
  --warn: #b45309;
  --warn-bg: #fef3c7;
  --danger: #b91c1c;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: linear-gradient(165deg, #fdf2f8 0%, #fce7f3 45%, #faf5ff 100%);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}
a { color: var(--brand-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 22px;
  background: rgba(255,255,255,0.9);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(10px);
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; color: var(--brand); text-decoration: none;
}
.brand img {
  width: 40px; height: 40px; border-radius: 50%;
  object-fit: cover; border: 2px solid var(--brand-dark);
}
.top-actions { display: flex; gap: 8px; align-items: center; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: none; cursor: pointer; font-weight: 650; font-size: 0.9rem;
  padding: 10px 16px; border-radius: 10px; text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn-primary { background: var(--brand-dark); color: #fff; }
.btn-primary:hover { background: #9d174d; color: #fff; }
.btn-soft { background: #fff; color: var(--brand); border: 1px solid #f9a8d4; }
.btn-ok { background: var(--ok); color: #fff; }
.btn-danger { background: #fee2e2; color: var(--danger); border: 1px solid #fecaca; }
.btn-sm { padding: 7px 12px; font-size: 0.82rem; border-radius: 8px; }

.wrap { max-width: 920px; margin: 0 auto; padding: 28px 16px 60px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 8px 28px rgba(190, 24, 93, 0.06);
}
.card + .card { margin-top: 16px; }
h1 { font-size: 1.45rem; margin-bottom: 6px; }
h2 { font-size: 1.15rem; margin-bottom: 12px; color: var(--brand); }
.sub { color: var(--muted); margin-bottom: 18px; font-size: 0.95rem; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 0.85rem; font-weight: 600; color: #374151; }
.field label .req { color: var(--danger); }
.field input, .field select {
  border: 1px solid #e5e7eb; border-radius: 10px;
  padding: 11px 12px; font-size: 0.95rem; background: #fff;
  outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus, .field select:focus {
  border-color: #f9a8d4;
  box-shadow: 0 0 0 3px rgba(244, 114, 182, 0.15);
}
.field input:disabled { background: #f9fafb; color: #6b7280; }
.radio-row { display: flex; gap: 14px; align-items: center; padding-top: 8px; }
.radio-row label { font-weight: 500; display: flex; gap: 6px; align-items: center; cursor: pointer; }

.alert {
  padding: 12px 14px; border-radius: 10px; margin-bottom: 14px; font-size: 0.92rem;
}
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-ok { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.78rem; font-weight: 700; padding: 5px 12px;
  border-radius: 999px;
}
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-pending { background: var(--warn-bg); color: var(--warn); }
.badge-no { background: #f3f4f6; color: #6b7280; }

.premium-box {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 12px; flex-wrap: wrap;
  background: linear-gradient(135deg, #fff 0%, #fdf2f8 100%);
  border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px;
  margin-bottom: 18px;
}
.premium-box h3 { font-size: 1.05rem; margin-bottom: 4px; }
.premium-box p { color: var(--muted); font-size: 0.9rem; }

.layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 16px;
}
@media (max-width: 760px) {
  .layout { grid-template-columns: 1fr; }
}
.side {
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
  padding: 16px; height: fit-content;
}
.side .who { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.side .who img, .avatar {
  width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: #e5e7eb;
}
.side nav a {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-radius: 10px; color: #4b5563;
  font-weight: 550; text-decoration: none; margin-bottom: 4px;
}
.side nav a:hover { background: #fdf2f8; color: var(--brand); }
.side nav a.active { background: var(--brand-dark); color: #fff; }
.side .logout {
  margin-top: 12px; width: 100%;
}

.profile-grid {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 24px;
  align-items: start;
}
@media (max-width: 700px) {
  .profile-grid { grid-template-columns: 1fr; }
}
.form-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.form-col .field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 520px) {
  .form-col .field-row { grid-template-columns: 1fr; }
}
.form-col .save-btn {
  width: 100%;
  margin-top: 4px;
  padding: 12px 18px;
  font-size: 0.95rem;
}
.photo-box {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px 16px;
  text-align: center;
  background: #fafafa;
}
.photo-box .preview {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  background: #111;
  margin: 0 auto 12px;
  display: block;
  border: 3px solid #fff;
  box-shadow: 0 4px 14px rgba(0,0,0,0.12);
}
.hint { font-size: 0.8rem; color: var(--muted); margin-bottom: 12px; line-height: 1.4; }
.photo-box .btn { width: 100%; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid #f3f4f6; vertical-align: middle; }
th { color: #6b7280; font-weight: 600; font-size: 0.8rem; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }

.auth-center {
  min-height: calc(100vh - 70px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px 16px;
}
.auth-card { width: min(440px, 100%); }
.auth-card .logo-row {
  display: flex; align-items: center; gap: 10px; margin-bottom: 18px;
}
.foot-note { text-align: center; margin-top: 14px; color: var(--muted); font-size: 0.9rem; }
