@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@500;600;700&family=Manrope:wght@400;500;600;700&display=swap");

:root {
  --bg: #f7f2ea;
  --bg-2: #fdf8f2;
  --panel: #ffffff;
  --text: #2a2623;
  --muted: #6f6a64;
  --accent: #d7906d;
  --accent-2: #7bb5a6;
  --danger: #d76b6b;
  --border: #eadfd2;
  --glow: rgba(215, 144, 109, 0.25);
  --shadow-xs: 0 1px 2px rgba(42,38,35,0.04);
  --shadow-sm: 0 2px 8px rgba(42,38,35,0.06);
  --shadow-md: 0 8px 24px rgba(42,38,35,0.1);
  --shadow-lg: 0 16px 40px rgba(42,38,35,0.14);
  --container: 920px;
  --radius: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Manrope", ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  color: var(--text);
  background: radial-gradient(1200px 600px at 10% -10%, #fff3e6 0%, transparent 60%),
    radial-gradient(900px 500px at 90% 0%, #e7f5f2 0%, transparent 55%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

html, body { overflow-x: clip; }

header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(247, 242, 234, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 24px 24px 16px;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.3px;
  font-family: "Cormorant Garamond", "Times New Roman", serif;
}

.sub { color: var(--muted); font-size: 13px; }
.sub-spaced { margin-top: 6px; }
.sub-with-margin { margin-bottom: 16px; }

.profile-wrap { position: relative; display: flex; align-items: center; gap: 8px; }

.menu-btn {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 999px;
  font-size: 20px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.profile-card {
  position: absolute;
  top: 48px;
  right: 0;
  min-width: 220px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: var(--shadow-lg);
  z-index: 10;
  font-size: 13px;
  color: var(--muted);
}

.profile-card-email {
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
  word-break: break-word;
}

.profile-card-nav {
  display: grid;
  gap: 8px;
}

.profile-card-nav .nav-btn {
  width: 100%;
  text-align: center;
}

nav {
  margin-top: 14px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.nav-btn {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
}

.nav-btn:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--glow);
}

.nav-btn.active {
  background: linear-gradient(135deg, var(--accent), #c47d5c);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(215,144,109,0.3);
}

.admin-only { display: none; }
body.is-admin .admin-only { display: inline-flex; }
.admin-only-block { display: none; }
body.is-admin .admin-only-block { display: block; }

.controls-wrap {
  max-width: var(--container);
  margin: 20px auto 0;
  padding: 0 24px;
}

.controls {
  padding: 20px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.controls-grid {
  display: grid;
  grid-template-columns: 1.4fr 1.6fr 1.4fr;
  grid-template-areas:
    "status status status"
    "search search search"
    "importfrom importto file"
    "actions actions actions";
  gap: 14px;
  align-items: end;
}

.control-search { grid-area: search; }
.control-status { grid-area: status; display: flex; flex-direction: column; gap: 6px; }
.control-status > label { text-align: left; }
.control-import-from { grid-area: importfrom; }
.control-import-to { grid-area: importto; }
.control-autoconfirm { grid-area: autoconfirm; }
.control-file { grid-area: file; }
.control-file.admin-only { display: none; }
body.is-admin .control-file.admin-only { display: block; }
.control-actions { grid-area: actions; display: grid; grid-template-columns: repeat(4, minmax(140px, 1fr)); gap: 12px; }

label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
  margin-bottom: 6px;
}

input, textarea, select {
  width: 100%;
  max-width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  transition: all 0.2s ease;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--glow);
}

input[type="checkbox"] {
  width: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  -webkit-appearance: checkbox;
  appearance: auto;
  accent-color: var(--accent);
}

input[type="date"] { color-scheme: light; }

.card input[type="date"] {
  min-width: 0;
  max-width: 100%;
  display: block;
  inline-size: 100%;
  max-inline-size: 100%;
  -webkit-appearance: none;
  appearance: none;
}

textarea { min-height: 270px; resize: vertical; line-height: 1.5; }

button {
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
}

.btn {
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-weight: 500;
  transition: all 0.2s ease;
  width: 100%;
}

.btn:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--glow);
}

.btn.success {
  background: var(--accent-2);
  color: #fff;
  border-color: var(--accent-2);
}

.btn.success:hover { box-shadow: 0 2px 12px rgba(123,181,166,0.35); }

.btn.danger {
  color: #c0392b;
  border-color: #e8c5c0;
}

.btn.danger:hover { box-shadow: 0 0 0 3px rgba(192,57,43,0.12); }

.status-btn {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  transition: all 0.15s ease;
}

.status-btn.active {
  border-color: var(--accent);
  background: rgba(215, 144, 109, 0.12);
  color: var(--text);
  box-shadow: 0 0 0 1px var(--accent);
}

.status-btn.success { color: #2f6b58; }
.status-btn.success.active {
  border-color: var(--accent-2);
  background: rgba(123,181,166,0.15);
  box-shadow: 0 0 0 1px var(--accent-2);
}

.status-btn.danger { color: #9b3a3a; }
.status-btn.danger.active {
  border-color: var(--danger);
  background: rgba(215,107,107,0.1);
  box-shadow: 0 0 0 1px var(--danger);
}

.status-btn.muted { color: var(--muted); }
.status-btn.muted.active {
  border-color: #ddd6c9;
  background: rgba(210,200,185,0.18);
  box-shadow: 0 0 0 1px #ddd6c9;
  color: var(--text);
}

main {
  max-width: var(--container);
  margin: 0 auto;
  padding: 24px 24px 48px;
}

.card {
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 18px 20px;
  display: grid;
  gap: 14px;
  overflow: hidden;
  min-width: 0;
  max-width: 100%;
  box-shadow: var(--shadow-xs);
  transition: box-shadow 0.2s ease;
}

.card > * {
  min-width: 0;
  max-width: 100%;
}

.card:hover { box-shadow: var(--shadow-sm); }
.card + .card { margin-top: 12px; }

.row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  width: 100%;
  max-width: 100%;
}

.row > * { min-width: 0; }
.status-row { display: flex; gap: 6px; }

.status-picker {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.admin-row { display: none; }
body.is-admin .admin-row { display: grid; }

.pill {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
}

.meta { color: var(--muted); font-size: 12px; }
.meta, .meta div { overflow-wrap: anywhere; word-break: break-word; }
.meta-end { align-self: end; padding-bottom: 10px; }

.empty {
  color: var(--muted);
  padding: 48px 0;
  text-align: center;
  font-size: 15px;
}

.file-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.file-row > * { min-width: 0; }

.option-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
}

.option-check-small {
  font-size: 12px;
}

.status-row-inline {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: nowrap;
  white-space: nowrap;
  justify-content: flex-start;
}

.status-row-inline label { display: inline-flex; align-items: center; gap: 6px; }
.status-row-inline label { min-width: 0; }
.status-row-inline .admin-only { display: none !important; }
body.is-admin .status-row-inline .admin-only { display: inline-flex !important; }

.status-tools {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: flex-start;
  margin-top: 8px;
  flex-wrap: wrap;
}

.status-tools > * { min-width: 0; }
.status-tools label {
  margin-bottom: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.status-tools .admin-only { display: none !important; }
body.is-admin .status-tools .admin-only { display: inline-flex !important; }

.status-tools input[type="number"] {
  width: 110px;
  padding: 8px 10px;
  font-size: 13px;
}

.status-tools .btn {
  padding: 8px 12px;
  font-size: 12px;
  width: auto;
}

.status-picker,
.status-row-inline,
.status-tools { min-width: 0; }

.file-row input { flex: 1; }

.event-image-wrap {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  padding: 8px;
}

.event-image {
  display: block;
  width: 100%;
  max-width: 420px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.reject-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(42, 38, 35, 0.35);
  padding: 16px;
}

.reject-modal.open { display: flex; }

.reject-modal-card {
  width: min(560px, 100%);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-lg);
}

.reject-modal-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 10px;
}

.reject-modal-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.reject-choice {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  text-align: left;
  font-size: 13px;
}

.reject-choice:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--glow);
}

.reject-modal-cancel { margin-top: 10px; }

.hidden { display: none !important; }

@media (max-width: 640px) {
  .header-inner { padding: 20px 16px 14px; }
  h1 { font-size: 24px; }
  .controls-wrap { margin: 12px 16px 0; padding: 0; }
  main { padding: 16px 16px 32px; }
  .card { padding: 14px; }
  .card .row { grid-template-columns: 1fr !important; }
  .card .row > * {
    min-width: 0;
    width: 100%;
  }
  .card .row { overflow: hidden; }
  .card input[type="date"] {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    inline-size: 100%;
    max-inline-size: 100%;
  }
  .card input,
  .card textarea,
  .card select {
    width: 100%;
    max-width: 100%;
  }
  .controls-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "status status"
      "search search"
      "importfrom importto"
      "file file"
      "actions actions";
  }
  .control-actions { grid-template-columns: 1fr 1fr; }
  .status-row-inline { flex-wrap: wrap; white-space: normal; }
  .header-top { display: grid; grid-template-columns: 1fr auto; align-items: start; }
  .profile-wrap { justify-self: end; margin-left: auto; }
}
