:root {
  --app-border: #d8dee8;
  --app-bg: #f5f7fb;
  --panel-bg: #ffffff;
  --item-hover: #edf4ff;
  --item-active: #dcecff;
}

body {
  min-height: 100vh;
  background: var(--app-bg);
  color: #182230;
}

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.login-card {
  width: min(100%, 380px);
  padding: 1.25rem;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  background: #ffffff;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  background: #ffffff;
}

.min-w-0 {
  min-width: 0;
}

.panel {
  background: var(--panel-bg);
  border: 1px solid var(--app-border);
  border-radius: 8px;
  overflow: hidden;
  min-height: 0;
}

.panel-header {
  min-height: 44px;
  padding: 0.625rem 0.875rem;
  border-bottom: 1px solid var(--app-border);
  background: #f9fbff;
  font-weight: 600;
}

.tree-view,
.folder-list {
  max-height: calc(100vh - 190px);
  overflow: auto;
}

.tree-row,
.folder-row {
  width: 100%;
  border: 0;
  border-bottom: 1px solid #eef1f5;
  background: transparent;
  color: inherit;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  text-align: left;
}

.tree-toggle {
  flex: 0 0 1.25rem;
  width: 1.25rem;
  height: 1.25rem;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #475467;
  line-height: 1;
}

.tree-toggle:hover {
  background: #dcecff;
}

.tree-toggle-placeholder {
  flex: 0 0 1.25rem;
  width: 1.25rem;
}

.tree-row:hover,
.folder-row:hover {
  background: var(--item-hover);
}

.tree-row.active,
.folder-row.active {
  background: var(--item-active);
}

.tree-name,
.folder-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.folder-row {
  min-height: 48px;
}

.folder-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
}

.folder-origin {
  overflow: hidden;
  max-width: 100%;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #667085;
  font-size: 0.7rem;
}

.folder-meta {
  margin-left: auto;
  color: #667085;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.action-icon-btn {
  width: 1.875rem;
  height: 1.875rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.action-icon-btn svg {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.modal-current-path {
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #eef1f5;
  color: #667085;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.path-tips {
  position: relative;
}

#pathForm .input-group {
  min-width: 0;
}

.path-tips-menu {
  position: absolute;
  bottom: calc(100% + 0.35rem);
  left: 0;
  z-index: 20;
  display: flex;
  gap: 0.35rem;
  padding: 0.35rem;
  border: 1px solid var(--app-border);
  border-radius: 6px;
  background: #ffffff;
  box-shadow: 0 0.5rem 1rem rgba(16, 24, 40, 0.12);
}

.icon {
  display: block;
  width: 1.25rem;
  height: 1rem;
  border: 1px solid #d39e16;
  border-radius: 2px;
  background: #ffd966;
  position: relative;
  text-align: center;
}

.icon-wrap {
  position: relative;
  flex: 0 0 1.25rem;
  width: 1.25rem;
  height: 1.25rem;
  display: inline-flex;
  align-items: center;
}

.reminder-count {
  position: absolute;
  top: -0.7rem;
  right: -0.55rem;
  min-width: 1.1rem;
  height: 1.1rem;
  border-radius: 999px;
  background: #dc3545;
  color: #ffffff;
  font-size: 0.7rem;
  line-height: 1.1rem;
  text-align: center;
}

.icon::before {
  content: "";
  position: absolute;
  left: 1px;
  top: -4px;
  width: 0.55rem;
  height: 0.35rem;
  border: 1px solid #d39e16;
  border-bottom: 0;
  border-radius: 2px 2px 0 0;
  background: #ffe699;
}

.json-editor {
  min-height: 220px;
  resize: vertical;
}

.typed-fields {
  display: grid;
  gap: 0.5rem;
}

.picker-tree {
  max-height: 60vh;
  overflow: auto;
}

.picker-row {
  width: 100%;
  border: 0;
  border-bottom: 1px solid #eef1f5;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  text-align: left;
}

.picker-row:hover {
  background: var(--item-hover);
}

.typed-field {
  border: 1px solid #e4e7ec;
  border-radius: 6px;
  padding: 0.625rem;
  background: #fcfcfd;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-cell {
  min-height: 72px;
  border: 0;
  border-right: 1px solid #eef1f5;
  border-bottom: 1px solid #eef1f5;
  background: #ffffff;
  padding: 0.5rem;
  text-align: left;
}

.calendar-cell:hover {
  background: var(--item-hover);
}

.calendar-cell.muted {
  color: #98a2b3;
  background: #fcfcfd;
}

.calendar-day-number {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
}

.calendar-reminder-count {
  display: inline-block;
  margin-top: 0.4rem;
}

.typed-field-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.typed-field-title-main {
  min-width: 0;
  overflow-wrap: anywhere;
}

.typed-field-remove {
  margin-left: auto;
}

.typed-field-value {
  margin-top: 0.35rem;
  color: #475467;
  font-size: 0.85rem;
  overflow-wrap: anywhere;
}

.asset-preview {
  display: block;
  max-width: 100%;
  max-height: 180px;
  border-radius: 6px;
  border: 1px solid #e4e7ec;
  background: #ffffff;
}

.query-output {
  min-height: 260px;
  max-height: calc(100vh - 540px);
  overflow: auto;
  padding: 0.875rem;
  background: #101828;
  color: #e7eefc;
  font-size: 0.82rem;
}

.empty-state {
  padding: 1rem;
  color: #667085;
}

@media (max-width: 991.98px) {
  .tree-view,
  .folder-list,
  .query-output {
    max-height: none;
  }
}
