/* Publifia Dashboard — Settings modal, light theme, motion & density modes */

/* ===== Overlay + modal ===== */
.se-overlay { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center;
  background: rgba(73,75,80,0.62); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  animation: seFade .2s ease both; padding: 24px; }
@keyframes seFade { from { opacity: 0; } to { opacity: 1; } }
.se-modal { width: 900px; max-width: 100%; height: 640px; max-height: 92vh; display: grid; grid-template-columns: 232px 1fr;
  background: var(--surface); border: 1px solid var(--line2); border-radius: 20px; overflow: hidden;
  box-shadow: 0 40px 120px -30px rgba(0,0,0,0.8); animation: sePop .28s cubic-bezier(.2,.9,.3,1) both; }
@keyframes sePop { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }

.se-rail { background: var(--bg); border-right: 1px solid var(--line); padding: 20px 14px; display: flex; flex-direction: column; }
.se-rail-h { font-size: 11px; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; color: var(--txt3); padding: 4px 10px 12px; }
.se-tab { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 11px; border: none; background: transparent;
  color: var(--txt2); font-family: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; transition: .14s; text-align: left; }
.se-tab:hover { background: var(--surface2); color: var(--txt); }
.se-tab.on { background: var(--surface2); color: var(--txt); }
.se-tab-ic { display: flex; width: 18px; height: 18px; color: var(--txt3); }
.se-tab.on .se-tab-ic { color: var(--pp2); }
.se-tab-ic svg { width: 18px; height: 18px; }
.se-rail-user { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px 8px 2px; border-top: 1px solid var(--line); }
.se-rail-av { width: 34px; height: 34px; border-radius: 10px; overflow: hidden; background: var(--pp); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: #fff; flex: none; }
.se-rail-av img { width: 100%; height: 100%; object-fit: cover; }
.se-rail-user .nm { font-size: 13px; font-weight: 600; color: var(--txt); }
.se-rail-user .em { font-size: 11px; color: var(--txt3); max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.se-main { display: flex; flex-direction: column; min-width: 0; }
.se-head { display: flex; align-items: flex-start; justify-content: space-between; padding: 22px 26px 16px; border-bottom: 1px solid var(--line); }
.se-head h2 { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.se-blurb { font-size: 13px; color: var(--txt3); margin-top: 3px; font-weight: 500; }
.se-x { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; color: var(--txt3); background: transparent; border: none; cursor: pointer; transition: .14s; flex: none; }
.se-x:hover { background: var(--surface2); color: var(--txt); }
.se-x svg { width: 18px; height: 18px; }
.se-body { flex: 1; overflow-y: auto; padding: 22px 26px 30px; }

/* ===== Blocks / cards / rows ===== */
.se-block { margin-bottom: 24px; }
.se-block:last-child { margin-bottom: 0; }
.se-block-t { font-size: 11.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--txt3); margin-bottom: 10px; }
.se-card { background: var(--surface2); border: 1px solid var(--line); border-radius: 14px; padding: 4px 16px; }
.se-row { display: flex; align-items: center; gap: 16px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.se-row.last, .se-row:last-child { border-bottom: none; }
.se-rl { flex: 1; min-width: 0; }
.se-rt { font-size: 13.5px; font-weight: 600; color: var(--txt); }
.se-rs { font-size: 12px; color: var(--txt3); margin-top: 3px; font-weight: 500; line-height: 1.4; }
.se-rc { flex: none; }

/* ===== Fields ===== */
.se-field { display: block; padding: 13px 0; border-bottom: 1px solid var(--line); }
.se-field.last, .se-card > .se-field:last-child { border-bottom: none; }
.se-field > span { display: block; font-size: 12px; font-weight: 600; color: var(--txt2); margin-bottom: 7px; }
.se-field input { width: 100%; padding: 10px 13px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line2);
  color: var(--txt); font-family: inherit; font-size: 13.5px; font-weight: 500; transition: border-color .14s; }
.se-field input:focus { outline: none; border-color: var(--pp); }
.se-field input::placeholder { color: var(--txt3); }
.se-pw { padding: 14px 0; }
.se-pw-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.se-pw-grid .se-field { border-bottom: none; }

.se-select { padding: 9px 32px 9px 12px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line2); color: var(--txt);
  font-family: inherit; font-size: 13px; font-weight: 600; appearance: none; cursor: pointer; min-width: 180px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none' stroke='%2367677a' stroke-width='1.6'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; }
.se-select:focus { outline: none; border-color: var(--pp); }

/* ===== Avatar ===== */
.se-avatar-row { display: flex; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.se-avatar { width: 64px; height: 64px; border-radius: 16px; overflow: hidden; background: var(--pp); display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 800; color: #fff; flex: none; }
.se-avatar img { width: 100%; height: 100%; object-fit: cover; }
.se-avatar-act { display: flex; flex-direction: column; }
.se-avatar-act .se-rt { margin-bottom: 8px; white-space: nowrap; }
.se-btns { display: flex; gap: 8px; }

/* ===== Buttons ===== */
.se-btn { display: inline-flex; align-items: center; gap: 7px; font-family: inherit; font-size: 12.5px; font-weight: 600;
  padding: 8px 14px; border-radius: 10px; cursor: pointer; transition: .14s; border: 1px solid var(--line2); background: var(--bg); color: var(--txt); white-space: nowrap; }
.se-btn:hover { border-color: var(--pp); }
.se-btn svg { width: 15px; height: 15px; }
.se-btn.ghost { background: transparent; color: var(--txt2); }
.se-btn.ghost:hover { color: var(--txt); border-color: var(--line2); }
.se-btn.primary { background: var(--pp); color: #fff; border-color: transparent; }
.se-btn.primary:hover { background: var(--pp2); border-color: transparent; }
.se-btn.danger { color: #ff8095; border-color: rgba(255,128,149,0.35); background: rgba(255,128,149,0.08); }
.se-btn.danger:hover { background: rgba(255,128,149,0.16); border-color: rgba(255,128,149,0.5); }

.se-soon { font-size: 11px; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; color: var(--txt3);
  background: var(--raised); border: 1px solid var(--line); padding: 5px 10px; border-radius: 999px; }

.se-msg { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; margin-top: 10px; }
.se-msg svg { width: 15px; height: 15px; }
.se-msg.ok { color: var(--pos); }
.se-msg.err { color: #ff8095; }

/* ===== Switch ===== */
.se-sw { width: 42px; height: 24px; border-radius: 999px; border: none; background: var(--raised); position: relative; cursor: pointer; transition: background .2s; padding: 0; flex: none; box-shadow: inset 0 0 0 1px var(--line2); }
.se-sw .knob { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s cubic-bezier(.3,1.4,.4,1); box-shadow: 0 1px 3px rgba(0,0,0,0.4); }
.se-sw.on { background: var(--pp); box-shadow: none; }
.se-sw.on .knob { transform: translateX(18px); }

/* ===== Segmented ===== */
.se-seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line2); }
.se-seg button { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 9px; border: none; background: transparent;
  color: var(--txt2); font-family: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; transition: .14s; white-space: nowrap; }
.se-seg button:hover { color: var(--txt); }
.se-seg button.on { background: var(--surface); color: var(--txt); box-shadow: 0 1px 3px rgba(0,0,0,0.25), 0 0 0 1px var(--line); }
.se-seg-ic { display: flex; width: 15px; height: 15px; }
.se-seg-ic svg { width: 15px; height: 15px; }

/* clickable profile button in sidebar */
.sb-user { border: none; background: transparent; width: 100%; text-align: left; cursor: pointer; border-radius: 12px; transition: background .14s; }
.sb-user:hover { background: var(--surface2); }
.sb-user .av { overflow: hidden; flex: none; }
.sb-user .av img { width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 720px) {
  .se-modal { grid-template-columns: 1fr; height: auto; }
  .se-rail { flex-direction: row; overflow-x: auto; align-items: center; }
  .se-rail-h, .se-rail-user { display: none; }
  .se-pw-grid { grid-template-columns: 1fr; }
}

/* ===================================================================
   LIGHT THEME
   =================================================================== */
:root[data-theme="light"] {
  --bg: #eef0f4;
  --surface: #ffffff;
  --surface2: #f1ece7;
  --raised: #e9e3db;
  --txt: #1a1b23;
  --txt2: #565a68;
  --txt3: #9296a4;
  --line: rgba(73,75,80,0.09);
  --line2: rgba(73,75,80,0.15);
  --pp: #9b9ea3;
  --pp2: #84878d;
  --pp-soft: rgba(155,158,163,0.12);
  --shadow: 0 1px 2px rgba(73,75,80,0.05), 0 12px 28px -16px rgba(73,75,80,0.26);
}
:root[data-theme="light"] body { background: var(--bg); }
:root[data-theme="light"] body::before { background: radial-gradient(900px 520px at 82% -8%, rgba(119,122,129,0.10), transparent 70%); }
/* white-on-white surfaces that need darkening in light mode */
:root[data-theme="light"] .cc-bar,
:root[data-theme="light"] .usebar .ub-track,
:root[data-theme="light"] .barz .tk,
:root[data-theme="light"] .nc-counter .prog,
:root[data-theme="light"] .tc-progress,
:root[data-theme="light"] .donut-mini .dl-row i,
:root[data-theme="light"] .greet-stats .gstat { background-color: rgba(73,75,80,0.06); }
:root[data-theme="light"] .sb-item:hover,
:root[data-theme="light"] .ibtn:hover { background: rgba(73,75,80,0.05); }
:root[data-theme="light"] .greet { background: linear-gradient(180deg, #ffffff, #f2f2f3); }
:root[data-theme="light"] .greet .gsub,
:root[data-theme="light"] .greet .eyelab { color: var(--txt2) !important; }
:root[data-theme="light"] .greet::after { background-image: radial-gradient(rgba(154,157,162,0.10) 1.3px, transparent 1.4px); }
:root[data-theme="light"] .greet .gbtn { background: var(--surface2); }
:root[data-theme="light"] .greet .gbtn.w { background: var(--pp); }
.sb-logo .logo-lite { display: none; }
:root[data-theme="light"] .sb-logo .logo-dark { display: none; }
:root[data-theme="light"] .sb-logo .logo-lite { display: block; }
:root[data-theme="light"] .kbd { background: var(--surface2); color: var(--txt3); }
:root[data-theme="light"] .mn-search { background: var(--surface); }
:root[data-theme="light"] .cc-bar span { background: var(--pp); }
:root[data-theme="light"] .stbadge.live { color: #1f9d57; }
:root[data-theme="light"] .se-overlay { background: rgba(96,78,57,0.4); }
:root[data-theme="light"] .se-sw .knob { box-shadow: 0 1px 3px rgba(0,0,0,0.22); }
:root[data-theme="light"] .explore-tile .leaflet-container { background: #dfe2ea; }
/* real card elevation on the light canvas */
:root[data-theme="light"] .app3 { background: var(--bg); }
:root[data-theme="light"] .tile { box-shadow: 0 1px 2px rgba(73,75,80,0.04), 0 10px 24px -18px rgba(73,75,80,0.3); }
:root[data-theme="light"] .mn-top { background: transparent; }
:root[data-theme="light"] .ibtn { border-color: var(--line2); }
:root[data-theme="light"] .cta { background: #1a1b23; color: #fff; }
:root[data-theme="light"] .cta:hover { background: #33343f; }
:root[data-theme="light"] .daterange { background: var(--surface); border-color: var(--line); }
:root[data-theme="light"] .daterange button.on { background: var(--raised); color: var(--txt); }
/* white-alpha tracks & fills that vanish on light */
:root[data-theme="light"] .cc-bar,
:root[data-theme="light"] .usebar .ub-track,
:root[data-theme="light"] .barz .tk,
:root[data-theme="light"] .tc-progress,
:root[data-theme="light"] .nc-counter .prog { background: rgba(73,75,80,0.08); }
/* hover states */
:root[data-theme="light"] .np-item:hover,
:root[data-theme="light"] .sp-row:hover,
:root[data-theme="light"] .prow:hover,
:root[data-theme="light"] .fchip:hover,
:root[data-theme="light"] .actiontile:hover { background: rgba(73,75,80,0.04); }
/* active sidebar item reads as a raised card */
:root[data-theme="light"] .sb-item.on { background: var(--surface); box-shadow: 0 1px 3px rgba(73,75,80,0.07); }
:root[data-theme="light"] .sb-item.on svg { color: var(--pp); }
/* elevated popovers */
:root[data-theme="light"] .np-pop,
:root[data-theme="light"] .search-pop,
:root[data-theme="light"] .ai-panel,
:root[data-theme="light"] .act-modal,
:root[data-theme="light"] .nc-modal { box-shadow: 0 30px 70px -28px rgba(73,75,80,0.4); }
/* greeting stat cards: light chips, not dark blocks */
:root[data-theme="light"] .greet-stats .gstat { background: #f1ece7; border-color: var(--line); }
:root[data-theme="light"] .kmini .ic { background: var(--pp-soft); }

/* ===================================================================
   MOTION OFF
   =================================================================== */
body.no-anim *, body.no-anim *::before, body.no-anim *::after {
  animation-duration: .001s !important; animation-delay: 0s !important;
  transition-duration: .001s !important; transition-delay: 0s !important;
}

/* ===================================================================
   COMPACT VIEW
   =================================================================== */
body.compact .bento { gap: 12px; }
body.compact .tile { padding: 15px; }
body.compact .mn-scroll { padding: 16px 22px; }
body.compact .greet { padding: 18px; gap: 18px; }
body.compact .greet .hi { font-size: 23px; margin-top: 8px; }
body.compact .greet-stats .gstat { padding: 12px 13px; min-width: 84px; }
body.compact .kmini .v { font-size: 22px; }
body.compact .mn-top { padding-top: 14px; padding-bottom: 14px; }
body.compact .plist .prow { padding: 9px 0; }

/* KPI mini-chart expand button + full-graph overlay */
.kmini .top { position: relative; }
.kx-open { position: absolute; top: -2px; right: -2px; width: 24px; height: 24px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05); color: var(--txt3); cursor: pointer; opacity: 0; transition: .15s;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.kx-open svg { width: 13px; height: 13px; }
.kmini:hover .kx-open { opacity: 1; }
.kx-open:hover { color: var(--txt); background: rgba(255,255,255,0.1); transform: scale(1.08); }
.kx-overlay { position: fixed; inset: 0; z-index: 210; display: flex; align-items: center; justify-content: center;
  background: rgba(73,75,80,0.66); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  animation: seFade .2s ease both; padding: 28px; }
.kx-modal { width: 860px; max-width: 96vw; background: var(--surface); border: 1px solid var(--line2);
  border-radius: 20px; padding: 24px 26px 28px; box-shadow: 0 40px 120px -30px rgba(0,0,0,0.85);
  animation: sePop .28s cubic-bezier(.2,.9,.3,1) both; }
.kx-head { display: flex; align-items: center; gap: 13px; margin-bottom: 18px; }
.kx-ic { width: 38px; height: 38px; border-radius: 11px; display: flex; align-items: center; justify-content: center; flex: none; }
.kx-ic svg { width: 19px; height: 19px; }
.kx-t { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.kx-s { font-size: 12px; color: var(--txt3); margin-top: 2px; }
.kx-big { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; margin-right: 8px; }
.kx-big b { font-size: 13px; font-weight: 700; margin-left: 6px; }
.kx-big b.up { color: var(--pos); }
.kx-scroll { overflow-x: auto; overflow-y: hidden; margin-top: 8px; padding-bottom: 6px; }
.kx-scroll::-webkit-scrollbar { height: 8px; }
.kx-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.14); border-radius: 999px; }
.kx-hint { font-size: 11px; color: var(--txt3); font-family: var(--mono); margin-top: 8px; text-align: right; }

/* ===================================================================
   MAP EXPLORER
   =================================================================== */
.mx-overlay { position: fixed; inset: 0; z-index: 210; display: flex; align-items: center; justify-content: center;
  background: rgba(73,75,80,0.66); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  animation: seFade .2s ease both; padding: 28px; }
.mx-modal { width: 980px; height: 640px; min-width: 520px; min-height: 400px; max-width: 96vw; max-height: 92vh;
  resize: both; overflow: hidden; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line2); border-radius: 20px;
  box-shadow: 0 40px 120px -30px rgba(0,0,0,0.85); animation: sePop .28s cubic-bezier(.2,.9,.3,1) both; }
.mx-modal.full { width: 96vw !important; height: 92vh !important; resize: none; }
.mx-modal::-webkit-resizer { background: transparent; }

.mx-head { display: flex; align-items: center; gap: 12px; padding: 15px 18px; border-bottom: 1px solid var(--line); flex: none; }
.mx-title h2 { font-size: 17px; font-weight: 800; letter-spacing: -0.02em; }
.mx-eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; color: var(--pp2); margin-bottom: 3px; }
.mx-eyebrow svg { width: 13px; height: 13px; }
.mx-seg { display: inline-flex; gap: 3px; padding: 3px; border-radius: 10px; background: var(--surface2); border: 1px solid var(--line); }
.mx-seg button { border: none; background: transparent; color: var(--txt2); font-family: inherit; font-size: 12px; font-weight: 600; padding: 6px 13px; border-radius: 8px; cursor: pointer; transition: .14s; }
.mx-seg button:hover { color: var(--txt); }
.mx-seg button.on { background: var(--raised); color: var(--txt); box-shadow: 0 1px 2px rgba(0,0,0,0.3); }
.mx-ic { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; color: var(--txt3); background: transparent; border: 1px solid var(--line); cursor: pointer; transition: .14s; flex: none; }
.mx-ic:hover { color: var(--txt); background: var(--surface2); border-color: var(--line2); }
.mx-ic svg { width: 17px; height: 17px; }

.mx-body { flex: 1; display: flex; min-height: 0; }
.mx-list { width: 264px; flex: none; border-right: 1px solid var(--line); overflow-y: auto; padding: 12px; background: var(--surface); }
.mx-list-h { font-size: 11px; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; color: var(--txt3); padding: 4px 8px 10px; }
.mx-item { display: flex; align-items: center; gap: 11px; width: 100%; text-align: left; padding: 10px 10px; border-radius: 11px; border: 1px solid transparent; background: transparent; cursor: pointer; transition: .14s; }
.mx-item:hover { background: var(--surface2); }
.mx-item.on { background: var(--surface2); border-color: var(--line2); }
.mx-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; box-shadow: 0 0 0 3px rgba(226,227,228,0.075); }
.mx-item-tx { flex: 1; min-width: 0; }
.mx-item-tx .nm { font-size: 13px; font-weight: 600; color: var(--txt); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mx-item-tx .ct { font-size: 11px; color: var(--txt3); margin-top: 2px; }
.mx-rel { font-size: 11px; font-weight: 700; color: var(--pp2); font-variant-numeric: tabular-nums; flex: none; }
.mx-map { flex: 1; min-width: 0; }
.mx-map .leaflet-container { width: 100%; height: 100%; background: #5d4e3c; }
.mx-light .mx-map .leaflet-container { background: #e6e1db; }

.mx-pin-dot { display: block; width: 14px; height: 14px; border-radius: 50%; background: var(--c); border: 2.5px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,0.4); cursor: pointer; }
.mx-light .mx-pin-dot { border-color: #fff; }
.mx-resize-hint { position: absolute; right: 14px; bottom: 8px; font-size: 10.5px; color: var(--txt3); font-family: var(--mono); pointer-events: none; opacity: .7; }

@media (max-width: 720px) {
  .mx-body { flex-direction: column; }
  .mx-list { width: auto; max-height: 160px; border-right: none; border-bottom: 1px solid var(--line); }
}
