/* AddSession24 – dashboard enhancements. Scoped to [data-agendee-dashboard] / .as24-* only. */
:root{--as24-accent:#12b76a;--as24-accent-d:#0e9f5c;--as24-navy:#0f172a;--as24-line:#e5e7eb;--as24-muted:#6b7280}

/* ---------- 1. Header button ---------- */
.as24-add-btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:42px;margin:0 2px 0 0;padding:0 18px;border:0;border-radius:999px;background:var(--as24-accent);color:#fff!important;font:inherit;font-size:.9rem;font-weight:700;line-height:1;cursor:pointer;white-space:nowrap;text-decoration:none!important;transition:background .15s,transform .15s}
.as24-add-btn:hover,.as24-add-btn:focus-visible{background:var(--as24-accent-d);transform:translateY(-1px)}
.as24-add-btn--fallback{display:flex;margin:0 0 14px auto}

/* ---------- 2. Wide dashboard / overview without horizontal scroll ---------- */
html.as24-wide-on .as24-wide{box-sizing:border-box;position:relative;left:50%;width:min(1440px,calc(100vw - 32px))!important;max-width:none!important;margin-left:calc(min(1440px,100vw - 32px) / -2)!important;margin-right:0!important}
html.as24-wide-on .as24-widen-up{max-width:none!important}
html.as24-wide-on{overflow-x:clip}
html.as24-wide-on .as24-noscroll,html.as24-wide-on .agendee-table-wrap{overflow-x:visible!important}
html.as24-wide-on table.as24-table{width:100%!important;min-width:0!important;table-layout:auto}
html.as24-wide-on table.as24-table th,html.as24-wide-on table.as24-table td{white-space:normal!important;word-break:normal;overflow-wrap:anywhere}
html.as24-wide-on .agendee-dash--front{padding-left:clamp(16px,2.5vw,32px);padding-right:clamp(16px,2.5vw,32px)}
/* Narrow screens: each table row becomes a card, so nothing ever needs a side scroll. */
@media (max-width:760px){
  html.as24-wide-on .as24-wide{width:calc(100vw - 20px)!important;margin-left:calc((100vw - 20px) / -2)!important}
  html.as24-wide-on table.as24-table:not(.agendee-table),html.as24-wide-on table.as24-table:not(.agendee-table) tbody{display:block;width:100%}
  html.as24-wide-on table.as24-table:not(.agendee-table) thead{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
  html.as24-wide-on table.as24-table:not(.agendee-table) tr{display:block;margin:0 0 12px;padding:6px 12px;border:1px solid var(--as24-line);border-radius:12px;background:#fff}
  html.as24-wide-on table.as24-table:not(.agendee-table) td{display:flex;justify-content:space-between;align-items:baseline;gap:14px;width:auto!important;padding:7px 0!important;border:0!important;border-bottom:1px dashed var(--as24-line)!important;text-align:right!important}
  html.as24-wide-on table.as24-table:not(.agendee-table) td:last-child{border-bottom:0!important}
  html.as24-wide-on table.as24-table:not(.agendee-table) td::before{content:attr(data-label);flex:0 0 38%;text-align:left;font-size:10px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--as24-muted)}
}

/* ---------- 3. Popup ---------- */
body.as24-open{overflow:hidden}
.as24-modal{position:fixed;inset:0;z-index:100000;display:flex;align-items:flex-start;justify-content:center;padding:max(12px,4vh) 12px;overflow-y:auto}
.as24-modal[hidden]{display:none}
.as24-backdrop{position:fixed;inset:0;background:rgba(15,23,42,.55);backdrop-filter:blur(2px)}
.as24-dialog{position:relative;width:min(760px,100%);margin:auto 0;background:#fff;color:#111827;border-radius:18px;box-shadow:0 24px 70px rgba(0,0,0,.3);outline:0;font-size:14px}
.as24-form{display:flex;flex-direction:column;max-height:calc(100vh - 8vh);margin:0}
.as24-dialog-head{display:flex;justify-content:space-between;gap:16px;padding:20px 24px 14px;border-bottom:1px solid var(--as24-line);background:var(--as24-navy);color:#fff;border-radius:18px 18px 0 0}
.as24-dialog-head h2{margin:0 0 2px;font-size:20px;color:#fff}
.as24-dialog-head p{margin:0;font-size:12.5px;opacity:.75}
.as24-x{flex:none;width:34px;height:34px;border:0;border-radius:50%;background:rgba(255,255,255,.12);color:#fff;font-size:22px;line-height:1;cursor:pointer}
.as24-x:hover{background:rgba(255,255,255,.25)}
.as24-dialog-body{padding:8px 24px 4px;overflow-y:auto}
.as24-form fieldset{margin:14px 0;padding:0;border:0;min-width:0}
.as24-form legend{padding:0 0 8px;font-size:11px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--as24-muted)}
.as24-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 14px}
.as24-grid-3{grid-template-columns:repeat(3,minmax(0,1fr))}
.as24-full{grid-column:1/-1}
.as24-field{display:flex;flex-direction:column;gap:5px;margin:0}
.as24-field>span{font-size:12px;font-weight:600;color:#374151}
.as24-form input[type=text],.as24-form input[type=number],.as24-form input[type=date],.as24-form input[type=time],.as24-form input[type=file],.as24-form select,.as24-form textarea{width:100%;min-height:42px;padding:9px 12px;border:1px solid #d1d5db;border-radius:10px;background:#fff;color:#111827;font:inherit;font-size:14px;box-sizing:border-box}
.as24-form textarea{min-height:90px;resize:vertical}
.as24-form input:focus,.as24-form select:focus,.as24-form textarea:focus{outline:0;border-color:var(--as24-accent);box-shadow:0 0 0 3px rgba(18,183,106,.18)}
.as24-field.as24-invalid input,.as24-field.as24-invalid select{border-color:#dc2626}
.as24-geo{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
#as24-geo-msg{font-size:12px;color:var(--as24-muted)}
.as24-errors{margin:14px 0 0;padding:10px 14px;border-radius:10px;background:#fef2f2;color:#991b1b;font-size:13px}
.as24-errors[hidden]{display:none}
.as24-errors ul{margin:0;padding-left:18px}
.as24-dialog-foot{display:flex;justify-content:flex-end;gap:10px;padding:14px 24px 20px;border-top:1px solid var(--as24-line)}
.as24-btn{display:inline-flex;align-items:center;justify-content:center;padding:10px 20px;border-radius:999px;border:1px solid transparent;font:inherit;font-size:14px;font-weight:700;cursor:pointer}
.as24-btn-primary{background:var(--as24-accent);color:#fff}
.as24-btn-primary:hover{background:var(--as24-accent-d)}
.as24-btn-primary[disabled]{opacity:.6;cursor:wait}
.as24-btn-ghost{background:#fff;border-color:#d1d5db;color:#374151}
.as24-btn-ghost:hover{background:#f3f4f6}
.as24-toast{position:fixed;left:50%;bottom:28px;z-index:100001;transform:translateX(-50%);max-width:calc(100vw - 32px);padding:12px 20px;border-radius:12px;background:var(--as24-navy);color:#fff;font-size:14px;font-weight:600;box-shadow:0 10px 30px rgba(0,0,0,.3)}
.as24-toast[hidden]{display:none}
.as24-toast.as24-ok{background:#15803d}
.as24-toast.as24-bad{background:#b91c1c}
@media (max-width:640px){
  .as24-grid,.as24-grid-3{grid-template-columns:1fr}
  .as24-dialog-head,.as24-dialog-body,.as24-dialog-foot{padding-left:16px;padding-right:16px}
  .as24-add-btn{padding:7px 12px;font-size:12px;margin-right:6px}
}
/* Duplicate link created by the older AgendeeSection plugin */
.asection-dashboard-action[data-agendeesection-add-button]{display:none!important}
