:root {
  --bg: #0b0f14;
  --surface: #0f1621;
  --surface2: #101a28;
  --border: rgba(255, 255, 255, 0.08);
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.62);
  --muted2: rgba(255, 255, 255, 0.45);
  --accent: #3b82f6; /* security blue */
  --good: #22c55e;
  --warn: #f59e0b;
  --bad: #ef4444;

  --radius: 14px;
  --radiusSm: 10px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);

  --font:
    ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial,
    "Apple Color Emoji", "Segoe UI Emoji";
}

* {
  box-sizing: border-box;
  scrollbar-width: none;
  scrollbar-color: transparent;

}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  font-family: var(--font);
  background:
    radial-gradient(
      1200px 700px at 30% -10%,
      rgba(59, 130, 246, 0.18),
      transparent 55%
    ),
    radial-gradient(
      900px 500px at 80% 0%,
      rgba(34, 197, 94, 0.1),
      transparent 60%
    ),
    var(--bg);
  color: var(--text);
}

.topbar {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 14, 20, 0.75);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 5;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand__mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
}
.brand__name {
  font-weight: 700;
  letter-spacing: 0.3px;
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.topbar__search {
  width: 320px;
  max-width: 46vw;
}

.iconBtn,
.avatar {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  height: 36px;
  width: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.iconBtn:hover,
.avatar:hover {
  border-color: rgba(255, 255, 255, 0.18);
}

.layout {
  display: grid;
  grid-template-columns: 320px 1fr 360px;
  gap: 14px;
  padding: 14px;
  height: calc(100vh - 56px - 42px);
}

.panel {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.03),
    rgba(255, 255, 255, 0.015)
  );
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.panel__header {
  padding: 12px 12px 10px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.panel__title {
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 10px;
}

.panel__body {
  padding: 12px;
  overflow: auto;
  flex: 1;
}

.panel__footer {
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  align-items: center;
  background: rgba(255, 255, 255, 0.015);
}

.statusDot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 14px rgba(34, 197, 94, 0.35);
}

.search {
  display: flex;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  padding: 10px 12px;
  border-radius: var(--radiusSm);
}
.search__icon {
  color: var(--muted2);
}
.search input {
  width: 100%;
  background: transparent;
  border: 0;
  outline: none;
  color: var(--text);
  font-size: 13px;
}
.search:focus-within {
  border-color: rgba(59, 130, 246, 0.55);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.tree {
  outline: none;
}
.tree:focus {
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
  border-radius: 10px;
}

.treeItem {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  user-select: none;
  border: 1px solid transparent;
}
.treeItem:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.06);
}
.treeItem[data-focused="true"] {
  border-color: rgba(59, 130, 246, 0.55);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.treeItem[data-selected="true"] {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.35);
}
.treeItem__twisty {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  color: var(--muted);
  flex: 0 0 auto;
}
.treeItem__icon {
  width: 18px;
  text-align: center;
}
.treeItem__label {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.treeChildren {
  margin-left: 18px;
  padding-left: 10px;
  border-left: 1px dashed rgba(255, 255, 255, 0.08);
}

.workspace {
  padding: 22px;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.fileHeader {
  display: flex;
  gap: 12px;
  align-items: center;
}
.fileIcon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  display: grid;
  place-items: center;
  font-size: 22px;
}
.fileTitle {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.fileTitle h1 {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0.2px;
}
.badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.badge {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.02);
}
.badge--accent {
  border-color: rgba(59, 130, 246, 0.4);
  color: rgba(147, 197, 253, 0.95);
}
.badge--good {
  border-color: rgba(34, 197, 94, 0.4);
  color: rgba(134, 239, 172, 0.95);
}
.badge--warn {
  border-color: rgba(245, 158, 11, 0.4);
  color: rgba(253, 230, 138, 0.95);
}

.actions {
  display: flex;
  gap: 10px;
}
.btn {
  height: 38px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  cursor: pointer;
  font-weight: 600;
  display: flex;
  gap: 8px;
  align-items: center;
}
.btn:hover {
  border-color: rgba(255, 255, 255, 0.18);
}
.btn--primary {
  background: rgba(59, 130, 246, 0.18);
  border-color: rgba(59, 130, 246, 0.45);
}
.btn--primary:hover {
  border-color: rgba(59, 130, 246, 0.65);
}
.btn--ghost {
  width: 38px;
  justify-content: center;
  padding: 0;
}

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.02);
  padding: 14px;
}
.lockPreview {
  min-height: 360px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.15);
  position: relative;
}
.lockPreview__inner {
  text-align: center;
  max-width: 440px;
  padding: 20px;
}
.lockPreview__icon {
  font-size: 36px;
  opacity: 0.9;
  margin-bottom: 10px;
}
.lockPreview__title {
  font-weight: 800;
  margin-bottom: 6px;
}
.lockPreview__desc {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 14px;
}
.lockPreview__buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.preview_wrapper, .kv {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  font-size: 13px;
  overflow: scroll;
}
.preview_item,
.kv__k {
  color: var(--muted);
  font-weight: bold;
}
.preview_value,
.kv__v {
  color: var(--text);
  text-align: right;
  margin-bottom: 10px;
  text-overflow: ellipsis;
  max-width: 100%;
}

.section {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 12px;
}
.section h3 {
  margin: 0 0 10px 0;
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.activity {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.activityItem {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.activityAvatar {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.activityMeta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.activityMeta .who {
  font-weight: 700;
  font-size: 13px;
}
.activityMeta .what {
  color: var(--muted);
  font-size: 12px;
}
.activityMeta .when {
  color: var(--muted2);
  font-size: 12px;
}

.muted {
  color: var(--muted);
}

.bottombar {
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-top: 1px solid var(--border);
  background: rgba(10, 14, 20, 0.75);
  backdrop-filter: blur(10px);
}

@media (max-width: 1100px) {
  .layout {
    grid-template-columns: 300px 1fr;
  }
  .panel--right {
    display: none;
  }
}
@media (max-width: 820px) {
  .layout {
    grid-template-columns: 1fr;
    height: auto;
  }
  .panel--left {
    order: 1;
  }
  .panel--center {
    order: 2;
    min-height: 70vh;
  }
  .topbar__search {
    display: none;
  }
}

/* --- Tree item action button + menu --- */
.treeItem {
  position: relative;
}

.treeItem__actions {
  margin-left: auto;
  display: flex;
  gap: 6px;
  opacity: 0;
  pointer-events: none;
}

.treeItem:hover .treeItem__actions,
.treeItem[data-focused="true"] .treeItem__actions,
.treeItem[data-selected="true"] .treeItem__actions {
  opacity: 1;
  pointer-events: auto;
}

.treeActionBtn {
  height: 28px;
  width: 28px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  cursor: pointer;
  display: grid;
  place-items: center;
}
.treeActionBtn:hover {
  border-color: rgba(255, 255, 255, 0.18);
}

.menu {
  position: absolute;
  right: 8px;
  top: calc(100% + 6px);
  min-width: 160px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(10, 14, 20, 0.92);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  z-index: 20;
  overflow: hidden;
}
.menu button {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
}
.menu button:hover {
  background: rgba(255, 255, 255, 0.04);
}
.menu .danger {
  color: rgba(248, 113, 113, 0.95);
}

/* --- Preview surfaces --- */
.previewFrame {
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.15);
  padding: 18px;
  min-height: 420px;
  display: grid;
  place-items: center;
}

.previewImageMock {
  width: min(820px, 100%);
  aspect-ratio: 4 / 5;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  overflow: hidden;
  display: grid;
  place-items: center;
}

.previewTextMock {
  width: min(920px, 100%);
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  padding: 14px;
  overflow: auto;
  max-height: 560px;
}
.previewTextMock pre {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.85);
}

/* --- Modal --- */
.modalOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: grid;
  place-items: center;
  z-index: 50;
  padding: 16px;
}
.modal {
  width: min(520px, 100%);
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(10, 14, 20, 0.92);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  padding: 18px;
}
.modal__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.modal__icon {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  border: 1px solid rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.1);
  display: grid;
  place-items: center;
  font-size: 20px;
}
.modal__title {
  font-size: 16px;
  font-weight: 800;
  margin: 10px 0 6px;
}
.modal__desc {
  color: var(--muted);
  margin: 0 0 14px;
}
.modal__actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.btn--danger {
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.4);
}
.btn--danger:hover {
  border-color: rgba(239, 68, 68, 0.65);
}
