:root {
  --bg: #0f1114;
  --panel: #161a21;
  --panel-alt: #1d2330;
  --line: #2f3f58;
  --text: #e6f1ff;
  --text-subtle: #8ea7c6;
  --accent: #43d5b0;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, #111722 0%, #0b0f16 100%);
  color: var(--text);
  font-family: "Rajdhani", sans-serif;
}

body {
  display: flex;
  flex-direction: column;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 11, 16, 0.72);
  backdrop-filter: blur(10px);
}

h1 {
  margin: 0;
  font-size: 28px;
  letter-spacing: 0.8px;
}

.token-box {
  display: flex;
  gap: 8px;
}

input,
button,
textarea {
  font: inherit;
}

input,
textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0f151f;
  color: var(--text);
}

input {
  padding: 8px 10px;
}

button {
  border: 1px solid #41c8a6;
  background: linear-gradient(120deg, rgba(53, 197, 158, 0.27), rgba(76, 158, 233, 0.28));
  color: #e5fffa;
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

main {
  min-height: 0;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(260px, 320px) 1fr;
}

aside {
  border-right: 1px solid var(--line);
  background: rgba(18, 23, 33, 0.8);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.aside-actions {
  padding: 12px;
  display: grid;
  gap: 8px;
}

#filterInput {
  margin: 0 12px 12px;
}

#fileList {
  margin: 0;
  padding: 0 0 12px;
  list-style: none;
  overflow: auto;
}

#fileList li {
  padding: 8px 12px;
  border-top: 1px solid rgba(47, 63, 88, 0.42);
  cursor: pointer;
  font-family: "Space Mono", monospace;
  font-size: 12px;
}

#fileList li:hover,
#fileList li.active {
  background: rgba(67, 213, 176, 0.13);
}

section {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(26, 32, 44, 0.8);
}

#currentPath {
  font-family: "Space Mono", monospace;
  font-size: 13px;
  color: var(--text-subtle);
}

#editor {
  flex: 1;
  width: 100%;
  border: none;
  border-radius: 0;
  resize: none;
  padding: 14px;
  font-family: "Space Mono", monospace;
  font-size: 13px;
  line-height: 1.5;
  background: #101622;
}

#statusBar {
  margin: 0;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  color: var(--text-subtle);
  font-size: 14px;
}

#statusBar.error {
  color: #ff9f9f;
}

#statusBar.ok {
  color: #95f3d8;
}

@media (max-width: 860px) {
  main {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(200px, 38vh) 1fr;
  }

  aside {
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
}
