:root {
  --bg: #eef2f7;
  --bg-soft: #f6f8fb;
  --surface: #ffffff;
  --surface-2: #f3f6fa;
  --border: #e0e6ef;
  --text: #1b2533;
  --muted: #5b6b7a;
  --accent: #1f7a8c;
  --accent-2: #0f4c5c;
  --accent-soft: #e3f2f4;
  --danger: #d64545;
  --shadow-sm: 0 2px 8px rgba(19, 33, 68, 0.08);
  --shadow-md: 0 8px 24px rgba(19, 33, 68, 0.12);
  --shadow-lg: 0 16px 48px rgba(19, 33, 68, 0.18);
  --radius: 10px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Aptos", "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
  background: radial-gradient(1200px 500px at 30% -10%, #dce9f7 0%, #eef2f7 50%, #f6f8fb 100%);
  color: var(--text);
  user-select: none;
  margin: 0;
}

/* Top bar */
.top-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(90deg, #0e2a35 0%, #18394a 60%, #1f4d5a 100%);
  color: #f7fbff;
  padding: 14px 18px;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: var(--shadow-sm);
}

.user-chip {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  color: #f7fbff;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  margin-left: 8px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  justify-content: center;
}
.search-wrap {
  position: relative;
  flex: 1;
  max-width: 420px;
}
.search-wrap input {
  width: 100%;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.12);
  color: #f7fbff;
  outline: none;
}
.search-wrap input::placeholder {
  color: rgba(255,255,255,0.7);
}
.chip-select {
  border-radius: 999px;
  padding: 6px 10px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.12);
  color: #f7fbff;
}
.chip-select option {
  color: #0f1b22;
  background: #ffffff;
}
.chip-btn {
  border-radius: 999px;
  padding: 6px 12px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.12);
  color: #f7fbff;
  cursor: pointer;
}
.chip-btn:hover {
  background: rgba(255,255,255,0.2);
}

.brand {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.breadcrumb {
  flex: 1;
  display: flex;
  gap: 6px;
  font-size: 13px;
  align-items: center;
}

.breadcrumb span {
  cursor: pointer;
  opacity: 0.85;
  padding: 3px 6px;
  border-radius: 6px;
}

.breadcrumb span:hover {
  background: rgba(255, 255, 255, 0.12);
  opacity: 1;
}

.breadcrumb .separator::after {
  content: ">";
  margin: 0 3px;
  opacity: 0.6;
}

.view-buttons {
  display: flex;
  gap: 8px;
}

.view-buttons button {
  background: rgba(255, 255, 255, 0.12);
  color: #f7fbff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 6px 12px;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.15s ease, transform 0.15s ease;
}
.view-buttons button:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

/* Left sidebar */
.left-sidebar {
  position: fixed;
  top: 56px;
  left: 0;
  width: 220px;
  bottom: 0;
  background: rgba(255, 255, 255, 0.9);
  border-right: 1px solid var(--border);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  backdrop-filter: blur(6px);
}

.sidebar-section {
  margin-top: 8px;
}
.sidebar-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin: 6px 6px 8px 6px;
}


.sidebar-btn {
  display: block;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
  transition: box-shadow 0.15s ease, transform 0.15s ease, background 0.15s ease;
}
.sidebar-btn:hover {
  background: var(--surface-2);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.sidebar-new-btn {
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: #fff;
  border: none;
}
.sidebar-new-btn:hover {
  filter: brightness(1.05);
}

/* The New dropdown in left sidebar */
.sidebar-new-dropdown {
  position: absolute;
  top: 58px;
  left: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  min-width: 180px;
  box-shadow: var(--shadow-md);
  border-radius: 12px;
  z-index: 9999;
  overflow: hidden;
  color: var(--text);
}
.sidebar-new-dropdown.hidden {
  display: none;
}
.dropdown-item {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
}
.dropdown-item:hover {
  background: var(--accent-soft);
}

/* Right sidebar for usage */
.right-sidebar {
  position: fixed;
  top: 56px;
  right: 0;
  width: 220px;
  bottom: 0;
  background: rgba(255, 255, 255, 0.9);
  border-left: 1px solid var(--border);
  padding: 16px 12px;
  overflow-y: auto;
  backdrop-filter: blur(6px);
}

/* Main content */
.main-content {
  margin-left: 220px;
  margin-right: 220px;
  padding: 12px;
}

/* File-list-area */
.file-list-area {
  padding: 14px;
  min-height: 640px;
  background: linear-gradient(180deg, #ffffff 0%, #f6f8fb 100%);
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  position: relative;
}

/* Drop overlay */
.drop-overlay {
  position: absolute;
  inset: 10px;
  border: 2px dashed rgba(31, 122, 140, 0.5);
  background: rgba(31, 122, 140, 0.08);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: opacity 0.15s ease;
}
.drop-overlay.hidden {
  opacity: 0;
}
.drop-overlay-inner {
  background: #ffffff;
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
  color: var(--accent-2);
}

/* HEADER BAR */
.file-list-header {
  background: var(--surface-2);
  padding: 10px 12px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.file-list-header button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
}
.compact-header {
  position: relative;
  gap: 10px;
}
.compact-field-label {
  font-weight: 700;
  margin-right: 8px;
  display: inline-flex;
  align-items: center;
}
.sort-dir-arrow {
  margin-left: 4px;
  color: var(--muted);
  font-size: 12px;
}
.sort-arrow-btn {
  font-size: 12px;
  cursor: pointer;
  user-select: none;
}

.detailed-header {
  position: relative;
  display: flex;
  align-items: center;
}

/* Detailed columns */
.header-check-container {
  width: 32px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-right: 8px;
}
.detailed-col-name {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  margin-right: 10px;
}
.detailed-col-modified {
  width: 160px;
  text-align: right;
  margin-left: 10px;
  display: flex;
  justify-content: flex-end;
}
.detailed-col-size {
  width: 100px;
  text-align: right;
  margin-left: 10px;
  display: flex;
  justify-content: flex-end;
}
.sort-arrow-icon {
  margin-left: 6px;
  font-size: 12px;
}

/* Sort dropdown */
.sort-dropdown {
  position: absolute;
  background: var(--surface);
  border: 1px solid var(--border);
  list-style: none;
  padding: 6px 0;
  margin: 0;
  width: 120px;
  z-index: 20000;
  box-shadow: var(--shadow-md);
  top: 40px;
  left: 130px;
  border-radius: 10px;
  overflow: hidden;
}
.sort-dropdown.hidden {
  display: none;
}
.sort-dropdown li {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 14px;
}
.sort-dropdown li:hover {
  background: var(--accent-soft);
}

/* FILE LIST */
.file-list {
  display: flex;
  flex-direction: row;
  margin-left: 0;
  margin-right: 0;
  gap: 10px;
}
.file-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin: 4px 0;
  cursor: pointer;
  position: relative;
  transition: background 0.12s ease, box-shadow 0.12s ease, transform 0.12s ease;
}
.file-item:hover {
  background: #fbfcfe;
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.file-item.selected {
  background: #e7f4f6;
  border-color: rgba(31, 122, 140, 0.35);
}
.file-item.selected:hover {
  background: #def0f3;
}
.file-item.drop-target {
  outline: 2px dashed rgba(31, 122, 140, 0.6);
  outline-offset: -4px;
  background: rgba(31, 122, 140, 0.08);
}

.empty-state {
  padding: 20px;
  color: var(--muted);
  font-size: 14px;
}

/* checkboxes hidden if none selected */
.rowCb {
  pointer-events: auto;
}

/* COMPACT MODE */
.file-list.compact {
  flex-wrap: wrap;
}
.compact-item {
  display: flex;
  flex-direction: column;
  width: 140px;
  margin: 6px 0;
}
.compact-box-container {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.compact-preview-wrapper {
  position: relative;
  width: 100%;
  height: 140px;
  overflow: hidden;
  background: var(--surface-2);
  border-radius: 12px;
  border: 1px solid var(--border);
}
.compact-top-cb {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 2;
  width: 16px;
  height: 16px;
}
.compact-img-or-vid {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
}
.compact-thumb-img,
.compact-thumb-vid {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}
.compact-thumb-vid {
  object-fit: cover;
  background: #000;
}
.compact-filename {
  width: 100%;
  background: var(--surface);
  text-align: center;
  padding: 6px 8px;
  font-size: 13px;
  border-top: 1px solid var(--border);
  border-radius: 0 0 12px 12px;
}

/* DETAILED MODE */
.file-list.detailed {
  flex-direction: column;
}
.detailed-item {
  display: flex;
  align-items: center;
  padding: 8px;
  min-height: 64px;
  margin: 4px 0;
}
.detailed-check-container {
  width: 32px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-left: 4px;
}
.detailed-thumb {
  width: 64px;
  height: 64px;
  margin-right: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.detailed-thumb-img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
}
.detailed-thumb-vid {
  max-width: 90%;
  max-height: 90%;
  background: #000;
  object-fit: cover;
}
.detailed-name-text {
  flex: 1 1 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-right: 8px;
}
.detailed-modified-text {
  width: 160px;
  text-align: right;
  margin-left: 10px;
  white-space: nowrap;
  color: var(--muted);
}
.detailed-size-text {
  width: 100px;
  text-align: right;
  margin-left: 10px;
  white-space: nowrap;
  color: var(--muted);
}

/* Upload progress bar */
.upload-progress {
  position: fixed;
  bottom: 20px;
  right: 240px;
  width: 320px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 12px;
  border-radius: 12px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-md);
}

.upload-queue {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 320px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  z-index: 12000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.upload-queue.hidden {
  display: none;
}
.upload-queue-header {
  display: flex;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}
.upload-queue-header button {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 16px;
}
.upload-queue-list {
  max-height: 260px;
  overflow-y: auto;
}
.upload-queue-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}
.upload-queue-item:last-child {
  border-bottom: none;
}
.upload-queue-name {
  flex: 1;
  font-size: 12px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.upload-queue-actions button {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 11px;
}
.upload-queue-actions button:hover {
  background: var(--accent-soft);
}

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(600px 300px at 20% 10%, rgba(31,122,140,0.18) 0%, rgba(31,122,140,0) 70%),
    radial-gradient(500px 260px at 80% 20%, rgba(15,76,92,0.15) 0%, rgba(15,76,92,0) 70%),
    linear-gradient(180deg, #eef2f7 0%, #f6f8fb 100%);
}
.auth-card {
  width: min(420px, 92vw);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow-lg);
}
.auth-card-wide {
  width: min(520px, 94vw);
}
.auth-brand {
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--accent-2);
  margin-bottom: 8px;
  font-size: 13px;
  text-transform: uppercase;
}
.auth-title {
  font-size: 22px;
  margin-bottom: 8px;
}
.auth-subtitle {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 16px;
}
.auth-card input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 10px;
}
.auth-card button {
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: #fff;
  cursor: pointer;
  margin-top: 4px;
}
.auth-card button:hover {
  filter: brightness(1.05);
}
.auth-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  margin-top: 10px;
}
.checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  margin: 6px 0;
}
.checkbox-row input {
  appearance: auto;
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
  margin: 0;
  vertical-align: middle;
}
.auth-link {
  color: var(--accent-2);
  text-decoration: none;
}
.auth-error {
  color: var(--danger);
  font-size: 12px;
  margin-bottom: 8px;
}
.auth-info {
  color: var(--accent);
  font-size: 12px;
  margin-bottom: 8px;
}
.upload-progress.hidden {
  display: none;
}
.upload-progress-text {
  font-size: 13px;
  margin-bottom: 6px;
  color: var(--muted);
}
.upload-progress-bar {
  width: 100%;
  height: 8px;
  background: #e5e9f0;
  border-radius: 6px;
  overflow: hidden;
}
.upload-progress-fill {
  height: 8px;
  background: linear-gradient(90deg, var(--accent) 0%, #4cc9c0 100%);
  width: 0%;
}

/* Modals */
.modal {
  position: fixed;
  z-index: 10000;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background: rgba(12, 21, 33, 0.55);
  display: flex;
  justify-content: center;
  align-items: center;
}
.modal.hidden {
  display: none;
}
.modal-content {
  background: var(--surface);
  padding: 20px;
  width: 420px;
  border-radius: 14px;
  position: relative;
  box-shadow: var(--shadow-lg);
}
.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}
.ghost-btn {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.ghost-btn:hover {
  background: var(--surface-2);
}
.muted-text {
  color: var(--muted);
  font-size: 13px;
  margin: 6px 0 8px 0;
}
.modal-content input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin: 10px 0;
}
.modal-content button {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
}
.modal-content button:hover {
  filter: brightness(1.05);
}
.close {
  color: var(--muted);
  position: absolute;
  right: 12px;
  top: 8px;
  font-size: 22px;
  cursor: pointer;
}
.close:hover {
  color: var(--text);
}

/* Preview modal */
#previewModal .modal-content {
  max-width: 1000px;
  width: min(1000px, 92vw);
  max-height: 86vh;
  overflow: hidden;
  padding: 20px 24px 24px 24px;
}
#previewModal h2 {
  margin-bottom: 12px;
}
.preview-stage {
  position: relative;
  height: 65vh;
}
.preview-content {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(600px 300px at 30% 20%, #1a2430 0%, #0e141b 60%, #0a1016 100%);
  border-radius: 14px;
  border: 1px solid #243141;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
  overflow: hidden;
}
.preview-content img.preview-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.2s ease;
}
.preview-content .preview-pdf {
  width: 100%;
  height: 100%;
  border: none;
  background: #0e141b;
}
.preview-content .preview-text {
  width: 100%;
  height: 100%;
  overflow: auto;
  color: #e6edf3;
  padding: 16px;
  background: #0b1118;
  font-family: "Cascadia Mono", "Consolas", monospace;
  font-size: 13px;
  line-height: 1.4;
}
.preview-content video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.preview-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 10px 0 14px 0;
  color: var(--muted);
  gap: 10px;
}
.preview-controls label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.seek-controls {
  display: none;
  align-items: center;
  gap: 8px;
}
.seek-controls button {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 6px 10px;
  cursor: pointer;
  border-radius: 8px;
}
.seek-controls button:hover {
  background: var(--accent-soft);
}
.zoom-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}
.zoom-controls button {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 6px 10px;
  cursor: pointer;
  border-radius: 8px;
}
.zoom-controls button:hover {
  background: var(--accent-soft);
}
#zoomLevel {
  font-weight: 700;
  min-width: 46px;
  text-align: center;
}

/* Navigation arrows */
#previewModal .preview-nav-btn {
  position: absolute;
  top: calc(50% - 2px);
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.9);
  color: #0f1b22;
  border: 1px solid var(--border);
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}
#previewModal .preview-nav-btn:hover {
  background: #ffffff;
}
#previewModal .prev-btn { left: 16px; }
#previewModal .next-btn { right: 16px; }

/* Folder Tree in Move Modal */
#folderTree {
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid var(--border);
  padding: 8px;
  background: var(--surface-2);
  font-size: 14px;
  border-radius: 10px;
}
.folder-node {
  margin-left: 10px;
  padding: 4px 6px;
  border-radius: 6px;
}
.folder-node:hover {
  background-color: var(--accent-soft);
}
.folder-node.selected {
  background-color: #cfe8ec;
}
.folder-children {
  margin-left: 20px;
  border-left: 1px dashed #c1c9d6;
}

/* Context menu */
.context-menu {
  position: absolute;
  background: var(--surface);
  border: 1px solid var(--border);
  list-style: none;
  padding: 8px 0;
  margin: 0;
  width: 200px;
  z-index: 20000;
  box-shadow: var(--shadow-lg);
  border-radius: 12px;
}
.context-menu.hidden {
  display: none;
}
.context-menu li {
  padding: 10px 16px;
  cursor: pointer;
  font-size: 14px;
}
.context-menu li:hover {
  background: var(--accent-soft);
}

.conflict-list {
  max-height: 240px;
  overflow-y: auto;
  margin-top: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
}
.conflict-item {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.conflict-item:last-child {
  border-bottom: none;
}

.toast-container {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 30000;
}
.toast {
  background: #0f1b22;
  color: #f7fbff;
  border: 1px solid rgba(255,255,255,0.12);
  padding: 10px 14px;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 280px;
}
.toast button {
  background: rgba(255,255,255,0.12);
  color: #f7fbff;
  border: 1px solid rgba(255,255,255,0.15);
  padding: 4px 8px;
  border-radius: 8px;
  cursor: pointer;
}
.toast button:hover {
  background: rgba(255,255,255,0.2);
}

.drag-ghost {
  position: absolute;
  top: -9999px;
  left: -9999px;
  background: rgba(15, 27, 34, 0.9);
  color: #f7fbff;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.2);
  box-shadow: var(--shadow-md);
  font-size: 12px;
  pointer-events: none;
}

/* "3-dot" button in each item row */
.three-dot-btn {
  position: absolute;
  right: 8px;
  top: 8px;
  cursor: pointer;
  font-size: 16px;
  background: rgba(255,255,255,0.9);
  padding: 4px 6px;
  border-radius: 8px;
  display: none;
  z-index: 3;
  border: 1px solid var(--border);
}
.three-dot-btn:hover {
  background: #ffffff;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .top-bar {
    flex-wrap: wrap;
    gap: 8px;
  }
  .top-actions {
    order: 3;
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .search-wrap {
    max-width: 100%;
    flex: 1 1 100%;
  }
  .left-sidebar,
  .right-sidebar {
    position: static;
    width: 100%;
    border-right: none;
    border-left: none;
    border-top: 1px solid var(--border);
    flex-direction: row;
    align-items: center;
    padding: 10px;
    gap: 10px;
  }
  .main-content {
    margin-left: 0;
    margin-right: 0;
  }
  .upload-progress {
    right: 20px;
  }
}

@media (max-width: 900px) {
  .left-sidebar,
  .right-sidebar {
    position: static;
    width: 100%;
    border-right: none;
    border-left: none;
    border-top: 1px solid var(--border);
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px;
    background: rgba(255,255,255,0.95);
  }
  .main-content {
    margin-left: 0;
    margin-right: 0;
    padding: 8px;
  }
  .file-list-area {
    padding: 10px;
    border-radius: 12px;
  }
  .compact-item {
    width: 120px;
  }
}

@media (max-width: 600px) {
  .top-bar {
    padding: 10px 12px;
  }
  .brand {
    font-size: 16px;
  }
  .view-buttons button {
    padding: 5px 10px;
    font-size: 12px;
  }
  .chip-select,
  .chip-btn,
  .search-wrap input {
    font-size: 12px;
  }
  .compact-item {
    width: 104px;
  }
  .compact-preview-wrapper {
    height: 110px;
  }
  .detailed-item {
    padding: 6px;
    min-height: 56px;
  }
  .detailed-thumb {
    width: 54px;
    height: 54px;
  }
  .right-sidebar h3 {
    font-size: 14px;
  }
}
.sidebar-new-btn:hover { color: #fff; }
.auth-page { position: relative; overflow: hidden; }
.auth-page::before, .auth-page::after {
  content: "";
  position: absolute;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(31,122,140,0.16) 0%, rgba(31,122,140,0) 70%);
  z-index: 0;
}
.auth-page::before { top: -180px; left: -180px; }
.auth-page::after { bottom: -200px; right: -200px; }
.auth-card { position: relative; z-index: 1; }
.sidebar-new-btn:hover {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: #fff !important;
  opacity: 1;
  filter: none;
}
.checkbox-row { line-height: 1; }
.hidden { display: none !important; }

/* Landing + Admin */
.landing-page {
  min-height: 100vh;
  background:
    radial-gradient(1000px 540px at 6% -10%, rgba(24, 132, 150, 0.18), transparent 58%),
    radial-gradient(1000px 540px at 96% 0%, rgba(253, 186, 116, 0.14), transparent 58%),
    linear-gradient(180deg, #ecf3fa 0%, #f7fbff 100%);
}
.landing-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 22px;
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
}
.landing-brand {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.4px;
}
.landing-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}
.landing-link {
  color: var(--text);
  text-decoration: none;
  padding: 8px 10px;
  opacity: 0.85;
}
.landing-cta,
.landing-secondary {
  text-decoration: none;
  border-radius: 10px;
  padding: 9px 14px;
  font-weight: 700;
}
.landing-cta {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: #fff;
  box-shadow: 0 10px 24px rgba(31, 122, 140, 0.22);
}
.landing-secondary {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(31, 122, 140, 0.3);
  color: #164d59;
}
.landing-main {
  max-width: 1220px;
  margin: 0 auto;
  padding: 22px 22px 42px 22px;
}

/* ── Hero ── */
.landing-hero {
  background: linear-gradient(130deg, #0e3442 0%, #145869 45%, #1c7385 100%);
  color: #f7fbff;
  border-radius: 20px;
  padding: 52px 48px;
  box-shadow: 0 24px 44px rgba(14, 52, 66, 0.28);
}
.landing-hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  min-height: min(68vh, 600px);
}
.landing-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 99px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  margin-bottom: 20px;
}
.landing-hero h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin: 0 0 14px 0;
  line-height: 1.1;
  font-weight: 800;
}
.landing-hero p {
  margin: 0 0 8px 0;
  opacity: 0.88;
  font-size: 1.05rem;
  line-height: 1.55;
  max-width: 500px;
}
.landing-hero-actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}

/* ── Mock UI visual ── */
.landing-hero-visual {
  display: flex;
  align-items: center;
  justify-content: center;
}
.landing-mock-ui {
  width: 100%;
  max-width: 420px;
  background: #f0f4f8;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.12);
}
.mock-topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  background: #0e2a35;
}
.mock-brand {
  font-size: 10px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: 0.4px;
  flex-shrink: 0;
}
.mock-search {
  flex: 1;
  height: 7px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}
.mock-topbar-btn {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}
.mock-body {
  display: flex;
  min-height: 220px;
}
.mock-sidebar {
  width: 100px;
  background: #18394a;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex-shrink: 0;
}
.mock-sidebar-btn {
  height: 7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.18);
}
.mock-sidebar-btn-accent {
  background: rgba(31, 122, 140, 0.7);
}
.mock-sidebar-btn-sm {
  height: 5px;
  width: 80%;
  background: rgba(255, 255, 255, 0.1);
}
.mock-sidebar-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 4px 0;
}
.mock-content {
  flex: 1;
  background: #f0f4f8;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.mock-content-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.mock-breadcrumb {
  height: 5px;
  width: 80px;
  background: #c8d3dc;
  border-radius: 3px;
}
.mock-view-btns {
  display: flex;
  gap: 3px;
}
.mock-view-btn {
  width: 14px;
  height: 10px;
  border-radius: 2px;
  background: #c8d3dc;
}
.mock-file-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 6px;
  border-radius: 6px;
}
.mock-folder { background: rgba(31, 122, 140, 0.06); }
.mock-selected { background: rgba(31, 122, 140, 0.15); }
.mock-file-icon {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: #b0bfc9;
  flex-shrink: 0;
}
.mock-icon-folder { background: #f5a623; }
.mock-icon-img { background: #4caf88; }
.mock-icon-pdf { background: #e57373; }
.mock-file-label {
  height: 5px;
  border-radius: 3px;
  background: #b8c5cf;
  flex: 1;
}
.mock-file-label-md { max-width: 90px; }
.mock-file-label-lg { max-width: 130px; }
.mock-file-label-xl { max-width: 160px; }
.mock-file-meta {
  height: 5px;
  width: 34px;
  border-radius: 3px;
  background: #c8d3dc;
  flex-shrink: 0;
}

/* ── Features section ── */
.landing-features {
  margin-top: 52px;
}
.landing-section-header {
  text-align: center;
  margin-bottom: 28px;
}
.landing-section-label {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}
.landing-section-title {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 800;
  color: var(--text);
  margin: 0;
}
.landing-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.landing-grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.landing-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.18s, transform 0.18s;
}
.landing-card:hover {
  box-shadow: 0 8px 24px rgba(31, 122, 140, 0.12);
  transform: translateY(-2px);
}
.landing-card-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(31, 122, 140, 0.12) 0%, rgba(15, 76, 92, 0.08) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  margin-bottom: 14px;
}
.landing-card h3 {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 8px 0;
  color: var(--text);
}
.landing-card p {
  font-size: 13.5px;
  margin: 0;
  color: var(--text-muted);
  line-height: 1.55;
}

/* ── Security strip ── */
.landing-security-strip {
  margin-top: 40px;
  background: linear-gradient(135deg, #0e2a35 0%, #1c4e5f 100%);
  border-radius: 14px;
  padding: 20px 28px;
}
.landing-security-items {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 0;
  justify-content: center;
}
.landing-security-item {
  display: flex;
  align-items: center;
  gap: 7px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 13px;
  font-weight: 500;
  padding: 0 16px;
}
.landing-security-item svg {
  color: #4dd4a8;
  flex-shrink: 0;
}
.landing-security-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  flex-shrink: 0;
}

/* ── Bottom CTA ── */
.landing-cta-section {
  margin-top: 52px;
  text-align: center;
  padding: 60px 20px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
}
.landing-cta-section h2 {
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 800;
  margin: 0 0 10px 0;
  color: var(--text);
}
.landing-cta-section p {
  font-size: 1rem;
  color: var(--text-muted);
  margin: 0 0 24px 0;
}

/* ── Footer ── */
.landing-footer {
  border-top: 1px solid var(--border);
  padding: 20px 22px;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(8px);
}
.landing-footer-inner {
  max-width: 1220px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.landing-footer-brand {
  opacity: 0.7;
  font-size: 15px;
}
.landing-footer-links {
  display: flex;
  gap: 16px;
}
.landing-footer-links a {
  text-decoration: none;
  font-size: 13px;
  color: var(--text-muted);
}
.landing-footer-links a:hover {
  color: var(--accent);
}

.admin-page {
  min-height: 100vh;
  padding: 20px;
  background: linear-gradient(180deg, #eef3f9 0%, #fbfcfe 100%);
}
.admin-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 14px;
}
.admin-header h1 {
  margin: 0;
}
.admin-header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}
.admin-header-actions button {
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  padding: 10px 12px;
  cursor: pointer;
}
.admin-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.admin-table-wrap {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: auto;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
}
.admin-table-wrap .admin-table { min-width: 980px; }
.admin-table th,
.admin-table td {
  border-bottom: 1px solid var(--border);
  padding: 10px;
  text-align: left;
  vertical-align: top;
}
.admin-table td button {
  margin-right: 6px;
  margin-bottom: 6px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
}
.admin-modal-content {
  width: min(960px, 94vw);
  max-height: 84vh;
  overflow: auto;
}
.admin-storage-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-bottom: 10px;
}
.admin-storage-toolbar p {
  margin: 0;
}
.admin-storage-table-wrap {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: auto;
  max-height: 52vh;
}
.admin-table-modal {
  min-width: 0;
}
.admin-inline-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}
.admin-token-box {
  white-space: pre-wrap;
  word-break: break-all;
}

@media (max-width: 900px) {
  .landing-grid,
  .landing-grid-4,
  .admin-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .landing-header,
  .admin-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .landing-hero {
    padding: 36px 28px;
  }
  .landing-hero-actions {
    flex-direction: column;
    align-items: flex-start;
  }
  .landing-hero-grid {
    grid-template-columns: 1fr;
    gap: 32px;
    min-height: auto;
  }
  .landing-hero-visual {
    display: none;
  }
  .landing-security-dot {
    display: none;
  }
  .landing-security-items {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .landing-security-item {
    padding: 0;
  }
  .landing-footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}
@media (max-width: 560px) {
  .landing-grid,
  .landing-grid-4,
  .admin-stats {
    grid-template-columns: 1fr;
  }
}
