:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --line: #d8dee6;
  --line-soft: #e7ecf1;
  --text: #1f2937;
  --muted: #5b6777;
  --primary: #0a66d1;
  --primary-dark: #084ea3;
  --secondary: #3d4b5f;
  --tree: #eef3f8;
  font-family: "Segoe UI", Tahoma, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: radial-gradient(circle at top left, #f9fbfd, var(--bg) 42%);
  color: var(--text);
}

.container {
  max-width: 1220px;
  margin: 1.2rem auto 2rem;
  padding: 0 1rem;
}

.page-head h1 {
  margin-bottom: 0.2rem;
}

.sub {
  margin: 0;
  color: var(--muted);
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem;
  margin-top: 1rem;
}

.hidden {
  display: none !important;
}

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

.row-right,
.row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.badge {
  background: #e4edf8;
  color: #17446f;
  border-radius: 999px;
  padding: 0.28rem 0.65rem;
  font-size: 0.84rem;
}

input,
select,
button {
  border: 1px solid #c3cddd;
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
  font: inherit;
}

button {
  background: var(--primary);
  color: #fff;
  border: none;
  cursor: pointer;
}

button:hover {
  background: var(--primary-dark);
}

.btn-secondary {
  background: var(--secondary);
}

.msg {
  margin-top: 0.5rem;
  color: var(--primary-dark);
}

.explorer-shell {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 0;
  overflow: hidden;
  padding: 0;
}

.tree-panel {
  border-right: 1px solid var(--line);
  background: var(--tree);
  padding: 0.8rem;
  min-height: 540px;
}

.tree-panel h3 {
  margin: 0.2rem 0 0.8rem;
}

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

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

.tree-list > li {
  margin: 0.15rem 0;
}

.tree-item {
  width: 100%;
  text-align: left;
  padding: 0.36rem 0.42rem;
  background: transparent;
  color: #213247;
  border-radius: 6px;
}

.tree-item:hover {
  background: #dbe7f3;
}

.tree-item.active {
  background: #c9dcf2;
  font-weight: 600;
}

.content-panel {
  padding: 0.8rem 1rem 1rem;
  min-height: 540px;
}

.breadcrumb {
  font-size: 0.95rem;
  color: #1f4063;
  margin-bottom: 0.55rem;
  padding: 0.35rem 0.55rem;
  background: #eef4fb;
  border-radius: 8px;
}

.drop-zone {
  margin-bottom: 0.8rem;
  border: 2px dashed #b8c6d8;
  border-radius: 10px;
  padding: 0.85rem;
  text-align: center;
  color: #4a6178;
  background: #f8fbff;
}

.drop-zone.drag-over {
  border-color: #1a70d4;
  background: #e9f2ff;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 0.55rem;
  border-bottom: 1px solid var(--line-soft);
}

.context-menu {
  position: fixed;
  z-index: 2000;
  min-width: 190px;
  background: #fff;
  border: 1px solid #c8d2dd;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  padding: 0.25rem;
}

.context-menu button {
  width: 100%;
  text-align: left;
  background: transparent;
  color: #1e2f43;
  border-radius: 6px;
}

.context-menu button:hover {
  background: #eaf2fc;
}

ul {
  margin-top: 0.4rem;
  padding-left: 1.2rem;
}

@media (max-width: 900px) {
  .explorer-shell {
    grid-template-columns: 1fr;
  }

  .tree-panel {
    min-height: 250px;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }

  .content-panel {
    min-height: 360px;
  }
}

@media (max-width: 720px) {
  table,
  thead,
  tbody,
  th,
  td,
  tr {
    display: block;
  }

  thead {
    display: none;
  }

  td {
    border: none;
    padding: 0.35rem 0;
  }

  .row-between {
    flex-direction: column;
    align-items: flex-start;
  }
}

.btn-link {
  display: inline-block;
  text-decoration: none;
  color: #17446f;
  background: #dfeaf8;
  border: 1px solid #c4d7f3;
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  font-weight: 600;
}

.btn-link:hover {
  background: #cfe2fb;
}
