@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;600;700;800&display=swap");

:root {
  --bg: #f5f7f2;
  --bg-2: #d9ece5;
  --panel: #ffffff;
  --ink: #18242d;
  --ink-soft: #44515b;
  --line: #d6e1de;
  --accent: #0f8f74;
  --accent-dark: #0b6c58;
  --warn: #d54332;
  --info-bg: #ebf5ff;
  --error-bg: #fdeeee;
  --shadow: 0 20px 50px rgba(16, 33, 48, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", "Segoe UI", "Tahoma", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 10% 10%, #f8fff7 0%, var(--bg) 40%, var(--bg-2) 100%);
}

h1,
h2,
p {
  margin: 0;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-size: 0.78rem;
  color: var(--ink-soft);
}

.login-page {
  position: relative;
  overflow: hidden;
}

.bg-shape {
  position: fixed;
  border-radius: 999px;
  filter: blur(4px);
  pointer-events: none;
}

.bg-shape-left {
  width: 420px;
  height: 420px;
  background: #9ad8ba;
  top: -140px;
  left: -100px;
  opacity: 0.6;
}

.bg-shape-right {
  width: 360px;
  height: 360px;
  background: #ffcf99;
  right: -110px;
  bottom: -120px;
  opacity: 0.55;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
}

.auth-card {
  width: min(460px, 94vw);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  box-shadow: var(--shadow);
  padding: 2rem;
}

.auth-head {
  display: grid;
  gap: 0.7rem;
  margin-bottom: 1.2rem;
}

.auth-head h1 {
  font-size: 2rem;
  font-weight: 800;
}

.auth-head p {
  color: var(--ink-soft);
}

.auth-form {
  display: grid;
  gap: 0.6rem;
}

label {
  font-weight: 700;
  margin-top: 0.3rem;
}

input {
  width: 100%;
  border: 1px solid #bfcfd1;
  border-radius: 0.7rem;
  padding: 0.72rem 0.85rem;
  font: inherit;
  background: #fff;
}

input:focus {
  outline: 2px solid #87cab6;
  border-color: #87cab6;
}

.btn {
  border: none;
  border-radius: 0.75rem;
  padding: 0.7rem 1rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.16s ease, filter 0.16s ease, background-color 0.16s ease;
}

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

.btn:disabled {
  cursor: not-allowed;
  transform: none;
  opacity: 0.45;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, #14a083 100%);
  color: #fff;
}

.btn-primary:hover {
  filter: brightness(1.05);
}

.btn-outline {
  background: #fff;
  border: 1px solid #b7c9c4;
  color: #23423c;
}

.btn-outline:hover {
  background: #f4faf8;
}

.btn-ghost {
  background: #eef4f1;
  color: #2f4c43;
}

.alert {
  border-radius: 0.75rem;
  border: 1px solid transparent;
  padding: 0.75rem 0.9rem;
  font-weight: 600;
  margin-top: 0.7rem;
}

.alert.info {
  background: var(--info-bg);
  border-color: #b8d7f6;
  color: #1f486f;
}

.alert.error {
  background: var(--error-bg);
  border-color: #efbbbb;
  color: #8f2d21;
}

.alert.success {
  background: #eafbf1;
  border-color: #b3e7c4;
  color: #1f6b41;
}

.upload-page {
  padding: 1.3rem;
}

.topbar {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 1rem;
  box-shadow: var(--shadow);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.topbar h1 {
  font-size: 1.8rem;
  margin-top: 0.2rem;
}

.userline {
  margin-top: 0.25rem;
  color: var(--ink-soft);
}

.panel-grid {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 1rem;
  box-shadow: var(--shadow);
  padding: 1rem;
  display: grid;
  gap: 0.8rem;
}

.panel > p {
  color: var(--ink-soft);
}

.panel-full {
  grid-column: 1 / -1;
}

.drop-zone {
  border: 2px dashed #8fbdb2;
  border-radius: 1rem;
  min-height: 170px;
  display: grid;
  place-content: center;
  text-align: center;
  padding: 1rem;
  background: linear-gradient(160deg, #f3fdf8, #ecf8f2);
  color: #22433b;
  transition: border-color 0.16s ease, transform 0.16s ease;
}

.drop-zone p {
  font-weight: 800;
  font-size: 1.12rem;
}

.drop-zone small {
  color: #406359;
  margin-top: 0.2rem;
}

.drop-zone.active {
  border-color: var(--accent);
  transform: scale(1.01);
}

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

.summary p {
  color: var(--ink-soft);
}

.progress-wrap {
  width: 100%;
  height: 14px;
  border-radius: 999px;
  border: 1px solid #b7ccc7;
  background: #f4fbf9;
  overflow: hidden;
}

.progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #1f9d80, #29b18f);
  transition: width 0.14s linear;
}

.progress-text {
  font-weight: 700;
}

.table-wrap {
  overflow: auto;
  border: 1px solid #d3e0dc;
  border-radius: 0.8rem;
}

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

th,
td {
  text-align: left;
  padding: 0.65rem 0.7rem;
  border-bottom: 1px solid #e2ece9;
  font-size: 0.93rem;
}

th {
  background: #edf5f2;
  position: sticky;
  top: 0;
  z-index: 1;
}

td.path-cell {
  font-family: "Consolas", "Courier New", monospace;
  font-size: 0.86rem;
}

.state {
  font-weight: 700;
}

.state.pending {
  color: #335f8a;
}

.state.uploading {
  color: #9a5c0d;
}

.state.done {
  color: #1e703f;
}

.state.error {
  color: #9d2f24;
}

/* --- File Browser --- */

.uploads-loading,
.uploads-empty,
.uploads-error {
  color: var(--ink-soft);
  font-weight: 600;
}

.uploads-error {
  color: var(--warn);
}

.ub-folder {
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  overflow: hidden;
}

.ub-folder + .ub-folder {
  margin-top: 0.5rem;
}

.ub-folder-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.75rem;
  background: #f5faf8;
}

.ub-toggle {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--ink-soft);
  padding: 0.2rem;
  line-height: 1;
  flex-shrink: 0;
}

.ub-folder-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.6rem;
}

.ub-folder-name {
  font-family: "Consolas", "Courier New", monospace;
  font-weight: 700;
  font-size: 0.92rem;
}

.ub-folder-meta {
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.btn-delete {
  border: 1px solid #e0b4b0;
  background: #fff;
  color: var(--warn);
  font-weight: 700;
  cursor: pointer;
  border-radius: 0.5rem;
  transition: background-color 0.14s ease;
  flex-shrink: 0;
}

.btn-delete:hover {
  background: var(--error-bg);
}

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

.btn-delete-folder {
  padding: 0.35rem 0.7rem;
  font-size: 0.82rem;
}

.btn-delete-file {
  padding: 0.15rem 0.45rem;
  font-size: 0.78rem;
  line-height: 1;
}

.ub-folder-files {
  border-top: 1px solid var(--line);
}

.ub-file {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem 0.4rem 2.2rem;
  border-bottom: 1px solid #eef3f1;
}

.ub-file:last-child {
  border-bottom: none;
}

.ub-file-path {
  flex: 1;
  min-width: 0;
  font-family: "Consolas", "Courier New", monospace;
  font-size: 0.84rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ub-file-size {
  color: var(--ink-soft);
  font-size: 0.82rem;
  white-space: nowrap;
}

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

  .upload-page {
    padding: 0.75rem;
  }

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