/* =========================================================
   HAGREB ADMIN — iSTIM-style shell, Tyrian purple palette
   ========================================================= */

:root {
  --purple:      #66023C;
  --purple-deep: #4A0129;
  --purple-mid:  #8A1656;
  --purple-soft: #F7EBF2;
  --purple-line: #E9D5E0;

  --black:       #0E0D10;
  --ink:         #1A171C;
  --ink-soft:    #5A525F;
  --ink-faint:   #948C99;

  --white:       #FFFFFF;
  --canvas:      #F6F4F7;
  --line:        #E8E4EA;

  --ok:    #17845A;
  --warn:  #B8720A;
  --bad:   #C93B3B;
  --info:  #2E5FAD;

  --r:     14px;
  --r-sm:  9px;
  --r-pill:999px;
  --font: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --shadow-sm: 0 1px 2px rgba(14,13,16,.04), 0 1px 3px rgba(14,13,16,.05);
  --shadow:    0 4px 16px rgba(14,13,16,.06);
  --shadow-lg: 0 18px 48px rgba(14,13,16,.16);

  --sidebar-w: 236px;
  --sidebar-w-collapsed: 74px;
}

* { box-sizing: border-box; }

body {
  margin: 0; font-family: var(--font); background: var(--canvas);
  color: var(--ink); font-size: 14px; line-height: 1.55; -webkit-font-smoothing: antialiased;
}
a { color: var(--purple); text-decoration: none; }
a:hover { color: var(--purple-mid); }

/* =========================================================
   PAGE LOADER
   ========================================================= */
#page-loader {
  position: fixed; inset: 0; z-index: 999;
  background: var(--canvas);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1.1rem; transition: opacity .35s ease, visibility .35s ease;
}
#page-loader.is-hidden { opacity: 0; visibility: hidden; }
/* The ring spins via a pseudo-element so the logo inside stays perfectly still. */
.loader-ring {
  width: 78px; height: 78px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.loader-ring::before {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid var(--purple-line);
  border-top-color: var(--purple);
  animation: spin 1s linear infinite;
}
.loader-icon { width: 26px; color: var(--purple); display: block; position: relative; z-index: 1; animation: pulse 1.8s ease-in-out infinite; }
.loader-icon svg { width: 100%; height: auto; display: block; }
.loader-text { text-align: center; }
.loader-text strong { display: block; font-size: .95rem; color: var(--ink); font-weight: 700; }
.loader-text span { font-size: .82rem; color: var(--ink-faint); }
.loader-dots { display: flex; gap: 5px; justify-content: center; margin-top: .45rem; }
.loader-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--purple); opacity: .3; animation: dot 1.2s infinite; }
.loader-dots i:nth-child(2) { animation-delay: .2s; }
.loader-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(.9); opacity: .65; } }
@keyframes dot { 0%,100% { opacity: .25; } 50% { opacity: 1; } }

/* Content fades up once loaded */
.admin-content main { animation: riseIn .45s ease both; }
@keyframes riseIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* =========================================================
   SIGN IN — split screen, photo + gradient on the right
   ========================================================= */
body.admin-guest { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }
.login-pane {
  display: flex; align-items: center; justify-content: center;
  padding: 2.5rem; background: var(--white);
}
.login-box { width: 100%; max-width: 380px; }
.login-box .brand { margin-bottom: 2.25rem; }
.login-box .brand-logo { display: block; width: 150px; color: var(--purple); }
.login-box .brand-logo svg { width: 100%; height: auto; display: block; }
.login-box h1 { font-size: 1.5rem; margin: 0 0 .3rem; color: var(--black); letter-spacing: -.02em; }
.login-box .sub { color: var(--ink-soft); font-size: .9rem; margin: 0 0 1.9rem; }
.login-box .error {
  background: #FBEAEA; color: #922020; border: 1px solid #EFC4C4;
  padding: .7rem .9rem; border-radius: var(--r-sm); font-size: .87rem; margin-bottom: 1.2rem;
}
.login-box form { display: flex; flex-direction: column; gap: 1.15rem; }
.login-box label { font-size: .84rem; font-weight: 600; display: flex; flex-direction: column; gap: .4rem; color: var(--ink); }
.login-box input {
  font-family: var(--font); padding: .78rem .9rem; border: 1.5px solid var(--line);
  border-radius: var(--r-sm); font-size: .95rem; background: #FAF9FB;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.login-box input:focus { outline: none; border-color: var(--purple); background: var(--white); box-shadow: 0 0 0 3px rgba(102,2,60,.1); }
.login-box button[type=submit] {
  background: var(--purple); color: #fff; border: none; padding: .85rem;
  border-radius: var(--r-sm); font-weight: 600; cursor: pointer; font-size: .95rem;
  font-family: var(--font); transition: background .15s;
}
.login-box button[type=submit]:hover { background: var(--purple-mid); }

.login-art {
  position: relative; background: var(--black) center/cover no-repeat;
  display: flex; align-items: flex-end; padding: 3.5rem;
  overflow: hidden;
}
.login-art::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(160deg, rgba(102,2,60,.55) 0%, rgba(14,13,16,.82) 55%, rgba(14,13,16,.95) 100%);
}
.login-art .art-copy { position: relative; z-index: 2; color: #fff; max-width: 30ch; }
.login-art h2 { font-size: 2.1rem; line-height: 1.15; margin: 0 0 .7rem; color: #fff; letter-spacing: -.02em; }
.login-art p { color: rgba(255,255,255,.78); font-size: .95rem; margin: 0; }
.login-art .art-badge {
  display: inline-flex; align-items: center; gap: .5rem; margin-bottom: 1.2rem;
  font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: rgba(255,255,255,.9); background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2); padding: .4rem .85rem; border-radius: var(--r-pill);
}

/* =========================================================
   SHELL
   ========================================================= */
body.admin-layout { display: flex; min-height: 100vh; }

.admin-sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background: linear-gradient(185deg, var(--purple) 0%, var(--purple-deep) 100%);
  border-right: 1px solid rgba(255,255,255,.08); display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; padding: 1.1rem 0 .9rem;
  transition: width .22s ease; z-index: 20;
}
body.sidebar-collapsed .admin-sidebar { width: var(--sidebar-w-collapsed); }

.admin-brand { display: flex; align-items: center; gap: .6rem; padding: 0 1.1rem 1.25rem; position: relative; }
.admin-brand img { height: 38px; width: auto; flex-shrink: 0; }
.admin-brand .brand-mark { color: #fff; display: block; width: 128px; }
.admin-brand .brand-mark svg { width: 100%; height: auto; display: block; }
.admin-brand .brand-icon { color: #fff; width: 34px; flex-shrink: 0; display: none; }
.admin-brand .brand-icon svg { width: 100%; height: auto; display: block; }
body.sidebar-collapsed .admin-brand .brand-icon { display: block; }
body.sidebar-collapsed .admin-brand { justify-content: center; padding-left: 0; padding-right: 0; }
body.sidebar-collapsed .admin-brand .brand-mark { display: none; }

/* Circular collapse handle on the sidebar edge, as in the reference */
.sidebar-toggle {
  position: absolute; right: -14px; top: 8px;
  width: 28px; height: 28px; border-radius: 50%;
  background: #fff; color: var(--purple); border: 3px solid var(--canvas);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  padding: 0; z-index: 30; transition: background .15s;
}
.sidebar-toggle:hover { background: var(--purple-soft); }
.sidebar-toggle svg { width: 13px; height: 13px; transition: transform .22s; }
body.sidebar-collapsed .sidebar-toggle svg { transform: rotate(180deg); }

.admin-nav {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: 2px; padding: 0 .7rem;
}
.admin-nav::-webkit-scrollbar { width: 5px; }
.admin-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.22); border-radius: 3px; }

.admin-nav-label {
  font-size: .66rem; text-transform: uppercase; letter-spacing: .09em;
  color: rgba(255,255,255,.45); padding: .95rem .7rem .35rem; font-weight: 700; white-space: nowrap;
}
body.sidebar-collapsed .admin-nav-label { opacity: 0; height: .8rem; padding: .4rem 0 0; overflow: hidden; }

.admin-nav a {
  display: flex; align-items: center; gap: .7rem;
  color: rgba(255,255,255,.8); padding: .62rem .7rem; border-radius: var(--r-sm);
  font-size: .89rem; font-weight: 500; white-space: nowrap;
  border: 1px solid transparent; transition: background .13s, color .13s, border-color .13s;
}
.admin-nav a svg { width: 18px; height: 18px; flex-shrink: 0; }
.admin-nav a .nav-text { flex: 1; }
.admin-nav a:hover { background: rgba(255,255,255,.12); color: #fff; }
.admin-nav a.active {
  background: #fff; color: var(--purple); font-weight: 700;
  border-color: transparent; box-shadow: 0 4px 12px rgba(0,0,0,.18);
}
.admin-nav a .badge-count {
  background: #fff; color: var(--purple); font-size: .68rem; font-weight: 700;
  padding: .08rem .4rem; border-radius: var(--r-pill); flex-shrink: 0;
}
body.sidebar-collapsed .admin-nav a { justify-content: center; padding: .62rem 0; }
body.sidebar-collapsed .admin-nav a .nav-text,
body.sidebar-collapsed .admin-nav a .badge-count { display: none; }

.admin-sidebar-foot { padding: .7rem .7rem 0; border-top: 1px solid rgba(255,255,255,.14); margin-top: .6rem; }
.admin-sidebar-foot a, .admin-sidebar-foot button {
  display: flex; align-items: center; gap: .7rem; width: 100%;
  background: none; border: none; font-family: var(--font); font-size: .87rem;
  color: rgba(255,255,255,.75); padding: .6rem .7rem; border-radius: var(--r-sm);
  cursor: pointer; text-align: left; white-space: nowrap;
}
.admin-sidebar-foot a:hover, .admin-sidebar-foot button:hover { background: rgba(255,255,255,.12); color: #fff; }
.admin-sidebar-foot svg { width: 18px; height: 18px; flex-shrink: 0; }
body.sidebar-collapsed .admin-sidebar-foot a span,
body.sidebar-collapsed .admin-sidebar-foot button span { display: none; }
body.sidebar-collapsed .admin-sidebar-foot a,
body.sidebar-collapsed .admin-sidebar-foot button { justify-content: center; padding: .6rem 0; }

/* =========================================================
   TOPBAR
   ========================================================= */
.admin-content { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.admin-topbar {
  background: var(--white); border-bottom: 1px solid var(--line);
  padding: .8rem 1.75rem; display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; position: sticky; top: 0; z-index: 15;
}
.org-chip {
  background: var(--purple-soft); color: var(--purple); font-weight: 600;
  padding: .45rem 1rem; border-radius: var(--r-sm); font-size: .87rem;
}

.avatar-wrap { position: relative; }
.avatar-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--purple-line);
  background: linear-gradient(140deg, var(--purple) 0%, var(--purple-mid) 100%);
  color: #fff; font-weight: 700; font-size: .92rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-family: var(--font);
}
.avatar-menu {
  position: absolute; right: 0; top: calc(100% + 10px); width: 250px;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow-lg); overflow: hidden; display: none; z-index: 40;
}
.avatar-menu.is-open { display: block; }
.avatar-menu .who { padding: 1rem 1.1rem; border-bottom: 1px solid var(--line); }
.avatar-menu .who strong { display: block; font-size: .93rem; color: var(--black); }
.avatar-menu .who span { font-size: .8rem; color: var(--ink-faint); }
.avatar-menu a, .avatar-menu button {
  display: block; width: 100%; text-align: left; background: none; border: none;
  font-family: var(--font); font-size: .88rem; color: var(--ink); padding: .7rem 1.1rem;
  cursor: pointer;
}
.avatar-menu a:hover, .avatar-menu button:hover { background: var(--purple-soft); color: var(--purple); }
.avatar-menu .sep { height: 1px; background: var(--line); }

.admin-content main { padding: 1.6rem 1.75rem 4rem; flex: 1; max-width: 1180px; width: 100%; }

/* =========================================================
   PAGE HEAD
   ========================================================= */
.a-page-head { margin-bottom: 1.4rem; display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.a-page-head h1 { font-size: 1.4rem; margin: 0 0 .2rem; color: var(--black); letter-spacing: -.02em; }
.a-page-head .page-lede { color: var(--ink-soft); font-size: .88rem; margin: 0; }
.a-breadcrumb { font-size: .81rem; color: var(--ink-faint); margin-bottom: .5rem; }

/* =========================================================
   WELCOME CARD
   ========================================================= */
.a-welcome {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r);
  padding: 1.6rem 1.75rem; box-shadow: var(--shadow-sm); margin-bottom: 1.25rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; overflow: hidden;
}
.a-welcome h2 { font-size: 1.2rem; margin: 0 0 .35rem; color: var(--purple); letter-spacing: -.01em; }
.a-welcome p { margin: 0; color: var(--ink-soft); font-size: .9rem; }
.a-welcome-art {
  width: 150px; flex-shrink: 0; border-radius: var(--r-sm); overflow: hidden;
  aspect-ratio: 3/2;
}
.a-welcome-art img { width: 100%; height: 100%; object-fit: cover; }

/* =========================================================
   SEGMENTED STAT CELLS
   ========================================================= */
.a-summary {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow-sm); margin-bottom: 1.25rem; overflow: hidden;
}
.a-summary-head { padding: 1.1rem 1.4rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.a-summary-head h2 { margin: 0; font-size: 1rem; }
.a-summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); }
.a-cell { padding: 1.15rem 1.4rem; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.a-cell:nth-child(4n) { border-right: none; }
.a-cell:nth-last-child(-n+4) { border-bottom: none; }
.a-cell .k { font-size: .8rem; color: var(--ink-soft); margin-bottom: .3rem; }
.a-cell .v { font-size: 1.6rem; font-weight: 800; color: var(--black); letter-spacing: -.03em; line-height: 1.1; }
.a-ticks { display: flex; gap: 3px; margin-top: .55rem; }
.a-ticks i { flex: 1; height: 14px; border-radius: 2px; background: var(--line); }
.a-ticks i.on { background: var(--purple); }
.a-ticks--alt i.on { background: var(--purple-mid); }
.a-cell .delta { font-size: .76rem; margin-top: .4rem; font-weight: 600; }
.a-cell .delta.up { color: var(--ok); }
.a-cell .delta.down { color: var(--bad); }
.a-cell .delta.flat { color: var(--ink-faint); }

/* =========================================================
   PANELS / TABLES / BUTTONS
   ========================================================= */
.a-panel {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r);
  padding: 1.35rem; margin-bottom: 1.25rem; box-shadow: var(--shadow-sm);
}
.a-panel--flush { padding: 0; overflow: hidden; }
/* Wrapper so wide tables can scroll sideways on small screens rather than
   clipping their action buttons off the edge. */
.a-scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.a-scroll-x table { min-width: 640px; }
.a-scroll-x::-webkit-scrollbar { height: 7px; }
.a-scroll-x::-webkit-scrollbar-thumb { background: var(--purple-line); border-radius: 4px; }
.a-panel-head { padding: 1.05rem 1.35rem; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.a-panel-head h2, .a-panel-head h3 { margin: 0; font-size: .96rem; font-weight: 700; }
.a-panel-head .sub { font-size: .8rem; color: var(--ink-soft); margin: .12rem 0 0; font-weight: 400; }

.a-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  background: var(--purple); color: #fff; border: 1px solid var(--purple);
  padding: .55rem 1.05rem; border-radius: var(--r-sm); font-weight: 600;
  font-size: .85rem; cursor: pointer; font-family: var(--font); white-space: nowrap;
  transition: background .13s, border-color .13s, color .13s;
}
.a-btn:hover { background: var(--purple-mid); border-color: var(--purple-mid); color: #fff; }
.a-btn--accent, .a-btn--orange { background: var(--purple); border-color: var(--purple); }
.a-btn--accent:hover, .a-btn--orange:hover { background: var(--purple-mid); border-color: var(--purple-mid); }
.a-btn--ghost { background: var(--white); color: var(--ink); border-color: var(--line); }
.a-btn--ghost:hover { background: var(--purple-soft); border-color: var(--purple-line); color: var(--purple); }
.a-btn--danger { background: transparent; color: var(--bad); border-color: var(--line); }
.a-btn--danger:hover { background: var(--bad); border-color: var(--bad); color: #fff; }
.a-btn--sm { padding: .34rem .68rem; font-size: .78rem; }
.a-actions-bar {
  position: sticky; bottom: 0; background: var(--white); border: 1px solid var(--line);
  border-radius: var(--r); padding: .85rem 1.25rem; display: flex; align-items: center; gap: .75rem;
  box-shadow: 0 -2px 14px rgba(14,13,16,.06); margin-top: 1.25rem;
}
.a-actions-bar .spacer { flex: 1; }
.a-actions-bar .hint { font-size: .8rem; color: var(--ink-soft); }

.a-table { width: 100%; border-collapse: collapse; }
.a-table th {
  text-align: left; font-size: .71rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--ink-soft); padding: .7rem 1.35rem; border-bottom: 1px solid var(--line);
  background: #FBFAFC; font-weight: 700;
}
.a-table td { padding: .85rem 1.35rem; border-bottom: 1px solid #F2EFF4; font-size: .88rem; vertical-align: middle; }
.a-table tr:last-child td { border-bottom: none; }
.a-table tbody tr:hover { background: #FCFAFD; }
.a-table .row-actions { display: flex; gap: .4rem; justify-content: flex-end; }
.a-table .cell-title { font-weight: 600; color: var(--black); }
.a-table .cell-sub { font-size: .79rem; color: var(--ink-soft); }
.a-table .cell-thumb { width: 52px; height: 40px; object-fit: cover; border-radius: 5px; border: 1px solid var(--line); }

.a-empty { padding: 3rem 1.5rem; text-align: center; color: var(--ink-soft); }
.a-empty strong { display: block; color: var(--black); margin-bottom: .3rem; font-size: .95rem; }
.a-empty p { margin: 0 0 1.1rem; font-size: .87rem; }

.a-badge { display: inline-block; font-size: .7rem; font-weight: 700; padding: .2rem .55rem; border-radius: 5px; }
.a-badge--published, .a-badge--approved { background: #E3F5EC; color: var(--ok); }
.a-badge--draft { background: #F1EEF3; color: var(--ink-soft); }
.a-badge--pending { background: #FDF3E2; color: var(--warn); }
.a-badge--rejected { background: #FBEAEA; color: var(--bad); }
.a-badge--new { background: var(--purple-soft); color: var(--purple); }

.a-alert { padding: .8rem 1.05rem; border-radius: var(--r-sm); font-size: .87rem; margin-bottom: 1.25rem; }
.a-alert--success { background: #E3F5EC; color: #106444; border: 1px solid #B5E2CD; }
.a-alert--error { background: #FBEAEA; color: #922020; border: 1px solid #EFC4C4; }

/* Forms */
.a-form-row { margin-bottom: 1.1rem; }
.a-form-row:last-child { margin-bottom: 0; }
.a-form-row label { display: block; font-size: .81rem; font-weight: 600; margin-bottom: .35rem; color: var(--ink); }
.a-form-row .hint { font-size: .78rem; color: var(--ink-soft); margin-top: .35rem; }
.a-form-row input[type=text], .a-form-row input[type=email], .a-form-row input[type=url],
.a-form-row input[type=number], .a-form-row select, .a-form-row textarea {
  width: 100%; font-family: var(--font); font-size: .9rem; padding: .55rem .75rem;
  border: 1.5px solid var(--line); border-radius: var(--r-sm); background: #fff; color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.a-form-row input:focus, .a-form-row select:focus, .a-form-row textarea:focus {
  outline: none; border-color: var(--purple); box-shadow: 0 0 0 3px rgba(102,2,60,.09);
}
.a-form-row textarea { min-height: 90px; resize: vertical; line-height: 1.6; }
.a-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.25rem; }
.a-form-grid .full { grid-column: 1 / -1; }
.a-checkbox { display: flex; align-items: center; gap: .5rem; font-size: .88rem; font-weight: 500; cursor: pointer; }
.a-checkbox input { width: auto; margin: 0; }

/* Section editor */
.a-section-card { border: 1px solid var(--line); border-radius: var(--r); background: var(--white); margin-bottom: .8rem; box-shadow: var(--shadow-sm); overflow: hidden; }
.a-section-toggle { width: 100%; text-align: left; background: transparent; border: none; padding: .95rem 1.25rem; cursor: pointer; font-family: var(--font); display: flex; align-items: center; gap: .75rem; }
.a-section-toggle:hover { background: #FCFAFD; }
.a-section-toggle .sec-name { font-weight: 600; font-size: .9rem; color: var(--black); }
.a-section-toggle .sec-preview { font-size: .8rem; color: var(--ink-soft); margin-left: auto; margin-right: .5rem; max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.a-section-toggle .chev { color: var(--ink-faint); transition: transform .18s; flex-shrink: 0; }
.a-section-card.is-open .a-section-toggle .chev { transform: rotate(180deg); }
.a-section-body { padding: 1.25rem; border-top: 1px solid var(--line); }
.a-section-card:not(.is-open) .a-section-body { display: none; }
.a-section-thumb { width: 34px; height: 26px; object-fit: cover; border-radius: 4px; border: 1px solid var(--line); flex-shrink: 0; }

/* Image picker */
.a-image-field { display: flex; gap: 1rem; align-items: flex-start; }
.a-image-preview { width: 168px; height: 108px; object-fit: cover; border-radius: var(--r-sm); border: 1px solid var(--line); flex-shrink: 0; display: block; }
.a-image-empty {
  width: 168px; height: 108px; border-radius: var(--r-sm); border: 1.5px dashed var(--purple-line);
  background: var(--purple-soft); flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  text-align: center; font-size: .75rem; color: var(--ink-faint); padding: .5rem;
}
.a-image-field-actions { display: flex; flex-direction: column; gap: .45rem; }

.a-modal-backdrop { position: fixed; inset: 0; background: rgba(14,13,16,.55); display: none; align-items: center; justify-content: center; z-index: 100; padding: 2rem; }
.a-modal-backdrop.is-open { display: flex; }
.a-modal { background: var(--white); border-radius: var(--r); width: 100%; max-width: 800px; max-height: 82vh; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); }
.a-modal-head { padding: 1.1rem 1.35rem; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.a-modal-head h3 { margin: 0; font-size: 1rem; }
.a-modal-close { background: none; border: none; font-size: 1.4rem; line-height: 1; cursor: pointer; color: var(--ink-faint); }
.a-modal-body { padding: 1.35rem; overflow-y: auto; }
.a-modal-foot { padding: .9rem 1.35rem; border-top: 1px solid var(--line); display: flex; gap: .6rem; justify-content: flex-end; }
.a-picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: .85rem; }
.a-picker-item { border: 2px solid var(--line); border-radius: var(--r-sm); overflow: hidden; cursor: pointer; background: #fff; padding: 0; width: 100%; font-family: var(--font); transition: border-color .12s, transform .12s; }
.a-picker-item:hover { border-color: var(--purple); transform: translateY(-1px); }
.a-picker-item.is-selected { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(102,2,60,.12); }
.a-picker-item img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.a-picker-item .name { padding: .4rem .5rem; font-size: .72rem; color: var(--ink-soft); word-break: break-all; text-align: left; }

/* Media library */
.a-media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; }
.a-media-item { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: #fff; box-shadow: var(--shadow-sm); }
.a-media-item img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.a-media-item .meta { padding: .65rem .75rem; }
.a-media-item .filename { font-size: .78rem; color: var(--ink); word-break: break-all; margin-bottom: .15rem; font-weight: 500; }
.a-media-item .dims { font-size: .72rem; color: var(--ink-faint); margin-bottom: .6rem; }
.a-dropzone { border: 2px dashed var(--purple-line); border-radius: var(--r); padding: 2rem 1.5rem; text-align: center; background: var(--purple-soft); transition: border-color .15s, background .15s; }
.a-dropzone.is-dragging { border-color: var(--purple); background: #F2E0EA; }
.a-dropzone p { margin: .4rem 0 0; font-size: .85rem; color: var(--ink-soft); }

/* Stats / charts */
.a-stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.4rem; }
.a-stat-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); padding: 1.15rem 1.25rem; box-shadow: var(--shadow-sm); }
.a-stat-label { font-size: .8rem; color: var(--ink-soft); display: block; }
.a-stat-number { display: block; font-size: 1.55rem; font-weight: 800; color: var(--black); line-height: 1.15; letter-spacing: -.03em; margin: .15rem 0; }
.a-stat-sub { font-size: .74rem; color: var(--ink-faint); display: block; }
.a-trend { font-size: .76rem; font-weight: 600; }
.a-trend.up { color: var(--ok); }
.a-trend.down { color: var(--bad); }

.a-chart-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1.25rem; margin-bottom: 1.25rem; }
.a-bars { display: flex; align-items: flex-end; gap: .55rem; height: 190px; padding-top: .5rem; }
.a-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .45rem; height: 100%; justify-content: flex-end; }
.a-bar { width: 100%; max-width: 42px; border-radius: 7px 7px 3px 3px; min-height: 3px; background: linear-gradient(180deg, var(--purple-mid) 0%, var(--purple) 100%); transition: filter .15s; }
.a-bar:hover { filter: brightness(1.12); }
.a-bar--empty { background: #EFECF1; }
.a-bar-col .lbl { font-size: .7rem; color: var(--ink-soft); }
.a-donut-wrap { display: flex; align-items: center; gap: 1.5rem; }
.a-donut { position: relative; flex-shrink: 0; }
.a-donut .center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.a-donut .center b { font-size: 1.4rem; font-weight: 800; color: var(--black); line-height: 1; }
.a-donut .center span { font-size: .72rem; color: var(--ink-faint); }
.a-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .55rem; font-size: .84rem; }
.a-legend li { display: flex; align-items: center; gap: .5rem; color: var(--ink-soft); }
.a-legend i { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.a-legend b { margin-left: auto; color: var(--black); }
.a-tier-row { display: flex; gap: 1rem; align-items: flex-start; padding: .85rem 0; border-bottom: 1px solid var(--line); }
.a-tier-row:last-of-type { border-bottom: none; }

.a-quick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.a-quick-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); padding: 1.15rem; box-shadow: var(--shadow-sm); display: block; transition: border-color .13s, transform .13s; }
.a-quick-card:hover { border-color: var(--purple); transform: translateY(-2px); }
.a-quick-card strong { display: block; color: var(--black); font-size: .9rem; margin-bottom: .2rem; }
.a-quick-card span { font-size: .8rem; color: var(--ink-soft); }

/* Rich text editor */
.a-editor-wrap { border: 1.5px solid var(--line); border-radius: var(--r-sm); overflow: hidden; background: #fff; }
.a-editor-wrap:focus-within { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(102,2,60,.09); }
.a-editor-toolbar { display: flex; flex-wrap: wrap; gap: .2rem; padding: .4rem; border-bottom: 1px solid var(--line); background: #FBFAFC; }
.a-editor-toolbar button { background: transparent; border: 1px solid transparent; border-radius: 4px; min-width: 30px; height: 28px; cursor: pointer; font-family: var(--font); font-size: .82rem; color: var(--ink); display: inline-flex; align-items: center; justify-content: center; padding: 0 .45rem; }
.a-editor-toolbar button:hover { background: var(--purple-soft); }
.a-editor-toolbar button.is-active { background: var(--purple-soft); border-color: var(--purple-line); color: var(--purple); }
.a-editor-toolbar .sep { width: 1px; background: var(--line); margin: .25rem; }
.a-editor-area { min-height: 200px; padding: .85rem .9rem; font-size: .92rem; line-height: 1.65; outline: none; overflow-y: auto; max-height: 460px; }
.a-editor-area:empty::before { content: attr(data-placeholder); color: var(--ink-faint); }
.a-editor-area h2 { font-size: 1.15rem; margin: 1.1rem 0 .5rem; }
.a-editor-area h3 { font-size: 1rem; margin: 1rem 0 .45rem; }
.a-editor-area p { margin: 0 0 .8rem; }
.a-editor-area ul, .a-editor-area ol { margin: 0 0 .8rem; padding-left: 1.4rem; }
.a-editor-area blockquote { margin: 0 0 .8rem; padding-left: .9rem; border-left: 3px solid var(--purple-line); color: var(--ink-soft); }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1050px) {
  .a-chart-grid { grid-template-columns: 1fr; }
  .a-stat-grid, .a-summary-grid { grid-template-columns: 1fr 1fr; }
  .a-cell:nth-child(4n) { border-right: 1px solid var(--line); }
  .a-cell:nth-child(2n) { border-right: none; }
  .a-quick-grid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  body.admin-guest { grid-template-columns: 1fr; }
  .login-art { display: none; }
  body.admin-layout { flex-direction: column; }
  .admin-sidebar { width: 100%; height: auto; position: static; padding-bottom: .6rem; }
  body.sidebar-collapsed .admin-sidebar { width: 100%; }
  .sidebar-toggle { display: none; }
  .admin-nav { flex-direction: row; flex-wrap: wrap; overflow: visible; }
  .admin-nav-label { display: none; }
  .admin-nav a .nav-text { display: none; }
  .admin-nav a { padding: .6rem .75rem; }
  .admin-content main { padding: 1.2rem 1rem 3rem; }
  .a-welcome-art { display: none; }
  .a-form-grid { grid-template-columns: 1fr; }
  .a-image-field { flex-direction: column; }
}
@media (max-width: 560px) {
  .a-stat-grid, .a-summary-grid { grid-template-columns: 1fr; }
  .a-cell { border-right: none !important; }
  .a-donut-wrap { flex-direction: column; align-items: flex-start; }
  .a-tier-row { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  *, #page-loader, .admin-content main { animation: none !important; transition: none !important; }
}

/* =========================================================
   ELEMENTOR-STYLE SECTION EDITOR
   Each section shows a live visual preview of what's on the
   site right now — image, heading and text — so the admin can
   see what they're editing instead of guessing from field names.
   ========================================================= */
.a-sec {
  border: 1px solid var(--line); border-radius: var(--r); background: var(--white);
  margin-bottom: .9rem; box-shadow: var(--shadow-sm); overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
}
.a-sec.is-open { border-color: var(--purple-line); box-shadow: var(--shadow); }

.a-sec-head {
  width: 100%; background: none; border: none; cursor: pointer; font-family: var(--font);
  display: flex; align-items: stretch; gap: 0; text-align: left; padding: 0;
}
.a-sec-head:hover { background: #FCFAFD; }

.a-sec-thumb {
  width: 128px; flex-shrink: 0; background: var(--purple-soft) center/cover no-repeat;
  position: relative; border-right: 1px solid var(--line);
}
.a-sec-thumb.is-empty::after {
  content: 'No image'; position: absolute; inset: 0; display: flex;
  align-items: center; justify-content: center; font-size: .68rem; color: var(--ink-faint);
}
.a-sec-info { flex: 1; min-width: 0; padding: .95rem 1.1rem; display: flex; flex-direction: column; justify-content: center; gap: .2rem; }
.a-sec-kicker { font-size: .64rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; color: var(--purple); }
.a-sec-title { font-weight: 700; font-size: .95rem; color: var(--black); }
.a-sec-snippet {
  font-size: .81rem; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.a-sec-chev { display: flex; align-items: center; padding-right: 1.1rem; color: var(--ink-faint); flex-shrink: 0; }
.a-sec-chev svg { width: 16px; height: 16px; transition: transform .2s; }
.a-sec.is-open .a-sec-chev svg { transform: rotate(180deg); }

.a-sec-body { border-top: 1px solid var(--line); padding: 1.25rem; background: #FDFCFE; }
.a-sec:not(.is-open) .a-sec-body { display: none; }

/* Two-column: fields left, live image preview right */
.a-sec-layout { display: grid; grid-template-columns: 1fr 260px; gap: 1.5rem; align-items: start; }
.a-sec-visual { position: sticky; top: 5rem; }
.a-sec-visual .cap { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; font-weight: 700; color: var(--ink-faint); margin-bottom: .5rem; }
.a-sec-visual img { width: 100%; aspect-ratio: 16/10; object-fit: cover; border-radius: var(--r-sm); border: 1px solid var(--line); display: block; }
.a-sec-visual .none {
  width: 100%; aspect-ratio: 16/10; border-radius: var(--r-sm); border: 1.5px dashed var(--purple-line);
  background: var(--purple-soft); display: flex; align-items: center; justify-content: center;
  font-size: .76rem; color: var(--ink-faint); text-align: center; padding: .75rem;
}
.a-sec-visual .acts { display: flex; flex-direction: column; gap: .4rem; margin-top: .6rem; }

@media (max-width: 900px) {
  .a-sec-layout { grid-template-columns: 1fr; }
  .a-sec-visual { position: static; }
  .a-sec-thumb { width: 84px; }
}

/* =========================================================
   BLOG GALLERY MANAGER
   ========================================================= */
.a-gallery { display: flex; flex-wrap: wrap; gap: .7rem; margin-bottom: .8rem; }
.a-gallery-item {
  position: relative; width: 118px; border-radius: var(--r-sm); overflow: hidden;
  border: 1px solid var(--line); background: #fff;
}
.a-gallery-item img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.a-gallery-item .rm {
  position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%;
  background: rgba(14,13,16,.72); color: #fff; border: none; cursor: pointer;
  font-size: 14px; line-height: 1; display: flex; align-items: center; justify-content: center;
}
.a-gallery-item .rm:hover { background: var(--bad); }
.a-gallery-empty {
  border: 1.5px dashed var(--purple-line); background: var(--purple-soft); border-radius: var(--r-sm);
  padding: 1.5rem; text-align: center; font-size: .84rem; color: var(--ink-soft); margin-bottom: .8rem;
}

/* =========================================================
   SHARED: compact panel titles, chips, meters
   ========================================================= */
.a-panel-title { margin-bottom: 1rem; }
.a-panel-title h2 { margin: 0 0 .15rem; font-size: .96rem; font-weight: 700; }
.a-panel-title p { margin: 0; font-size: .81rem; color: var(--ink-soft); }

.a-chip {
  display: inline-block; background: var(--purple-soft); color: var(--purple);
  font-size: .74rem; font-weight: 600; padding: .22rem .6rem; border-radius: var(--r-pill);
}

.a-meter { height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; margin-top: .45rem; }
.a-meter span { display: block; height: 100%; background: var(--purple); border-radius: 3px; }
.a-meter span.alt { background: var(--purple-mid); }

/* =========================================================
   SETTINGS — compact two-column, fits without scrolling
   ========================================================= */
.a-settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; align-items: start; }
.a-field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .85rem 1rem; }
.a-field-grid--1 { grid-template-columns: 1fr; }
.a-field label {
  display: block; font-size: .72rem; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--ink-faint); margin-bottom: .3rem;
}
.a-field input {
  width: 100%; font-family: var(--font); font-size: .88rem; padding: .48rem .7rem;
  border: 1.5px solid var(--line); border-radius: var(--r-sm); background: #fff; color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.a-field input:focus { outline: none; border-color: var(--purple); box-shadow: 0 0 0 3px rgba(102,2,60,.09); }
.a-field .hint { display: block; font-size: .74rem; color: var(--ink-faint); margin-top: .25rem; }

/* =========================================================
   PAGES — card grid instead of a sparse table
   ========================================================= */
.a-page-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; }
.a-page-card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r);
  padding: 1.15rem 1.25rem; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: .7rem;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.a-page-card:hover { border-color: var(--purple-line); transform: translateY(-2px); box-shadow: var(--shadow); }
.a-page-card-top h3 { margin: 0 0 .2rem; font-size: 1rem; }
.a-page-card-top code { font-size: .78rem; color: var(--ink-faint); }
.a-page-card-actions { display: flex; gap: .45rem; margin-top: auto; }

/* =========================================================
   SUBMISSIONS — tiles, tabs, message cards
   ========================================================= */
.a-sub-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
.a-sub-tile {
  border-radius: var(--r); padding: 1.1rem 1.25rem; color: #fff;
  background: linear-gradient(140deg, var(--purple) 0%, var(--purple-deep) 100%);
}
.a-sub-tile--alt  { background: linear-gradient(140deg, var(--purple-mid) 0%, var(--purple) 100%); }
.a-sub-tile--alt2 { background: linear-gradient(140deg, #A33B75 0%, var(--purple-mid) 100%); }
.a-sub-tile--dark { background: linear-gradient(140deg, #2B2230 0%, var(--black) 100%); }
.a-sub-tile .n { display: block; font-size: 1.7rem; font-weight: 800; line-height: 1.1; letter-spacing: -.03em; }
.a-sub-tile .l { display: block; font-size: .78rem; color: rgba(255,255,255,.8); margin-top: .15rem; }

.a-tabs { display: flex; gap: .35rem; border-bottom: 1px solid var(--line); margin-bottom: 1.25rem; overflow-x: auto; }
.a-tab {
  background: none; border: none; border-bottom: 2px solid transparent;
  font-family: var(--font); font-size: .87rem; font-weight: 600; color: var(--ink-soft);
  padding: .7rem .9rem; cursor: pointer; white-space: nowrap;
  display: inline-flex; align-items: center; gap: .45rem;
}
.a-tab:hover { color: var(--purple); }
.a-tab.is-active { color: var(--purple); border-bottom-color: var(--purple); }
.a-tab .c { background: var(--purple-soft); color: var(--purple); font-size: .7rem; font-weight: 700; padding: .05rem .4rem; border-radius: var(--r-pill); }
.a-tab.is-active .c { background: var(--purple); color: #fff; }
.a-tabpanel { display: none; }
.a-tabpanel.is-active { display: block; }

.a-msg-list { display: flex; flex-direction: column; gap: .8rem; }
.a-msg { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); padding: 1.1rem 1.25rem; box-shadow: var(--shadow-sm); }
.a-msg-head { display: flex; align-items: center; gap: .75rem; margin-bottom: .7rem; }
.a-msg-avatar {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(140deg, var(--purple) 0%, var(--purple-mid) 100%);
  color: #fff; font-weight: 700; font-size: .85rem;
  display: flex; align-items: center; justify-content: center;
}
.a-msg-who { flex: 1; min-width: 0; line-height: 1.35; }
.a-msg-who strong { display: block; font-size: .9rem; color: var(--black); }
.a-msg-who a, .a-msg-who span { font-size: .79rem; color: var(--ink-soft); }
.a-msg-head time { font-size: .76rem; color: var(--ink-faint); white-space: nowrap; }
.a-msg-body { margin: 0; font-size: .89rem; color: var(--ink); background: #FBFAFC; border-radius: var(--r-sm); padding: .8rem .9rem; }
.a-msg-actions { display: flex; gap: .45rem; margin-top: .8rem; }

/* =========================================================
   DASHBOARD — hero, metrics, feed
   ========================================================= */
.a-hero {
  border-radius: var(--r); padding: 1.75rem 1.9rem; margin-bottom: 1.4rem;
  background: linear-gradient(125deg, var(--purple) 0%, var(--purple-deep) 62%, var(--black) 100%);
  color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 2rem;
  position: relative; overflow: hidden;
}
.a-hero::after {
  content: ''; position: absolute; right: -70px; top: -70px; width: 260px; height: 260px;
  border-radius: 50%; background: rgba(255,255,255,.06);
}
.a-hero-copy { position: relative; z-index: 2; }
.a-hero-kicker { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: rgba(255,255,255,.62); font-weight: 600; }
.a-hero h1 { color: #fff; font-size: 1.6rem; margin: .35rem 0 .3rem; letter-spacing: -.02em; }
.a-hero p { color: rgba(255,255,255,.78); margin: 0 0 1.1rem; font-size: .9rem; }
.a-hero-actions { display: flex; gap: .55rem; flex-wrap: wrap; }
.a-btn--light { background: #fff; color: var(--purple); border-color: #fff; }
.a-btn--light:hover { background: var(--purple-soft); color: var(--purple); border-color: var(--purple-soft); }
.a-btn--outline-light { background: transparent; color: #fff; border-color: rgba(255,255,255,.45); }
.a-btn--outline-light:hover { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.6); }
.a-hero-figure { position: relative; z-index: 2; flex-shrink: 0; }
.a-hero-stat {
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18);
  border-radius: var(--r); padding: 1.15rem 1.5rem; text-align: center; backdrop-filter: blur(6px);
}
.a-hero-stat .n { display: block; font-size: 2rem; font-weight: 800; line-height: 1; letter-spacing: -.03em; }
.a-hero-stat .l { display: block; font-size: .74rem; color: rgba(255,255,255,.75); margin-top: .3rem; }

.a-metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.4rem; }
.a-metric {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r);
  padding: 1.15rem 1.25rem; box-shadow: var(--shadow-sm); display: block;
  border-top: 3px solid var(--purple); transition: transform .15s, box-shadow .15s;
}
.a-metric:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.a-metric--p1 { border-top-color: var(--purple); }
.a-metric--p2 { border-top-color: var(--purple-mid); }
.a-metric--p3 { border-top-color: #A33B75; }
.a-metric--p4 { border-top-color: var(--black); }
.a-metric-top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .35rem; }
.a-metric-label { font-size: .79rem; color: var(--ink-soft); font-weight: 600; }
.a-metric-top svg { width: 17px; height: 17px; color: var(--purple); opacity: .55; }
.a-metric-value { display: block; font-size: 1.65rem; font-weight: 800; color: var(--black); letter-spacing: -.03em; line-height: 1.1; }
.a-metric-sub { display: block; font-size: .76rem; color: var(--ink-faint); margin-top: .3rem; }

.a-dash-split { display: grid; grid-template-columns: 1.15fr .85fr; gap: 1.25rem; margin-bottom: 1.25rem; align-items: start; }

.a-feed { list-style: none; margin: 0; padding: 0; }
.a-feed li { display: flex; align-items: center; gap: .8rem; padding: .8rem 1.35rem; border-bottom: 1px solid #F2EFF4; }
.a-feed li:last-child { border-bottom: none; }
.a-feed-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.a-feed-dot--post { background: var(--purple); }
.a-feed-dot--form { background: #A33B75; }
.a-feed-body { flex: 1; min-width: 0; line-height: 1.35; }
.a-feed-body strong { display: block; font-size: .87rem; color: var(--black); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.a-feed-body span { font-size: .76rem; color: var(--ink-faint); }
.a-feed time { font-size: .76rem; color: var(--ink-faint); white-space: nowrap; }

.a-breakdown { list-style: none; margin: 0 0 1.1rem; padding: 0; display: flex; flex-direction: column; gap: .9rem; }
.a-breakdown li { display: grid; grid-template-columns: 1fr auto; gap: .2rem .5rem; }
.a-breakdown .k { font-size: .84rem; color: var(--ink-soft); }
.a-breakdown .v { font-size: .95rem; font-weight: 700; color: var(--black); }
.a-breakdown .a-meter { grid-column: 1 / -1; }

.a-mini-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.a-mini {
  background: var(--purple-soft); border-radius: var(--r-sm); padding: .8rem .6rem;
  text-align: center; display: block; transition: background .15s;
}
.a-mini:hover { background: var(--purple-line); }
.a-mini.is-flag { background: #FDF3E2; }
.a-mini .n { display: block; font-size: 1.15rem; font-weight: 800; color: var(--purple); line-height: 1.1; }
.a-mini.is-flag .n { color: var(--warn); }
.a-mini .l { display: block; font-size: .71rem; color: var(--ink-soft); margin-top: .15rem; }

/* =========================================================
   RESPONSIVE for the new blocks
   ========================================================= */
@media (max-width: 1050px) {
  .a-settings-grid { grid-template-columns: 1fr; }
  .a-metric-grid, .a-sub-tiles { grid-template-columns: 1fr 1fr; }
  .a-dash-split { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .a-hero { flex-direction: column; align-items: flex-start; gap: 1.25rem; }
  .a-hero-figure { width: 100%; }
  .a-hero-stat { width: 100%; }
}
@media (max-width: 560px) {
  .a-metric-grid, .a-sub-tiles, .a-field-grid, .a-page-cards { grid-template-columns: 1fr; }
  .a-mini-grid { grid-template-columns: 1fr 1fr; }
}

/* =========================================================
   BLACK + GLASS LAYER
   Black is now a real surface in the scheme, not just text:
   the dashboard console, profile banner and hero all sit on it,
   with frosted glass panels over the top.
   ========================================================= */

/* --- Dashboard hero: deeper, blacker, with a fine grid texture --- */
.a-hero {
  background:
    radial-gradient(1100px 320px at 88% -30%, rgba(138,22,86,.55) 0%, rgba(138,22,86,0) 60%),
    linear-gradient(120deg, var(--purple-deep) 0%, #16121A 55%, var(--black) 100%);
  border: 1px solid rgba(255,255,255,.08);
}
.a-hero::before {
  content: ''; position: absolute; inset: 0; opacity: .5;
  background-image:
    linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(105deg, #000 0%, transparent 62%);
  -webkit-mask-image: linear-gradient(105deg, #000 0%, transparent 62%);
}
.a-hero-stat {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.14);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
}
.a-hero-stat .n { font-variant-numeric: tabular-nums; }

/* --- Console strip: one black instrument panel, not four white cards --- */
.a-console {
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: linear-gradient(160deg, #17131B 0%, var(--black) 100%);
  border: 1px solid rgba(255,255,255,.09);
  border-radius: var(--r); overflow: hidden; margin-bottom: 1.4rem;
  position: relative;
}
.a-console::after {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--purple-mid), transparent);
}
.a-console-cell {
  padding: 1.15rem 1.3rem; display: block; color: #fff;
  border-right: 1px solid rgba(255,255,255,.08);
  transition: background .16s;
}
.a-console-cell:last-child { border-right: none; }
.a-console-cell:hover { background: rgba(255,255,255,.045); color: #fff; }
.a-console-cell .k {
  display: flex; align-items: center; gap: .4rem;
  font-size: .72rem; letter-spacing: .09em; text-transform: uppercase;
  color: rgba(255,255,255,.52); font-weight: 600;
}
.a-console-cell .v {
  display: block; font-size: 1.85rem; font-weight: 800; letter-spacing: -.035em;
  line-height: 1.15; margin-top: .3rem; font-variant-numeric: tabular-nums;
}
.a-console-cell .v .cur { font-size: .82rem; font-weight: 600; color: rgba(255,255,255,.5); margin-right: .3rem; letter-spacing: 0; }
.a-console-cell .s { display: block; font-size: .74rem; color: rgba(255,255,255,.42); margin-top: .3rem; }
.a-console-cell.is-live .v { color: #fff; }
.a-meter--dark { background: rgba(255,255,255,.12); margin-top: .55rem; }
.a-meter--dark span { background: linear-gradient(90deg, var(--purple-mid), #C46A9B); }

.a-live-dot {
  width: 6px; height: 6px; border-radius: 50%; background: #E0568C; flex-shrink: 0;
  box-shadow: 0 0 0 0 rgba(224,86,140,.7); animation: livePulse 1.8s infinite;
}
@keyframes livePulse {
  0%   { box-shadow: 0 0 0 0 rgba(224,86,140,.6); }
  70%  { box-shadow: 0 0 0 7px rgba(224,86,140,0); }
  100% { box-shadow: 0 0 0 0 rgba(224,86,140,0); }
}

/* --- Sidebar badge: make new activity unmistakable --- */
.admin-nav a .badge-count { box-shadow: 0 0 0 0 rgba(255,255,255,.55); animation: livePulse 2.2s infinite; }

/* --- Feed dots reduced to two tones (purple / white) --- */
.a-feed-dot--form { background: rgba(102,2,60,.42); }

/* =========================================================
   PROFILE
   ========================================================= */
.a-profile-banner {
  position: relative; overflow: hidden; border-radius: var(--r);
  padding: 1.75rem 1.9rem; margin-bottom: 1.25rem;
  display: flex; align-items: center; justify-content: space-between; gap: 2rem; flex-wrap: wrap;
  background:
    radial-gradient(900px 300px at 85% -40%, rgba(138,22,86,.5) 0%, rgba(138,22,86,0) 60%),
    linear-gradient(120deg, var(--purple-deep) 0%, #16121A 58%, var(--black) 100%);
  border: 1px solid rgba(255,255,255,.08);
  color: #fff;
}
.a-profile-banner::before {
  content: ''; position: absolute; inset: 0; opacity: .45;
  background-image:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(105deg, #000 0%, transparent 60%);
  -webkit-mask-image: linear-gradient(105deg, #000 0%, transparent 60%);
}
.a-profile-id { display: flex; align-items: center; gap: 1.1rem; position: relative; z-index: 2; }
.a-profile-avatar {
  width: 72px; height: 72px; border-radius: 20px; flex-shrink: 0;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.7rem; font-weight: 800; color: #fff;
}
.a-profile-id .kicker { font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.55); font-weight: 600; }
.a-profile-id h2 { color: #fff; font-size: 1.5rem; margin: .15rem 0 .1rem; letter-spacing: -.02em; }
.a-profile-id .mail { font-size: .86rem; color: rgba(255,255,255,.62); }

.a-profile-facts { display: flex; gap: .7rem; flex-wrap: wrap; position: relative; z-index: 2; }
.a-glass-chip {
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14);
  backdrop-filter: blur(14px) saturate(150%); -webkit-backdrop-filter: blur(14px) saturate(150%);
  border-radius: var(--r-sm); padding: .7rem 1rem; min-width: 128px;
}
.a-glass-chip .k { display: block; font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; color: rgba(255,255,255,.5); font-weight: 600; }
.a-glass-chip .v { display: block; font-size: .88rem; font-weight: 600; color: #fff; margin-top: .2rem; }

.a-profile-split { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; align-items: start; }

/* =========================================================
   PASSWORD SHOW / HIDE
   ========================================================= */
.a-pw { position: relative; display: block; }
.a-pw input { padding-right: 2.9rem !important; width: 100%; }
.a-pw-toggle {
  position: absolute; right: .4rem; top: 50%; transform: translateY(-50%);
  background: transparent; border: none; cursor: pointer;
  width: 32px; height: 32px; border-radius: 7px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-faint); transition: color .15s, background .15s;
}
.a-pw-toggle svg { width: 18px; height: 18px; display: block; }
.a-pw-toggle:hover { background: var(--purple-soft); color: var(--purple); }
.a-pw-toggle.is-on { color: var(--purple); }

@media (max-width: 1050px) {
  .a-console { grid-template-columns: 1fr 1fr; }
  .a-console-cell:nth-child(2n) { border-right: none; }
  .a-console-cell:nth-child(-n+2) { border-bottom: 1px solid rgba(255,255,255,.08); }
  .a-profile-split { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .a-console { grid-template-columns: 1fr; }
  .a-console-cell { border-right: none; border-bottom: 1px solid rgba(255,255,255,.08); }
  .a-console-cell:last-child { border-bottom: none; }
  .a-profile-facts { width: 100%; }
  .a-glass-chip { flex: 1; }
}

/* =========================================================
   GLASS DIALOG (flash messages)
   ========================================================= */
.a-dialog-backdrop {
  position: fixed; inset: 0; z-index: 200; display: none;
  align-items: center; justify-content: center; padding: 2rem;
  background: rgba(14,13,16,.55);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.a-dialog-backdrop.is-open { display: flex; animation: fadeIn .18s ease both; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.a-dialog {
  width: 100%; max-width: 400px; text-align: center; padding: 2rem 1.9rem 1.75rem;
  border-radius: 20px; position: relative; overflow: hidden;
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(26px) saturate(180%);
  -webkit-backdrop-filter: blur(26px) saturate(180%);
  border: 1px solid rgba(255,255,255,.7);
  box-shadow: 0 26px 70px rgba(14,13,16,.28);
  animation: dialogIn .24s cubic-bezier(.2,.9,.3,1) both;
}
@keyframes dialogIn { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
.a-dialog::before {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.9), transparent);
}
.a-dialog-icon {
  width: 58px; height: 58px; border-radius: 50%; margin: 0 auto 1.1rem;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255,255,255,.6);
}
.a-dialog-icon svg { width: 26px; height: 26px; }
.a-dialog-icon--ok  { background: rgba(23,132,90,.14); color: var(--ok); }
.a-dialog-icon--err { background: rgba(201,59,59,.14); color: var(--bad); }
.a-dialog h3 { margin: 0 0 .4rem; font-size: 1.1rem; color: var(--black); }
.a-dialog p { margin: 0 0 1.5rem; font-size: .89rem; color: var(--ink-soft); }
.a-dialog .a-btn { min-width: 130px; }

/* =========================================================
   SIDEBAR PATTERN — subtle depth on the purple rail
   ========================================================= */
.admin-sidebar {
  position: sticky; /* re-stated: pattern layers must not break stickiness */
  /* NOTE: no overflow:hidden here — the circular collapse toggle deliberately
     sits outside the rail at right:-14px and would get clipped. */
}
.admin-sidebar::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image:
    radial-gradient(rgba(255,255,255,.055) 1px, transparent 1px),
    radial-gradient(circle at 100% 0%, rgba(0,0,0,.42) 0%, transparent 55%),
    linear-gradient(180deg, transparent 60%, rgba(0,0,0,.35) 100%);
  background-size: 18px 18px, 100% 100%, 100% 100%;
  opacity: .9;
}
.admin-sidebar > * { position: relative; z-index: 1; }
/* Soft purple glow bleeding from the top of the rail */
.admin-sidebar::after {
  content: ''; position: absolute; top: -60px; left: -40px;
  width: 240px; height: 240px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(200,60,140,.30) 0%, transparent 70%);
  transition: opacity .22s ease, width .22s ease, height .22s ease;
}
/* The glow is sized for the expanded rail; collapsed it would spill past the
   narrow sidebar, so shrink and fade it in step with the width transition. */
body.sidebar-collapsed .admin-sidebar::after {
  width: 120px; height: 120px; top: -40px; left: -30px; opacity: .35;
}

/* =========================================================
   GLASS SURFACES IN THE ADMIN BODY
   Applied where there's a dark backdrop to actually see through.
   ========================================================= */
.admin-topbar {
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
}
.avatar-menu {
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  border-color: rgba(255,255,255,.75);
}
.a-modal {
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255,255,255,.7);
}
.a-modal-backdrop { backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); }
.a-actions-bar {
  background: rgba(255,255,255,.78);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
}

/* =========================================================
   CAMPAIGN / TIER EDITOR
   ========================================================= */
.a-goal-row {
  display: grid; grid-template-columns: 240px 1fr; gap: 1.5rem; align-items: center;
  padding: 1.1rem 1.25rem; margin-bottom: 1.5rem;
  background: linear-gradient(120deg, var(--purple-deep) 0%, var(--black) 100%);
  border-radius: var(--r); color: #fff;
}
.a-goal-field label {
  display: block; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase;
  font-weight: 700; color: rgba(255,255,255,.6); margin-bottom: .35rem;
}
.a-goal-field input {
  width: 100%; font-family: var(--font); font-size: 1.05rem; font-weight: 700;
  padding: .55rem .75rem; border-radius: var(--r-sm); color: #fff;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.a-goal-field input:focus { outline: none; border-color: rgba(255,255,255,.5); background: rgba(255,255,255,.13); }
.a-goal-progress .lbl { display: block; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,.55); font-weight: 700; margin-bottom: .5rem; }
.a-goal-progress .a-meter { background: rgba(255,255,255,.15); height: 8px; }
.a-goal-progress .a-meter span { background: linear-gradient(90deg, #C46A9B, #fff); }
.a-goal-progress .val { display: block; font-size: .82rem; color: rgba(255,255,255,.75); margin-top: .5rem; font-variant-numeric: tabular-nums; }

.a-tier-head { display: flex; align-items: baseline; gap: .6rem; margin-bottom: .7rem; }
.a-tier-head span { font-size: .82rem; font-weight: 700; color: var(--ink); text-transform: uppercase; letter-spacing: .05em; }
.a-tier-head small { font-size: .78rem; color: var(--ink-faint); }

.a-tier-list { display: flex; flex-direction: column; gap: .7rem; }
.a-tier {
  display: grid; grid-template-columns: 34px 170px 1fr 110px; gap: 1rem; align-items: end;
  padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: var(--r); background: #FCFBFD;
  transition: border-color .15s, background .15s;
}
.a-tier:hover { border-color: var(--purple-line); background: #fff; }
.a-tier-num {
  width: 34px; height: 34px; border-radius: 10px; margin-bottom: .1rem;
  background: var(--purple-soft); color: var(--purple);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: .88rem;
}
/* Scoped to the field wrappers only — a bare `.a-tier label` also matched the
   toggle's <label>, forcing it to display:block and breaking its flex layout. */
.a-tier-amount > label,
.a-tier-label > label {
  display: block; font-size: .7rem; letter-spacing: .06em; text-transform: uppercase;
  font-weight: 700; color: var(--ink-faint); margin-bottom: .3rem;
}
.a-tier input[type=text], .a-tier input[type=number] {
  width: 100%; font-family: var(--font); font-size: .9rem; padding: .5rem .7rem;
  border: 1.5px solid var(--line); border-radius: var(--r-sm); background: #fff; color: var(--ink);
}
.a-tier input:focus { outline: none; border-color: var(--purple); box-shadow: 0 0 0 3px rgba(102,2,60,.09); }

.a-input-prefix { display: flex; align-items: stretch; }
.a-input-prefix span {
  display: flex; align-items: center; padding: 0 .6rem;
  background: var(--purple-soft); color: var(--purple); font-size: .78rem; font-weight: 700;
  border: 1.5px solid var(--line); border-right: none;
  border-radius: var(--r-sm) 0 0 var(--r-sm);
}
.a-input-prefix input { border-radius: 0 var(--r-sm) var(--r-sm) 0 !important; }

/* Toggle switch replaces the bare checkbox */
.a-tier-toggle { display: flex; align-items: flex-end; height: 100%; }
.a-switch {
  display: inline-flex !important; align-items: center; gap: .55rem; cursor: pointer;
  position: relative; margin: 0 0 .35rem; text-transform: none; letter-spacing: normal;
}
.a-switch input {
  position: absolute; opacity: 0; width: 1px; height: 1px;
  margin: 0; pointer-events: none;
}
.a-switch .track {
  width: 38px; height: 22px; border-radius: 999px; background: #D5D0DA;
  position: relative; transition: background .18s; flex-shrink: 0;
}
.a-switch .knob {
  position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; transition: transform .18s; box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.a-switch input:checked + .track { background: var(--purple); }
.a-switch input:checked + .track .knob { transform: translateX(16px); }
.a-switch input:focus-visible + .track { box-shadow: 0 0 0 3px rgba(102,2,60,.2); }
.a-switch .txt {
  font-size: .82rem; font-weight: 600; color: var(--ink-soft);
  text-transform: none; letter-spacing: normal; white-space: nowrap;
}
.a-switch input:checked ~ .txt { color: var(--purple); }

@media (max-width: 900px) {
  .a-goal-row { grid-template-columns: 1fr; gap: 1rem; }
  .a-tier { grid-template-columns: 34px 1fr; gap: .75rem; }
  .a-tier-label, .a-tier-toggle { grid-column: 2; }
}

.a-manual-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 1rem; }
@media (max-width: 900px) { .a-manual-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .a-manual-grid { grid-template-columns: 1fr; } }
