:root {
  color-scheme: dark;
  --bg: #05060a;
  --surface: #101218;
  --surface-alt: #151823;
  --accent: #6f8dfd;
  --accent-alt: #a076f9;
  --border: rgba(255, 255, 255, 0.08);
  --danger: #ff5572;
  --text: #f4f6fb;
  --muted: #a1a6c2;
  --radius: 18px;
  --transition: 200ms ease;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top, rgba(111, 141, 253, 0.2), transparent),
    linear-gradient(120deg, #05060a 30%, #090b11 70%);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

#app {
  width: min(1200px, 100%);
}

.hidden {
  display: none !important;
}

.card {
  background: rgba(16, 18, 24, 0.85);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  box-shadow: 0 20px 60px rgba(5, 6, 10, 0.65);
  backdrop-filter: blur(16px);
  display: grid;
  gap: 1.5rem;
}

.card h1 {
  margin: 0;
}

.login-form {
  display: grid;
  gap: 0.8rem;
}

.login-form input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
  color: var(--text);
  font-size: 1rem;
}

.login-form button {
  border: none;
  cursor: pointer;
  background: linear-gradient(120deg, var(--accent), var(--accent-alt));
  color: var(--text);
  font-weight: 600;
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius);
  transition: transform var(--transition), box-shadow var(--transition);
}

.login-form button:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 30px rgba(111, 141, 253, 0.35);
}

.app-header {
  background: rgba(15, 17, 24, 0.9);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}

.app-header h1 {
  margin: 0 0 0.3rem 0;
}

.header-actions {
  display: flex;
  gap: 0.5rem;
}

.disk-usage {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  background: rgba(15, 17, 24, 0.8);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.8rem 1rem;
  margin-bottom: 1rem;
}

.disk-bar {
  flex: 1;
  min-width: 150px;
  height: 6px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  overflow: hidden;
}

.disk-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(120deg, var(--accent), var(--accent-alt));
  transition: width 200ms ease;
}

button {
  font-family: inherit;
}

.text-button {
  background: none;
  border: none;
  color: var(--text);
  padding: 0;
  cursor: pointer;
  font-size: 0.95rem;
}

.text-button:hover {
  color: var(--accent);
}

.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  padding: 0.7rem 1rem;
  cursor: pointer;
  transition: background var(--transition), border var(--transition);
}

.ghost:hover {
  border-color: var(--accent);
  background: rgba(111, 141, 253, 0.1);
}

.danger {
  border: none;
  background: rgba(255, 85, 114, 0.15);
  color: var(--danger);
  border-radius: var(--radius);
  padding: 0.7rem 1rem;
  cursor: pointer;
}

.danger:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.breadcrumbs button {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  padding: 0.2rem 0.8rem;
  cursor: pointer;
}

.layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 1rem;
}

.panel {
  background: rgba(15, 17, 24, 0.85);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.panel-header h2 {
  margin: 0;
}

.tree {
  max-height: 500px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.tree ul {
  list-style: none;
  margin: 0;
  padding-left: 1rem;
}

.tree li {
  padding: 0.2rem 0;
}

.tree button {
  background: none;
  border: none;
  color: inherit;
  text-align: left;
  width: 100%;
  padding: 0.2rem 0.4rem;
  border-radius: 10px;
  cursor: pointer;
}

.tree button:hover,
.tree button.active {
  background: rgba(111, 141, 253, 0.15);
  color: var(--accent);
}

.tree button.drop-target {
  border: 1px dashed var(--accent);
  background: rgba(111, 141, 253, 0.1);
}

.full-width {
  width: 100%;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.section-header h2,
.section-header h3 {
  margin: 0;
}

.table-wrapper {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
}

th,
td {
  padding: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  text-align: left;
}

tbody tr:hover {
  background: rgba(111, 141, 253, 0.05);
}

.droppable-row {
  outline: 1px dashed var(--accent);
  background: rgba(111, 141, 253, 0.05);
}

.entry-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.pill {
  padding: 0.15rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.8rem;
  text-transform: capitalize;
}

.upload-area {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  background: rgba(21, 24, 35, 0.6);
  transition: border var(--transition), background var(--transition);
}

.upload-area.dragging {
  border-color: var(--accent);
  background: rgba(111, 141, 253, 0.1);
}

.upload-area .link {
  color: var(--accent);
  cursor: pointer;
  font-weight: 600;
}

.tasks {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}

.task-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.task {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(16, 18, 25, 0.8);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 0.9rem;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.progress {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  overflow: hidden;
}

.progress span {
  display: block;
  height: 100%;
  background: linear-gradient(120deg, var(--accent), var(--accent-alt));
  width: 0%;
  transition: width 150ms linear;
}

.task button {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  border-radius: 12px;
  padding: 0.2rem 0.8rem;
  cursor: pointer;
}

.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: rgba(5, 6, 10, 0.95);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.8rem 1.2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition), transform var(--transition);
  transform: translateY(10px);
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .tree-panel {
    order: 2;
  }
}

@media (max-width: 600px) {
  body {
    padding: 1rem 0.5rem;
  }

  .card {
    padding: 1.5rem;
  }

  table {
    min-width: 100%;
  }

  th:nth-child(3),
  td:nth-child(3),
  th:nth-child(4),
  td:nth-child(4),
  th:nth-child(5),
  td:nth-child(5) {
    display: none;
  }
}
