:root {
  --bg: #f3f0e8;
  --panel: rgba(255, 255, 255, 0.92);
  --panel-border: rgba(76, 54, 29, 0.12);
  --text: #231a12;
  --muted: #6c5b4b;
  --accent: #005f73;
  --accent-strong: #0a9396;
  --danger: #ae2012;
  --shadow: 0 18px 40px rgba(35, 26, 18, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(10, 147, 150, 0.16), transparent 28%),
    radial-gradient(circle at top right, rgba(238, 155, 0, 0.14), transparent 24%),
    linear-gradient(180deg, #f8f4ed 0%, var(--bg) 100%);
  min-height: 100vh;
}

.page-shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 32px 20px 48px;
}

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

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

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(76, 54, 29, 0.12);
  box-shadow: 0 10px 24px rgba(35, 26, 18, 0.06);
}

.user-chip-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.user-chip-role {
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(0, 95, 115, 0.12);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

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

h1,
h2 {
  margin: 0;
}

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

.card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.auth-card {
  max-width: 460px;
  margin: 72px auto 0;
  padding: 32px;
}

.browser-card {
  padding: 28px;
}

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

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.breadcrumbs a,
.link-button,
.ghost-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.flash-stack {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.flash {
  border-radius: 16px;
  padding: 14px 16px;
  font-weight: 600;
}

.flash-success {
  background: rgba(10, 147, 150, 0.12);
  color: #074849;
}

.flash-error {
  background: rgba(174, 32, 18, 0.12);
  color: #77160f;
}

.stack-form,
.action-panel {
  display: grid;
  gap: 14px;
}

label,
.file-input {
  display: grid;
  gap: 8px;
  font-weight: 600;
}

input[type="text"],
input[type="password"],
input[type="file"],
select {
  width: 100%;
  border: 1px solid rgba(76, 54, 29, 0.18);
  border-radius: 14px;
  padding: 13px 14px;
  font: inherit;
  background: rgba(255, 255, 255, 0.9);
}

button,
.ghost-button {
  border: 0;
  border-radius: 14px;
  padding: 12px 16px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

button {
  color: white;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
}

.ghost-button {
  background: rgba(0, 95, 115, 0.12);
  color: var(--accent);
}

.danger-button {
  background: rgba(174, 32, 18, 0.12);
  color: var(--danger);
}

.ghost-link {
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(0, 95, 115, 0.12);
}

.actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.action-panel {
  padding: 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(76, 54, 29, 0.1);
}

.upload-progress {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(0, 95, 115, 0.08);
  border: 1px solid rgba(0, 95, 115, 0.12);
}

.upload-progress-bar {
  width: 100%;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(0, 95, 115, 0.12);
}

.upload-progress-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  transition: width 0.15s linear;
}

.upload-progress-meta {
  display: grid;
  gap: 4px;
}

.action-panel.is-uploading {
  border-color: rgba(0, 95, 115, 0.18);
  box-shadow: inset 0 0 0 1px rgba(0, 95, 115, 0.08);
}

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

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

th,
td {
  padding: 16px 12px;
  border-bottom: 1px solid rgba(76, 54, 29, 0.1);
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.actions-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.actions-cell form {
  margin: 0;
}

.empty-state {
  color: var(--muted);
  text-align: center;
}

.admin-card {
  padding: 28px;
}

.explorer-panel {
  margin-top: 24px;
  margin-bottom: 24px;
  padding: 22px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(76, 54, 29, 0.1);
}

.result-panel {
  margin-bottom: 24px;
  padding: 20px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(10, 147, 150, 0.12), rgba(255, 255, 255, 0.88));
  border: 1px solid rgba(0, 95, 115, 0.12);
}

.credential-grid,
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
}

.result-label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

code {
  display: inline-block;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(35, 26, 18, 0.08);
  font-family: Consolas, "Courier New", monospace;
}

.stat-box {
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(76, 54, 29, 0.1);
}

.stat-box strong {
  font-size: 30px;
}

.admin-actions {
  margin-top: 24px;
}

.folder-tabs,
.admin-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.folder-tabs {
  margin-bottom: 14px;
}

.search-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  margin-bottom: 16px;
}

.admin-breadcrumbs {
  margin-bottom: 16px;
}

.tab-link {
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
  background: rgba(0, 95, 115, 0.08);
}

.tab-link.is-active {
  color: white;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
}

.current-folder-banner {
  margin-bottom: 18px;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(0, 95, 115, 0.08);
  border: 1px solid rgba(0, 95, 115, 0.12);
}

.current-folder-banner.is-warning {
  background: rgba(174, 32, 18, 0.08);
  border-color: rgba(174, 32, 18, 0.14);
}

.current-folder-banner p {
  margin-bottom: 0;
}

.folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.search-results,
.current-subfolders {
  margin-bottom: 18px;
}

.folder-card,
.folder-empty {
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(76, 54, 29, 0.1);
}

.folder-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
}

.folder-title {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 700;
}

.folder-empty p {
  margin: 0;
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkbox-line input[type="checkbox"] {
  width: auto;
  margin: 0;
}

.admin-tables {
  display: grid;
  gap: 22px;
}

.table-section {
  padding: 6px 0 0;
}

.password-form {
  display: grid;
  gap: 10px;
  min-width: 250px;
}

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

.password-form-actions .ghost-button,
.password-form-actions button {
  padding: 10px 12px;
}

.section-head {
  margin-bottom: 12px;
}

.section-head h3 {
  margin: 0;
}

.admin-note {
  margin-top: 20px;
}

button[disabled],
input[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

@media (max-width: 720px) {
  .page-shell {
    padding: 22px 14px 40px;
  }

  .topbar,
  .browser-header {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-actions {
    justify-content: flex-start;
  }

  .breadcrumbs {
    justify-content: flex-start;
  }

  .search-bar {
    grid-template-columns: 1fr;
  }
}
