@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=IBM+Plex+Sans:wght@400;500&display=swap");

:root {
  --bg-dark: #0f1417;
  --bg-light: #f6f4ef;
  --card: rgba(255, 255, 255, 0.78);
  --card-strong: rgba(255, 255, 255, 0.9);
  --accent: #f06a2b;
  --accent-soft: #ffd7c3;
  --ink: #1d1f23;
  --muted: #6b6f76;
  --line: rgba(29, 31, 35, 0.1);
  --shadow: 0 20px 60px rgba(16, 17, 20, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", "IBM Plex Sans", sans-serif;
  background: radial-gradient(circle at top left, #fbe4d5 0%, #f6f4ef 45%, #e4f0ef 100%);
  color: var(--ink);
  min-height: 100vh;
}

.mesh {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 15% 20%, rgba(240, 106, 43, 0.2), transparent 35%),
    radial-gradient(circle at 85% 15%, rgba(35, 125, 117, 0.18), transparent 30%),
    radial-gradient(circle at 50% 80%, rgba(15, 52, 96, 0.15), transparent 40%);
  z-index: -1;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 48px 16px;
}

.brand {
  display: flex;
  gap: 16px;
  align-items: center;
}

.brand-mark {
  font-weight: 700;
  font-size: 1.1rem;
  padding: 10px 12px;
  background: var(--accent);
  color: white;
  border-radius: 12px;
  letter-spacing: 0.08em;
}

.brand-title {
  font-size: 1.4rem;
  font-weight: 700;
}

.brand-sub {
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 0.95rem;
  color: var(--muted);
}

.top-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.user-pill {
  padding: 6px 12px;
  background: var(--card);
  border-radius: 999px;
  box-shadow: var(--shadow);
  font-size: 0.9rem;
}

.page {
  padding: 16px 48px 60px;
}

.flash-stack {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.flash {
  padding: 12px 16px;
  background: var(--card);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.flash-error {
  border-left: 4px solid #d9534f;
}

.flash-success {
  border-left: 4px solid #2f8f76;
}

.auth {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 120px);
}

.auth-card {
  background: var(--card-strong);
  padding: 40px;
  border-radius: 24px;
  box-shadow: var(--shadow);
  max-width: 420px;
  width: 100%;
  animation: floatIn 0.6s ease;
}

.auth-card h1 {
  margin-top: 0;
}

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

.auth-form {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

label {
  display: grid;
  gap: 8px;
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 0.95rem;
}

input,
select,
button {
  font-family: inherit;
}

input,
select {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: white;
}

.primary-btn {
  background: var(--accent);
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(240, 106, 43, 0.2);
}

.ghost-btn {
  background: var(--card);
  border: 1px solid transparent;
  padding: 8px 14px;
  border-radius: 12px;
  cursor: pointer;
  transition: border 0.2s ease, transform 0.2s ease;
}

.ghost-btn:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.ghost-btn.full {
  width: 100%;
  text-align: left;
}

.ghost-btn.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.dashboard {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 28px;
  animation: floatIn 0.6s ease;
}

.sidebar {
  display: grid;
  gap: 20px;
}

.panel {
  background: var(--card);
  padding: 18px;
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.panel h2,
.panel h1 {
  margin-top: 0;
}

.usage {
  display: grid;
  gap: 12px;
}

.usage .label {
  font-size: 0.85rem;
  color: var(--muted);
}

.usage .value {
  font-weight: 600;
}

.quota-note,
.hint {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 10px;
}

.inline-form {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.pool-list {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.collapsible {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(-6px);
  padding: 0;
  border: 0;
  transition: max-height 0.35s ease, opacity 0.3s ease, transform 0.3s ease;
}

.collapsible.is-open {
  max-height: 600px;
  opacity: 1;
  transform: translateY(0);
}

.workspace {
  background: var(--card-strong);
  border-radius: 24px;
  padding: 20px 24px 28px;
  box-shadow: var(--shadow);
  min-height: 560px;
  display: grid;
  gap: 20px;
}

.workspace-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

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

.file-input input {
  display: none;
}

.breadcrumb {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.crumb {
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-family: "IBM Plex Sans", sans-serif;
}

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

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

.dropzone {
  border: 2px dashed rgba(29, 31, 35, 0.2);
  border-radius: 18px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.4);
  text-align: center;
  transition: border 0.2s ease, background 0.2s ease;
}

.dropzone.is-active {
  border-color: var(--accent);
  background: rgba(240, 106, 43, 0.08);
}

.dropzone-inner h3 {
  margin: 0 0 6px;
}

.status {
  font-size: 0.9rem;
  color: var(--muted);
}

.status[data-tone="success"] {
  color: #2f8f76;
}

.status[data-tone="error"] {
  color: #d9534f;
}

.warning {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(217, 83, 79, 0.12);
  color: #b3423e;
  font-size: 0.9rem;
}

.is-hidden {
  display: none !important;
}

.share-panel {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  display: grid;
  gap: 12px;
}

.share-panel.collapsible {
  border: 0;
  padding: 0;
}

.share-panel h3 {
  margin: 0;
}

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

.transfer {
  padding: 12px 14px;
  border-radius: 14px;
  background: white;
  border: 1px solid var(--line);
}

.transfer-title {
  font-weight: 600;
}

.transfer-meta {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 4px;
}

.transfer-bar {
  height: 6px;
  background: rgba(29, 31, 35, 0.08);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 8px;
}

.transfer-progress {
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.2s ease;
}

.transfer.is-done .transfer-progress {
  background: #2f8f76;
}

.transfer.is-error .transfer-progress {
  background: #d9534f;
}

.transfer.is-error .transfer-meta {
  color: #d9534f;
}

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

.file-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 16px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 14px;
  background: white;
  border: 1px solid var(--line);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.file-row.folder {
  grid-template-columns: auto 1fr auto;
  background: rgba(255, 255, 255, 0.9);
  border-left: 4px solid var(--accent);
}

.file-row:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(31, 37, 43, 0.08);
}

.file-row.is-selected {
  border-color: var(--accent);
  background: rgba(240, 106, 43, 0.08);
}

.file-row.is-drop-target {
  border-color: #2f8f76;
  background: rgba(47, 143, 118, 0.12);
}

.select-box {
  width: 16px;
  height: 16px;
}

.file-name {
  font-weight: 600;
  display: flex;
  gap: 8px;
  align-items: center;
}

.file-row.folder .file-name::before {
  content: "[DIR]";
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.file-row:not(.folder) .file-name::before {
  content: "[FILE]";
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.file-size {
  color: var(--muted);
  font-size: 0.9rem;
}

.file-actions {
  display: flex;
  gap: 8px;
}

.selection-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--line);
}

.selection-count {
  font-weight: 600;
}

.selection-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.preview-panel {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
}

.preview-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.preview-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.preview-meta {
  color: var(--muted);
  font-size: 0.85rem;
}

.preview-body {
  min-height: 120px;
}

.preview-media {
  max-width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
}

.editor {
  width: 100%;
  min-height: 240px;
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 12px;
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 0.95rem;
}

.pool-card {
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
}

.pool-header {
  display: grid;
  gap: 8px;
}

.pool-toggle {
  justify-self: start;
}

.pool-details.is-open {
  margin-top: 8px;
  padding-top: 6px;
}

.share-panel.collapsible.is-open {
  padding: 16px;
  border: 1px solid var(--line);
}

#pool-create-panel.is-open {
  padding-top: 12px;
}

.pool-members {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.member-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.member-pill {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(29, 31, 35, 0.08);
  font-size: 0.8rem;
}
.pool-meta {
  font-size: 0.85rem;
  color: var(--muted);
}

.empty {
  padding: 30px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 18px;
}

.admin {
  display: grid;
  gap: 24px;
}

.admin-form .grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.checkbox {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 0.9rem;
}

.table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-family: "IBM Plex Sans", sans-serif;
}

.admin-table th,
.admin-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.row-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  align-items: center;
}

[data-tooltip] {
  position: relative;
}

[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #1d1f23;
  color: white;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 0.75rem;
  white-space: nowrap;
  z-index: 10;
}

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

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

  .topbar {
    padding: 18px 24px 8px;
  }

  .page {
    padding: 12px 24px 40px;
  }

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