:root{
  --bg:#0b0c10;
  --body-gradient:linear-gradient(180deg,#0b0c10 0%, #0f1117 100%);
  --panel:#121319;
  --ink:#e9eef3;
  --muted:#aab3bd;
  --accent:#00a794;
  --grid:#2a2e36;
  --wk-alt:#181b22;
  --wk-num:#7f8a97;
  --surface:#10131a;
  --surface-alt:#0f1117;
  --surface-strong:#121621;
  --surface-soft:#0c0e14;

  /* Categorias */
  --cat-nacional:#4caf50;
  --cat-regional:#2e7d32;
  --cat-grupo:#1976d2;
  --cat-formacao:#f9a825;
  --cat-acamp:#8d6e63;
  --cat-outro:#9c27b0;
}

body[data-theme='light']{
  --bg:#f6f7fb;
  --body-gradient:linear-gradient(180deg,#f6f7fb 0%,#eef1f6 100%);
  --panel:#ffffff;
  --ink:#1b2026;
  --muted:#616c78;
  --accent:#00a794;
  --grid:#d4d9e3;
  --wk-alt:#f0f1f5;
  --wk-num:#6b6f76;
  --surface:#ffffff;
  --surface-alt:#f0f1f5;
  --surface-strong:#eef1f6;
  --surface-soft:#f6f7fb;
}

body[data-theme='dark']{
  --bg:#0b0c10;
  --body-gradient:linear-gradient(180deg,#0b0c10 0%, #0f1117 100%);
  --panel:#121319;
  --ink:#e9eef3;
  --muted:#aab3bd;
  --accent:#00a794;
  --grid:#2a2e36;
  --wk-alt:#181b22;
  --wk-num:#7f8a97;
  --surface:#10131a;
  --surface-alt:#0f1117;
  --surface-strong:#121621;
  --surface-soft:#0c0e14;
}

body[data-theme='system']{
  color-scheme: dark light;
}

@media (prefers-color-scheme: dark){
  body[data-theme='system']{
    --bg:#0b0c10;
    --body-gradient:linear-gradient(180deg,#0b0c10 0%, #0f1117 100%);
    --panel:#121319;
    --ink:#e9eef3;
    --muted:#aab3bd;
    --accent:#00a794;
    --grid:#2a2e36;
    --wk-alt:#181b22;
    --wk-num:#7f8a97;
    --surface:#10131a;
    --surface-alt:#0f1117;
    --surface-strong:#121621;
    --surface-soft:#0c0e14;
  }
}

@media (prefers-color-scheme: light){
  body[data-theme='system']{
    --bg:#f6f7fb;
    --body-gradient:linear-gradient(180deg,#f6f7fb 0%,#eef1f6 100%);
    --panel:#ffffff;
    --ink:#1b2026;
    --muted:#616c78;
    --accent:#00a794;
    --grid:#d4d9e3;
    --wk-alt:#f0f1f5;
    --wk-num:#6b6f76;
    --surface:#ffffff;
    --surface-alt:#f0f1f5;
    --surface-strong:#eef1f6;
    --surface-soft:#f6f7fb;
  }
}

body[data-theme='dark'] .admin-status[data-tone="success"],
body[data-theme='dark'] .section-admin-status[data-tone="success"]{
  color:#ffffff;
}

@media (prefers-color-scheme: dark){
  body[data-theme='system'] .admin-status[data-tone="success"],
  body[data-theme='system'] .section-admin-status[data-tone="success"]{
    color:#ffffff;
  }
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font:14px/1.35 system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif;
  color:var(--ink);
  background:var(--body-gradient);
  background-color:var(--bg);
}

.topbar{
  display:flex;
  flex-direction:column;
  gap:12px;
  padding:14px 18px;
  background:var(--panel);
  border-bottom:1px solid var(--grid);
  position:sticky;
  top:0;
  z-index:10;
}
.topbar-row{display:flex;align-items:center;gap:16px;flex-wrap:wrap}
.topbar-primary{justify-content:space-between}
.topbar-primary h1{margin:0;font-size:18px;letter-spacing:.4px}
.brand-logo{max-height:50px;display:inline-block;vertical-align:middle}
.logo-control{display:flex;align-items:center;gap:12px;margin-top:8px}
.logo-status{font-size:12px;color:var(--muted)}
.topbar-nav{display:flex;gap:8px;flex-wrap:wrap;justify-content:center;flex:1;margin:0 24px}
.nav-btn{padding:6px 12px;font-size:13px;font-weight:600}
.session-controls{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.session-label{color:var(--muted)}
.topbar-controls{justify-content:center;gap:16px;flex-wrap:wrap}
.actions-group{margin-left:auto}
.controls-group{display:flex;align-items:center;gap:10px;flex-wrap:wrap;justify-content:center}
.controls-group label{display:flex;align-items:center;gap:6px;color:var(--muted)}
.theme-control select{min-width:130px}
.controls-group select{
  background:var(--panel);color:var(--ink);border:1px solid var(--grid);
  padding:6px 8px;border-radius:6px;min-width:96px
}
.controls-group input[type="search"]{
  background:var(--panel);color:var(--ink);border:1px solid var(--grid);
  padding:6px 10px;border-radius:8px;min-width:220px
}
.actions-group{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.btn{border:1px solid var(--grid);background:var(--panel);color:var(--ink);padding:8px 12px;border-radius:8px;text-decoration:none;cursor:pointer}
.btn:hover{border-color:var(--accent);color:var(--accent)}
.btn.primary{background:var(--accent);border-color:var(--accent);color:var(--surface-alt)}
.btn.back-btn{border-color:var(--accent);color:var(--accent);font-weight:600}
.btn.back-btn:hover{background:color-mix(in srgb,var(--accent) 12%,transparent);color:var(--accent)}
.btn.icon-btn{padding:6px 8px}
.btn:disabled{opacity:.55;cursor:not-allowed;border-color:var(--grid);color:var(--muted);background:var(--surface-soft)}
.btn.primary:disabled{background:#205b86;border-color:#205b86;color:var(--surface-alt);opacity:.65}
.range.hidden{display:none}
.hidden{display:none !important}

.layout{display:grid;grid-template-columns: 240px 1fr;gap:18px;padding:18px}
.legend{background:var(--panel);border:1px solid var(--grid);border-radius:10px;padding:14px}
.legend h3{margin:0 0 8px 0;font-size:13px;color:var(--muted)}
.legend-filters{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:10px}
.legend-section-presets{display:flex;flex-wrap:wrap;gap:6px;margin:4px 0 10px 0}
.legend-section-presets .btn{padding:4px 8px;font-size:12px}
.legend .item{display:flex;align-items:center;gap:8px;margin:6px 0}
.legend .item input[type="checkbox"]{accent-color:var(--accent);width:16px;height:16px}
.legend .swatch{width:18px;height:10px;border-radius:8px}
.legend .lbl{color:var(--ink)}
.section-tree{display:flex;flex-direction:column;gap:6px;margin-top:8px}
.section-node{padding-left:6px;border-left:1px solid var(--grid)}
.section-node.depth-0{border-left:none;padding-left:0}
.section-node.depth-1{margin-left:6px}
.section-node.depth-2{margin-left:12px}
.section-node.depth-3{margin-left:18px}
.section-label{font-weight:600;color:var(--muted);margin-bottom:4px}
.section-leaf{display:flex;align-items:center;gap:6px}
.section-leaf label{display:inline-flex;align-items:center;gap:8px;color:var(--ink);cursor:pointer;flex-wrap:nowrap;white-space:normal}
.section-leaf span{color:var(--ink)}
.section-leaf input[type="checkbox"]{accent-color:var(--accent);width:16px;height:16px}
.section-pill{display:inline-flex;align-items:center;gap:8px;padding:4px 10px;border-radius:999px;border:1px solid var(--grid);background:var(--surface-strong);font-size:12px;transition:all .2s ease;opacity:.85}
.section-pill .dot{width:10px;height:10px;border-radius:50%;background:var(--section-color,var(--accent))}
.section-pill .name{white-space:normal;line-height:1.25;overflow-wrap:anywhere}
.section-pill.active{opacity:1;border-color:var(--section-color,var(--accent));background:color-mix(in srgb,var(--section-color,var(--accent)) 18%,transparent)}
.section-pill.inactive{opacity:.55}
.section-pill.disabled{opacity:.35;border-style:dashed}
.section-choice{margin:4px 0;padding-left:12px}
.section-choice.depth-1{margin-left:8px}
.section-choice.depth-2{margin-left:16px}
.section-choice.depth-3{margin-left:24px}
.section-choice .section-group{font-weight:600;color:var(--muted);margin:4px 0}
.section-choice label{display:inline-flex;align-items:center;gap:8px;flex-wrap:nowrap}
.section-choice label span{white-space:normal;line-height:1.25;overflow-wrap:anywhere}
.section-choice small{margin-left:6px}
.section-actions{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:8px;align-items:center}
.section-actions .hint{font-size:11px;color:var(--muted)}
.section-choice-tree{display:flex;flex-direction:column;gap:4px;max-height:240px;overflow:auto;padding:8px;border:1px solid var(--grid);border-radius:8px;background:var(--surface-alt)}
.section-choices{display:flex;flex-direction:column;gap:4px;max-height:220px;overflow:auto;padding:8px;border:1px solid var(--grid);border-radius:8px;background:var(--surface-alt)}
.section-choices-new{display:flex;flex-wrap:wrap;gap:6px;padding:8px;border:1px solid var(--grid);border-radius:8px;background:var(--surface-alt);max-height:200px;overflow:auto}

.calendar{
  background:var(--panel);
  border:1px solid var(--grid);
  border-radius:10px;
  overflow:visible;
  position:relative;
  isolation:isolate;
}

.cal-header{
  display:grid;
  grid-template-columns:64px 48px repeat(7,1fr);
  background:var(--surface-alt);
  border-bottom:1px solid var(--grid);
  position:sticky;
  top:0;
  z-index:10;
  box-shadow:0 2px 6px rgba(0,0,0,.08);
}
.cal-header .cell{padding:8px 10px;color:var(--muted);border-left:1px solid var(--grid)}
.cal-header .cell:first-child{border-left:none}
.cal-header .month-header{border-left:none;font-size:12px;letter-spacing:.1em;text-transform:uppercase}

.week-row{position:relative}
.week-grid{display:grid;grid-template-columns:64px 48px repeat(7,1fr)}
.week-grid .wk{display:flex;align-items:center;justify-content:flex-end;color:var(--wk-num);font-size:12px;border-right:1px solid var(--grid);padding-right:12px}
.week-grid .day{min-height:54px;padding:6px 6px;border-left:1px solid var(--grid);border-top:1px solid var(--grid)}
.week-grid .day .date{font-size:12px;color:var(--muted)}
.week-row:nth-child(odd) .week-grid .day{background:var(--wk-alt)}

.week-grid .wk a{color:var(--wk-num);text-decoration:none;padding:6px 8px;display:block;width:100%;height:100%}
.week-grid .wk a:hover{color:var(--accent)}
.week-grid .day .date a{color:var(--muted);text-decoration:none}
.week-grid .day .date a:hover{color:var(--accent)}

.month-cell{
  border-left:1px solid var(--grid);
  border-top:1px solid var(--grid);
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:12px;
  font-weight:600;
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:0.05em;
  min-height:46px;
}

/* Events layer */
.events{position:absolute;left:calc(64px + 48px);right:0;top:34px;bottom:6px;padding:0 4px;display:grid;grid-template-columns:repeat(7,1fr);grid-auto-rows:minmax(30px,42px);gap:2px}

.event{position:relative;border-radius:10px;padding:4px 8px;font-size:12px;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;border:1px solid transparent;cursor:pointer;transition:filter .15s ease,transform .15s ease;--category-color:var(--accent);max-width:100%;min-width:0;width:100%}
.event{box-shadow:inset 4px 0 var(--section-color,var(--category-color));}
.event.holiday-event{box-shadow:inset 4px 0 #26c6da;border-style:solid;border-color:#26c6da}
.event:hover{filter:brightness(1.06);transform:translateY(-1px);z-index:5}
.event:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.event .title{font-weight:600;display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}
.event .meta{opacity:.85;display:block;font-size:11px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}
.event.private-event{border-style:dashed}
.event-row.private-event{border-style:dashed}
.event .private-tag{display:inline-block;margin-left:6px;padding:1px 6px;border-radius:999px;font-size:10px;background:#45505b;color:#ffffff}
.event-row .private-tag{display:inline-block;margin-left:6px;padding:2px 6px;border-radius:999px;font-size:11px;background:#45505b;color:#ffffff}
.private-tag::before{content:"\01F512";margin-right:4px;display:inline-block}
.section-dots{display:flex;gap:3px;margin-top:2px}
.section-dot{width:6px;height:6px;border-radius:50%;background:var(--section-color,var(--accent));border:1px solid rgba(0,0,0,.25)}
.section-dot-more{font-size:10px;color:var(--muted)}
.event-expanded{position:fixed;top:0;left:0;background:inherit;color:inherit;padding:8px 10px;border-radius:12px;box-shadow:0 10px 18px rgba(0,0,0,.4);white-space:normal;z-index:30;pointer-events:none;opacity:0;transform:translateY(-6px);transition:opacity .15s ease,transform .15s ease;max-width:min(320px,90vw)}
.event-expanded .section-dots{margin-top:4px}
.event-expanded.active{opacity:1;transform:translateY(0)}
.event-expanded .title{display:block;font-weight:600;margin-bottom:4px}
.event-expanded .meta{display:block;font-size:11px;margin-bottom:2px}

.foot{padding:10px 18px;color:var(--muted)}

/* Simple views: form and lists */
.pane{background:var(--panel);border:1px solid var(--grid);border-radius:10px;padding:14px}
.pane h2{margin:6px 0 12px 0}
.form{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.form-split{grid-template-columns:minmax(0,1.6fr) minmax(0,1fr);align-items:flex-start}
.form-split .form-main,
.form-split .form-side{display:flex;flex-direction:column;gap:12px}
.form-split .form-side-card{padding:12px;border:1px solid var(--grid);border-radius:10px;background:var(--surface);display:flex;flex-direction:column;gap:10px}
.form-split .form-side-card h3{margin:0;font-size:13px;color:var(--muted);text-transform:uppercase;letter-spacing:.05em}
.form-split .form-side-card .field{gap:4px}
.form-split .form-side .toggle{margin-top:4px}
.form-split .field-notes textarea{min-height:120px}
.form-split .field-sections{display:flex;flex-direction:column;gap:8px}
.form-split .field-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.form-split .field-row label{display:flex;flex-direction:column;gap:6px}
.form-split .form-footer{grid-column:1/-1;display:flex;gap:10px;flex-wrap:wrap;margin-top:6px}
.form .field{display:flex;flex-direction:column;gap:6px}
.form input,.form select,.form textarea{background:var(--surface-soft);color:var(--ink);border:1px solid var(--grid);padding:8px 10px;border-radius:8px}
.form textarea{min-height:80px;grid-column:1/-1}
.hint{display:block;font-size:12px;color:var(--muted);margin-top:4px}
.location-area-field{display:flex;flex-direction:column;gap:8px}
.location-area-options{display:flex;flex-wrap:wrap;gap:8px}
.location-area-choice{display:inline-flex;align-items:center;gap:6px;padding:4px 8px;border:1px solid var(--grid);border-radius:8px;background:var(--surface-alt);font-size:12px}
.location-area-choice input{accent-color:var(--accent)}
.location-area-choice span{color:var(--ink)}
.actions{display:flex;gap:10px;margin-top:10px}
.categories-header{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem;margin:0 0 6px}
.categories-header p{margin:0;flex:1;min-width:0}
.categories-header{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem;margin-bottom:8px}
.categories-header p{margin:0;flex:1;min-width:0}
.btn.danger{border-color:#c62828;color:#f5dde1;background:#8e1c1c}
.list{display:flex;flex-direction:column;gap:8px}
.item-row{display:flex;justify-content:space-between;align-items:center;background:var(--surface-alt);border:1px solid var(--grid);border-radius:8px;padding:10px 12px;gap:12px}
.event-row-main{display:flex;flex-direction:column;gap:4px;flex:1}
.event-title{font-weight:600;font-size:14px}
.event-schedule{font-size:12px;color:var(--muted)}
.event-location{font-size:12px;color:var(--muted)}
.event-row-actions{display:flex;gap:8px}
.badge{display:inline-block;padding:2px 8px;border-radius:999px;font-size:12px;border:1px solid var(--grid);width:max-content}
.info-grid{display:grid;grid-template-columns:auto 1fr;gap:6px 12px;margin:12px 0}
.info-grid dt{color:var(--muted);font-size:12px}
.info-grid dd{margin:0;font-size:14px}
.category-row{align-items:center;gap:10px}
.category-row .swatch{width:22px;height:12px;border-radius:10px}
.category-name{flex:1;min-width:140px;background:var(--surface-soft);color:var(--ink);border:1px solid var(--grid);padding:6px 8px;border-radius:6px}
.category-color{width:60px;height:32px;border-radius:6px;border:1px solid var(--grid);background:var(--surface-soft);color:var(--ink)}
.category-color-hex{width:110px;height:32px;margin-left:8px;border-radius:6px;border:1px solid var(--grid);background:var(--surface-soft);color:var(--ink);padding:0 8px;font-family:monospace;text-transform:uppercase}
.section-color-hex{width:120px;height:32px;margin-left:8px;border-radius:6px;border:1px solid var(--grid);background:var(--surface-soft);color:var(--ink);padding:0 8px;font-family:monospace;text-transform:uppercase}
.category-actions{display:flex;gap:8px}
.user-row{flex-direction:column;align-items:stretch}
.user-row-main{display:flex;flex-direction:column;gap:10px;flex:1}
.user-row-actions{display:flex;gap:8px;justify-content:flex-end;width:100%}
.field.inline label{display:flex;flex-direction:column;gap:4px;font-size:12px;color:var(--muted)}
.category-choices-wrapper{display:flex;flex-wrap:wrap;gap:6px}
  .category-choices{display:flex;flex-wrap:wrap;gap:6px}
  .category-selection-panel{margin:8px 0 12px}
  .category-select-toolbar{display:flex;justify-content:flex-end;margin-bottom:6px}
  .category-select-toolbar .btn{padding:6px 12px;font-size:12px}
.category-choice{display:inline-flex;align-items:center;gap:6px;padding:4px 8px;border:1px solid var(--grid);border-radius:8px;background:var(--surface-alt)}
.category-choice input{accent-color:var(--accent)}
.category-choice .swatch{width:14px;height:8px;border-radius:4px}
.legend .item .swatch{width:18px;height:10px;border-radius:8px}
.legend .item input{margin-right:2px}
.legend-filters .btn{padding:4px 8px;font-size:12px}
.category-choices-field{display:flex;flex-direction:column;gap:6px}
.category-choices-field .category-choices{background:var(--surface-alt);border:1px dashed var(--grid);padding:8px;border-radius:8px}
.toggle{display:flex;align-items:center;gap:6px;font-size:13px;color:var(--muted)}
.toggle input{accent-color:var(--accent)}
.user-row .toggle{align-self:flex-start}
.legend .item{gap:10px}
.legend .item .lbl{flex:1}
.section-badges{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px}
.section-badge{display:inline-flex;align-items:center;gap:8px;padding:3px 10px;border-radius:999px;font-size:11px;background:var(--surface-strong);border:1px solid rgba(255,255,255,.05);color:var(--ink);box-shadow:0 0 0 1px var(--section-color,var(--accent)) inset;white-space:normal;line-height:1.25}
.section-badge::before{content:'';display:inline-block;width:8px;height:8px;border-radius:50%;background:var(--section-color,var(--accent));box-shadow:0 0 0 2px rgba(0,0,0,.45);flex-shrink:0}
.section-badges.compact{gap:4px;margin-top:2px}
.section-badges.compact .section-badge{font-size:10px;padding:2px 6px}

.holiday-note{margin:8px 0;border:1px solid rgba(38,198,218,.4);background:rgba(38,198,218,.08);color:#9be8f4;padding:10px 12px;border-radius:10px;font-size:13px;line-height:1.4}

.section-admin-pane{display:flex;flex-direction:column;gap:18px}
.section-admin-toolbar{display:flex;flex-wrap:wrap;gap:10px}
.section-admin-summary{margin:0;font-size:13px;color:var(--muted)}
.section-admin-status{padding:10px 12px;border-radius:10px;border:1px solid var(--grid);background:color-mix(in srgb,var(--surface-alt) 80%,var(--surface));font-size:13px;transition:.2s ease color,.2s ease border-color,.2s ease background}
.section-admin-status[data-tone="success"]{border-color:color-mix(in srgb,var(--accent) 60%,var(--surface-strong));background:color-mix(in srgb,var(--accent) 25%,var(--surface));color:var(--surface-alt)}
.section-admin-status[data-tone="error"]{border-color:#c62828;background:color-mix(in srgb,#c62828 20%,var(--surface));color:var(--surface-alt)}
.section-admin-status[data-tone="info"]{color:var(--muted)}
.section-admin-tree{display:flex;flex-direction:column;gap:12px}
.section-admin-node{background:var(--surface-alt);border:1px solid var(--grid);border-radius:12px;padding:14px;box-shadow:0 10px 18px rgba(0,0,0,.28)}
.section-admin-node.depth-1{margin-left:12px}
.section-admin-node.depth-2{margin-left:24px}
.section-admin-node.depth-3{margin-left:36px}
.section-admin-row{display:flex;flex-wrap:wrap;align-items:flex-start;gap:14px}
.section-admin-main{flex:1;min-width:220px;display:flex;flex-direction:column;gap:6px}
.section-admin-actions{display:flex;flex-wrap:wrap;gap:8px}
.section-admin-name{background:var(--surface-soft);border:1px solid var(--grid);border-radius:8px;color:var(--ink);padding:6px 10px;font-size:13px;min-width:200px;max-width:320px}
.section-admin-name.is-root{border-color:transparent;font-weight:600}
.section-admin-path{font-size:12px;color:var(--muted)}
.section-admin-meta{font-size:11px;color:var(--muted)}
.section-admin-color-row{display:flex;flex-wrap:wrap;align-items:center;gap:12px;margin-top:12px;padding:10px 12px;border:1px dashed var(--grid);border-radius:10px;background:var(--surface)}
.section-admin-color-preview{width:18px;height:18px;border-radius:50%;background:var(--section-color,var(--accent));box-shadow:0 0 0 3px rgba(0,0,0,.45) inset}
.section-admin-color-hint{font-size:12px;color:var(--muted)}
.section-admin-children{display:flex;flex-direction:column;gap:12px;margin-top:12px}
.section-admin-add{display:flex;flex-direction:column;gap:8px;padding:10px 12px;border-radius:10px;border:1px dashed var(--grid);background:var(--surface-soft)}
.section-admin-add input{background:var(--surface-soft);border:1px solid var(--grid);border-radius:8px;color:var(--ink);padding:6px 10px}
.section-admin-add-actions{display:flex;flex-wrap:wrap;gap:8px}

.preview-summary{margin:0;font-size:13px;color:var(--muted)}
.preview-toolbar{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:10px}
.preview-list{display:flex;flex-direction:column;gap:10px}
.preview-row{display:flex;align-items:flex-start;gap:12px;padding:10px 12px;border:1px solid var(--grid);border-radius:10px;background:var(--surface)}
.preview-select{display:flex;align-items:flex-start;padding-top:4px}
.preview-select input{accent-color:var(--accent)}
.preview-row-main{flex:1;display:flex;flex-direction:column;gap:6px}
.preview-title{font-weight:600;font-size:14px}
.preview-meta{font-size:12px;color:var(--muted)}
.preview-status{display:inline-flex;align-items:center;padding:2px 8px;border-radius:999px;font-size:11px;background:var(--surface);color:#cdd8e6;border:1px solid rgba(255,255,255,.05);width:max-content}
.preview-status.locked{background:var(--surface-strong);color:#f4c4ca;border-color:#c62828}
.preview-status.warn{background:var(--surface-strong);color:#f4deb1;border-color:#b5882e}
.preview-row-actions{display:flex;flex-direction:column;gap:8px;min-width:120px;align-items:flex-end}
.preview-locked-note{font-size:12px;color:var(--muted)}
.preview-actions{justify-content:flex-start;gap:10px}

.months-grid{display:flex;flex-wrap:wrap;gap:8px}
.month-choice{display:flex;align-items:center;gap:6px;padding:4px 8px;border-radius:8px;border:1px solid var(--grid);background:var(--surface);font-size:12px}
.month-choice input{accent-color:var(--accent)}
.export-preview{margin-top:18px;padding:12px;background:var(--surface-alt);border:1px solid var(--grid);border-radius:10px;overflow:auto}
.export-preview .calendar{min-width:960px}
.event-row{align-items:flex-start}
.event-row.holiday-event{border-left:3px solid #26c6da;padding-left:10px}
.filters-summary{display:flex;flex-wrap:wrap;gap:12px;margin-bottom:14px;padding:12px 14px;border:1px solid var(--grid);border-radius:10px;background:var(--surface)}
.event-title,.event-schedule,.event-location{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}
.filters-group{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.filters-label{font-size:12px;color:var(--muted);text-transform:uppercase;letter-spacing:.05em}
.filters-tags{display:flex;flex-wrap:wrap;gap:6px}
.filter-chip{display:inline-flex;align-items:center;gap:6px;padding:4px 10px;border-radius:999px;border:1px solid var(--grid);background:var(--surface-soft);font-size:12px}
.filter-chip::before{content:'';display:block;width:8px;height:8px;border-radius:50%;background:var(--chip-color,var(--accent))}
.filter-chip.is-empty{padding:4px 8px;color:var(--muted);border-style:dashed}
.list-toolbar{display:flex;flex-wrap:wrap;gap:12px;margin-bottom:12px;align-items:center}
.list-toolbar label{display:flex;align-items:center;gap:6px;color:var(--muted);font-size:13px}
.list-toolbar select{background:var(--surface-soft);color:var(--ink);border:1px solid var(--grid);padding:6px 10px;border-radius:8px}
.list-nav{display:flex;flex-wrap:wrap;gap:10px;margin-bottom:12px}

.admin-pane{display:flex;flex-direction:column;gap:16px}
.admin-status{padding:10px 12px;border-radius:10px;border:1px solid var(--grid);background:color-mix(in srgb,var(--surface-alt) 80%,var(--surface));font-size:13px;color:var(--muted);transition:.2s ease color,.2s ease border-color,.2s ease background}
.admin-status[data-tone="success"]{border-color:color-mix(in srgb,var(--accent) 60%,var(--surface-strong));background:color-mix(in srgb,var(--accent) 20%,var(--surface-soft));color:#004d40}
.admin-status[data-tone="error"]{border-color:#c62828;background:color-mix(in srgb,#c62828 20%,var(--surface));color:var(--surface-alt)}
.admin-grid{display:grid;gap:16px;grid-template-columns:repeat(auto-fit,minmax(260px,1fr))}
.admin-card{background:var(--panel);border:1px solid var(--grid);border-radius:12px;padding:14px;display:flex;flex-direction:column;gap:12px;box-shadow:0 10px 18px rgba(0,0,0,.18)}
.admin-card-scroll{max-height:360px;overflow:hidden}
.admin-table-wrap{flex:1;overflow:auto;border-top:1px solid var(--grid); margin-top:10px; padding-top:10px}
.admin-card-header{display:flex;align-items:center;justify-content:space-between;gap:10px}
.admin-sync{display:flex;justify-content:flex-end;margin:8px 0 16px}
.admin-sync .btn{white-space:nowrap}
.admin-note{font-size:12px;color:var(--muted);margin:0}
.admin-actions{display:flex;flex-wrap:wrap;gap:10px}
.admin-input,.admin-textarea{background:var(--surface-soft);color:var(--ink);border:1px solid var(--grid);border-radius:8px;padding:8px 10px;font-size:13px}
.admin-input{flex:1;min-width:200px}
.admin-textarea{min-height:80px;resize:vertical}
.admin-metrics{display:grid;grid-template-columns:repeat(auto-fit,minmax(110px,1fr));gap:10px}
.admin-metric{background:var(--surface-alt);border:1px solid var(--grid);border-radius:10px;padding:10px 12px;display:flex;flex-direction:column;gap:6px}
.admin-metric .metric-label{font-size:12px;color:var(--muted)}
.admin-metric .metric-value{font-size:20px;font-weight:600}
.admin-table{width:100%;border-collapse:collapse;font-size:13px}
.admin-table th{padding:6px 8px;text-align:left;color:var(--muted);border-bottom:1px solid var(--grid);font-weight:500;text-transform:uppercase;letter-spacing:.04em;font-size:11px}
.admin-table td{padding:6px 8px;border-bottom:1px solid var(--grid);color:var(--ink)}
.admin-table tr:last-child td{border-bottom:none}
.admin-table tbody tr:hover{background:var(--surface-strong)}

.tenant-form{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px;margin-top:12px}
.tenant-form .actions{grid-column:1/-1;display:flex;gap:8px;flex-wrap:wrap}
.tenant-list{margin-top:12px;overflow-x:auto}
.tenant-table{width:100%;border-collapse:collapse;font-size:13px}
.tenant-table th,.tenant-table td{border:1px solid var(--grid);padding:8px;text-align:left}
.tenant-table th{background:var(--surface-alt);text-transform:uppercase;letter-spacing:.03em;font-size:11px;color:var(--muted)}
.tenant-table .btn{padding:4px 8px;margin-right:6px}
.tenant-table .btn.danger{background:#c62828;color:#fff;border-color:#b71c1c}

@media (max-width: 900px){
  .layout{grid-template-columns:1fr}
  .legend{order:2}
  .form{grid-template-columns:1fr}
  .form-split{grid-template-columns:1fr}
  .form-split .field-row{grid-template-columns:1fr}
  .form-split .form-footer{justify-content:flex-start}
  .list-toolbar{flex-direction:column;align-items:flex-start}
  .list-nav{justify-content:flex-start}
  .item-row{flex-direction:column;align-items:flex-start}
  .event-row-actions{width:100%}
  .user-row-actions{justify-content:flex-start}
  .topbar-nav{margin:0;justify-content:flex-start}
  .actions-group{margin-left:0;width:100%;justify-content:flex-start}
  .section-admin-node.depth-1,
  .section-admin-node.depth-2,
  .section-admin-node.depth-3{margin-left:0}
  .admin-grid{grid-template-columns:minmax(0,1fr)}
  .preview-row{flex-direction:column;align-items:flex-start}
  .preview-row-actions{align-items:flex-start;min-width:auto;width:100%}
}

.toast-container{position:fixed;bottom:24px;right:24px;display:flex;flex-direction:column;gap:10px;z-index:9999;pointer-events:none}
.toast{min-width:240px;max-width:320px;background:var(--surface-soft);color:var(--ink);border-radius:10px;padding:12px 16px;box-shadow:0 12px 30px rgba(0,0,0,.35);border-left:4px solid var(--accent);opacity:0;transform:translateY(20px);transition:opacity .2s ease,transform .2s ease;pointer-events:auto;display:flex;justify-content:space-between;gap:12px}
.toast.visible{opacity:1;transform:translateY(0)}
.toast-success{border-color:#43a047}
.toast-error{border-color:#ef5350}
.toast-info{border-color:#29b6f6}
.toast-close{background:transparent;border:none;color:var(--muted);font-size:18px;line-height:1;cursor:pointer;padding:0;margin:0}
.toast-close:hover{color:var(--ink)}

.users-toolbar{display:flex;gap:12px;flex-wrap:wrap;align-items:center;margin:16px 0}
.create-form-highlight{animation:pulse-highlight .8s ease}
@keyframes pulse-highlight{
  0%{box-shadow:0 0 0 rgba(46,163,255,.0)}
  50%{box-shadow:0 0 0 4px rgba(46,163,255,.35)}
  100%{box-shadow:0 0 0 rgba(46,163,255,.0)}
}

.feedback-widget{position:fixed;right:24px;bottom:24px;display:flex;flex-direction:column;gap:8px;align-items:flex-end;z-index:1000}
.feedback-button{width:60px;height:60px;border-radius:50%;background:var(--accent);border:none;color:#fff;font-size:32px;display:flex;align-items:center;justify-content:center;box-shadow:0 6px 20px rgba(0,0,0,.35);cursor:pointer}
.feedback-panel{width:320px;background:var(--panel);border:1px solid var(--grid);border-radius:16px;box-shadow:0 12px 30px rgba(0,0,0,.25);padding:16px;display:flex;flex-direction:column;gap:8px}
.feedback-tabs{display:flex;gap:6px}
.feedback-tab{flex:1;padding:8px 12px;border-radius:999px;border:1px solid var(--grid);background:var(--surface-alt);color:var(--muted);text-align:center;cursor:pointer;font-size:13px}
.feedback-tab.active{background:var(--accent);color:#fff;border-color:var(--accent)}
.feedback-textarea{width:100%;height:120px;border-radius:10px;border:1px solid var(--grid);padding:8px;resize:none;background:var(--surface-soft);color:var(--ink)}
.feedback-meta{display:flex;gap:8px;flex-wrap:wrap}
.feedback-meta-input{flex:1;border-radius:8px;border:1px solid var(--grid);padding:8px;background:var(--surface-soft);color:var(--ink);font-size:14px}
.feedback-meta-input:focus{outline:2px solid var(--accent);border-color:var(--accent)}
.feedback-actions{display:flex;justify-content:flex-end;gap:8px}
.feedback-send{padding:8px 16px;border:none;border-radius:8px;background:var(--accent);color:#fff;cursor:pointer}
