/* ==========================================================================
   Celebration Events — the signed-in application
   ========================================================================== */

:root {
  --ink:      #1b1c22;
  --ink-soft: #5b5f6b;
  --ink-mute: #8b8f9b;
  --line:     #e6e5ef;
  --bg:       #f6f5fa;
  --surface:  #ffffff;
  --gold:     #b08628;
  --gold-soft:#f3ead4;
  --brand:    #6d4b9c;
  --brand-dk: #553a7d;
  --shadow:   0 1px 2px rgba(27, 28, 34, .05), 0 8px 24px rgba(27, 28, 34, .06);
  --shadow-sm:0 1px 2px rgba(27, 28, 34, .06);
  --radius:   14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dk); text-decoration: underline; }

.req { color: #c0392b; font-weight: 600; }

/* --- Sign-in and setup ---------------------------------------------------- */
.auth-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(1200px 500px at 15% -10%, #efe6fb 0%, transparent 60%),
    radial-gradient(900px 500px at 110% 10%, var(--gold-soft) 0%, transparent 55%),
    var(--bg);
  padding: 2rem 1rem;
}
.auth-wrap { width: 100%; max-width: 27rem; }
.auth-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 2.25rem 2rem;
}
.auth-brand {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.1rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1.5rem;
}
.auth-title { font-size: 1.55rem; font-weight: 650; margin: 0 0 .3rem; }
.auth-sub   { color: var(--ink-soft); margin-bottom: 1.5rem; font-size: .92rem; }
.auth-foot  { margin: 1.5rem 0 0; font-size: .8rem; color: var(--ink-mute); line-height: 1.6; }
.auth-foot code { background: var(--bg); padding: .1rem .3rem; border-radius: 4px; }
.check-table td { padding: .35rem .5rem; border-color: var(--line); }

.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 3rem; }
.pw-eye {
  position: absolute; top: 50%; right: .4rem; transform: translateY(-50%);
  width: 2.4rem; height: 2.4rem; display: grid; place-items: center;
  background: none; border: 0; border-radius: 8px; color: var(--ink-mute); cursor: pointer;
}
.pw-eye:hover { background: var(--bg); color: var(--ink); }

/* --- The shell ----------------------------------------------------------- */
.app-shell { display: flex; min-height: 100vh; }

.app-sidebar {
  width: 16rem; flex: 0 0 16rem;
  background: #16131f;
  color: #cfc9dd;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.brand {
  display: flex; align-items: center; gap: .65rem;
  padding: 1.35rem 1.25rem;
  color: #fff; text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.brand:hover { color: #fff; text-decoration: none; }
.brand-mark {
  width: 2.1rem; height: 2.1rem; flex: 0 0 2.1rem;
  display: grid; place-items: center;
  border-radius: 9px;
  background: linear-gradient(140deg, var(--gold) 0%, #8c6a1f 100%);
  color: #fff; font-size: 1rem;
}
.brand-text {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.12rem; line-height: 1.15; font-weight: 600;
}

.side-nav { padding: .85rem .7rem; flex: 1 1 auto; overflow-y: auto; }
.side-link {
  display: flex; align-items: center; gap: .7rem;
  padding: .62rem .75rem; margin-bottom: .15rem;
  border-radius: 10px;
  color: #cfc9dd; text-decoration: none;
  font-size: .92rem; font-weight: 500;
}
.side-link i { font-size: 1.02rem; opacity: .85; width: 1.2rem; text-align: center; }
.side-link:hover { background: rgba(255,255,255,.07); color: #fff; text-decoration: none; }
.side-link.active { background: var(--brand); color: #fff; }
.side-link.active i { opacity: 1; }

.side-foot { padding: .9rem .9rem 1.1rem; border-top: 1px solid rgba(255,255,255,.07); }
.side-user { display: flex; align-items: center; gap: .6rem; margin-bottom: .7rem; }
.side-user-av {
  width: 2.1rem; height: 2.1rem; flex: 0 0 2.1rem;
  border-radius: 50%; background: var(--gold); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: .9rem;
}
.side-user-txt { line-height: 1.2; min-width: 0; }
.side-user-txt strong { display: block; color: #fff; font-size: .88rem; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user-txt span { font-size: .72rem; color: #9b94ad; }
.side-signout { display: block; font-size: .82rem; color: #9b94ad; }
.side-signout:hover { color: #fff; text-decoration: none; }

.app-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }

.app-top {
  display: flex; align-items: center; gap: 1rem;
  padding: 1.05rem 1.6rem;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.app-title { font-size: 1.22rem; font-weight: 650; margin: 0; }
.app-top-actions { margin-left: auto; }
.app-body { padding: 1.6rem; flex: 1 1 auto; }

/* --- The bar shown while inside one event -------------------------------- */
.event-bar { background: var(--surface); border-bottom: 1px solid var(--line); padding: 0 1.6rem; }
.event-bar-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; padding: 1rem 0 .85rem;
}
.event-bar-name { font-size: 1.02rem; font-weight: 650; display: flex; align-items: center; gap: .5rem; }
.event-bar-meta { font-size: .83rem; color: var(--ink-mute); margin-top: .15rem; }
.event-tabs { display: flex; gap: .2rem; overflow-x: auto; }
.event-tabs a {
  padding: .6rem .9rem; font-size: .88rem; font-weight: 500;
  color: var(--ink-soft); white-space: nowrap;
  border-bottom: 2px solid transparent;
}
.event-tabs a:hover { color: var(--ink); text-decoration: none; }
.event-tabs a.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }

.sub-bar {
  display: flex; align-items: center; gap: 1rem;
  margin-bottom: 1.1rem; font-size: .9rem; flex-wrap: wrap;
}
.sub-bar-title { font-weight: 600; }

/* --- Panels -------------------------------------------------------------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: .95rem 1.15rem;
  border-bottom: 1px solid var(--line);
}
.panel-head h2 {
  font-size: .96rem; font-weight: 650; margin: 0;
  display: flex; align-items: center; gap: .5rem;
}
.panel-body { padding: 1.15rem; }
.sticky-panel { position: sticky; top: 5.6rem; }

/* --- Statistic cards ----------------------------------------------------- */
.stat-row {
  display: grid; gap: .9rem;
  grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr));
}
.stat-card {
  display: flex; align-items: center; gap: .8rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .85rem .95rem;
  box-shadow: var(--shadow-sm);
  color: inherit; text-decoration: none;
}
a.stat-card:hover { border-color: #cfc8e4; box-shadow: var(--shadow); text-decoration: none; color: inherit; }
.stat-ico {
  width: 2.4rem; height: 2.4rem; flex: 0 0 2.4rem;
  border-radius: 10px; display: grid; place-items: center; font-size: 1.05rem;
}
.stat-txt { line-height: 1.15; min-width: 0; }
.stat-txt strong { display: block; font-size: 1.4rem; font-weight: 700; }
.stat-txt span { font-size: .78rem; color: var(--ink-mute); }

.mini-stat {
  background: var(--bg); border-radius: 10px; padding: .6rem .7rem; text-align: center;
}
.mini-stat strong { display: block; font-size: 1.1rem; font-weight: 700; }
.mini-stat span { font-size: .74rem; color: var(--ink-mute); }

/* --- Toolbar ------------------------------------------------------------- */
.toolbar {
  display: flex; align-items: center; gap: .8rem;
  flex-wrap: wrap; margin-bottom: 1.2rem;
}
.toolbar-search { flex: 1 1 18rem; max-width: 26rem; }
.toolbar-filters { display: flex; gap: .35rem; flex-wrap: wrap; align-items: center; }
.chip {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .36rem .7rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: .82rem; font-weight: 500; color: var(--ink-soft);
}
.chip:hover { border-color: #cfc8e4; color: var(--ink); text-decoration: none; }
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip span {
  background: rgba(0,0,0,.07); border-radius: 999px;
  padding: 0 .35rem; font-size: .72rem; font-weight: 600;
}
.chip.active span { background: rgba(255,255,255,.22); }

/* --- Event cards --------------------------------------------------------- */
.event-grid {
  display: grid; gap: 1.1rem;
  grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
}
.event-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; overflow: hidden;
}
.event-card:hover { box-shadow: var(--shadow); }
.event-card-cover {
  height: 7.5rem; position: relative;
  background-size: cover; background-position: center;
  display: grid; place-items: center;
}
.event-card-cover .badge { position: absolute; top: .6rem; right: .6rem; }
.event-card-ico { font-size: 2rem; color: rgba(255,255,255,.75); }
.event-card-body { padding: .95rem 1rem .6rem; flex: 1 1 auto; }
.event-card-type {
  font-size: .7rem; text-transform: uppercase; letter-spacing: .09em;
  color: var(--gold); font-weight: 650;
}
.event-card-title { font-size: 1.04rem; font-weight: 650; margin: .15rem 0 .5rem; }
.event-card-title a { color: var(--ink); }
.event-card-title a:hover { color: var(--brand); text-decoration: none; }
.event-card-meta {
  font-size: .82rem; color: var(--ink-soft);
  display: flex; align-items: center; gap: .4rem; margin-bottom: .2rem;
}
.event-card-meta i { color: var(--ink-mute); }
.event-card-counts {
  display: flex; gap: .85rem; flex-wrap: wrap;
  margin-top: .7rem; padding-top: .6rem;
  border-top: 1px dashed var(--line);
  font-size: .78rem; color: var(--ink-mute);
}
.event-card-counts strong { color: var(--ink); }
.event-card-foot {
  display: flex; align-items: center; gap: .3rem;
  padding: .6rem .8rem; background: #fbfaff; border-top: 1px solid var(--line);
}

/* Cover colours when an event has no picture */
.theme-gold     { background: linear-gradient(135deg, #c79a33, #8a6a1c); }
.theme-rose     { background: linear-gradient(135deg, #d98aa0, #a4596f); }
.theme-emerald  { background: linear-gradient(135deg, #3f9f7f, #27705a); }
.theme-midnight { background: linear-gradient(135deg, #4b5c92, #262f52); }
.theme-sand     { background: linear-gradient(135deg, #cdb79a, #9a846a); }

.theme-picker { display: flex; gap: .45rem; flex-wrap: wrap; }
.theme-swatch { cursor: pointer; text-align: center; }
.theme-swatch input { position: absolute; opacity: 0; pointer-events: none; }
.theme-swatch span {
  display: block; padding: .3rem .55rem;
  border-radius: 8px; font-size: .74rem; color: #fff; font-weight: 600;
  border: 2px solid transparent;
}
.theme-swatch.theme-gold span     { background: linear-gradient(135deg, #c79a33, #8a6a1c); }
.theme-swatch.theme-rose span     { background: linear-gradient(135deg, #d98aa0, #a4596f); }
.theme-swatch.theme-emerald span  { background: linear-gradient(135deg, #3f9f7f, #27705a); }
.theme-swatch.theme-midnight span { background: linear-gradient(135deg, #4b5c92, #262f52); }
.theme-swatch.theme-sand span     { background: linear-gradient(135deg, #cdb79a, #9a846a); }
.theme-swatch input:checked + span { border-color: var(--ink); box-shadow: 0 0 0 2px #fff inset; }

.cover-preview {
  height: 7rem; border-radius: 10px; border: 1px solid var(--line);
  background-size: cover; background-position: center;
}
.thumb {
  width: 4.5rem; height: 3.2rem; border-radius: 8px; border: 1px solid var(--line);
  background-size: cover; background-position: center; flex: 0 0 auto;
}

/* --- Builder block rows -------------------------------------------------- */
.block-list { padding: .7rem; display: flex; flex-direction: column; gap: .55rem; }
.block-row {
  border: 1px solid var(--line); border-radius: 11px;
  background: var(--surface); overflow: hidden;
}
.block-row.is-hidden { background: #fbfbfd; }
.block-row.is-hidden .block-head-txt strong { color: var(--ink-mute); text-decoration: line-through; }
.block-head { display: flex; align-items: center; gap: .7rem; padding: .7rem .8rem; }
.block-ico {
  width: 2.1rem; height: 2.1rem; flex: 0 0 2.1rem;
  display: grid; place-items: center; border-radius: 8px;
  background: var(--gold-soft); color: #8a6a1c;
}
.block-head-txt { flex: 1 1 auto; line-height: 1.25; min-width: 0; }
.block-head-txt strong { display: block; font-size: .92rem; font-weight: 600; }
.block-head-txt span { font-size: .76rem; color: var(--ink-mute); }
.block-actions { display: flex; gap: .2rem; flex: 0 0 auto; }
.block-actions .btn { padding: .25rem .45rem; line-height: 1; }
.block-form { padding: .3rem .9rem 1rem; border-top: 1px dashed var(--line); }
.block-hint { font-size: .8rem; color: var(--ink-mute); margin: .7rem 0 .3rem; }
.block-form-foot {
  display: flex; align-items: center; gap: .6rem;
  margin-top: 1rem; padding-top: .8rem; border-top: 1px solid var(--line);
}

/* --- Add-a-block palette ------------------------------------------------- */
.palette { display: flex; flex-direction: column; gap: .4rem; }
.palette-item {
  display: flex; align-items: center; gap: .7rem; width: 100%;
  padding: .6rem .7rem; text-align: left;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; cursor: pointer;
}
.palette-item:hover { border-color: var(--brand); background: #faf8ff; }
.palette-ico {
  width: 2rem; height: 2rem; flex: 0 0 2rem;
  display: grid; place-items: center; border-radius: 8px;
  background: var(--bg); color: var(--brand);
}
.palette-txt { flex: 1 1 auto; line-height: 1.25; min-width: 0; }
.palette-txt strong { display: block; font-size: .86rem; font-weight: 600; }
.palette-txt small { font-size: .73rem; color: var(--ink-mute); }
.palette-plus { color: var(--ink-mute); flex: 0 0 auto; }

/* --- Repeating rows inside a block --------------------------------------- */
.rep-rows { display: flex; flex-direction: column; gap: .5rem; }
.rep-row {
  display: flex; gap: .45rem; align-items: flex-start;
  background: var(--bg); border-radius: 9px; padding: .5rem;
}
.rep-row .rep-cell { flex: 1 1 0; min-width: 0; }
.rep-row .rep-cell label {
  display: block; font-size: .68rem; text-transform: uppercase;
  letter-spacing: .05em; color: var(--ink-mute); margin-bottom: .15rem;
}
.rep-row input, .rep-row textarea {
  width: 100%; font-size: .85rem; padding: .3rem .5rem;
  border: 1px solid var(--line); border-radius: 7px; background: #fff;
}
.rep-del {
  flex: 0 0 auto; align-self: center; margin-top: .9rem;
  background: none; border: 0; color: #b2546a; cursor: pointer; padding: .2rem .3rem;
}
.rep-del:hover { color: #8d2f45; }

/* --- Tables -------------------------------------------------------------- */
.table { font-size: .89rem; margin-bottom: 0; }
.table > thead th {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--ink-mute); font-weight: 650;
  border-bottom: 1px solid var(--line); background: #fbfaff;
  white-space: nowrap;
}
.table > tbody td { border-color: #f0eff6; vertical-align: middle; }
.row-muted { opacity: .62; }
.nowrap, .nowrap-table td, .nowrap-table th { white-space: nowrap; }
.nowrap-table td { max-width: 18rem; overflow: hidden; text-overflow: ellipsis; }

.avatar {
  width: 2rem; height: 2rem; flex: 0 0 2rem;
  border-radius: 50%; background: var(--gold-soft); color: #8a6a1c;
  display: grid; place-items: center; font-weight: 700; font-size: .82rem;
}

.bulk-bar {
  display: flex; align-items: center; gap: .7rem;
  padding: .6rem 1.15rem; background: #f4f0fd;
  border-bottom: 1px solid var(--line); font-size: .86rem;
}

.date-chip {
  width: 3rem; height: 3rem; flex: 0 0 3rem;
  border-radius: 10px; background: var(--gold-soft); color: #7d5f18;
  display: grid; place-items: center; line-height: 1;
}
.date-chip strong { font-size: 1.12rem; font-weight: 700; }
.date-chip span { font-size: .66rem; text-transform: uppercase; letter-spacing: .05em; }

/* --- Picking staff ------------------------------------------------------- */
.pick-list { max-height: 24rem; overflow-y: auto; }
.pick-group {
  font-size: .68rem; text-transform: uppercase; letter-spacing: .07em;
  color: var(--ink-mute); font-weight: 650;
  padding: .6rem .2rem .25rem;
}
.pick-item {
  display: flex; align-items: flex-start; gap: .55rem;
  padding: .4rem .45rem; border-radius: 8px; cursor: pointer;
}
.pick-item:hover { background: var(--bg); }
.pick-item span { line-height: 1.25; }
.pick-item strong { display: block; font-size: .87rem; font-weight: 600; }
.pick-item small { font-size: .74rem; color: var(--ink-mute); }

/* --- Activity list ------------------------------------------------------- */
.activity { list-style: none; margin: 0; padding: .9rem 1.15rem; }
.activity li { display: flex; gap: .65rem; padding: .35rem 0; font-size: .85rem; }
.act-dot {
  width: .5rem; height: .5rem; flex: 0 0 .5rem; margin-top: .45rem;
  border-radius: 50%; background: var(--gold);
}

/* --- Empty states -------------------------------------------------------- */
.empty-state { text-align: center; padding: 3rem 1.5rem; }
.empty-ico {
  width: 3.4rem; height: 3.4rem; margin: 0 auto .9rem;
  border-radius: 14px; background: var(--gold-soft); color: #8a6a1c;
  display: grid; place-items: center; font-size: 1.5rem;
}
.empty-state h2 { font-size: 1.05rem; font-weight: 650; margin: 0 0 .35rem; }
.empty-state p { color: var(--ink-soft); max-width: 30rem; margin: 0 auto 1.1rem; font-size: .9rem; }

.col-list { list-style: none; padding: 0; margin: 0 0 1rem; }
.col-list li { padding: .3rem 0; border-bottom: 1px dashed var(--line); font-size: .87rem; }
.col-list li:last-child { border-bottom: 0; }

.link-box { background: var(--bg); border-radius: 10px; padding: .6rem .7rem; }
.form-actions {
  display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: .9rem 1.15rem;
  box-shadow: var(--shadow-sm);
}

/* --- Bootstrap touch-ups ------------------------------------------------- */
.form-label { font-size: .82rem; font-weight: 600; margin-bottom: .25rem; color: var(--ink-soft); }
.form-control, .form-select { border-color: #dcdbe8; font-size: .9rem; }
.form-control:focus, .form-select:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px rgba(109, 75, 156, .13);
}
.form-text { font-size: .76rem; color: var(--ink-mute); }
.btn { font-size: .88rem; font-weight: 550; border-radius: 9px; }
.btn-primary { background: var(--brand); border-color: var(--brand); }
.btn-primary:hover, .btn-primary:focus { background: var(--brand-dk); border-color: var(--brand-dk); }
.btn-lg { font-size: .95rem; padding: .6rem 1.2rem; }
.btn-sm { font-size: .8rem; border-radius: 8px; }
.badge { font-weight: 600; font-size: .7rem; padding: .3em .55em; }
.alert { border-radius: 11px; font-size: .9rem; border: 1px solid transparent; }
.modal-content { border-radius: 16px; border: 0; }
.modal-header, .modal-footer { border-color: var(--line); }
.dropdown-menu { font-size: .87rem; border-color: var(--line); border-radius: 11px; box-shadow: var(--shadow); }
.dropdown-item { padding: .4rem .9rem; }
details > summary { cursor: pointer; }
details > summary:hover { color: var(--brand); }

/* --- Narrow screens ------------------------------------------------------ */
@media (max-width: 991.98px) {
  .app-sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 1040;
    transform: translateX(-100%); transition: transform .2s ease;
  }
  .app-sidebar.open { transform: translateX(0); box-shadow: 0 0 40px rgba(0,0,0,.3); }
  .app-body { padding: 1.1rem; }
  .app-top, .event-bar { padding-left: 1.1rem; padding-right: 1.1rem; }
  .sticky-panel { position: static; }
}
@media (max-width: 575.98px) {
  .toolbar-search { max-width: none; }
  .stat-txt strong { font-size: 1.2rem; }
}
