/* =========================================================
   Latente CMS · Admin UI — v3.0 (Editorial Dark)
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:opsz,wght@14..32,300..900&display=swap');

/* -------------------------
   Design tokens
   ------------------------- */
:root{
  /* Base */
  --bg:       #f1f5f9;
  --surface:  #ffffff;
  --surface-2:#f8fafc;
  --text-1:   #0f172a;
  --text-2:   #64748b;
  --muted:    #94a3b8;
  --border:   #e2e8f0;

  /* Brand */
  --primary:     #2563eb;
  --primary-2:   #3b82f6;
  --primary-ink: #ffffff;
  --focus:       rgba(37,99,235,.18);

  /* Accents */
  --accent-soft:  #eff6ff;
  --accent-peach: #fff7ed;
  --accent-mint:  #f0fdf4;

  /* Gradients */
  --grad-1:
    linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
  --grad-soft:
    radial-gradient(900px 480px at 15% -10%, rgba(37,99,235,.05), transparent 60%),
    radial-gradient(700px 400px at 85% -5%,  rgba(96,165,250,.04), transparent 55%);

  /* Radii & Shadows */
  --radius:    10px;
  --radius-sm: 6px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 20px rgba(0,0,0,.09), 0 2px 6px rgba(0,0,0,.05);

  /* Typography */
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system,
               "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Editor tokens */
  --field-gap: .75rem;
  --panel-gap: 1.25rem;
  --sidebar-w: 300px;
  --thumb: #dbeafe;
  --danger: #dc2626;
  --ok:     #16a34a;
  --warn:   #d97706;

  --danger-bg:     #fef2f2;
  --danger-border: #fecaca;
  --danger-text:   #991b1b;

  --ok-bg:     #f0fdf4;
  --ok-border: #bbf7d0;
  --ok-text:   #14532d;
}

/* -------------------------
   Base / reset
   ------------------------- */
*{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
body.z2h-body{
  margin: 0;
  background: var(--bg);
  color: var(--text-1);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-variation-settings: "opsz" 16;
  line-height: 1.5;
  font-size: 15px;
}
.container{ max-width: 1280px; }

h1,h2,h3,h4,h5,h6{
  font-weight: 700;
  letter-spacing: .01em;
  line-height: 1.2;
  margin-top: .25rem;
  margin-bottom: .5rem;
}
p{ margin: .25rem 0 .75rem; color: var(--text-1); }
small,.small{ font-size: .85rem; color: var(--text-2); }

::selection{ background: rgba(37,99,235,.15); }
a{ color: var(--primary); text-decoration: none; transition: color .15s ease; }
a:hover{ color: #1d4ed8; }

/* -------------------------
   Navbar — frosted glass, premium
   ------------------------- */
.z2h-nav{
  position: sticky; top: 0; z-index: 1030;
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid rgba(228,228,231,.8);
  box-shadow: 0 1px 0 rgba(228,228,231,.6);
  transition: box-shadow .4s ease;
}
.z2h-nav .container{ padding: .55rem 1rem; }

/* Brand — letter-spacing reveal on load, gentle expansion on hover */
.z2h-brand--badge{
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: #18181b;
  background: transparent;
  border: none;
  padding: 0;
  text-decoration: none;
  display: inline-block;
  animation: navBrandReveal 1.3s cubic-bezier(.22,.61,.36,1) .05s both;
  transition:
    letter-spacing .55s cubic-bezier(.4,0,.2,1),
    color .3s ease;
}
.z2h-brand--badge:hover{
  letter-spacing: .3em;
  color: #3f3f46;
  text-decoration: none;
}
@keyframes navBrandReveal {
  from { opacity: 0; letter-spacing: .04em; }
  to   { opacity: 1; letter-spacing: .2em; }
}

.z2h-badge{
  display: inline-block;
  background: #f4f4f5;
  color: #71717a;
  border: 1px solid #e4e4e7;
  border-radius: 5px;
  padding: .18rem .5rem;
  font-size: .7rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-weight: 600;
  transition: color .35s cubic-bezier(.4,0,.2,1), border-color .35s cubic-bezier(.4,0,.2,1);
}

/* Nav links — sliding underline, no background pill */
.navbar .nav-link{
  position: relative;
  padding: .42rem .65rem;
  margin: 0 .05rem;
  color: #71717a;
  font-weight: 500;
  font-size: .82rem;
  letter-spacing: .02em;
  border-radius: 0;
  background: transparent !important;
  transition: color .35s cubic-bezier(.4,0,.2,1);
}

/* Underline slides in from left */
.navbar .nav-link::after{
  content: "";
  position: absolute;
  bottom: -1px; left: .65rem; right: .65rem;
  height: 1px;
  background: #18181b;
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform .45s cubic-bezier(.4,0,.2,1);
}

.navbar .nav-link:hover{ color: #18181b; }
.navbar .nav-link:hover::after{ transform: scaleX(1); }

.navbar .nav-link.active{
  color: #18181b;
  font-weight: 600;
}
.navbar .nav-link.active::after{ transform: scaleX(1); }

.z2h-select{
  background: #ffffff;
  border: 1px solid #e4e4e7;
  color: #18181b;
}

@media (prefers-reduced-motion: reduce){
  .z2h-brand--badge{ animation: none !important; opacity: 1; letter-spacing: .2em; transition: none !important; }
  .navbar .nav-link,
  .navbar .nav-link::after{ transition: none !important; }
}

/* -------------------------
   Cards / surfaces
   ------------------------- */
.card{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s ease, border-color .2s ease;
}
.z2h-card{ border-radius: 12px; }
.card:hover{ box-shadow: var(--shadow-md); border-color: #d1d5db; }

.z2h-divider{
  width: 100%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,0,0,.08), transparent);
}

/* -------------------------
   Admin page headers
   ------------------------- */
.z2h-admin-hero{
  position: relative;
  padding: clamp(18px, 3vw, 34px) 0 clamp(16px, 2.4vw, 26px);
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
  animation: adminHeroIn .55s cubic-bezier(.22,.61,.36,1) both;
}
.z2h-admin-hero::after{
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 72px;
  height: 1px;
  background: #18181b;
}
.z2h-admin-hero__bar{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
  margin-bottom: .85rem;
}
.z2h-admin-hero__context{
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .65rem;
  min-width: 0;
}
.z2h-admin-hero__actions{
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: .65rem;
  margin-left: auto;
}
.z2h-admin-hero__eyebrow{
  color: #71717a;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .18em;
  line-height: 1;
  text-transform: uppercase;
}
.z2h-admin-hero__title{
  margin: 0;
  max-width: 72ch;
  color: #111827;
  font-size: clamp(1.15rem, 2.2vw, 1.65rem);
  font-weight: 680;
  letter-spacing: .01em;
  line-height: 1.18;
  text-transform: none;
}
.z2h-admin-hero__meta{
  max-width: 74ch;
  margin: .5rem 0 0;
  color: var(--text-2);
  font-size: .94rem;
}
.z2h-admin-hero__meta strong{
  color: var(--text-1);
  font-weight: 650;
}
.z2h-admin-token{
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-height: 28px;
  max-width: 100%;
  padding: .22rem .58rem;
  border: 1px solid #e4e4e7;
  border-radius: 6px;
  background: rgba(255,255,255,.74);
  color: #18181b;
  font-size: .82rem;
  line-height: 1.2;
  box-shadow: 0 1px 0 rgba(255,255,255,.85) inset;
}
.z2h-admin-token.is-muted{
  color: var(--text-2);
  background: transparent;
}
.z2h-admin-token.z2h-chip-status{
  font-size: .72rem;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.z2h-admin-token.z2h-chip-status.published{
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #14532d;
}
.z2h-admin-token.z2h-chip-status.draft{
  background: #fffbeb;
  border-color: #fde68a;
  color: #713f12;
}
.z2h-admin-token.z2h-chip-status.archived{
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--text-2);
}
.z2h-admin-token .dot{
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.z2h-admin-code{
  color: #71717a;
  font-size: .78rem;
  font-weight: 600;
  background: #f4f4f5;
  border: 1px solid #e4e4e7;
  border-radius: 4px;
  padding: .08rem .32rem;
}
.z2h-admin-back{
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  color: #71717a;
  font-size: .78rem;
  font-weight: 650;
  letter-spacing: .04em;
  line-height: 1;
  text-transform: uppercase;
  text-decoration: none;
  border-bottom: 1px solid #d4d4d8;
  padding-bottom: .12rem;
  transition: color .2s ease, border-color .2s ease;
}
.z2h-admin-back:hover{
  color: #18181b;
  border-color: #18181b;
}
@keyframes adminHeroIn{
  from{ opacity: 0; transform: translateY(6px); }
  to{ opacity: 1; transform: translateY(0); }
}
@media (max-width: 640px){
  .z2h-admin-hero{ padding-top: 10px; }
  .z2h-admin-hero__title{ font-size: 1.15rem; }
  .z2h-admin-hero__meta{ font-size: .88rem; }
}
@media (prefers-reduced-motion: reduce){
  .z2h-admin-hero{ animation: none !important; }
  .z2h-admin-back{ transition: none !important; }
}

/* -------------------------
   Buttons
   ------------------------- */
.btn{
  border-radius: var(--radius-sm);
  padding: .55rem 1rem;
  font-weight: 600;
  font-size: .875rem;
  letter-spacing: .02em;
  transition: all .15s ease;
}
.btn:active{ transform: scale(.98); }

.btn-primary{
  background: var(--grad-1);
  color: var(--primary-ink);
  border: 1px solid #1d4ed8;
  box-shadow: 0 1px 3px rgba(37,99,235,.3), 0 1px 2px rgba(37,99,235,.2);
}
.btn-primary:hover{
  background: linear-gradient(135deg, #1a44c8 0%, #2159d4 100%);
  box-shadow: 0 4px 12px rgba(37,99,235,.35);
}
.btn-primary:focus{ outline: none; box-shadow: 0 0 0 3px var(--focus); }

.btn-outline{
  background: var(--surface);
  color: var(--text-1);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.btn-outline:hover{
  background: var(--surface-2);
  border-color: #cbd5e1;
  color: var(--text-1);
  box-shadow: none;
}
.btn-outline:focus{ outline: none; box-shadow: 0 0 0 3px var(--focus); }

.btn-cta{
  background: var(--grad-1);
  color: var(--primary-ink);
  border: 1px solid #1d4ed8;
  box-shadow: 0 1px 3px rgba(37,99,235,.3);
}
.btn-cta:hover{ background: linear-gradient(135deg, #1a44c8 0%, #2159d4 100%); filter: none; }
.btn-cta:focus{ outline: none; box-shadow: 0 0 0 3px var(--focus); }
.btn-cta:disabled,
.btn-cta[disabled]{ opacity: .5; cursor: not-allowed; }

.btn-owa-outline{
  background: transparent;
  color: var(--primary);
  border: 1px solid #bfdbfe;
}
.btn-owa-outline:hover{ background: var(--accent-soft); border-color: #93c5fd; color: var(--primary); }
.btn-owa-outline:focus{ outline: none; box-shadow: 0 0 0 3px var(--focus); }
.btn-owa-outline:disabled{ opacity: .5; cursor: not-allowed; }

.btn-soft-danger,.btn-delete{
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: var(--danger-text);
}
.btn-soft-danger:hover,.btn-delete:hover{
  background: #fee2e2; border-color: #fca5a5; color: #7f1d1d;
}
.btn-soft-danger:focus,.btn-delete:focus{
  outline: none; box-shadow: 0 0 0 3px rgba(220,38,38,.15);
}
.btn-soft-success,.btn-add{
  background: var(--ok-bg);
  border: 1px solid var(--ok-border);
  color: var(--ok-text);
}
.btn-soft-success:hover,.btn-add:hover{
  background: #dcfce7; border-color: #86efac; color: #052e16;
}
.btn-soft-success:focus,.btn-add:focus{
  outline: none; box-shadow: 0 0 0 3px rgba(22,163,74,.15);
}

/* -------------------------
   Forms
   ------------------------- */
.form-control{
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-1);
  padding: .58rem .8rem;
  font-size: .9rem;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.form-control:focus{
  outline: none;
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
label.form-label{ font-weight: 600; font-size: .875rem; color: var(--text-1); }
.text-muted{ color: var(--text-2) !important; }
.small code{
  background: var(--accent-soft);
  padding: .1rem .3rem;
  border-radius: 4px;
  border: 1px solid #bfdbfe;
  font-size: .82rem;
}

/* -------------------------
   Auth
   ------------------------- */
.z2h-auth-wrap{
  min-height: calc(100vh - 56px);
  display: grid;
  align-items: center;
  padding: 2rem 0;
  background: var(--grad-soft);
}
.z2h-auth-form .form-control{ border-radius: 8px; }
.z2h-auth-form .btn-lg{ border-radius: 10px; }

/* -------------------------
   Dashboard hero
   ------------------------- */
.z2h-dash-hero{
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  color: var(--text-1);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  position: relative;
  isolation: isolate;
  box-shadow: var(--shadow-md);
}
.z2h-dash-hero::before{
  content: "";
  position: absolute; inset: -20% -20% auto -20%; height: 70%;
  background: var(--grad-soft);
  filter: blur(16px); opacity: .8; z-index: 0;
}
.z2h-dash-hero .z2h-hero-title{
  position: relative; z-index: 1;
  letter-spacing: .1em; text-transform: uppercase;
}
.z2h-dash-hero .lead{ position: relative; z-index: 1; color: var(--text-2); }
.z2h-dash-hero .btn{ position: relative; z-index: 1; }

/* KPIs */
.z2h-kpis{
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 1rem;
}
.z2h-kpi{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.1rem 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s ease;
}
.z2h-kpi:hover{ box-shadow: var(--shadow-md); }
.z2h-kpi .z2h-kpi-label{
  font-size: .72rem; color: var(--text-2);
  letter-spacing: .1em; text-transform: uppercase;
  font-weight: 600; margin-bottom: .35rem;
}
.z2h-kpi .z2h-kpi-value{
  display: flex; align-items: baseline; gap: .3rem;
  font-weight: 800; line-height: 1;
  font-size: clamp(1.5rem, 2.2vw, 2rem);
  color: var(--text-1);
}
.z2h-kpi .z2h-kpi-suffix{
  font-size: .82rem; color: var(--text-2); font-weight: 600;
}

/* Lists / rails */
.z2h-card-list{ display: flex; flex-direction: column; gap: .25rem; }
.z2h-list-item{
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: .85rem .5rem .85rem 0;
  border-top: 1px solid var(--border);
  transition: background-color .2s ease;
}
.z2h-list-item:first-child{ border-top: 0; }
.z2h-list-title{ font-weight: 600; color: var(--text-1); }
.z2h-list-sub{ font-size: .875rem; color: var(--text-2); }

/* Empty states */
.z2h-empty{
  background: var(--surface-2);
  border: 1px dashed var(--border);
  color: var(--text-2);
  padding: 1.5rem;
  border-radius: var(--radius);
  text-align: center;
}

/* Footer */
.z2h-footer{
  border-top: 1px solid #e4e4e7;
  padding: .9rem 0;
  background: #f4f4f5;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #a1a1aa;
}
.z2h-footer a{ color: inherit; }
.z2h-footer a:hover{ color: #71717a; text-decoration: none; }
.z2h-footer-support{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: .28rem .7rem;
  border: 1px solid #e4e4e7;
  border-radius: 5px;
  background: #ffffff;
  color: #71717a !important;
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}
.z2h-footer-support:hover{
  background: #fafafa;
  border-color: #d4d4d8;
  color: #18181b !important;
}

/* Responsive KPIs */
@media (max-width: 991.98px){ .z2h-kpis{ grid-template-columns: 1fr 1fr 1fr; } }
@media (max-width: 575.98px){  .z2h-kpis{ grid-template-columns: 1fr 1fr; } }

/* ===================================================
   Editor
   =================================================== */
.vr{ width: 1px; height: 14px; background: var(--border); display: inline-block; }
kbd{
  background: var(--surface-2); border: 1px solid var(--border);
  border-bottom-color: #cbd5e1; padding: .05rem .35rem;
  border-radius: 5px; font-size: .8rem;
}
.list-group-item:focus{ outline: none; box-shadow: inset 0 0 0 2px var(--focus); }
.is-invalid{ border-color: #dc2626 !important; box-shadow: 0 0 0 3px rgba(220,38,38,.12) !important; }

/* Page entrance */
#main-content{ opacity: 0; animation: z2hFadeIn .7s ease-out .05s both; }
#main-content.no-entrance{ animation: none; opacity: 1; }
@keyframes z2hFadeIn{ from{ opacity: 0; transform: translateY(4px); } to{ opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce){ #main-content{ animation: none; opacity: 1; } }

/* Pages list hover */
.z2h-card-list .z2h-list-item,
.z2h-card-list .z2h-list-item:hover{ background: transparent !important; }
.z2h-card-list .z2h-list-item a{
  color: var(--text-1) !important; text-decoration: none; transition: opacity .2s ease;
}
.z2h-card-list .z2h-list-item a:hover{ opacity: .8; }
.z2h-card-list .z2h-list-item::before{ content: none !important; display: none !important; }

/* Editor layout */
.z2h-editor{
  display: grid;
  grid-template-columns: minmax(260px, var(--sidebar-w)) 1fr;
  gap: var(--panel-gap);
}
@media (max-width: 991.98px){ .z2h-editor{ grid-template-columns: 1fr; } }

.z2h-sections-nav{
  position: sticky; top: 80px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  padding: .75rem;
  box-shadow: var(--shadow-sm);
}
.z2h-sections-nav .nav-item{
  display: flex; align-items: center; gap: .55rem;
  padding: .55rem .65rem;
  border-radius: 7px;
  color: var(--text-2);
  font-size: .875rem;
  transition: background-color .15s ease, color .15s ease;
  cursor: pointer;
}
.z2h-sections-nav .nav-item:hover{ background: var(--surface-2); color: var(--text-1); }
.z2h-sections-nav .nav-item.active{
  background: var(--accent-soft);
  color: #1d4ed8;
  font-weight: 600;
  border: 1px solid #bfdbfe;
}

.z2h-editor-panel{
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.field-group{
  display: grid; grid-template-columns: 1fr;
  gap: var(--field-gap);
  padding: 1.1rem;
  border-top: 1px solid var(--border);
}
.field-group:first-child{ border-top: none; }

.field-row{ display: grid; gap: .9rem; }
.field-row[data-columns="2"]{ grid-template-columns: 1fr 1fr; }
.field-row[data-columns="3"]{ grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 767.98px){ .field-row,[data-columns]{ grid-template-columns: 1fr !important; } }

.field{ display: flex; flex-direction: column; gap: .4rem; }
.field .form-label{ font-weight: 600; font-size: .875rem; color: var(--text-1); }
.field .form-hint{ color: var(--text-2); font-size: .82rem; }

/* Textareas */
textarea.form-control{ min-height: 110px; resize: vertical; }
.textarea-md{ min-height: 200px !important; }
.textarea-lg{ min-height: 280px !important; }
.textarea-xl{ min-height: 380px !important; }
[data-widget="textarea"] textarea{ min-height: 180px; }
[data-widget="textarea-lg"] textarea{ min-height: 260px; }
[data-widget="textarea-xl"] textarea{ min-height: 340px; }
[data-widget="switch"] .form-check-input{ width: 2.4rem; height: 1.3rem; cursor: pointer; }
[data-widget="number"] input{ text-align: left; }

/* Repeater */
.z2h-repeater{ display: flex; flex-direction: column; gap: .75rem; }
.repeater-item{
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
}
.repeater-item .repeater-head{
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  margin-bottom: .65rem;
}
.repeater-item .repeater-title{ font-weight: 700; font-size: .9rem; color: var(--text-1); }
.repeater-item .repeater-actions{ display: flex; gap: .4rem; align-items: center; }
.repeater-item .repeater-actions .btn{ padding: .38rem .62rem; font-size: .78rem; }
.repeater-grid{ display: grid; gap: 1rem; grid-template-columns: 1fr !important; }

/* Media */
.img-thumb{
  width: 100%; max-width: 240px;
  aspect-ratio: 4/3; object-fit: cover;
  border-radius: 10px; border: 1px solid var(--thumb);
  background: var(--accent-soft);
}
.avatar{
  width: 72px; height: 72px; object-fit: cover;
  border-radius: 999px; border: 1px solid var(--thumb);
}

/* Upload */
.btn-upload{
  display: inline-flex; align-items: center; gap: .55rem;
  border: 1px dashed #93c5fd; background: var(--accent-soft);
  color: #1d4ed8; padding: .5rem .9rem; border-radius: 8px;
  font-weight: 500; font-size: .875rem;
}
.btn-upload:hover{ background: #dbeafe; }
.input-file{ position: relative; display: inline-block; }
.input-file input[type="file"]{ position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* Toolbar */
.z2h-toolbar{
  display: flex; flex-wrap: wrap; gap: .5rem;
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 56px;
  background: rgba(255,255,255,.97);
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
  z-index: 1050;
}

/* Bottom actions */
.z2h-actions-bottom{
  position: sticky; bottom: 0; z-index: 1040;
  background: rgba(255,255,255,.97);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--border);
  padding: .65rem; display: flex; gap: .5rem; justify-content: flex-end; flex-wrap: wrap;
}

/* Validation */
.field .error-text{ color: var(--danger); font-size: .83rem; }
.form-control.is-valid{ border-color: #86efac; box-shadow: 0 0 0 3px rgba(22,163,74,.12); }
.form-control[readonly]{ background: var(--surface-2); color: var(--text-2); }

/* Chips */
#main-content .z2h-chip{
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .8rem; padding: .16rem .55rem; border-radius: 6px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-2);
}
.z2h-chip.ok{ border-color: #bbf7d0; background: var(--ok-bg); color: #14532d; }
.z2h-chip.warn{ border-color: #fde68a; background: #fffbeb; color: #713f12; }

/* Misc helpers */
.help-text{ font-size: .85rem; color: var(--text-2); }
.inline-list{ display: flex; flex-wrap: wrap; gap: .4rem; }
.inline-list .inline-pill{
  border: 1px solid var(--border); background: var(--surface);
  border-radius: 6px; padding: .12rem .5rem; font-size: .8rem;
}

.section-header{
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  padding: .65rem 1rem; border-bottom: 1px solid var(--border);
}
.section-title{ font-weight: 700; letter-spacing: .03em; font-size: .9rem; }

.note{
  border: 1px solid var(--border);
  background: var(--surface-2);
  padding: .85rem; border-radius: 10px;
  color: var(--text-2); font-size: .875rem;
}

.key-row{ display: flex; gap: .55rem; align-items: center; flex-wrap: wrap; }

/* Panels & wide shell */
.z2h-panels{ max-width: 1100px; margin-inline: auto; }
.z2h-editor-panel .card{ border-color: var(--border); padding: 1rem; }
:root{ --sidebar-w: 300px; --panel-gap: 1.25rem; }
.z2h-editor{ grid-template-columns: minmax(260px, var(--sidebar-w)) 1fr; }
