/* Pillow — compact glass interface on a muted blue backdrop. */
:root {
  --ink: #1c2430;
  --ink-2: #3a4453;
  --muted: #6f7988;
  --muted-2: #99a1ad;
  --accent: #0a84ff;
  --accent-ink: #0063c7;
  --danger: #ff3b30;
  --green: #30b15a;
  --line: rgba(20, 30, 48, 0.09);
  --line-strong: rgba(20, 30, 48, 0.16);
  --glass: rgba(255, 255, 255, 0.78);
  --glass-2: rgba(255, 255, 255, 0.9);
  --glass-3: rgba(255, 255, 255, 0.97);
  --shadow: 0 18px 44px rgba(17, 32, 56, 0.22), 0 2px 8px rgba(17, 32, 56, 0.08);
  --shadow-sm: 0 6px 18px rgba(17, 32, 56, 0.14);
  --radius: 15px;
  --radius-sm: 8px;
  --blur: blur(30px) saturate(165%);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, Roboto, sans-serif;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  height: 100%;
}

body {
  margin: 0;
  font: 12.5px/1.35 var(--font);
  color: var(--ink);
  background:
    radial-gradient(1100px 720px at 14% -14%, rgba(168, 203, 242, 0.62), transparent 62%),
    radial-gradient(900px 640px at 108% 112%, rgba(36, 62, 96, 0.42), transparent 58%),
    linear-gradient(158deg, #7d9cc1 0%, #5f7ea6 46%, #4a668a 100%);
  background-attachment: fixed;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

a {
  color: var(--accent-ink);
  text-decoration: none;
}

::selection {
  background: rgba(10, 132, 255, 0.22);
}

*::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}
*::-webkit-scrollbar-thumb {
  background: rgba(30, 45, 70, 0.22);
  border-radius: 9px;
  border: 2px solid transparent;
  background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover {
  background-color: rgba(30, 45, 70, 0.34);
}
*::-webkit-scrollbar-corner {
  background: transparent;
}

.i {
  display: block;
  flex: none;
}

/* ------------------------------------------------------------------ layout */
.app {
  height: 100%;
  display: flex;
  gap: 9px;
  padding: 9px;
}

.glass {
  background: var(--glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.sidebar {
  width: 196px;
  flex: none;
  display: flex;
  flex-direction: column;
  padding: 12px 9px 10px;
  min-height: 0;
}

.content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--glass-2);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 6px 14px;
}

.brand-tag {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 8px;
  background: rgba(10, 132, 255, 0.09);
  border: 1px solid rgba(10, 132, 255, 0.14);
  color: #0a6fd8;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

/* -------------------------------------------------------------------- tree */
.tree {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 2px;
}

.tree-section {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.tree-head {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 0 6px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 6px;
}
.tree-head:hover {
  color: var(--ink-2);
}
.tree-head .chev {
  display: grid;
  place-items: center;
  transition: transform 0.12s ease;
}
.tree-head.open .chev {
  transform: rotate(90deg);
}

.tree-items {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding-left: 22px;
}
.tree-items::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 0;
  bottom: 12px;
  width: 1px;
  background: rgba(20, 30, 48, 0.14);
}

.tree-item {
  position: relative;
  display: flex;
  align-items: center;
  height: 25px;
  padding: 0 8px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-2);
  font-size: 12.5px;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  overflow: visible;
}
.tree-item-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tree-item::before {
  content: "";
  position: absolute;
  left: -11px;
  top: 50%;
  width: 11px;
  height: 1px;
  background: rgba(20, 30, 48, 0.14);
}
.tree-item:hover {
  background: rgba(255, 255, 255, 0.55);
}
.tree-item.active {
  background: rgba(10, 132, 255, 0.14);
  color: var(--accent-ink);
  font-weight: 600;
}

.sidebar-foot {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 2px 0;
  margin-top: 6px;
  border-top: 1px solid var(--line);
}

.user-chip {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  height: 28px;
  padding: 0 6px;
  border: none;
  border-radius: 7px;
  background: transparent;
  cursor: pointer;
  text-align: left;
}
.user-chip:hover {
  background: rgba(255, 255, 255, 0.55);
}
.user-name {
  font-size: 12px;
  font-weight: 550;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 8.5px;
  font-weight: 650;
  flex: none;
}
.avatar.tiny {
  width: 17px;
  height: 17px;
  font-size: 7.5px;
}

.bell {
  position: relative;
}
.bell.has-unread::after {
  content: "";
  position: absolute;
  top: 5px;
  right: 5px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.9);
}

/* -------------------------------------------------------------------- tabs */
.tabs {
  height: 38px;
  flex: none;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 0 8px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 25px;
  padding: 0 6px 0 9px;
  border-radius: 7px;
  color: var(--ink-2);
  cursor: default;
  flex: none;
  max-width: 170px;
  border: 1px solid transparent;
}
.tab:hover {
  background: rgba(255, 255, 255, 0.5);
}
.tab.active {
  background: var(--glass-3);
  border-color: rgba(255, 255, 255, 0.75);
  box-shadow: 0 1px 4px rgba(17, 32, 56, 0.12);
  color: var(--ink);
  font-weight: 600;
}
.tab-title {
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tab-close {
  width: 15px;
  height: 15px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--muted-2);
  cursor: pointer;
  padding: 0;
  opacity: 0.42;
}
.tab:hover .tab-close,
.tab.active .tab-close {
  opacity: 1;
}
.tab-close:hover {
  background: rgba(20, 30, 48, 0.1);
  color: var(--ink);
}

.tab-add {
  width: 24px;
  height: 24px;
  flex: none;
}

.grow {
  flex: 1;
}

/* ------------------------------------------------------------------- icons */
.icon-btn {
  width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  flex: none;
}
.icon-btn:hover {
  background: rgba(20, 30, 48, 0.07);
  color: var(--ink);
}
.icon-btn.big {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.65);
  color: var(--ink-2);
}
.icon-btn.big:hover {
  background: rgba(255, 255, 255, 0.9);
}

/* ------------------------------------------------------------------- views */
.view {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}

.blank {
  flex: 1;
  display: grid;
  place-items: center;
}

/* -------------------------------------------------------------------- grid */
.grid {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.grid-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  outline: none;
  position: relative;
}

.grid-inner {
  position: relative;
  min-width: 0;
}

.grid-head {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  height: 30px;
  background: rgba(250, 251, 253, 0.9);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

.th {
  position: relative;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 0 7px;
  flex: none;
  height: 30px;
  border-right: 1px solid var(--line);
  font-size: 11px;
  font-weight: 650;
  color: var(--muted);
  user-select: none;
  white-space: nowrap;
  overflow: visible;
}
.th-title {
  cursor: pointer;
  overflow: hidden;
  text-overflow: clip;
}
.th-title:hover {
  color: var(--ink-2);
}
.th-sort {
  color: var(--accent);
  display: grid;
  place-items: center;
}
.th-lock {
  color: var(--muted-2);
  display: grid;
  place-items: center;
}
.th-more {
  margin-left: auto;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--muted-2);
  cursor: pointer;
  opacity: 0.45;
  padding: 0;
  flex: none;
}
.th:hover .th-more {
  opacity: 1;
}
.th-more:hover {
  background: rgba(20, 30, 48, 0.09);
  color: var(--ink);
}

.th-add {
  width: 28px;
  min-width: 28px;
  justify-content: center;
  padding: 0;
  border-right: none;
}
.th-add-btn {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: var(--muted-2);
  cursor: pointer;
  padding: 0;
}
.th-add-btn:hover {
  background: rgba(20, 30, 48, 0.08);
  color: var(--ink);
}

.th-spacer {
  flex: 1;
  min-width: 0;
  border-right: 1px solid var(--line);
}
.td.td-spacer {
  flex: 1;
  min-width: 0;
  border-right: none;
}

.th-actions,
.td-actions {
  position: static;
  width: 100px;
  min-width: 100px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  padding: 0 7px;
  background: transparent;
  z-index: 4;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
}
.th-actions {
  z-index: 7;
  justify-content: center;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.resize {
  position: absolute;
  top: 0;
  right: -4px;
  bottom: 0;
  width: 9px;
  cursor: col-resize;
  z-index: 6;
}
.resize:hover,
.resize.dragging {
  background: rgba(10, 132, 255, 0.32);
}

.grid-canvas {
  position: relative;
  min-width: 100%;
}

.row {
  position: absolute;
  left: 0;
  right: 0;
  height: 32px;
  display: flex;
  border-bottom: 1px solid var(--line);
  background: rgba(252, 253, 255, 0.94);
}
.row:hover {
  background: rgba(255, 255, 255, 0.5);
}
.row.locked {
  background: rgba(255, 214, 120, 0.06);
}

.td {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0 7px;
  height: 32px;
  border-right: 1px solid var(--line);
  flex: none;
  min-width: 0;
  overflow: hidden;
  font-size: 12px;
  color: var(--ink-2);
  cursor: default;
}
.td.locked {
  color: var(--muted);
}
.grid-canvas {
  user-select: none;
}
.td.selected {
  background: rgba(10, 132, 255, 0.10);
}
.td.focused {
  box-shadow: inset 0 0 0 2px var(--accent);
  background: rgba(255, 255, 255, 0.85);
  z-index: 3;
}
.td.editing {
  padding: 0 2px;
  z-index: 6;
  box-shadow: inset 0 0 0 2px var(--accent);
  background: #fff;
  overflow: visible;
}
.td.editing input {
  width: 100%;
  height: 26px;
  border: none;
  outline: none;
  background: transparent;
  font-size: 12px;
  padding: 0 5px;
  user-select: text;
}

.td-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 1px solid var(--line);
  overflow: visible;
}
.row-more {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--muted-2);
  cursor: pointer;
  opacity: 0.35;
  padding: 0;
}
.row:hover .row-more {
  opacity: 1;
}
.row-more:hover {
  background: rgba(20, 30, 48, 0.09);
  color: var(--ink);
}
.row-lock {
  position: absolute;
  left: 3px;
  color: var(--muted-2);
  display: grid;
  place-items: center;
  pointer-events: none;
}

.row-add {
  border-bottom: none;
}
.add-row-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--muted-2);
  cursor: pointer;
  opacity: 0.7;
}
.add-row-btn:hover {
  opacity: 1;
  color: var(--ink-2);
  background: rgba(255, 255, 255, 0.4);
}

.text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.text.strong {
  color: var(--ink);
  font-weight: 550;
}
.ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.num {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.computed {
  color: var(--muted);
  font-style: italic;
}
.date {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.link {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ref {
  display: inline-block;
  max-width: 100%;
  padding: 1px 6px;
  border-radius: 5px;
  background: rgba(10, 132, 255, 0.08);
  color: var(--accent-ink);
  font-size: 11.5px;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ref:hover {
  background: rgba(10, 132, 255, 0.14);
}
.person {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}
.check {
  color: var(--green);
  display: grid;
  place-items: center;
}
.pills {
  display: flex;
  gap: 3px;
  overflow: hidden;
  max-width: 100%;
}
.pill {
  display: inline-block;
  max-width: 100%;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 550;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: color-mix(in srgb, var(--c, var(--muted)) 14%, transparent);
  color: color-mix(in srgb, var(--c, var(--muted)) 72%, #1c2430);
}
.rename {
  width: 100%;
  height: 22px;
  border: 1px solid var(--accent);
  border-radius: 4px;
  background: #fff;
  font-size: 11px;
  font-weight: 550;
  padding: 0 4px;
  outline: none;
}

/* -------------------------------------------------------------- personnel */
.view-head {
  height: 38px;
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px;
  border-bottom: 1px solid var(--line);
}
.view-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.segmented {
  display: flex;
  gap: 2px;
  padding: 2px;
  border-radius: 7px;
  background: rgba(20, 30, 48, 0.06);
}
.seg {
  height: 23px;
  padding: 0 10px;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 550;
  cursor: pointer;
}
.seg.active {
  background: var(--glass-3);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(17, 32, 56, 0.12);
}

.table {
  width: auto;
  max-width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  table-layout: auto;
}
.table th {
  position: sticky;
  top: 0;
  z-index: 2;
  height: 28px;
  padding: 0 10px;
  text-align: left;
  font-size: 11px;
  font-weight: 650;
  color: var(--muted);
  background: rgba(250, 251, 253, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.table td {
  height: 32px;
  padding: 0 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.table tr:hover td {
  background: rgba(255, 255, 255, 0.42);
}
.table tr.clickable {
  cursor: pointer;
}
.table .center {
  text-align: center;
  width: auto;
  white-space: nowrap;
}
.table .right {
  text-align: right;
  width: auto;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.table .thin {
  width: 30px;
  padding: 0 4px;
}
.table .muted {
  color: var(--muted);
}
.amount.negative {
  color: var(--danger);
}

.select {
  height: 26px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.72);
  padding: 0 22px 0 7px;
  outline: none;
  font-size: 11.5px;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 11px) 11px, calc(100% - 7px) 11px;
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
  cursor: pointer;
}
.select.mini {
  height: 23px;
  font-size: 11.5px;
  padding: 0 19px 0 6px;
  background-position: calc(100% - 10px) 9px, calc(100% - 6px) 9px;
}
.select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.16);
}

.switch {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}
.switch input {
  appearance: none;
  width: 28px;
  height: 17px;
  border-radius: 999px;
  background: rgba(20, 30, 48, 0.2);
  position: relative;
  cursor: pointer;
  margin: 0;
  transition: background 0.15s ease;
}
.switch input::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s ease;
}
.switch input:checked {
  background: var(--green);
}
.switch input:checked::after {
  transform: translateX(11px);
}

.balance-head {
  display: flex;
  justify-content: flex-end;
  padding: 0 0 10px;
}
.balance-value {
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.history {
  max-height: 220px;
  overflow-y: auto;
  border-top: 1px solid var(--line);
}
.history-row {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 28px;
  border-bottom: 1px solid var(--line);
  font-size: 11.5px;
}
.history-row .muted {
  color: var(--muted-2);
  width: 70px;
  flex: none;
}
.history-add {
  display: flex;
  gap: 6px;
  padding-top: 10px;
}
.history-add .input {
  height: 26px;
  font-size: 11.5px;
}
.history-add .input:first-child {
  width: 92px;
  flex: none;
}
.pad {
  padding: 14px;
}
.muted {
  color: var(--muted);
}

/* -------------------------------------------------------------------- menu */
.popover {
  position: absolute;
  z-index: 350;
  min-width: 150px;
  padding: 4px;
  border-radius: 9px;
  background: rgba(252, 253, 255, 0.95);
  backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow-sm);
  animation: pop 0.1s ease;
}
@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(-2px);
  }
}
.menu {
  display: flex;
  flex-direction: column;
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 25px;
  padding: 0 8px;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: var(--ink-2);
  font-size: 12px;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
}
.menu-item:hover {
  background: rgba(10, 132, 255, 0.12);
  color: var(--accent-ink);
}
.menu-item.danger {
  color: var(--danger);
}
.menu-item.danger:hover {
  background: rgba(255, 59, 48, 0.1);
}
.menu-item.muted {
  color: var(--muted-2);
}
.menu-check {
  width: 12px;
  display: grid;
  place-items: center;
  color: var(--accent);
}
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: none;
}
.sep {
  height: 1px;
  background: var(--line);
  margin: 4px 5px;
}

.picker {
  width: 230px;
  display: flex;
  flex-direction: column;
}
.picker-search {
  height: 25px;
  border: 1px solid var(--line);
  border-radius: 5px;
  margin: 3px 3px 5px;
  padding: 0 7px;
  outline: none;
  background: #fff;
  font-size: 11.5px;
}
.picker-search:focus {
  border-color: var(--accent);
}
.picker-list {
  max-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.picker-item {
  height: 25px;
  padding: 0 7px;
  border: none;
  border-radius: 5px;
  background: transparent;
  text-align: left;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.picker-item:hover {
  background: rgba(10, 132, 255, 0.12);
  color: var(--accent-ink);
}
.picker-clear {
  height: 23px;
  margin-top: 3px;
  border: none;
  border-top: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 11.5px;
}
.picker-clear:hover {
  color: var(--ink);
}

/* ---------------------------------------------------------- notifications */
.notifications {
  width: 260px;
  display: flex;
  flex-direction: column;
  max-height: 320px;
  overflow-y: auto;
}
.notification {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 6px 8px;
  border: none;
  border-radius: 5px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.notification:hover {
  background: rgba(10, 132, 255, 0.1);
}
.notification.unread .notification-text::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 5px;
  border-radius: 50%;
  background: var(--accent);
  vertical-align: 1px;
}
.notification-text {
  font-size: 11.8px;
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.notification-time {
  font-size: 10.5px;
  color: var(--muted-2);
}
.notifications-empty {
  padding: 12px;
  text-align: center;
  color: var(--muted-2);
}
.notifications-read {
  border: none;
  border-top: 1px solid var(--line);
  background: transparent;
  height: 25px;
  color: var(--accent-ink);
  font-size: 11.5px;
  cursor: pointer;
}

/* ------------------------------------------------------------------- forms */
.form {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.input {
  width: 100%;
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.8);
  outline: none;
  font-size: 12px;
}
.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.16);
  background: #fff;
}
.input::placeholder {
  color: var(--muted-2);
}
.check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.8px;
  color: var(--ink-2);
  cursor: pointer;
}
.check input {
  appearance: none;
  width: 14px;
  height: 14px;
  margin: 0;
  border: 1.4px solid var(--line-strong);
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  position: relative;
  flex: none;
}
.check input:checked {
  background: var(--accent);
  border-color: var(--accent);
}
.check input:checked::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1.4px;
  width: 3.6px;
  height: 7px;
  border: solid #fff;
  border-width: 0 1.8px 1.8px 0;
  transform: rotate(43deg);
}
.options {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.choice-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.choice-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.swatch {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  overflow: hidden;
  flex: none;
  border: 1px solid var(--line);
  cursor: pointer;
}
.swatch input {
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.chip {
  height: 21px;
  padding: 0 8px;
  border: none;
  border-radius: 5px;
  background: rgba(10, 132, 255, 0.1);
  color: var(--accent-ink);
  font-size: 11px;
  cursor: pointer;
}
.chip:hover {
  background: rgba(10, 132, 255, 0.18);
}
.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px;
}

/* ----------------------------------------------------------------- buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 26px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.75);
  color: var(--ink-2);
  font-size: 11.8px;
  font-weight: 550;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover {
  background: #fff;
}
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn.primary:hover {
  background: #0074e0;
}
.btn.danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}
.btn.danger:hover {
  background: #e8332a;
}
.btn.ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}
.btn.ghost:hover {
  background: rgba(20, 30, 48, 0.06);
  color: var(--ink);
}
.btn.danger.ghost {
  color: var(--danger);
}
.btn.small {
  height: 23px;
  padding: 0 8px;
  font-size: 11.5px;
}
.btn.wide {
  width: 100%;
  height: 30px;
}
.btn:disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* ------------------------------------------------------------------ modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(22, 34, 52, 0.28);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 0.14s ease;
}
.modal-overlay.open {
  opacity: 1;
}
.modal {
  max-width: 100%;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  background: rgba(252, 253, 255, 0.96);
  backdrop-filter: blur(30px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 30px 70px rgba(17, 32, 56, 0.3);
  transform: translateY(5px) scale(0.995);
  transition: transform 0.16s ease;
  overflow: hidden;
}
.modal-overlay.open .modal {
  transform: none;
}
.modal-head {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 8px 0 12px;
  border-bottom: 1px solid var(--line);
}
.modal-title {
  flex: 1;
  font-size: 12.5px;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.modal-body {
  padding: 12px;
  overflow-y: auto;
}
.modal-foot {
  padding: 8px 12px;
  border-top: 1px solid var(--line);
  background: rgba(245, 247, 250, 0.7);
}
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}
.confirm-text {
  font-size: 12.5px;
  color: var(--ink-2);
}

/* ------------------------------------------------------------------ toasts */
.toast-host {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 400;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
}
.toast {
  display: flex;
  align-items: center;
  gap: 7px;
  max-width: 340px;
  padding: 7px 11px;
  border-radius: 8px;
  background: rgba(252, 253, 255, 0.96);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow-sm);
  font-size: 11.8px;
  color: var(--ink-2);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  cursor: pointer;
}
.toast.show {
  opacity: 1;
  transform: none;
}
.toast.error {
  color: var(--danger);
}
.toast.success {
  color: var(--green);
}

/* ------------------------------------------------------------------ login */
.login {
  height: 100%;
  display: grid;
  place-items: center;
  padding: 20px;
}
.login-card {
  width: 320px;
  padding: 22px 20px 20px;
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
}
.login-form {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.login-error {
  font-size: 11.5px;
  color: var(--danger);
  min-height: 14px;
  padding: 0 2px;
}
.fatal {
  margin-bottom: 12px;
  color: var(--danger);
  font-size: 12.5px;
}

/* ----------------------------------------------------------------- import */
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 130px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 9px;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
}
.dropzone:hover,
.dropzone.over {
  border-color: var(--accent);
  color: var(--accent-ink);
  background: rgba(10, 132, 255, 0.04);
}
.import-map {
  display: flex;
  flex-direction: column;
  max-height: 320px;
  overflow-y: auto;
}
.import-row {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  border-bottom: 1px solid var(--line);
}
.import-col {
  width: 34%;
  font-size: 11.8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.import-sample {
  flex: 1;
  color: var(--muted-2);
  font-size: 11.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.import-row .select {
  width: 150px;
  flex: none;
}
.import-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 12px 0;
  text-align: center;
}
.import-result .big {
  font-size: 26px;
  font-weight: 650;
}
.import-errors {
  margin-top: 8px;
  width: 100%;
  max-height: 130px;
  overflow-y: auto;
  text-align: left;
  color: var(--danger);
  font-size: 11.5px;
}

/* --------------------------------------------------------------- responsive */
@media (max-width: 760px) {
  .app {
    padding: 5px;
    gap: 5px;
  }
  .sidebar {
    width: 156px;
    padding: 8px 6px;
  }
  .brand {
    padding: 0 4px 10px;
  }
  .tabs {
    padding: 0 4px;
  }
  .tab {
    max-width: 130px;
  }
  .table .center,
  .table .right {
    width: auto;
  }
}

@media (max-width: 560px) {
  .sidebar {
    position: fixed;
    left: 5px;
    top: 5px;
    bottom: 5px;
    z-index: 50;
    width: 200px;
    transform: translateX(-110%);
    transition: transform 0.18s ease;
  }
  .sidebar.open {
    transform: none;
  }
  .app {
    padding: 5px;
  }
}

.mobile-menu {
  display: none;
}
.scrim {
  display: none;
}
@media (max-width: 560px) {
  .mobile-menu {
    display: inline-grid;
    place-items: center;
    width: 26px;
    height: 26px;
    flex: none;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    padding: 0;
  }
  .scrim {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(20, 30, 48, 0.25);
    backdrop-filter: blur(2px);
  }
  .scrim.open {
    display: block;
  }
}


/* ------------------------------------------------------------------ power */
.power {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 40;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.62);
  color: #5d6673;
  box-shadow: 0 3px 12px rgba(17, 32, 56, 0.16);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.power:hover { opacity: 1; color: #ff3b30; background: rgba(255, 255, 255, 0.95); }
.power[hidden] { display: none; }
.stopped {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  color: #344050;
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  text-align: center;
}

.tree-add-item,
.tree-add-section {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 23px;
  padding: 0 8px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted-2);
  font-size: 11px;
  text-align: left;
  cursor: pointer;
}
.tree-add-item { margin-top: 1px; }
.tree-add-section { margin-top: 5px; padding-left: 6px; }
.tree-add-item:hover,
.tree-add-section:hover { background: rgba(255,255,255,.55); color: var(--ink-2); }

.icon-btn.active {
  background: rgba(10, 132, 255, 0.14);
  color: var(--accent-ink);
}
.grid.settings .th,
.grid.settings .row {
  cursor: grab;
}
.grid.settings .th.dragging,
.grid.settings .row.dragging {
  opacity: 0.42;
}
.grid.settings .th.drop-target {
  box-shadow: inset 2px 0 0 var(--accent);
}
.grid.settings .row.drop-target {
  box-shadow: inset 0 2px 0 var(--accent);
}

.options { display: flex; flex-direction: column; gap: 6px; }
.option-label { color: var(--muted); font-size: 10.5px; margin-top: 2px; }
.muted.small { color: var(--muted); font-size: 11px; }

.icon-btn:disabled { opacity: 0.35; cursor: default; }


.row-open {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border: 1px solid rgba(10, 132, 255, 0.18);
  border-radius: 5px;
  background: rgba(10, 132, 255, 0.07);
  color: #0a6fd8;
  font-size: 10.5px;
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
}
.row-open:hover { background: rgba(10, 132, 255, 0.14); }
.row-delete {
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted-2);
  opacity: 0.38;
  cursor: pointer;
}
.row:hover .row-delete { opacity: 0.65; }
.row-delete:hover { opacity: 1; color: #d92d20; background: rgba(217, 45, 32, 0.09); }

.row-detail {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}
.row-detail.no-math { grid-template-columns: 1fr; }
.row-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.math-card, .chat-card, .logs-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,255,255,.56);
  padding: 12px;
}
.detail-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 9px;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 700;
}
.math-sum-wrap { color: var(--muted); font-size: 11px; font-weight: 500; }
.math-sum { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.math-row { display: flex; align-items: center; gap: 6px; margin: 5px 0; min-height: 24px; }
.math-row.net-row { padding-top: 8px; margin-top: 8px; border-top: 1px solid var(--line); }
.math-label {
  flex: 1; min-width: 0; height: 23px; border: 0; border-bottom: 1px dashed rgba(20,30,48,.18);
  background: transparent; color: var(--ink); font: inherit; font-size: 12px; font-weight: 650; outline: none;
}
.math-label:focus { border-bottom-color: var(--accent); }
.math-value { min-width: 92px; text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); font-size: 12px; }
.math-value.strong { color: var(--ink); font-weight: 700; }
.math-fixed { flex: 1; font-size: 12px; font-weight: 700; }
.math-controls { display: flex; gap: 8px; margin: 7px 0; }
.math-controls label { display: flex; flex: 1; align-items: center; gap: 4px; color: var(--muted); font-size: 10.5px; }
.math-input {
  width: 58px; height: 23px; border: 1px solid var(--line); border-radius: 5px;
  background: rgba(255,255,255,.8); color: var(--ink); font: inherit; font-size: 11px; padding: 0 5px; outline: none;
}
.math-input.wide { flex: 1; width: auto; }
.math-input:focus { border-color: rgba(10,132,255,.5); box-shadow: 0 0 0 2px var(--accent-soft); }
.math-note { min-height: 15px; color: var(--muted); font-size: 10.5px; margin: 5px 0; }
.math-save { width: 100%; margin-top: 4px; }
.chat-list, .logs-list { overflow-y: auto; padding-right: 3px; }
.chat-list { height: 180px; }
.logs-list { max-height: 170px; }
.chat-message, .log-item { padding: 6px 0; border-bottom: 1px solid rgba(20,30,48,.06); }
.chat-message:last-child, .log-item:last-child { border-bottom: 0; }
.chat-meta, .log-meta { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 10.5px; }
.chat-meta b, .log-meta b { color: var(--ink-2); font-weight: 650; }
.chat-text, .log-text { margin-top: 2px; color: var(--ink-2); font-size: 11.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-form { display: flex; gap: 5px; margin-top: 8px; }
.chat-input { flex: 1; min-width: 0; height: 26px; border: 1px solid var(--line); border-radius: 6px; background: rgba(255,255,255,.8); color: var(--ink); font: inherit; font-size: 11.5px; padding: 0 7px; outline: none; }
.chat-input:focus { border-color: rgba(10,132,255,.5); }
@media (max-width: 760px) {
  .row-detail { grid-template-columns: 1fr; }
  .td-actions, .th-actions { width: 100px; min-width: 100px; padding: 0 7px; }
  .row-open { font-size: 9.5px; padding: 0 6px; }
}

.btn.export {
  background: linear-gradient(180deg, #1687f8, #0a72dc);
  border-color: rgba(0, 80, 170, .2);
  color: #fff;
  box-shadow: 0 2px 8px rgba(10, 114, 220, .24);
}
.btn.export:hover { background: linear-gradient(180deg, #2b96ff, #0a72dc); }
.tab-export { height: 24px; padding: 0 9px; font-size: 11px; gap: 4px; }
.math-actions { display: flex; gap: 6px; margin-top: 6px; }
.math-actions .math-save { flex: 1; margin-top: 0; }
.math-export { flex: 0 0 auto; }
.export-preview {
  max-height: 58vh; overflow: auto; padding: 14px;
  border: 1px solid var(--line); border-radius: 9px;
  background: rgba(255,255,255,.72); color: var(--ink-2);
  font-size: 13px; line-height: 1.6;
}
.day-export { display: flex; flex-direction: column; gap: 10px; min-height: 360px; }
.day-export-date { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; font-weight: 600; }
.day-export-date .input { width: 150px; }
.day-export-status { color: var(--muted); font-size: 11px; min-height: 16px; }

.sidebar-foot {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
  padding: 8px 2px 0;
  margin-top: 6px;
  border-top: 1px solid var(--line);
}
.foot-brand-row,
.foot-user-row { display: flex; align-items: center; gap: 3px; min-width: 0; }
.version-tag { height: 22px; padding: 0 8px; font-size: 11.5px; }
.brand-version { margin-left: 4px; color: var(--muted); font-size: 10px; font-weight: 500; }
.foot-action { width: 24px; height: 24px; flex: none; color: var(--muted); }
.foot-action:hover { color: var(--ink); background: rgba(20, 30, 48, .06); }
.foot-user-row .user-chip { flex: 1; }

.th-index,
.td-index {
  position: sticky;
  left: 0;
  flex: none;
  width: 42px;
  min-width: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-right: 1px solid var(--line);
  background: rgba(250, 252, 255, 0.94);
  color: var(--muted-2);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  z-index: 3;
}
.th-index {
  z-index: 9;
  background: rgba(252, 253, 255, 0.97);
  color: var(--muted);
  font-weight: 650;
}
.row:hover .td-index { background: rgba(246, 250, 255, 0.98); color: var(--ink-2); }
@media (max-width: 760px) {
  .th-index, .td-index { width: 36px; min-width: 36px; }
}


.icon-btn.settings-toggle.active {
  background: #ff8a00;
  color: #fff;
  box-shadow: 0 2px 8px rgba(255, 138, 0, .35);
}
.th-grip,
.row-grip {
  display: inline-grid;
  place-items: center;
  flex: none;
  color: var(--muted-2);
  cursor: grab;
}
.th-grip { width: 12px; opacity: .9; }
.row-grip { width: 10px; opacity: .8; }
.td-index { gap: 3px; flex-direction: row; }
.grid.settings .th[data-field] { padding-right: 22px; }
.grid.settings .th-more {
  position: absolute;
  top: 1px;
  right: 3px;
  margin-left: 0;
  opacity: .9;
}
.grid.settings .th-more:hover { opacity: 1; }

.type-control {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  height: 30px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, .78);
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}
.type-control:hover { border-color: rgba(10, 132, 255, .35); }
.type-control-icon { color: #0a6fd8; display: grid; place-items: center; }
.type-control-label { flex: 1; min-width: 0; }
.type-control-chevron { color: var(--muted-2); display: grid; place-items: center; }
.type-menu { min-width: 220px; max-height: 360px; overflow-y: auto; }
.type-option { display: flex; align-items: center; gap: 8px; }
.type-option.active { background: rgba(10, 132, 255, .10); color: var(--accent-ink); }
.type-option-icon { width: 16px; display: grid; place-items: center; color: var(--muted); }
.type-option.active .type-option-icon { color: var(--accent); }
.type-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.type-card {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .65);
  color: var(--ink-2);
  font: inherit;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}
.type-card:hover { border-color: rgba(10, 132, 255, .4); background: rgba(10, 132, 255, .06); }
.type-card-icon { width: 20px; display: grid; place-items: center; color: #0a6fd8; }
.type-card-label { flex: 1; min-width: 0; }
@media (max-width: 520px) { .type-grid { grid-template-columns: 1fr; } }

.picker-empty { padding: 14px 10px; color: var(--muted); font-size: 12px; text-align: center; }


.th.last-field,
.td.last-field { border-right: none; }

.tabs-bar {
  height: 38px;
  flex: none;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 8px;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.table-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: none;
}
.tabs-bar .tabs {
  height: 100%;
  flex: 1;
  min-width: 0;
  border-bottom: none;
  padding: 0 0 0 4px;
  overflow-x: auto;
}
@media (max-width: 560px) {
  .tabs-bar { padding: 0 4px; gap: 2px; }
  .table-toolbar { gap: 0; }
  .tab-export { font-size: 0; width: 26px; padding: 0; justify-content: center; }
}

.mark-all-read {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted-2);
  cursor: pointer;
}
.mark-all-read:hover { background: rgba(20, 30, 48, .07); color: var(--ink); }
.row-no {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  border-radius: 50%;
  font-variant-numeric: tabular-nums;
}
.td-index.unread .row-no {
  background: #ff8a00;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 0 0 2px rgba(255, 138, 0, .18);
}

.index-label { color: var(--muted); font-size: 10.5px; font-weight: 650; }
.mark-all-read {
  color: #1f9d55;
  background: rgba(31, 157, 85, .10);
}
.mark-all-read:hover { color: #137a40; background: rgba(31, 157, 85, .18); }

.toolbar-reset {
  height: 26px;
  padding: 0 8px;
  font-size: 11px;
  gap: 4px;
  color: var(--muted);
}
.toolbar-reset.active {
  color: #b45309;
  border-color: rgba(245, 158, 11, .35);
  background: rgba(245, 158, 11, .10);
}
@media (max-width: 560px) {
  .toolbar-reset .reset-label { display: none; }
  .toolbar-reset { width: 26px; padding: 0; justify-content: center; }
}

.mark-all-read[hidden],
.index-label[hidden] { display: none !important; }

.grid.settings .th-title { flex: 1; min-width: 0; }
.th-rename {
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  flex: none;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted-2);
  cursor: pointer;
  padding: 0;
}
.th-rename:hover { background: rgba(20, 30, 48, .08); color: var(--ink); }


.td-actions { padding-left: 7px; }

.audit-view { padding: 14px; min-height: 0; overflow: auto; }
.audit-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.audit-title { font-size: 14px; font-weight: 700; color: var(--ink); }
.audit-body { border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: rgba(255,255,255,.5); }
.audit-table { width: auto; max-width: none; border-collapse: collapse; font-size: 11.5px; }
.audit-table th { padding: 8px 10px; text-align: left; color: var(--muted); font-size: 10px; font-weight: 650; border-bottom: 1px solid var(--line); background: rgba(245,247,250,.7); }
.audit-table td { padding: 8px 10px; border-bottom: 1px solid rgba(20,30,48,.06); color: var(--ink-2); vertical-align: top; }
.audit-table tr:last-child td { border-bottom: 0; }
.audit-table tbody tr:hover { background: rgba(255,255,255,.6); }
.audit-user { font-weight: 600; white-space: nowrap; }
.audit-time { color: var(--muted); white-space: nowrap; }
.audit-empty { padding: 24px; text-align: center; color: var(--muted); font-size: 12px; }

.tree-head-row { display: flex; align-items: center; gap: 2px; }
.tree-head-row .tree-head { flex: 1; min-width: 0; }
.tree-add-icon {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  flex: none;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted-2);
  opacity: .35;
  cursor: pointer;
  padding: 0;
}
.tree-add-icon:hover { opacity: .95; background: rgba(20, 30, 48, .06); color: var(--ink-2); }

.math-card { padding: 10px 12px; }
.math-top {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 10.5px;
}
.math-caption { color: var(--muted); }
.math-sum { color: var(--ink); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.math-client { margin-left: auto; color: var(--muted); font-size: 10.5px; }
.math-client b { color: var(--accent-ink); font-size: 12px; }
.math-row { margin: 3px 0; min-height: 23px; gap: 6px; }
.math-row.net-row { padding-top: 5px; margin-top: 5px; }
.math-label {
  flex: 0 0 82px;
  width: 82px;
  height: 22px;
  font-size: 11.5px;
}
.math-value { min-width: 64px; font-size: 11.5px; }
.math-fixed { flex: 0 0 46px; width: 46px; font-size: 11.5px; }
.math-input { height: 22px; font-size: 11px; }
.math-input.wide { flex: 1; width: auto; min-width: 0; }
.math-pct { width: 44px; text-align: right; }
.math-percent-wrap { display: inline-flex; align-items: center; gap: 2px; flex: none; }
.math-unit { color: var(--muted); font-size: 10.5px; }
.math-note { min-height: 0; margin: 3px 0; font-size: 10px; }
.math-actions { margin-top: 4px; }
.math-card .math-save { height: 26px; font-size: 11px; }
.math-card .math-export { height: 26px; font-size: 11px; }

.settings-control { display: inline-flex; align-items: center; }
.settings-control .settings-toggle { border-radius: 6px 0 0 6px; }
.settings-control .table-more {
  width: 15px;
  height: 26px;
  border-radius: 0 6px 6px 0;
  color: var(--muted-2);
}
.settings-control .table-more:hover { background: rgba(20, 30, 48, .07); color: var(--ink); }

.th-add-floating {
  position: absolute;
  top: 0;
  width: 24px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--muted-2);
  opacity: .38;
  cursor: pointer;
  z-index: 8;
  padding: 0;
}
.th-add-floating:hover { opacity: 1; background: rgba(20, 30, 48, .06); }

.td-index { border-bottom: 1px solid var(--line); }

.day-export { gap: 7px; min-height: 0; }
.day-export-top { display: flex; align-items: center; gap: 7px; }
.day-export-caption { color: var(--muted); font-size: 11px; font-weight: 600; }
.export-date-btn {
  height: 26px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 8px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: rgba(255,255,255,.78);
  color: var(--ink);
  font: inherit;
  font-size: 11.5px;
  cursor: pointer;
}
.export-date-btn:hover { border-color: rgba(10,132,255,.4); }
.export-date-chevron { color: var(--muted-2); display: grid; place-items: center; }
.date-menu { min-width: 160px; max-height: 260px; overflow-y: auto; }
.date-menu .menu-item.active { background: rgba(10,132,255,.10); color: var(--accent-ink); }
.day-export-status { margin-left: auto; min-height: 0; font-size: 10.5px; }
.day-export .export-preview { max-height: 44vh; padding: 10px 12px; font-size: 12.5px; line-height: 1.45; }

.toolbar-btn {
  height: 26px;
  min-width: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 7px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
  white-space: nowrap;
}
.toolbar-btn:hover { background: rgba(20, 30, 48, .06); color: var(--ink-2); }
.toolbar-btn:disabled { opacity: .35; cursor: default; }
.toolbar-btn.toolbar-accent {
  background: linear-gradient(180deg, #1687f8, #0a72dc);
  border-color: rgba(0, 80, 170, .2);
  color: #fff;
  font-weight: 600;
  padding: 0 10px;
  box-shadow: 0 2px 8px rgba(10, 114, 220, .22);
}
.toolbar-btn.toolbar-accent:hover { background: linear-gradient(180deg, #2b96ff, #0a72dc); color: #fff; }
.toolbar-btn.settings-toggle.active { background: #ff8a00; color: #fff; border-color: transparent; }
.settings-control .toolbar-btn { border-radius: 7px 0 0 7px; }
.settings-control .table-more { width: 19px; min-width: 19px; padding: 0; border-radius: 0 7px 7px 0; }
@media (max-width: 560px) {
  .toolbar-btn.tab-export { width: 26px; min-width: 26px; padding: 0; font-size: 0; }
}

.math-summary {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto auto;
  gap: 7px;
  align-items: end;
  margin-bottom: 7px;
}
.math-summary-item { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.math-summary-item b { color: var(--ink); font-size: 11.5px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.math-summary-status { align-items: flex-end; }
.math-status { max-width: 100px; overflow: hidden; text-overflow: ellipsis; }
.math-grid {
  display: grid;
  grid-template-columns: 64px 84px minmax(0, 1fr);
  gap: 5px 8px;
  align-items: center;
  margin-top: 5px;
}
.math-label-text { color: var(--ink); font-size: 11.5px; font-weight: 650; }
.math-amount { text-align: right; font-size: 11.5px; font-variant-numeric: tabular-nums; }
.math-amount.strong { font-weight: 700; }
.math-percent { color: var(--muted); font-size: 11px; }
.math-fee { width: 100%; }
.math-grid .math-pct { width: 42px; }
.math-ready {
  width: 100%;
  height: 74px;
  margin-top: 6px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255,255,255,.76);
  color: var(--ink-2);
  font: inherit;
  font-size: 10.5px;
  line-height: 1.35;
  resize: none;
  outline: none;
}
.math-ready:focus { border-color: rgba(10,132,255,.4); }
.math-footer { display: flex; align-items: center; gap: 6px; margin-top: 5px; }
.math-copy { margin-left: auto; height: 26px; font-size: 11px; }
.math-saved { color: var(--muted); font-size: 10px; }

.table-toolbar .toolbar-btn {
  background: rgba(255, 255, 255, .52);
  border: 1px solid var(--line);
  color: var(--muted);
}
.table-toolbar .toolbar-btn:hover {
  background: rgba(255, 255, 255, .9);
  border-color: var(--line-strong);
  color: var(--ink-2);
}
.table-toolbar .toolbar-btn.toolbar-accent {
  background: linear-gradient(180deg, #1687f8, #0a72dc);
  border-color: rgba(0, 80, 170, .22);
  color: #fff;
  box-shadow: 0 2px 8px rgba(10, 114, 220, .22);
}
.table-toolbar .toolbar-btn.toolbar-accent:hover {
  background: linear-gradient(180deg, #2b96ff, #0a72dc);
  border-color: rgba(0, 80, 170, .22);
  color: #fff;
}
.table-toolbar .toolbar-btn.settings-toggle.active {
  background: #ff8a00;
  border-color: #ff8a00;
  color: #fff;
}
.table-toolbar .settings-control .settings-toggle { border-right: 0; }
.table-toolbar .settings-control .table-more { border-left: 1px solid var(--line); }
.table-toolbar .toolbar-btn.toolbar-reset.active {
  color: #b45309;
  border-color: rgba(245, 158, 11, .4);
  background: rgba(245, 158, 11, .12);
}

.row-modal-title {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
}
.row-modal-title > span:not(.pill) { overflow: hidden; text-overflow: ellipsis; }
.row-modal-sep { color: var(--muted-2); }
.row-modal-sum { color: var(--ink); font-variant-numeric: tabular-nums; }
.row-modal-status { flex: none; }
.math-grid {
  grid-template-columns: 64px 86px 80px;
  justify-content: start;
}
.math-amount { text-align: left; }

.math-ready-wrap { position: relative; margin-top: 6px; }
.math-ready { padding-right: 108px; }
.math-copy {
  position: absolute;
  top: 6px;
  right: 6px;
  height: 24px;
  margin: 0;
  padding: 0 9px;
  font-size: 10.5px;
}

.table .row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 1px; width: 56px; padding: 0 5px; }

.tree { gap: 0; }
.tree-section { padding: 3px 0; }
.tree-section + .tree-section,
.tree-add-section + .tree-section { border-top: 1px solid var(--line); }
.tree-section:first-child { padding-top: 0; }
.tree-add-section {
  margin-top: 0;
  padding-top: 6px;
  padding-bottom: 6px;
  border-top: 1px solid var(--line);
  border-radius: 0;
}

.th-actions { justify-content: flex-start; text-align: left; }


.view { background: rgba(226, 236, 249, 0.5); }

.td-actions { padding-right: 0; }


.content.table-view {
  flex: 0 0 auto;
  width: var(--grid-width, 100%);
  max-width: 100%;
}

.grid-scroll { scrollbar-width: none; -ms-overflow-style: none; }
.grid-scroll::-webkit-scrollbar { width: 0; height: 0; display: none; }

.table-toolbar { flex: 1; min-width: 0; }
.tabs-bar { padding-right: 0; }

.day-export .export-preview { max-height: 58vh; font-size: 11.5px; line-height: 1.4; }

.cell-value {
  flex: 1;
  min-width: 80px;
  height: 26px;
  margin: 0 3px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, .52);
  color: var(--ink-2);
  font: inherit;
  font-size: 11px;
  outline: none;
}
.cell-value:focus { border-color: rgba(10, 132, 255, .5); background: #fff; }
.cell-value:disabled { color: var(--muted); background: transparent; border-color: transparent; }

.table-search {
  flex: 0 1 165px;
  min-width: 92px;
  height: 26px;
  margin: 0 3px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, .52);
  color: var(--muted-2);
}
.table-search:focus-within { border-color: rgba(10, 132, 255, .5); background: #fff; color: var(--muted); }
.table-search-icon { display: grid; place-items: center; flex: none; }
.table-search-input {
  min-width: 0;
  width: 100%;
  height: 100%;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: 11px;
}
.table-search-input::-webkit-search-cancel-button { -webkit-appearance: none; }

.table td.inline-editing {
  padding: 4px 7px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(10, 132, 255, .45);
}
.inline-user-input {
  width: 100%;
  height: 22px;
  padding: 0;
  border: 0;
  outline: none;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
}

.row { border-bottom-color: var(--line-strong); }
.grid-head { border-bottom-color: var(--line-strong); }
.td-index { border-bottom: 0; box-shadow: inset 0 -1px 0 var(--line-strong); }

.date-calendar-popover { padding: 6px; }
.date-calendar { width: 238px; display: flex; flex-direction: column; gap: 4px; }
.date-cal-head { display: flex; align-items: center; gap: 4px; }
.date-cal-title { flex: 1; text-align: center; color: var(--ink); font-size: 12px; font-weight: 650; }
.date-cal-week, .date-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.date-cal-week span { height: 19px; display: grid; place-items: center; color: var(--muted-2); font-size: 9.5px; font-weight: 600; }
.date-day { height: 26px; border: 0; border-radius: 5px; background: transparent; color: var(--ink-2); font: inherit; font-size: 11px; cursor: pointer; }
.date-day:hover { background: rgba(10, 132, 255, .10); color: var(--accent-ink); }
.date-day.today { box-shadow: inset 0 0 0 1px rgba(10, 132, 255, .45); }
.date-day.selected { background: var(--accent); color: #fff; }
.date-day.empty { pointer-events: none; }
.date-cal-foot { display: flex; justify-content: space-between; gap: 6px; padding-top: 2px; }

.th, .td { border-right-color: var(--line-strong); }
.add-row-btn {
  position: absolute;
  left: 42px;
  right: 0;
  top: 0;
  height: 32px;
  flex: none;
  background: transparent;
}
.add-row-btn:hover { background: rgba(255, 255, 255, .22); }
.row-add .td.add-cell { background: transparent; }

.list-actions { display: flex; justify-content: flex-end; padding: 8px 0 10px; }

.content.table-view {
  height: var(--content-height, auto);
  max-height: 100%;
  align-self: flex-start;
}
.view-body, .audit-body { scrollbar-width: none; -ms-overflow-style: none; }
.view-body::-webkit-scrollbar, .audit-body::-webkit-scrollbar { width: 0; height: 0; display: none; }

.row { border-bottom: 0; }
.th { border-bottom: 0; border-right-color: var(--line-strong); }
.td { border-bottom: 1px solid var(--line-strong); border-right-color: var(--line-strong); }
.td-index { border-bottom: 1px solid var(--line-strong); box-shadow: none; }
.th-actions, .td-actions { border-left: 1px solid var(--line-strong); }

.tree-subitems {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-left: 11px;
  padding-left: 11px;
  border-left: 1px solid var(--line);
}

.grid-head { border-bottom: 0; }
.th { border-bottom: 1px solid var(--line-strong); }
.th.last-field, .td.last-field { border-right: 1px solid var(--line-strong); }
.th-actions, .td-actions { border-left: 0; }

.tree-subitems { position: relative; border-left: 0; }
.tree-subitems::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 12px;
  width: 1px;
  background: rgba(20, 30, 48, 0.14);
}

.tree-group { font-weight: 600; color: var(--ink-2); }
.tree-group::after { content: "›"; margin-left: auto; color: var(--muted-2); }

.tree-group { padding-left: 3px; }
.tree-group::after { content: none; }
.tree-group-chev {
  width: 10px;
  flex: none;
  display: grid;
  place-items: center;
  color: var(--muted-2);
  transition: transform .12s ease;
}
.tree-group-chev.open { transform: rotate(90deg); }

.row-add .add-row-btn {
  position: static;
  left: auto;
  right: auto;
  width: 42px;
  min-width: 42px;
  height: 32px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-right: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  border-radius: 0;
  background: transparent;
  color: var(--accent);
  opacity: .72;
  cursor: pointer;
}
.row-add .add-row-btn:hover { background: rgba(10, 132, 255, .08); color: var(--accent); opacity: 1; }

.tree-group-chev, .tree-group-chev.open { transform: rotate(180deg); }

.tree-group-chev { margin-left: 3px; transform: rotate(0deg); }
.tree-group-chev.open { transform: rotate(90deg); }

.th[data-field] { cursor: grab; }
.th-grip { opacity: .35; }
.th[data-field]:hover .th-grip { opacity: 1; }
.th.dragging { opacity: .42; }
.th.drop-target { box-shadow: inset 2px 0 0 var(--accent); }

.tree-group { gap: 4px; }

.ref {
  background: color-mix(in srgb, var(--c, var(--accent)) 13%, transparent);
  color: color-mix(in srgb, var(--c, var(--accent)) 72%, #1c2430);
}
.ref:hover { background: color-mix(in srgb, var(--c, var(--accent)) 20%, transparent); }

.th[data-field] .th-title { padding-right: 13px; }
.th-filter {
  position: absolute;
  top: 1px;
  right: 2px;
  width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--accent);
  opacity: .5;
  cursor: pointer;
  z-index: 4;
}
.th-filter:hover { opacity: 1; background: rgba(10, 132, 255, .1); }
.th-filter.active { color: #ff8a00; opacity: 1; }
.filter-popover-wrap { padding: 7px; }
.filter-popover { width: 190px; display: flex; flex-direction: column; gap: 5px; }
.filter-popover .input { width: 100%; height: 26px; }
.filter-popover .btn { align-self: flex-end; }

.tree-item { gap: 4px; }
.tree-level2 { padding-left: 3px; }
.tree-dot {
  width: 10px;
  margin-left: 3px;
  display: grid;
  place-items: center;
  flex: none;
}
.tree-dot::before {
  content: "";
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--muted-2);
}

.row-add .td, .row-add .add-row-btn { border-right: 0; }

.th-filter .i { fill: currentColor; stroke: none; }

.th[data-field] { cursor: default; }
.th-grip { opacity: .9; }
.th[data-field]:hover .th-grip { opacity: .9; }

.td-actions { padding-right: 3px; }

.table th, .table td { border-right: 1px solid var(--line-strong); }
.table th:last-child, .table td:last-child { border-right: 0; }
.password-cell { padding: 4px 7px; }
.password-control { display: flex; align-items: center; }
.password-mask {
  height: 22px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  letter-spacing: .08em;
  cursor: pointer;
}
.password-mask:hover { border-color: rgba(10,132,255,.4); color: var(--ink-2); }
.password-edit { display: flex; align-items: center; gap: 3px; width: 100%; }
.password-input { min-width: 0; width: 100%; border: 1px solid var(--line); border-radius: 5px; padding: 0 5px; height: 22px; }

.grid-scroll { scrollbar-width: thin; scrollbar-color: rgba(20,30,48,.28) transparent; -ms-overflow-style: auto; }
.grid-scroll::-webkit-scrollbar { display: block; width: 8px; height: 8px; }
.grid-scroll::-webkit-scrollbar-thumb { background: rgba(20,30,48,.24); border-radius: 8px; }
.grid-scroll::-webkit-scrollbar-track { background: transparent; }
.row-add .add-row-btn {
  position: sticky;
  left: 0;
  z-index: 4;
  background: rgba(252, 253, 255, .94);
}

.tree-item-label { flex: 1; }
.tree-edit-icon {
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 4px;
  color: var(--muted-2);
  opacity: .18;
  cursor: pointer;
}
.tree-item:hover .tree-edit-icon,
.tree-head-row:hover .tree-edit-icon,
.tree-edit-icon:hover { opacity: .9; background: rgba(20,30,48,.06); }

.audit-view { padding: 0; }
.audit-body {
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(20,30,48,.28) transparent;
}
.audit-body::-webkit-scrollbar { display: block; width: 8px; height: 8px; }
.audit-body::-webkit-scrollbar-thumb { background: rgba(20,30,48,.24); border-radius: 8px; }
.audit-body::-webkit-scrollbar-track { background: transparent; }
.audit-table { width: auto; max-width: none; }
.audit-table th, .audit-table td { border-right: 1px solid var(--line-strong); }
.audit-table th:last-child, .audit-table td:last-child { border-right: 0; }
.audit-table th { border-bottom: 1px solid var(--line-strong); }
.audit-number { width: 88px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

.td.overridden { background: rgba(255, 159, 10, .10); box-shadow: inset 0 0 0 1px rgba(255, 159, 10, .22); }

.row-delete-user { color: var(--muted-2); }
.row-delete-user:hover { color: var(--danger); background: rgba(255,59,48,.08); }

.password-cell { width: 96px; min-width: 96px; }
.password-control, .password-edit { width: 100%; }
.password-mask { width: 100%; }
.password-input { width: 100%; min-width: 0; }

.th-actions, .td-actions { width: 128px; min-width: 128px; }
.row-comment {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-width: 20px;
  height: 22px;
  padding: 0 3px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted-2);
  opacity: .3;
  cursor: pointer;
}
.row-comment.has-comments { opacity: .85; color: var(--accent-ink); }
.row-comment.unread { opacity: 1; color: var(--danger); }
.row-comment:hover { opacity: 1; background: rgba(20,30,48,.06); }
.comment-count { font-size: 9px; font-weight: 700; line-height: 1; }

.row-actions { width: 96px !important; }
.permissions-list { display: flex; flex-direction: column; gap: 4px; }
.permission-row { display: flex; align-items: center; gap: 8px; height: 28px; font-size: 12px; color: var(--ink-2); cursor: pointer; }
.permission-row input { width: 14px; height: 14px; accent-color: var(--accent); }

.snapshots-table { width: auto; max-width: none; }
.snapshots-table th, .snapshots-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); }
.snapshots-table th { border-bottom: 1px solid var(--line-strong); }
.snapshots-table tr:last-child td { border-bottom: 0; }

.updates-view { padding: 0; }
.updates-list { display: flex; flex-direction: column; gap: 8px; max-width: 820px; }
.update-card { padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.5); }
.update-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 5px; }
.update-head b { font-size: 13px; }
.update-head span { color: var(--muted-2); font-size: 10.5px; }
.update-subtitle { margin: 7px 0 3px; color: var(--ink); font-size: 11.5px; font-weight: 650; }
.update-line { position: relative; padding-left: 11px; margin: 2px 0; color: var(--ink-2); font-size: 11.5px; line-height: 1.4; }
.update-line::before { content: "•"; position: absolute; left: 1px; color: var(--accent); }

.audit-table tr.is-new td { background: rgba(255, 138, 0, .10); }
.audit-table tr.is-new .audit-number { color: #d97706; font-weight: 700; }

.snapshots-table th { position: relative; }
.table-resize {
  position: absolute;
  top: 0;
  right: -3px;
  bottom: 0;
  width: 7px;
  cursor: col-resize;
  z-index: 2;
}
.table-resize:hover, .table-resize:active { background: rgba(10,132,255,.18); }

.permissions-body { display: flex; flex-direction: column; gap: 6px; }
.permissions-toolbar { display: flex; gap: 4px; justify-content: flex-end; }
.permissions-list { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 12px; }
.permission-row { height: 25px; font-size: 11.5px; }

.table th, .audit-table th { position: relative; }
.table-resize { right: -4px; width: 8px; }

.permissions-columns { display: grid; grid-template-columns: 1.1fr 1fr; gap: 16px; min-height: 300px; }
.permissions-block { min-width: 0; }
.permissions-heading { margin-bottom: 6px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.permission-tree { max-height: 360px; overflow: auto; padding-right: 4px; }
.permission-section { margin-bottom: 7px; }
.permission-section-row b { font-size: 11.5px; }
.permission-section-body { border-left: 1px solid var(--line); margin-left: 7px; }
.permission-group { height: 20px; display: flex; align-items: center; color: var(--muted); font-size: 10.5px; font-weight: 650; }
.permission-table { height: 23px; font-size: 11px; }
.permissions-list { max-height: 360px; overflow: auto; padding-right: 4px; }

.user-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 5px;
  border-radius: 50%;
  flex: none;
  vertical-align: 1px;
}
.user-inline { display: inline-flex; align-items: center; }
.audit-user .user-dot { width: 8px; height: 8px; }

.avatar.avatar-dot { width: 9px; height: 9px; }

.tabs-row {
  height: 30px;
  flex: none;
  display: flex;
  align-items: center;
  padding: 0 8px;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.tabs-row .tabs { height: 100%; padding: 0; border: 0; }
.tabs-row .tab { height: 23px; }

.grid-scroll.no-x-scroll { overflow-x: hidden; }

.updates-view { flex: 1; min-height: 0; overflow: auto; }
.updates-table { width: 100%; table-layout: fixed; }
.updates-table th, .updates-table td { padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.updates-table th { position: sticky; top: 0; z-index: 1; background: rgba(250,251,253,.96); border-bottom: 1px solid var(--line-strong); font-size: 10px; color: var(--muted); text-align: left; text-transform: uppercase; letter-spacing: .04em; }
.updates-table th:first-child, .updates-table td:first-child { width: 90px; }
.updates-table th:last-child, .updates-table td:last-child { width: 100px; }
.updates-table tr:last-child td { border-bottom: 0; }
.update-version { font-weight: 700; font-size: 12px; }
.update-date { font-size: 10.5px; white-space: nowrap; }
.updates-table .update-description { display: flex; flex-direction: column; gap: 2px; }

.content.grid-view {
  height: 100% !important;
  max-height: 100% !important;
  align-self: stretch;
}

.td.cell-locked {
  background: rgba(10, 132, 255, .11) !important;
  box-shadow: inset 0 0 0 1px rgba(10, 132, 255, .28);
}
.cell-lock-name {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  max-width: 105px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, .78);
  color: #0a6fd1;
  font-size: 9px;
  font-weight: 700;
  pointer-events: none;
}
.td { position: relative; }

.content.table-view .table,
.content.table-view .audit-table {
  max-width: none;
}
