:root {
  color-scheme: dark;
  --bg: #07111c;
  --bg-2: #0c1724;
  --panel: rgba(14, 24, 38, 0.9);
  --panel-2: rgba(18, 31, 47, 0.94);
  --line: rgba(255, 255, 255, 0.08);
  --text: #edf4fb;
  --muted: #91a4bb;
  --accent: #62f2d2;
  --accent-2: #ffb44d;
  --danger: #ff6d7a;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(98, 242, 210, 0.12), transparent 28%),
    radial-gradient(circle at 80% 0%, rgba(255, 180, 77, 0.12), transparent 28%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
  color: var(--text);
  font-family: "Segoe UI Variable", "SF Pro Display", "Aptos", "Trebuchet MS", sans-serif;
}

body {
  position: relative;
  overflow-x: hidden;
}

.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0));
}

.hidden {
  display: none !important;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
}

.muted {
  color: var(--muted);
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
  padding: 28px;
}

.auth-panel,
.login-card,
.panel,
.sidebar {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.auth-panel {
  display: flex;
  align-items: end;
  padding: 36px;
  min-height: calc(100vh - 56px);
  background:
    linear-gradient(140deg, rgba(8, 18, 30, 0.78), rgba(11, 27, 43, 0.72)),
    radial-gradient(circle at top right, rgba(98, 242, 210, 0.12), transparent 32%),
    radial-gradient(circle at bottom left, rgba(255, 180, 77, 0.12), transparent 28%);
}

.brand-mark {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  color: #04131a;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), #d7fff6);
  box-shadow: 0 16px 40px rgba(98, 242, 210, 0.24);
}

.auth-copy h1 {
  margin: 0 0 14px;
  font-size: clamp(2.4rem, 4vw, 4.8rem);
  line-height: 0.96;
  max-width: 8ch;
}

.lede {
  max-width: 52ch;
  color: #c7d5e4;
  font-size: 1.05rem;
  line-height: 1.6;
}

.feature-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.feature-row span,
.pill {
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  color: #e4eef9;
}

.login-card {
  align-self: center;
  padding: 28px;
  display: grid;
  gap: 14px;
}

.login-card h2,
.panel h3,
.topbar h3,
.sidebar h2 {
  margin: 0;
}

label {
  display: grid;
  gap: 8px;
  font-size: 0.95rem;
  color: #d7e4f1;
}

input,
select,
button {
  font: inherit;
}

input,
select {
  width: 100%;
  min-height: 46px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(5, 12, 20, 0.7);
  color: var(--text);
  padding: 0 14px;
  outline: none;
}

input:focus,
select:focus {
  border-color: rgba(98, 242, 210, 0.55);
  box-shadow: 0 0 0 4px rgba(98, 242, 210, 0.12);
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease, background 0.15s ease;
}

button:hover {
  transform: translateY(-1px);
}

.primary-btn,
.tool-btn {
  background: linear-gradient(135deg, var(--accent), #9df7e5);
  color: #04131a;
  font-weight: 700;
  padding: 0 16px;
}

.ghost-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 0 14px;
}

.hint,
.error,
.status-line {
  margin: 0;
  font-size: 0.92rem;
}

.status-line {
  min-height: 1.2em;
  padding: 0 4px;
}

.error {
  color: var(--danger);
  min-height: 1.2em;
}

.app-shell {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
  min-height: 100vh;
}

.sidebar {
  padding: 18px;
  display: grid;
  gap: 18px;
  align-content: start;
}

.sidebar-head,
.section-title,
.panel-head,
.topbar,
.dialog-actions,
.topbar-actions,
.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.stats-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stat {
  padding: 14px;
  border-radius: 14px;
  background: var(--panel-2);
  border: 1px solid var(--line);
}

.stat strong {
  display: block;
  font-size: 1.1rem;
  margin-top: 4px;
}

.side-section {
  display: grid;
  gap: 10px;
}

.folder-list {
  display: grid;
  gap: 6px;
  max-height: 38vh;
  overflow: auto;
}

.folder-item,
.activity-item {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.folder-item.active {
  background: rgba(98, 242, 210, 0.12);
  border-color: rgba(98, 242, 210, 0.4);
}

.workspace {
  display: grid;
  gap: 18px;
  align-content: start;
}

.topbar {
  padding: 4px 4px 0;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  color: #cde0ee;
}

.breadcrumbs button {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
}

.dropzone {
  min-height: 130px;
  border-radius: var(--radius);
  border: 1px dashed rgba(98, 242, 210, 0.28);
  background: rgba(11, 25, 38, 0.72);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
}

.dropzone.dragover {
  background: rgba(98, 242, 210, 0.08);
  border-color: rgba(98, 242, 210, 0.6);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) 360px;
  gap: 18px;
}

.panel {
  padding: 18px;
}

.table-panel {
  min-height: 58vh;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}

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

tbody tr {
  cursor: pointer;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.item-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.tiny-btn {
  min-height: 34px;
  padding: 0 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border: 1px solid var(--line);
}

.details-panel {
  display: grid;
  gap: 12px;
}

.detail-view {
  display: grid;
  gap: 14px;
}

.preview {
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.preview img {
  display: block;
  width: 100%;
  height: auto;
}

.settings-form {
  display: grid;
  gap: 18px;
}

.form-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
}

.check-row input {
  width: auto;
  min-height: 0;
}

.activity-list {
  display: grid;
  gap: 10px;
}

.dialog {
  border: 0;
  background: transparent;
  padding: 0;
}

.dialog::backdrop {
  background: rgba(0, 0, 0, 0.64);
  backdrop-filter: blur(5px);
}

.dialog-card {
  width: min(560px, calc(100vw - 28px));
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 22px;
  display: grid;
  gap: 14px;
}

.dialog-card input {
  display: block;
}

.status-ok {
  color: var(--accent);
}

.status-bad {
  color: var(--danger);
}

@media (max-width: 1100px) {
  .auth-screen,
  .app-shell,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    order: 2;
  }
}

@media (max-width: 720px) {
  .auth-screen,
  .app-shell {
    padding: 12px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .topbar,
  .sidebar-head,
  .panel-head,
  .dropzone,
  .sidebar {
    gap: 14px;
  }

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

  .topbar-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .search-box {
    width: 100%;
  }
}
