:root{
  --green:#0B5D3B;
  --green-dark:#08472d;
  --gold:#C8A951;
  --bg:#f4f6f5;
  --text:#17211c;
  --muted:#66726c;
  --card:#fff;
  --border:#dde6e1;
  --shadow:0 10px 28px rgba(0,0,0,.06);
  --radius:18px;
  --max:1320px;
  --danger:#b42318;
  --light:#eef5f1;
}

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

body{
  font-family:'Inter',sans-serif;
  background:linear-gradient(180deg,#f7f8f7 0%, #f1f4f2 100%);
  color:var(--text);
  padding:24px 14px 42px;
  font-size:13px;
  line-height:1.45;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  text-rendering:optimizeLegibility;
}

.wrap{
  max-width:var(--max);
  margin:auto;
}

.page-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  margin-bottom:18px;
  flex-wrap:wrap;
}

h1{
  margin-bottom:6px;
  font-size:30px;
  line-height:1.08;
  letter-spacing:-0.02em;
}

.lead{
  color:var(--muted);
  margin-bottom:0;
  line-height:1.6;
  font-size:12.5px;
  max-width:760px;
}

.dashboard-grid{
  display:grid;
  grid-template-columns:minmax(0, 1.55fr) minmax(320px, .85fr);
  gap:18px;
  align-items:start;
}

.dashboard-main,
.dashboard-side{
  display:grid;
  gap:18px;
}

.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:20px;
  box-shadow:var(--shadow);
  padding:18px;
}

.card-wide{
  padding:20px;
}

.card h2{
  font-size:18px;
  margin-bottom:8px;
  line-height:1.2;
  letter-spacing:-0.01em;
}

.card h3{
  font-size:15px;
  line-height:1.3;
}

.muted{
  color:var(--muted);
  font-size:12px;
  line-height:1.6;
  margin-bottom:12px;
}

.field{
  display:flex;
  flex-direction:column;
  gap:7px;
  margin-bottom:10px;
}

label{
  font-size:12px;
  font-weight:700;
  color:var(--text);
}

input, textarea, select{
  width:100%;
  padding:10px 12px;
  border:1px solid #d8e2dc;
  border-radius:12px;
  font:inherit;
  font-size:13px;
  background:#fff;
  color:var(--text);
}

input[type="file"]{
  padding:9px;
  background:#fff;
}

textarea{
  min-height:88px;
  resize:vertical;
}

input:focus, textarea:focus, select:focus{
  outline:none;
  border-color:var(--green);
  box-shadow:0 0 0 4px rgba(11,93,59,.08);
}

.row{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
}

.btn{
  border:none;
  border-radius:999px;
  padding:10px 15px;
  background:var(--green);
  color:#fff;
  font-weight:700;
  cursor:pointer;
  font-size:12px;
  line-height:1;
  transition:transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}

.btn:hover{
  transform:translateY(-1px);
}

.btn.alt{background:var(--gold);}
.btn.light{
  background:var(--light);
  color:var(--green);
}
.btn.delete{background:var(--danger);}
.btn:disabled{
  opacity:.65;
  cursor:not-allowed;
}

.actions{
  display:flex;
  flex-wrap:wrap;
  gap:7px;
  margin-top:8px;
}

.message{
  margin-top:10px;
  font-size:12px;
  color:var(--green);
  min-height:18px;
}

.list{
  display:grid;
  gap:10px;
  margin-top:12px;
}

.list-item{
  border:1px solid var(--border);
  border-radius:14px;
  padding:13px;
  background:#fbfcfb;
  cursor:grab;
  transition:box-shadow .15s ease, border-color .15s ease, transform .15s ease;
}

.list-item:hover{
  border-color:#d0ddd6;
  box-shadow:0 8px 20px rgba(0,0,0,.04);
}

.list-item:active{
  cursor:grabbing;
}

.pill{
  display:inline-flex;
  align-items:center;
  background:#eef5f1;
  color:var(--green);
  padding:4px 8px;
  border-radius:999px;
  font-size:10px;
  font-weight:800;
  margin-bottom:8px;
  line-height:1;
}

.list-item h3{
  font-size:14px;
  margin-bottom:5px;
  line-height:1.3;
}

.list-item p{
  color:var(--muted);
  font-size:12px;
  line-height:1.55;
  margin-bottom:5px;
}

.thumb{
  width:100%;
  max-height:190px;
  object-fit:contain;
  border-radius:12px;
  margin:8px 0 10px;
  border:1px solid var(--border);
  background:#fff;
}

.tiny{
  font-size:11px;
  color:var(--muted);
}

.divider{
  height:1px;
  background:var(--border);
  margin:14px 0;
}

/* preview layout */
.event-preview-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px;
  align-items:start;
}

.preview-card-wrap{
  margin-top:10px;
}

.preview-empty{
  border:1px dashed var(--border);
  border-radius:14px;
  padding:14px;
  background:#fcfdfc;
  color:var(--muted);
  font-size:12px;
}

.preview-card{
  border:1px solid var(--border);
  border-radius:16px;
  padding:15px;
  background:#fff;
  box-shadow:0 10px 24px rgba(0,0,0,.05);
}

.preview-badges{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin-bottom:8px;
}

.preview-card h4{
  font-size:17px;
  margin-bottom:8px;
  line-height:1.3;
  letter-spacing:-0.01em;
}

.preview-meta{
  display:grid;
  gap:4px;
  margin-bottom:10px;
}

.preview-meta p{
  font-size:12px;
  color:var(--muted);
  margin:0;
}

.preview-thumb{
  width:100%;
  max-height:240px;
  object-fit:contain;
  border-radius:12px;
  border:1px solid var(--border);
  background:#fff;
  margin:10px 0;
}

.preview-description{
  font-size:12.5px;
  line-height:1.65;
  color:var(--text);
  margin-top:8px;
}

.preview-actions{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:12px;
}

/* sortable states */
.sortable-ghost{
  opacity:.4;
}

.sortable-chosen{
  box-shadow:0 10px 30px rgba(0,0,0,.12);
}

.sortable-drag{
  transform:rotate(1deg);
}

#migrateEventsBtn{
  margin-left:4px;
}

#logoutBtn{
  min-width:110px;
}

/* compact right column cards */
.dashboard-side .card{
  padding:16px;
}

.dashboard-side .card h2{
  font-size:17px;
}

/* responsive */
@media (max-width: 1080px){
  .dashboard-grid{
    grid-template-columns:1fr;
  }
}

@media (max-width: 760px){
  .row,
  .event-preview-grid{
    grid-template-columns:1fr;
  }

  h1{
    font-size:25px;
  }

  .card,
  .card-wide{
    padding:16px;
  }
}
.admin-logo-wrap{
  display:flex;
  justify-content:center;
  margin-bottom:14px;
}

.admin-logo{
  width:72px;
  height:72px;
  object-fit:contain;
  border-radius:16px;
  background:#fff;
  padding:6px;
  border:1px solid var(--border);
  box-shadow:0 8px 22px rgba(0,0,0,.06);
}

.page-top-brand{
  display:flex;
  align-items:flex-start;
  gap:12px;
}

.admin-logo-panel{
  width:56px;
  height:56px;
  border-radius:14px;
  padding:5px;
  flex:0 0 auto;
}

@media (max-width:760px){
  .page-top-brand{
    align-items:center;
  }

  .admin-logo{
    width:64px;
    height:64px;
  }

  .admin-logo-panel{
    width:50px;
    height:50px;
  }
}


/* ===== FORM BUILDER PREMIUM UI ===== */
.form-builder-wrap{
  max-width:1320px;
}

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

.form-builder-grid{
  display:grid;
  grid-template-columns:360px minmax(0,1fr);
  gap:18px;
  align-items:start;
}

.form-builder-sidebar{
  position:sticky;
  top:20px;
  padding:18px;
}

.sidebar-section h2{
  font-size:16px;
  color:var(--green);
  margin-bottom:6px;
}

.premium-select{
  appearance:none;
  background:
    linear-gradient(45deg, transparent 50%, var(--green) 50%),
    linear-gradient(135deg, var(--green) 50%, transparent 50%),
    linear-gradient(to right, #eef5f1, #eef5f1);
  background-position:
    calc(100% - 18px) calc(50% - 3px),
    calc(100% - 13px) calc(50% - 3px),
    100% 0;
  background-size:
    5px 5px,
    5px 5px,
    44px 100%;
  background-repeat:no-repeat;
  padding-right:52px;
  border-radius:14px;
  font-weight:700;
}

.selected-summary{
  margin-top:12px;
  border:1px solid #d7e4dd;
  background:#f7faf8;
  border-radius:16px;
  padding:13px;
}

.selected-summary.empty{
  color:var(--muted);
  border-style:dashed;
}

.selected-summary strong{
  display:block;
  font-size:14px;
  margin-bottom:4px;
}

.selected-summary span{
  display:block;
  font-size:12px;
  color:var(--muted);
}

.form-editor-card{
  padding:20px;
}

.editor-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  margin-bottom:14px;
  flex-wrap:wrap;
}

.editor-head h2{
  font-size:20px;
  margin-bottom:4px;
  color:var(--green);
}

.form-settings-card{
  border:1px solid var(--border);
  background:#fbfcfb;
  border-radius:18px;
  padding:16px;
}

.field-toolbar{
  margin-top:16px;
  display:grid;
  grid-template-columns:minmax(240px, 380px) 1fr;
  gap:12px;
  align-items:end;
}

.field-toolbar-actions{
  display:flex;
  justify-content:flex-end;
  align-items:center;
  flex-wrap:wrap;
  gap:8px;
  padding-bottom:10px;
}

.fields-builder{
  border-top:1px solid var(--border);
  margin-top:14px;
  padding-top:14px;
}

.field-builder-card{
  display:none;
  border:1px solid #d8e6de;
  background:linear-gradient(180deg,#ffffff,#fbfdfc);
  box-shadow:0 14px 34px rgba(0,0,0,.055);
}

.field-builder-card.active-field-card{
  display:block;
}

.field-builder-head{
  border-bottom:1px solid #edf2ef;
  padding-bottom:12px;
}

.field-builder-head div{
  display:grid;
  gap:2px;
}

.field-builder-head span{
  font-size:12px;
  color:var(--muted);
}

#importJsonText{
  min-height:130px;
  font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size:12px;
}

#formSelector,
#fieldSelector{
  min-height:44px;
}

@media (max-width:1080px){
  .form-builder-grid{
    grid-template-columns:1fr;
  }

  .form-builder-sidebar{
    position:static;
  }
}

@media (max-width:760px){
  .field-toolbar{
    grid-template-columns:1fr;
  }

  .field-toolbar-actions{
    justify-content:flex-start;
    padding-bottom:0;
  }

  .top-actions{
    width:100%;
  }
}


/* ===== REQUIRED TERMS CONFIG ===== */
.terms-settings-card{
  margin-top:14px;
  padding:16px;
  border:1px solid #d8e6de;
  background:linear-gradient(180deg,#ffffff,#f8fbf9);
  border-radius:18px;
}

.terms-settings-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin-bottom:12px;
}

.terms-settings-head h3{
  color:var(--green);
  font-size:15px;
  margin-bottom:4px;
}

.terms-required-pill{
  flex:0 0 auto;
  border-radius:999px;
  padding:5px 9px;
  background:#fff3d6;
  color:#8a6500;
  font-size:10px;
  font-weight:800;
}

.terms-textarea{
  min-height:180px;
  line-height:1.55;
}

/* ===== FORM BUILDER ROW REARRANGEMENT ===== */
.row-2{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:10px;
}

.row-3{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:10px;
}

.form-settings-card .row-2,
.field-builder-card .row-2{
  align-items:start;
}

@media (max-width:760px){
  .row-2,
  .row-3{
    grid-template-columns:1fr;
  }
}
