:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --sheet-bg: #edeff3;
  --border: #e4e8ee;
  --border-strong: #d0d7e1;
  --text: #1a2233;
  --muted: #667085;
  --faint: #98a2b3;
  --hover: rgba(16,24,40,.06);
  --primary: #3056d3;
  --primary-hover: #2646b8;
  --primary-2: #6d8dff;
  --primary-soft: rgba(48,86,211,.10);
  --sidebar-bg: #101828;
  --sidebar-hover: #1d2939;
  --sidebar-text: #9aa5b8;
  --green: #12b76a;
  --green-soft: #ecfdf3;
  --amber: #dc8a0b;
  --amber-soft: #fffaeb;
  --red: #d92d20;
  --red-soft: #fef3f2;
  --blue: #1570ef;
  --blue-soft: #eff8ff;
  --radius: 10px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.06);
  --shadow-lg: 0 8px 24px rgba(16,24,40,.14);
  --font: 'Inter', -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* ============================= THEME ENGINE =============================
   `data-mode` = light | dark  ·  `data-theme` = palette de acento
   ====================================================================== */

/* ---- Accent themes (work on both modes) ---- */
html[data-theme="monokai"] {
  --primary: #f92672;
  --primary-hover: #d81b60;
  --primary-2: #ff8ad8;
  --primary-soft: rgba(249,38,114,.12);
}
html[data-theme="catppuccin"] {
  --primary: #8839ef;
  --primary-hover: #6c1fd6;
  --primary-2: #cba6f7;
  --primary-soft: rgba(136,57,239,.12);
}
html[data-theme="dracula"] {
  --primary: #bd93f9;
  --primary-hover: #a06cf5;
  --primary-2: #e2c8ff;
  --primary-soft: rgba(189,147,249,.18);
}
html[data-theme="nord"] {
  --primary: #5e81ac;
  --primary-hover: #4c6f99;
  --primary-2: #88c0d0;
  --primary-soft: rgba(94,129,172,.14);
}
html[data-theme="solarized"] {
  --primary: #268bd2;
  --primary-hover: #1f6fa8;
  --primary-2: #6cbfe0;
  --primary-soft: rgba(38,139,210,.12);
}
html[data-theme="gruvbox"] {
  --primary: #b57614;
  --primary-hover: #9a6310;
  --primary-2: #fabd2f;
  --primary-soft: rgba(181,118,20,.12);
}
html[data-theme="synthwave"] {
  --primary: #ff4fd8;
  --primary-hover: #e03fc0;
  --primary-2: #00e5ff;
  --primary-soft: rgba(255,79,216,.14);
}

/* ---- Dark mode (neutral overrides) ---- */
html[data-mode="dark"] {
  --bg: #0f1115;
  --surface: #161a21;
  --surface-2: #1c212a;
  --sheet-bg: #12151b;
  --border: #262b36;
  --border-strong: #343b48;
  --text: #e7eaf0;
  --muted: #9aa3b2;
  --faint: #6d7686;
  --hover: rgba(255,255,255,.06);
  --sidebar-bg: #0a0c10;
  --sidebar-hover: #181d26;
  --sidebar-text: #98a2b2;
  --green: #32d583;
  --green-soft: rgba(18,183,106,.14);
  --amber: #f5a623;
  --amber-soft: rgba(245,166,35,.14);
  --red: #f5635a;
  --red-soft: rgba(217,45,32,.15);
  --blue: #3b9eff;
  --blue-soft: rgba(59,158,255,.15);
  --shadow: 0 1px 2px rgba(0,0,0,.35), 0 1px 3px rgba(0,0,0,.4);
  --shadow-lg: 0 12px 32px rgba(0,0,0,.55);
  color-scheme: dark;
}
html[data-mode="dark"] body { color: var(--text); background: var(--bg); }

/* ---- Accent soft tint for dark mode (per theme) ---- */
html[data-mode="dark"][data-theme="monokai"] { --primary-soft: rgba(249,38,114,.20); }
html[data-mode="dark"][data-theme="catppuccin"] { --primary-soft: rgba(136,57,239,.22); }
html[data-mode="dark"][data-theme="dracula"] { --primary-soft: rgba(189,147,249,.22); }
html[data-mode="dark"][data-theme="nord"] { --primary-soft: rgba(94,129,172,.22); }
html[data-mode="dark"][data-theme="solarized"] { --primary-soft: rgba(38,139,210,.22); }
html[data-mode="dark"][data-theme="gruvbox"] { --primary-soft: rgba(214,161,32,.22); }
html[data-mode="dark"][data-theme="synthwave"] { --primary-soft: rgba(255,79,216,.22); }

/* reward colors that read better on dark */
html[data-mode="dark"] .badge-green { color: #6ee7b7; }
html[data-mode="dark"] .badge-amber { color: #ffc96b; }
html[data-mode="dark"] .badge-red { color: #ff9c94; }
html[data-mode="dark"] .badge-blue { color: #7cc0ff; }
html[data-mode="dark"] .badge-gray { background: rgba(255,255,255,.06); color: var(--muted); }

/* hard-coded neutral fixes for dark */
html[data-mode="dark"] ::-webkit-scrollbar-thumb { background: #3a4352; }
html[data-mode="dark"] .btn-ghost:hover,
html[data-mode="dark"] .icon-btn:hover { background: rgba(255,255,255,.07); color: var(--text); }
html[data-mode="dark"] .switch .track { background: #3a4150; }
html[data-mode="dark"] .switch .track::before { box-shadow: 0 1px 3px rgba(0,0,0,.5); }
html[data-mode="dark"] .tbl tbody tr:hover { background: rgba(255,255,255,.035); }
html[data-mode="dark"] .bar { background: #262b36; }
html[data-mode="dark"] .pip { background: #3a4150; }
html[data-mode="dark"] .attr-box .a-input:hover,
html[data-mode="dark"] .attr-box .a-input:focus { background: var(--surface-2); }
html[data-mode="dark"] .sh-name:focus { background: var(--surface-2); }
html[data-mode="dark"] .sheet-head { background: linear-gradient(180deg, #1b2029, var(--surface)); }
html[data-mode="dark"] .icon-btn { color: var(--faint); }
html[data-mode="dark"] .avatar-light { box-shadow: inset 0 0 0 1px var(--border); }
html[data-mode="dark"] .cat-dd-item:hover,
html[data-mode="dark"] .ac-item:hover,
html[data-mode="dark"] .ac-item.active { background: var(--surface-2); }
html[data-mode="dark"] .tag-cat { background: rgba(255,255,255,.06); }
html[data-mode="dark"] .login-error { color: #ff9c94; }
html[data-mode="dark"] .btn-danger-soft:hover { background: rgba(217,45,32,.22); }
html[data-mode="dark"] .btn-danger-soft { color: #ff9c94; }

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}

button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; color: var(--text); }
[hidden] { display: none !important; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
svg { display: block; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #cdd4dd; border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.2;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
  white-space: nowrap;
  user-select: none;
}
.btn svg { width: 15px; height: 15px; flex-shrink: 0; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); box-shadow: var(--shadow); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--hover); color: var(--text); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #b42318; }
.btn-danger-soft { background: var(--red-soft); color: var(--red); border-color: transparent; }
.btn-danger-soft:hover { background: #fee4e2; }
.btn-block { width: 100%; justify-content: center; }
.btn-sm { padding: 5px 10px; font-size: 12.5px; border-radius: 7px; }
.btn-sm svg { width: 13px; height: 13px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--faint);
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn.danger:hover { background: var(--red-soft); color: var(--red); }
.icon-btn svg { width: 15px; height: 15px; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 5px; }
.field .req { color: var(--red); margin-left: 2px; }
.field .hint { font-size: 12px; color: var(--faint); margin-top: 4px; }

.input {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 8px 11px;
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.input::placeholder { color: var(--faint); }
textarea.input { resize: vertical; min-height: 70px; line-height: 1.55; }
select.input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2.4'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}
.input.invalid { border-color: var(--red); }

.search-wrap { position: relative; flex: 1; max-width: 340px; }
.search-wrap svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--faint); pointer-events: none; }
.search-wrap .input { padding-left: 32px; }

.form-row { display: flex; gap: 12px; }
.form-row > * { flex: 1; min-width: 0; }

.switch { position: relative; display: inline-block; width: 34px; height: 19px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track { position: absolute; inset: 0; background: #cbd3de; border-radius: 999px; transition: background .18s; }
.switch .track::before {
  content: '';
  position: absolute; left: 2px; top: 2px;
  width: 15px; height: 15px;
  background: #fff; border-radius: 50%;
  box-shadow: 0 1px 2px rgba(16,24,40,.25);
  transition: transform .18s;
}
.switch input:checked + .track { background: var(--primary); }
.switch input:checked + .track::before { transform: translateX(15px); }

.check-line { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; user-select: none; }
.check-line input { width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; }

#shell { display: flex; min-height: 100vh; }

#sidebar {
  width: 232px;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  z-index: 60;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 18px 14px;
}
.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
}
.brand-name { color: #fff; font-size: 14.5px; font-weight: 700; line-height: 1.2; }
.brand-sub { font-size: 11px; color: #667085; letter-spacing: .02em; }

.nav-section { padding: 10px 12px 4px; }
.nav-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #5d6b81;
  padding: 6px 10px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--sidebar-text);
  font-size: 13.5px;
  font-weight: 500;
  text-align: left;
  transition: background .15s, color .15s;
  margin-bottom: 1px;
}
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; opacity: .85; }
.nav-item:hover { background: var(--sidebar-hover); color: #e4e9f1; text-decoration: none; }
.nav-item.active { background: var(--primary); color: #fff; }
.nav-item.active svg { opacity: 1; }
.nav-empty {
  font-size: 12px;
  color: #5d6b81;
  padding: 4px 10px 8px;
}

.sidebar-foot {
  margin-top: auto;
  padding: 12px;
  border-top: 1px solid rgba(255,255,255,.07);
}
.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px;
  border: none;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  transition: background .15s;
}
.user-chip:hover { background: var(--sidebar-hover); }
.avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #353e52, #20293800), var(--sidebar-hover);
  border: 1px solid rgba(255,255,255,.12);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12.5px;
  color: #fff;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
}
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.user-chip .u-info { min-width: 0; flex: 1; }
.user-chip .u-name { color: #fff; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip .u-role { font-size: 11px; color: #7c8899; }

.main-wrap { flex: 1; margin-left: 232px; display: flex; flex-direction: column; min-width: 0; }

#topbar {
  height: 58px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 22px;
  position: sticky;
  top: 0;
  z-index: 40;
}
.tb-title { font-size: 15.5px; font-weight: 700; }
.tb-crumb { font-size: 12.5px; color: var(--faint); margin-top: -1px; }
.tb-spacer { flex: 1; }
.conn-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 11px;
}
.conn-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.conn-pill.off .conn-dot { background: var(--red); }
.menu-btn { display: none; }

#page { padding: 24px 26px 60px; max-width: 1240px; width: 100%; margin: 0 auto; }

#scrim {
  display: none;
  position: fixed; inset: 0;
  background: rgba(16,24,40,.45);
  z-index: 55;
}

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
.page-head .sub { color: var(--muted); font-size: 13px; margin-top: 3px; }
.page-actions { display: flex; gap: 9px; align-items: center; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 16px; }
.card-pad { padding: 18px 20px; }
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}
.card-head h2 { font-size: 13.5px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card-head h2 svg { width: 15px; height: 15px; color: var(--muted); }
.card-body { padding: 16px 20px; }
.card-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 20px; }
.tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.tile .t-label { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); }
.tile .t-value { font-size: 23px; font-weight: 700; letter-spacing: -.02em; margin-top: 2px; }
.tile .t-value small { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.tile .t-foot { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.tile.tone-red .t-value { color: var(--red); }
.tile.tone-green .t-value { color: var(--green); }
.tile.tone-blue .t-value { color: var(--blue); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 2.5px 10px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-green { background: var(--green-soft); color: #027a48; }
.badge-amber { background: var(--amber-soft); color: #b54708; }
.badge-red { background: var(--red-soft); color: #b42318; }
.badge-blue { background: var(--blue-soft); color: #175cd3; }
.badge-gray { background: #f2f4f7; color: var(--muted); }
.badge-primary { background: var(--primary-soft); color: var(--primary); }

.tag-cat {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  padding: 2px 8px;
  background: #f2f4f7;
  color: var(--muted);
}

.cash-val {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--amber);
  white-space: nowrap;
}
.cash-val svg { width: 13px; height: 13px; flex: none; }
.cash-val b { font-weight: 700; color: inherit; }

.inv-add { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border); }
.sec-subtitle {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--faint);
  margin-bottom: 7px;
}
.inv-add-row { display: flex; gap: 8px; flex-wrap: wrap; }
.ni-hint {
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
  margin-top: 6px;
}

.ac-wrap { position: relative; min-width: 0; }
.ac-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  max-height: 264px;
  overflow-y: auto;
  z-index: 70;
  padding: 4px;
}
.ac-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 0;
  background: none;
  text-align: left;
  padding: 7px 9px;
  border-radius: 6px;
}
.ac-item:hover, .ac-item.active { background: var(--surface-2); }
.ac-item.active { outline: 1.5px solid var(--primary-soft); }
.ac-item.out { opacity: .5; }
.ac-item[disabled] { cursor: not-allowed; }
.ac-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ac-meta { display: inline-flex; align-items: center; gap: 7px; flex: none; font-size: 11.5px; }
.ac-empty { padding: 10px; font-size: 12.5px; color: var(--muted); }

.equip-grid { display: flex; flex-direction: column; gap: 10px; }
.equip-slot { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; }
.equip-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin-bottom: 6px; }
.equip-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.equip-item-name { font-weight: 600; font-size: 14px; color: var(--text); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.equip-empty { color: var(--muted); font-size: 13px; font-style: italic; padding: 4px 0; }
.equip-select { width: 100%; margin-top: 6px; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--muted);
  border-radius: 999px;
  padding: 4.5px 13px;
  font-size: 12.5px;
  font-weight: 600;
  transition: all .15s;
}
.chip:hover { border-color: var(--faint); color: var(--text); }
.chip.active { background: var(--sidebar-bg); border-color: var(--sidebar-bg); color: #fff; }

.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--faint);
  background: var(--surface-2);
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.tbl td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl .cell-strong { font-weight: 600; }
.tbl .cell-muted { color: var(--muted); font-size: 12.5px; }
.tbl .cell-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl .row-actions { display: flex; gap: 2px; justify-content: flex-end; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.tab {
  border: none;
  background: transparent;
  padding: 9px 15px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .15s, border-color .15s;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-color: var(--primary); }

.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(16,24,40,.55);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 7vh 18px 18px;
  z-index: 100;
  overflow-y: auto;
}
.modal {
  background: var(--surface);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 480px;
  animation: modalIn .16s ease-out;
}
.modal.wide { max-width: 640px; }
@keyframes modalIn { from { opacity: 0; transform: translateY(8px) scale(.985); } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 15px 20px; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-size: 14.5px; font-weight: 700; }
.modal-body { padding: 18px 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 9px; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 12px 12px; }

#toast-root { position: fixed; bottom: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--sidebar-bg);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  border-radius: 9px;
  padding: 11px 16px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 9px;
  animation: toastIn .2s ease-out;
  max-width: 340px;
}
.toast svg { width: 15px; height: 15px; flex-shrink: 0; }
.toast.ok svg { color: var(--green); }
.toast.err svg { color: #fda29b; }
@keyframes toastIn { from { opacity: 0; transform: translateX(12px); } }

.bar { height: 7px; background: #eef1f5; border-radius: 99px; overflow: hidden; }
.bar > div { height: 100%; background: var(--primary); border-radius: 99px; transition: width .3s ease-out; min-width: 0; }
.bar > div.warn { background: var(--amber); }
.bar > div.full { background: var(--red); }

.avatar-light {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
.avatar-light img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.avatar-light.lg { width: 56px; height: 56px; font-size: 17px; border-radius: 14px; }

.empty {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 34px 20px;
}
.empty svg { width: 30px; height: 30px; margin: 0 auto 10px; color: var(--faint); }

.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }

.char-card { cursor: pointer; transition: box-shadow .15s, border-color .15s, transform .1s; padding: 16px; }
.char-card:hover { box-shadow: var(--shadow-lg); border-color: var(--border-strong); }
.cc-top { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.cc-info { min-width: 0; flex: 1; }
.cc-name { font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-meta { display: flex; justify-content: space-between; margin-top: 9px; font-size: 11.5px; color: var(--faint); }

.rpg-card .cc-icon {
  width: 42px; height: 42px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 17px;
}

.usage-row {
  display: grid;
  grid-template-columns: 34px 130px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 7px 0;
}
.usage-row .u-name { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.usage-row .u-nums { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.usage-total { border-top: 1px dashed var(--border); margin-top: 5px; padding-top: 11px; }

.mv-item { display: flex; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); align-items: baseline; }
.mv-item:last-child { border-bottom: none; }
.mv-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; }
.mv-main { flex: 1; min-width: 0; }
.mv-title { font-size: 13px; }
.mv-sub { font-size: 11.5px; color: var(--faint); }

.sheet {
  background: var(--sheet-bg, var(--bg));
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.sheet-col { background: transparent; }
.sheet-head {
  padding: 26px 28px 22px;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(620px 220px at 6% -40%, var(--primary-soft), transparent),
    linear-gradient(160deg, color-mix(in srgb, var(--primary-2) 7%, var(--surface)), var(--surface) 55%);
  position: relative;
  overflow: hidden;
}
.sheet-head::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(127, 127, 127, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(127, 127, 127, .05) 1px, transparent 1px);
  background-size: 26px 26px;
  pointer-events: none;
}
.sheet-head::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
  opacity: .9;
}
.sheet-head > * { position: relative; z-index: 1; }
.sh-row { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; position: relative; }
.sh-photo-btn { position: relative; border: none; background: none; padding: 0; flex: none; }
.sh-photo-edit {
  position: absolute; inset: 0;
  border-radius: inherit;
  display: none;
}
.sh-photo-btn:hover .sh-photo-edit { display: flex; align-items: center; justify-content: center; background: rgba(16,24,40,.55); color: #fff; border-radius: 16px; }
.sh-title-wrap { flex: 1; min-width: 220px; }
.sh-name {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -.015em;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 2px 8px;
  margin-left: -8px;
  transition: border-color .15s, background .15s;
}
.sh-name:hover { border-color: var(--border); }
.sh-name:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); background: var(--surface); }
.sh-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 9px; }
.sh-meta .input { width: auto; font-size: 12.5px; padding: 5px 11px; }
.sh-stats {
  display: flex;
  gap: 0;
  margin-top: 16px;
  flex-wrap: wrap;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 11px;
  overflow: hidden;
  max-width: fit-content;
}
.sh-stat { padding: 9px 16px; border-right: 1px solid var(--border); }
.sh-stat:last-child { border-right: none; }
.sh-stat .k { font-size: 10px; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); font-weight: 700; display: flex; align-items: center; gap: 5px; }
.sh-stat .v { font-size: 15px; font-weight: 700; color: var(--text); margin-top: 2px; display: block; }

.sheet-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.sheet-col { padding: 24px 28px; min-width: 0; }
.sheet-col + .sheet-col { border-left: 1px solid var(--border); }

.sec {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px 20px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}
.sec:last-child { margin-bottom: 4px; }
.sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 13px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.sec-head::before {
  content: '';
  position: absolute;
  left: -20px; top: -18px; bottom: -1px;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: linear-gradient(180deg, var(--primary), var(--primary-2));
}
.sec-head h3 { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; display: flex; gap: 7px; align-items: center; color: var(--text); }
.sec-head h3 svg { width: 15px; height: 15px; color: var(--primary); }

.attr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.attr-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 11px 12px 10px;
  position: relative;
  overflow: hidden;
}
.attr-box::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary-soft), transparent);
}
.attr-box .a-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.attr-box .a-input {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  font-size: 22px;
  font-weight: 800;
  text-align: left;
  padding: 2px 0 0;
  border-radius: 6px;
  -moz-appearance: textfield;
  color: var(--text);
}
.attr-box .a-input::-webkit-outer-spin-button, .attr-box .a-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.attr-box .a-input:hover { border-color: var(--border-strong); background: var(--surface); }
.attr-box .a-input:focus { outline: none; border-color: var(--primary); background: var(--surface); box-shadow: 0 0 0 3px var(--primary-soft); }

.a-stepper { display: flex; align-items: center; gap: 5px; margin-top: 4px; }
.a-stepper .icon-btn {
  width: 26px; height: 26px; padding: 0;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  border-radius: 7px;
  font-size: 15px; line-height: 1; font-weight: 800;
  color: var(--text);
  flex: none;
}
.a-stepper .icon-btn:hover { border-color: var(--primary); color: var(--primary); }
.a-stepper .a-input { width: 46px; text-align: center; flex: none; }
.a-stepper .a-input::-webkit-outer-spin-button, .a-stepper .a-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.a-moeda { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.a-moeda .a-coini {
  font-style: normal;
  color: var(--text); 
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  height: 24px;
  opacity: .9;
}
.a-moeda .a-input { width: 84px; font-size: 18px; text-align: left; }
.a-moeda .a-input::-webkit-outer-spin-button, .a-moeda .a-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.attr-rows { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.attr-line {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 10px 12px;
  position: relative;
  overflow: hidden;
}
.attr-line::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary-soft), transparent);
}
.attr-line .a-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.attr-line .a-long, .attr-line .a-vinculo, .attr-line .a-longview { width: 100%; }
.a-long {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  color: var(--text);
  resize: vertical;
  font-family: inherit;
  min-height: 56px;
}
.a-long:focus, .a-vinculo:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.a-longview { font-size: 13px; color: var(--text); white-space: pre-wrap; }
.a-vinculo {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 13px;
  color: var(--text);
}
.attr-line .a-longview:not(:empty)::before { content: ''; }

.skill-group-label { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); margin: 12px 0 3px; display: flex; align-items: center; gap: 7px; }
.skill-group-label:first-child { margin-top: 0; }
.skill-group-label::before {
  content: '';
  width: 8px; height: 8px;
  border-radius: 3px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
}
.skill-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px;
  border-radius: 8px;
  border-bottom: 1px dashed var(--border);
}
.skill-row:last-child { border-bottom: none; }
.skill-row:hover { background: var(--surface-2); }
.skill-row .s-name { font-size: 13px; font-weight: 500; flex: 1; min-width: 0; }
.skill-row .s-val {
  width: 46px;
  text-align: center;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font-weight: 800;
  font-size: 13px;
  padding: 4px 2px;
  -moz-appearance: textfield;
  background: var(--surface);
}
.skill-row .s-val::-webkit-outer-spin-button, .skill-row .s-val::-webkit-inner-spin-button { -webkit-appearance: none; }
.skill-row .s-val:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.pips { display: flex; gap: 4px; }
.pip { width: 10px; height: 10px; border-radius: 3px; background: var(--border-strong); cursor: pointer; transition: background .12s, transform .12s; }
.pip:hover { transform: scale(1.25); }
.pip.on { background: linear-gradient(135deg, var(--primary), var(--primary-2)); box-shadow: 0 1px 3px var(--primary-soft); }

.inv-table td { padding: 7px 8px !important; }
.inv-qty { display: inline-flex; align-items: center; gap: 4px; }
.inv-qty input { width: 46px; text-align: center; border: 1px solid var(--border-strong); border-radius: 6px; padding: 4px 2px; font-weight: 600; -moz-appearance: textfield; }
.inv-qty input::-webkit-outer-spin-button, .inv-qty input::-webkit-inner-spin-button { -webkit-appearance: none; }
.slot-line { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; font-size: 12.5px; color: var(--muted); }
.slot-line b { color: var(--text); }

.spell-item { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin-bottom: 9px; background: var(--surface-2); }
.spell-head { display: flex; gap: 9px; align-items: center; margin-bottom: 7px; }
.spell-head input:first-child { flex: 1; border: none; background: transparent; font-weight: 600; font-size: 13.5px; outline: none; border-bottom: 1px dashed transparent; }
.spell-head input:first-child:hover { border-color: var(--border-strong); }
.spell-cost { width: 74px; text-align: center; border: 1px solid var(--border-strong); border-radius: 7px; padding: 5px 6px; font-size: 12.5px; background: var(--surface); }
.note-area { width: 100%; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); resize: vertical; min-height: 90px; padding: 10px 12px; font-size: 13.5px; line-height: 1.65; outline: none; }
.note-area:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }

.login-bg {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background:
    radial-gradient(900px 480px at 85% -10%, var(--primary-soft), transparent),
    radial-gradient(700px 420px at -10% 110%, var(--primary-soft), transparent),
    var(--sidebar-bg);
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  padding: 30px 30px 26px;
}
.login-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 22px; }
.login-brand .brand-mark { width: 40px; height: 40px; border-radius: 10px; font-size: 18px; }
.login-brand h1 { font-size: 17px; font-weight: 700; }
.login-brand p { font-size: 12px; color: var(--muted); }
.login-error {
  background: var(--red-soft);
  color: #b42318;
  font-size: 12.5px;
  font-weight: 500;
  border-radius: 8px;
  padding: 9px 12px;
  margin-bottom: 14px;
}

@media (max-width: 1024px) {
  .sheet-grid { grid-template-columns: 1fr; }
  .sheet-col + .sheet-col { border-left: none; border-top: 1px solid var(--border); }
}

@media (max-width: 860px) {
  #sidebar { transform: translateX(-100%); transition: transform .2s ease-out; }
  body.nav-open #sidebar { transform: translateX(0); }
  body.nav-open #scrim { display: block; }
  .main-wrap { margin-left: 0; }
  .menu-btn { display: inline-flex; }
  #page { padding: 18px 14px 60px; }
  .usage-row { grid-template-columns: 34px 90px 1fr auto; }
  .form-row { flex-direction: column; gap: 0; }
}

@media (max-width: 560px) {
  .page-head { flex-direction: column; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .search-wrap { max-width: none; }
  .tb-crumb { display: none; }
}

/* ---- dropdown de categorias (estoque) ---- */
.cat-dd { position: relative; }
.cat-dd > .btn { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; font-size: 13px; }
.cat-dd > .btn svg { width: 15px; height: 15px; color: var(--muted); }
.cat-dd-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 240px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(16, 24, 40, 0.16);
  padding: 6px;
  z-index: 60;
  animation: catdd-in 0.12s ease-out;
}
@keyframes catdd-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.cat-dd-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  border: 0;
  background: none;
  text-align: left;
  padding: 9px 11px;
  font: inherit;
  font-size: 13px;
  color: var(--text);
  border-radius: 8px;
  cursor: pointer;
}
.cat-dd-item:hover { background: var(--surface-2); }
.cat-dd-item.active { color: var(--primary); font-weight: 600; background: var(--primary-soft); }
.cat-dd-name { display: inline-flex; align-items: center; gap: 8px; }
.cat-dd-name svg { width: 14px; height: 14px; }
.cat-dd-count {
  font-size: 11.5px;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 8px;
  min-width: 26px;
  text-align: center;
}

/* ---- subpontos de atributo e pool de perícia ---- */
.a-sub-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  padding: 2px 8px 2px 5px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .03em;
  max-width: 100%;
}
.a-sub-chip:hover { border-color: var(--border-strong); }
.a-sub-chip .a-sub-ic {
  display: grid;
  place-items: center;
  width: 15px; height: 15px;
  flex: none;
  color: var(--primary);
}
.a-sub-chip .a-sub-ic svg { width: 12px; height: 12px; }
.a-sub-chip .a-sub {
  width: 32px;
  min-width: 0;
  padding: 0 0 0 2px;
  border: 1px solid transparent;
  background: transparent;
  font-size: 11px;
  font-weight: 800;
  color: var(--text);
  -moz-appearance: textfield;
  text-align: left;
}
.a-sub-chip .a-sub::-webkit-outer-spin-button, .a-sub-chip .a-sub::-webkit-inner-spin-button { -webkit-appearance: none; }
.a-sub-chip .a-sub:focus { outline: none; border-color: var(--primary); background: var(--surface); border-radius: 6px; }
.a-sub-chip .a-sub-view { color: var(--text); font-weight: 800; font-size: 11.5px; line-height: 1; }
.a-sub-chip .a-sub-unit { color: var(--faint); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
.pool-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 0.5px 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 999px;
  vertical-align: 1px;
}

/* ============================ THEME CONTROL ============================ */
.theme-wrap { position: relative; }
.theme-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 600;
  transition: border-color .15s, color .15s, background .15s;
}
.theme-btn svg { width: 15px; height: 15px; }
.theme-btn:hover { border-color: var(--border-strong); color: var(--text); }
.theme-btn .tb-swatch {
  width: 13px; height: 13px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--primary);
  box-shadow: 0 0 0 2px var(--surface-2), 0 0 0 3px var(--border-strong);
}
.theme-dd {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 268px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 8px;
  z-index: 80;
  animation: catdd-in 0.12s ease-out;
}
.theme-dd-section { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); padding: 8px 8px 5px; }
.theme-dd-section:first-child { padding-top: 2px; }
.theme-dd-row { display: flex; gap: 6px; padding: 2px 4px 6px; }
.theme-mode-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
  border-radius: 9px;
  padding: 8px;
  font-size: 12.5px;
  font-weight: 600;
}
.theme-mode-btn svg { width: 15px; height: 15px; }
.theme-mode-btn:hover { color: var(--text); border-color: var(--border-strong); }
.theme-mode-btn.active { background: var(--primary-soft); color: var(--primary); border-color: var(--primary); }
.theme-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 5px; padding: 0 4px 2px; }
.theme-opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 8px;
  padding: 7px 9px;
  font-size: 12px;
  font-weight: 600;
  text-align: left;
}
.theme-opt:hover { border-color: var(--border-strong); }
.theme-opt.active, .theme-opt.picked { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.theme-opt .to-swatch {
  width: 15px; height: 15px;
  border-radius: 6px;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent, var(--primary)), var(--accent2, var(--accent, var(--primary-2))));
  box-shadow: 0 0 0 1px var(--border);
}

/* ============================ SHEET POLISH ============================ */
.sheet { position: relative; }
.sheet-head { position: relative; }
.sheet-head::after { opacity: .9; }
.sheet-head .sh-title-wrap { position: relative; z-index: 1; }
.sh-photo-btn .avatar-light.lg {
  box-shadow: 0 8px 22px -6px var(--primary-soft), 0 0 0 1px var(--border);
}
.sh-stat .v { color: var(--text); }
.sh-stat .k { color: var(--faint); }

.equip-slot {
  background: var(--surface-2);
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 12px 14px;
  transition: border-color .15s, box-shadow .15s;
}
.equip-slot:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.equip-slot .equip-label { color: var(--faint); }

.spell-item {
  border-left: 3px solid var(--primary-soft);
}
.spell-item:hover { border-left-color: var(--primary); }

.inv-table td { padding: 9px 10px !important; }

@media (max-width: 960px) {
  .sheet-grid { grid-template-columns: 1fr; }
  .sheet-col + .sheet-col { border-left: none; border-top: 1px solid var(--border); }
}
@media (max-width: 860px) {
  .theme-btn .theme-btn-label { display: none; }
}

.sheet.hide-atributos .sec-atributos,
.sheet.hide-pericias .sec-pericias,
.sheet.hide-camposlivres .sec-camposlivres,
.sheet.hide-inventario .sec-inventario,
.sheet.hide-equipamento .sec-equipamento,
.sheet.hide-magias .sec-magias,
.sheet.hide-runas .sec-runas,
.sheet.hide-anotacoes .sec-anotacoes,
.sheet.hide-historico .sec-historico { display: none; }

.sec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.sec-toggle {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border: 1px solid var(--border);
  border-radius: 12px; background: var(--bg); cursor: pointer;
  transition: border-color .15s, transform .1s, box-shadow .15s;
}
.sec-toggle:hover { border-color: var(--border-strong); box-shadow: var(--shadow); transform: translateY(-1px); }
.sec-toggle-icon {
  width: 34px; height: 34px; display: grid; place-items: center; flex: none;
  border-radius: 9px; background: var(--primary-soft); color: var(--primary);
  font-size: 15px;
}
.sec-toggle-name { color: var(--text); flex: 1; font-weight: 600; font-size: 14px; }

.sections-list { display: flex; flex-direction: column; gap: 8px; padding: 16px 20px 4px; }
.sect-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 12px; background: var(--bg);
  transition: border-color .15s, background .15s, opacity .15s;
}
.sect-row:hover { border-color: var(--border-strong); }
.sect-off { opacity: .6; }
.sect-off .sect-label { text-decoration: line-through; }
.sect-moves { display: flex; gap: 3px; flex: none; }
.sect-ico {
  width: 32px; height: 32px; flex: none; display: grid; place-items: center;
  border-radius: 9px; background: var(--primary-soft); color: var(--primary); font-size: 15px;
}
.sect-off .sect-ico { background: var(--surface-2); color: var(--muted); }
.sect-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sect-label { width: 100%; min-width: 0; }
.sect-state { font-size: 10.5px; font-weight: 700; letter-spacing: .03em; }
.sect-state.on { color: var(--green); }
.sect-state.off { color: var(--red); }
.sect-col { flex: none; width: 112px; }
.sect-acts { display: flex; gap: 4px; flex: none; }
.sect-check { display: inline-flex; align-items: center; gap: 8px; flex: none; cursor: pointer; user-select: none; white-space: nowrap; }
.sect-check input { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; flex: none; }
.sect-check-txt { font-size: 12px; font-weight: 600; color: var(--muted); }
.sect-check:hover .sect-check-txt { color: var(--text); }

.sections-hint {
  display: flex; align-items: center; gap: 8px;
  margin: 8px 20px 16px; padding: 9px 12px; border-radius: 10px;
  background: var(--primary-soft); color: var(--muted); font-size: 12px;
}
.sections-hint svg { width: 14px; height: 14px; color: var(--primary); flex: none; }

.cs-label { font-weight: 600; font-size: 13px; color: var(--muted); margin: 14px 0 8px; }
.cs-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border: 1px solid var(--border);
  border-radius: 10px; background: var(--bg); margin-bottom: 8px;
}
.cs-fname { flex: 1; min-width: 160px; }
.cs-fed-wrap { flex: none; font-size: 12px; color: var(--muted); white-space: nowrap; margin: 0; }
