/* Goddess Love Notes — dusty rose / grey dark theme */
:root {
  --bg: #1a1618;
  --bg-deep: #120f11;
  --panel: #2a2226;
  --panel-soft: #32282c;
  --rose: #c9a0a8;
  --rose-mid: #b88490;
  --rose-deep: #8f5f6c;
  --mist: #e8d6da;
  --text: #f5eef0;
  --muted: #b5a6aa;
  --line: #3d3338;
  --ok: #6bcb77;
  --err: #e07a7a;
  --field: #1e191b;
  --radius: 14px;
  --font: 'Cabin', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg-deep);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}
a { color: var(--rose); }
a:hover { color: var(--mist); }

.mx-shell {
  min-height: 100vh;
  padding: 28px 16px 48px;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(201,160,168,0.12), transparent 55%),
    var(--bg-deep);
}

.mx-panel {
  max-width: 520px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  background: linear-gradient(165deg, #3a2e33 0%, var(--panel) 40%, #241e21 100%);
  border: 1px solid rgba(201,160,168,0.22);
  border-radius: 18px;
  padding: 28px 24px 26px;
  box-shadow: 0 18px 50px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.04);
}
.mx-panel.has-bg {
  /* gradient still paints on the panel; image sits under content via ::before */
}

.mx-panel.wide { max-width: 920px; }

/* Public panel close */
.mx-close {
  position: absolute;
  top: 12px;
  right: 12px;
  left: auto !important;
  bottom: auto !important;
  z-index: 6;
  width: 34px;
  height: 34px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(12, 10, 12, 0.48);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  transition: background 0.15s ease, transform 0.15s ease, color 0.15s ease;
}
.mx-close:hover {
  background: rgba(12, 10, 12, 0.68);
  color: #fff;
  transform: scale(1.04);
}
.mx-close:active {
  transform: scale(0.96);
}
.mx-close svg {
  display: block;
  pointer-events: none;
}


.mx-brand {
  text-align: center;
  margin-bottom: 18px;
}
.mx-logo {
  display: block;
  max-width: 120px;
  max-height: 120px;
  margin: 0 auto 12px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(201,160,168,0.35);
}
.mx-title {
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--mist);
}
.mx-tagline {
  margin-top: 4px;
  font-size: 0.95rem;
  color: var(--rose);
  opacity: 0.9;
}

.mx-intro {
  text-align: center;
  color: var(--muted);
  font-size: 0.98rem;
  margin: 0 0 20px;
  line-height: 1.55;
}

label {
  display: block;
  margin: 12px 0 6px;
  font-size: 0.9rem;
  color: var(--muted);
}
input[type="email"],
input[type="password"],
input[type="text"],
input[type="file"],
textarea {
  width: 100%;
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  padding: 11px 13px;
  font-family: inherit;
  font-size: 1rem;
}
input:focus, textarea:focus {
  outline: none;
  border-color: var(--rose-mid);
  box-shadow: 0 0 0 3px rgba(184,132,144,0.18);
}
textarea { min-height: 120px; resize: vertical; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: 10px;
  padding: 11px 16px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  color: #1a1214;
  background: var(--rose);
}
.btn:hover { background: var(--mist); color: #1a1214; }
.btn.secondary {
  background: var(--panel-soft);
  color: var(--text);
  border: 1px solid var(--line);
}
.btn.secondary:hover { border-color: var(--rose-mid); color: var(--mist); }
.btn.ok { background: #5a9e68; color: #fff; }
.btn.danger { background: #8b3a3a; color: #fff; }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
  align-items: center;
}

.msg {
  padding: 10px 12px;
  border-radius: 10px;
  margin: 12px 0;
  font-size: 0.92rem;
}
.msg.ok {
  background: rgba(107,203,119,0.12);
  border: 1px solid rgba(107,203,119,0.35);
  color: #b6f0cd;
}
.msg.err {
  background: rgba(224,122,122,0.12);
  border: 1px solid rgba(224,122,122,0.35);
  color: #ffc0c0;
}

.muted { color: var(--muted); font-size: 0.9rem; }
.hint { font-size: 0.85rem; color: var(--muted); margin-top: 8px; text-align: center; }

.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 0 0 18px;
}
.admin-nav a {
  font-size: 0.88rem;
  text-decoration: none;
  color: var(--muted);
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
}
.admin-nav a:hover,
.admin-nav a.active {
  color: var(--mist);
  border-color: var(--line);
  background: rgba(0,0,0,0.2);
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  margin: 8px 0 4px;
}
.stat strong {
  display: block;
  font-size: 1.35rem;
  color: var(--mist);
}
.stat span { font-size: 0.85rem; color: var(--muted); }

.grid { display: grid; gap: 12px; }
@media (min-width: 720px) {
  .grid.two { grid-template-columns: 1fr 1fr; }
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
th, td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}
th { color: var(--muted); font-weight: 600; }

/* Editor */
.mx-editor-wrap {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--field);
  overflow: hidden;
  position: relative;
}
.mx-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 10px;
  background: #241e21;
  border-bottom: 1px solid var(--line);
}
.mx-toolbar button {
  background: #32282c;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 0.85rem;
  cursor: pointer;
  font-family: inherit;
}
.mx-toolbar button:hover { border-color: var(--rose-mid); }
.mx-editor {
  min-height: 200px;
  padding: 14px 16px;
  color: var(--text);
  outline: none;
  line-height: 1.5;
}
.mx-editor a { color: var(--rose); }
.mx-emoji-panel {
  display: none;
  position: absolute;
  top: 46px;
  left: 10px;
  z-index: 20;
  background: #241e21;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  width: min(320px, calc(100% - 20px));
  max-height: 180px;
  overflow: auto;
}
.mx-emoji-panel.open { display: block; }
.mx-emoji-panel button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  background: #32282c;
  border-radius: 6px;
  margin: 2px;
  cursor: pointer;
  font-size: 1.1rem;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  cursor: pointer;
}
.checkbox-row input { width: auto; accent-color: var(--rose-mid); }

#send_to_field {
  min-height: 42px;
  max-height: 160px;
  resize: vertical;
}

.mx-footer-link {
  display: block;
  text-align: center;
  margin-top: 14px;
  font-size: 16px;
  font-weight: 500;
  color: #faae60;
  text-decoration: none;
}
.mx-footer-link:hover {
  color: #ffc98a;
  text-decoration: underline;
}
