:root {
  --bg: #f6f1e9;
  --ink: #1b1b1b;
  --muted: #6a6a6a;
  --card: #fff7ee;
  --accent: #0d4b55;
  --accent-2: #d36b2b;
  --border: #d9cbb8;
  --mono: "JetBrains Mono", "Fira Code", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --sans: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: radial-gradient(1200px 600px at 10% -10%, #ffe6c7 0%, transparent 60%),
              radial-gradient(900px 500px at 90% 0%, #d9f0f2 0%, transparent 55%),
              var(--bg);
}

.page {
  max-width: 980px;
  margin: 0 auto;
  padding: 32px 20px 60px;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

h1 {
  margin: 0 0 6px;
  font-size: 32px;
  letter-spacing: 0.2px;
}

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

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 18px 16px;
  margin-bottom: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
}

.card h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.tablist {
  display: inline-flex;
  gap: 8px;
  margin: 4px 0 14px;
  padding: 6px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #f9efe0;
}

.tab {
  border: 1px solid transparent;
  background: transparent;
  color: #4a4a4a;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
}

.tab.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.tabpanel.is-hidden {
  display: none;
}

.row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.file-nav {
  margin-bottom: 10px;
}

label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

input {
  padding: 10px 12px;
  min-width: 160px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 14px;
  color: var(--ink);
}

input.wide {
  min-width: 360px;
  flex: 1;
}

.btn {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--ink);
  padding: 10px 16px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
}

.btn.primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn.danger {
  background: #3a1f23;
  color: #ffd9df;
  border-color: #5f2f36;
}

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

.status {
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
}

.hint {
  font-size: 12px;
  color: var(--muted);
}

.terminal {
  border: 1px solid #2a3536;
  border-radius: 12px;
  overflow: hidden;
  background: #0a0f10;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(180deg, #2b3334 0%, #202829 100%);
  border-bottom: 1px solid #3a4748;
  padding: 8px 10px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.dot-red {
  background: #ff6b6b;
}

.dot-yellow {
  background: #ffd166;
}

.dot-green {
  background: #4ade80;
}

.terminal-title {
  margin-left: 6px;
  color: #c3d3d5;
  font-family: var(--mono);
  font-size: 12px;
}

.log {
  margin: 0;
  background: radial-gradient(1400px 300px at 10% -30%, rgba(76, 175, 80, 0.08) 0%, transparent 70%), #0c1213;
  color: #b6ffcc;
  padding: 14px;
  min-height: 260px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.file-log {
  margin: 0;
  border-radius: 12px;
  border: 1px solid #c6d5d8;
  background: #eef7f8;
  color: #17323a;
  padding: 12px;
  height: 180px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.file-table-wrap {
  border-top: 1px solid #d7dde3;
  border-bottom: 1px solid #d7dde3;
  border-radius: 0;
  background: #f3f5f7;
  overflow: auto;
  margin-bottom: 10px;
}

.file-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--sans);
  font-size: 14px;
}

.file-table th,
.file-table td {
  padding: 14px 12px;
  border-bottom: 1px solid #dbe1e6;
  text-align: left;
}

.file-table thead th {
  position: sticky;
  top: 0;
  background: #f3f5f7;
  color: #5f7186;
  font-weight: 700;
  z-index: 1;
}

.file-table tbody tr {
  cursor: pointer;
  background: #f3f5f7;
}

.file-table tbody tr:hover {
  background: #e9eef3;
}

.file-table tbody tr.is-selected {
  background: #dde8f3;
}

.name-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  color: #1f334b;
}

.entry-icon {
  width: 28px;
  text-align: center;
  font-size: 20px;
}

.file-manager-card {
  padding: 0;
  overflow: hidden;
  background: #f3f5f7;
}

.file-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid #d7dde3;
  background: #f3f5f7;
}

.file-header h2 {
  margin: 0;
}

.file-toolbar {
  display: flex;
  gap: 10px;
}

.toolbar-btn {
  background: #f1f3f5;
  border-color: #cfd6dd;
  color: #1e2f44;
  border-radius: 12px;
  min-width: 88px;
}

.toolbar-btn:disabled {
  color: #9aa7b5;
}

.file-path-row {
  padding: 8px 18px 0;
}

.file-manager-card .row {
  padding: 8px 18px 14px;
}

.file-breadcrumb {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 18px;
  border-bottom: 1px solid #d7dde3;
  background: #f3f5f7;
}

.dir-input {
  flex: 1;
  min-width: 260px;
  border-radius: 10px;
  border: 1px solid #cfd6dd;
  background: #edf2f6;
  padding: 9px 12px;
  font-family: var(--mono);
  font-size: 13px;
  color: #2a3f59;
}

.file-manager-card .toolbar-btn {
  background: #edf2f6;
}

.app-table-wrap {
  border-top: 1px solid #d7dde3;
  border-bottom: 1px solid #d7dde3;
  background: #f3f5f7;
  overflow: auto;
  margin-top: 10px;
  max-height: 320px;
}

.app-table tbody tr {
  cursor: pointer;
}

.is-hidden {
  display: none;
}

.actions {
  display: flex;
  gap: 10px;
}

.app-row {
  margin-top: 10px;
}

#panelApps .card {
  animation: cardFadeIn 180ms ease-out;
}

@keyframes cardFadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 720px) {
  .header {
    flex-direction: column;
    align-items: flex-start;
  }

  input.wide {
    min-width: 100%;
  }
}
