:root {
  --bg-main: #0B0F19;
  --bg-surface: #111827;
  --bg-surface-elevated: #1F2937;
  --bg-surface-hover: #263345;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.16);
  --text-primary: #F9FAFB;
  --text-secondary: #9CA3AF;
  --text-muted: #6B7280;
  
  --primary: #4F46E5;
  --primary-hover: #4338CA;
  --primary-gradient: linear-gradient(135deg, #4F46E5 0%, #06B6D4 100%);
  --accent-cyan: #06B6D4;
  --accent-emerald: #10B981;
  --accent-amber: #F59E0B;
  --accent-rose: #EF4444;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.5);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Global Utilities */
.hidden {
  display: none !important;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: #374151;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #4B5563;
}

/* Header */
.app-header {
  height: 68px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 40;
}

.header-left .brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 16px rgba(79, 70, 229, 0.4);
}

.brand-icon svg {
  width: 22px;
  height: 22px;
  stroke: #ffffff;
}

.brand-info h1 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-badge {
  font-size: 0.72rem;
  color: var(--accent-cyan);
  font-weight: 500;
  display: block;
}

/* Header Center: Google Drive Style Search Bar */
.header-center {
  flex: 1;
  max-width: 680px;
  margin: 0 32px;
}

.global-search-box {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: 28px;
  padding: 6px 16px;
  gap: 12px;
  transition: all 0.2s ease;
  width: 100%;
}

.global-search-box:focus-within {
  background: var(--bg-surface-elevated);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.25);
}

.global-search-box .search-icon {
  position: static;
  width: 18px;
  height: 18px;
  stroke: var(--text-muted);
  flex-shrink: 0;
  pointer-events: none;
}

.global-search-box input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 0.92rem;
  width: 100%;
}

.global-search-box input::placeholder {
  color: var(--text-muted);
}

.search-shortcut {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
}

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

.header-settings-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s;
}

.header-settings-btn:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
  transform: rotate(30deg);
}

.header-settings-btn svg {
  width: 18px;
  height: 18px;
}

/* App Body Layout: Sidebar + Main Workspace */
.app-body {
  display: flex;
  flex: 1;
  min-height: calc(100vh - 68px);
}

/* Google Drive Sidebar */
.app-sidebar {
  width: 260px;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  gap: 20px;
  flex-shrink: 0;
  user-select: none;
}

/* Tombol "+ Baru" Google Drive Style */
.sidebar-action-wrap {
  padding: 0 4px;
}

.new-action-dropdown {
  position: relative;
}

.btn-new-google {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: #FFFFFF;
  color: #1E293B;
  border: none;
  border-radius: 16px;
  padding: 12px 24px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
  width: 100%;
}

.btn-new-google:hover {
  background: #F8FAFC;
  box-shadow: 0 4px 16px rgba(255, 255, 255, 0.2), 0 8px 24px rgba(0, 0, 0, 0.3);
  transform: translateY(-1px);
}

.btn-new-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-new-icon svg {
  width: 20px;
  height: 20px;
  stroke: #4F46E5;
}

/* Dropdown Menu "+ Baru" */
.new-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 100%;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 2px;
  animation: dropdownFadeIn 0.15s ease-out;
}

@keyframes dropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.new-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 0.88rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: all 0.15s;
}

.new-menu-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
}

.new-menu-item svg {
  width: 18px;
  height: 18px;
  stroke: var(--accent-cyan);
}

.dropdown-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 4px 0;
}

/* Sidebar Section & Nav Items */
.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-section-title {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  padding: 4px 12px;
  text-transform: uppercase;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  width: 100%;
  text-align: left;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.nav-item.active {
  background: rgba(79, 70, 229, 0.18);
  color: #A5B4FC;
  font-weight: 600;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  flex-shrink: 0;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot.dev {
  background-color: var(--accent-cyan);
  box-shadow: 0 0 8px rgba(6, 182, 212, 0.7);
}
.status-dot.prd {
  background-color: var(--accent-rose);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.7);
}

/* Sidebar Footer Storage Card */
.sidebar-footer {
  margin-top: auto;
  padding-top: 12px;
}

.storage-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.storage-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.storage-card-header svg {
  width: 16px;
  height: 16px;
  stroke: var(--accent-cyan);
}

.storage-stats {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-line {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
}

.stat-title {
  color: var(--text-muted);
}

.stat-val {
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
}

.cors-pill {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-emerald);
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 12px;
  padding: 3px 8px;
  text-align: center;
}

/* Main Workspace */
.app-workspace {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 18px 24px;
  gap: 16px;
  overflow-x: hidden;
}

/* Toolbar */
.explorer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  gap: 16px;
  flex-wrap: wrap;
}

.toolbar-left {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 280px;
}

.filter-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(79, 70, 229, 0.2);
  border: 1px solid rgba(79, 70, 229, 0.4);
  color: #A5B4FC;
  padding: 4px 10px;
  border-radius: 14px;
  font-size: 0.8rem;
  font-weight: 600;
}

.filter-badge-clear {
  background: transparent;
  border: none;
  color: #A5B4FC;
  font-size: 1rem;
  cursor: pointer;
  line-height: 1;
}

.readonly-input {
  background: rgba(0, 0, 0, 0.25) !important;
  color: var(--text-muted) !important;
  cursor: not-allowed;
}

/* Breadcrumbs */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.crumb-item {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
}

.crumb-item:hover {
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
}

.crumb-item.active {
  color: var(--text-primary);
  font-weight: 600;
}

.crumb-separator {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.crumb-icon {
  width: 15px;
  height: 15px;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Search Box */
.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-box .search-icon {
  position: absolute;
  left: 12px;
  width: 16px;
  height: 16px;
  stroke: var(--text-muted);
  pointer-events: none;
}

.search-box input {
  background: #0B0F19;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 32px 8px 36px;
  color: var(--text-primary);
  font-size: 0.86rem;
  width: 220px;
  transition: all 0.2s;
}

.search-box input:focus {
  outline: none;
  border-color: var(--primary);
  width: 280px;
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
}

.clear-search {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

.btn svg {
  width: 16px;
  height: 16px;
}

.btn-primary {
  background: var(--primary-gradient);
  color: #FFFFFF;
  box-shadow: 0 2px 10px rgba(79, 70, 229, 0.35);
}

.btn-primary:hover {
  filter: brightness(1.1);
  box-shadow: 0 4px 16px rgba(79, 70, 229, 0.5);
}

.btn-secondary {
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-hover);
}

.btn-danger {
  background: var(--accent-rose);
  color: #FFFFFF;
}

.btn-danger:hover {
  background: #DC2626;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-elevated);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.icon-btn:hover {
  color: var(--text-primary);
  background: var(--bg-surface-hover);
}

.icon-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.icon-btn svg {
  width: 16px;
  height: 16px;
}

.view-switcher {
  display: flex;
  background: #0B0F19;
  padding: 2px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  gap: 2px;
}

.view-switcher .icon-btn {
  border: none;
  background: transparent;
  width: 32px;
  height: 32px;
}
.view-switcher .icon-btn.active {
  background: var(--bg-surface-elevated);
}

/* Explorer Container & Drag-Drop */
.explorer-container {
  flex: 1;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  position: relative;
  min-height: 480px;
  overflow: hidden;
}

.drop-overlay {
  position: absolute;
  inset: 0;
  background: rgba(11, 15, 25, 0.92);
  border: 2px dashed var(--accent-cyan);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 30;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  backdrop-filter: blur(4px);
}

.drop-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.drop-content {
  text-align: center;
  animation: pulseDrop 1.5s infinite alternate;
}

@keyframes pulseDrop {
  from { transform: scale(0.98); }
  to { transform: scale(1.02); }
}

.drop-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(6, 182, 212, 0.15);
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.drop-icon svg {
  width: 32px;
  height: 32px;
  stroke: var(--accent-cyan);
}

.drop-content h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.drop-content p {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* File Content Area */
#fileViewArea {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

/* List / Table View */
.file-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.file-table th {
  padding: 10px 14px;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-subtle);
}

.file-row {
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background 0.15s ease;
}

.file-row:hover {
  background: var(--bg-surface-elevated);
}

.file-row td {
  padding: 12px 14px;
  font-size: 0.88rem;
}

.file-cell-name {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.file-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.file-name-text {
  font-weight: 500;
  color: var(--text-primary);
  word-break: break-all;
}

.file-row.is-folder .file-name-text {
  color: #60A5FA;
  font-weight: 600;
}

.file-cell-size {
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  white-space: nowrap;
}

.file-cell-date {
  color: var(--text-muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

.file-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
}

.action-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}

.action-btn:hover {
  color: var(--text-primary);
  background: var(--bg-surface-hover);
  border-color: var(--border-subtle);
}

.action-btn.delete-btn:hover {
  color: var(--accent-rose);
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
}

.action-btn svg {
  width: 15px;
  height: 15px;
}

/* Grid View */
.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

.grid-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.grid-card:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.grid-card.is-folder {
  border-left: 3px solid #3B82F6;
}

.grid-icon-wrap {
  width: 48px;
  height: 48px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.grid-icon-wrap svg {
  width: 36px;
  height: 36px;
}

.grid-name {
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-primary);
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 4px;
}

.grid-card.is-folder .grid-name {
  color: #60A5FA;
  font-weight: 600;
}

.grid-meta {
  font-size: 0.74rem;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

.grid-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
  opacity: 0;
  transition: opacity 0.15s;
}

.grid-card:hover .grid-actions {
  opacity: 1;
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 360px;
  text-align: center;
  color: var(--text-muted);
}

.empty-icon {
  width: 64px;
  height: 64px;
  stroke: var(--text-muted);
  margin-bottom: 16px;
  opacity: 0.6;
}

.empty-state h4 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.empty-state p {
  font-size: 0.88rem;
  max-width: 320px;
  margin-bottom: 16px;
}

/* Loading State */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 360px;
  gap: 16px;
  color: var(--text-secondary);
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent-cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Status Bar */
.app-statusbar {
  height: 40px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.status-sep {
  margin: 0 6px;
}

.cors-badge {
  color: var(--accent-emerald);
  font-weight: 500;
}

/* Upload Progress Drawer */
.upload-drawer {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 460px;
  max-width: calc(100vw - 48px);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 50;
  overflow: hidden;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
}

.upload-drawer.hidden {
  transform: translateY(120%);
  opacity: 0;
  pointer-events: none;
}

.drawer-header {
  padding: 12px 16px;
  background: var(--bg-surface-elevated);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.drawer-pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 10px var(--accent-cyan);
  animation: pulseDot 1s infinite alternate;
}

@keyframes pulseDot {
  from { opacity: 0.5; }
  to { opacity: 1; }
}

.drawer-title h4 {
  font-size: 0.9rem;
  font-weight: 600;
}

.drawer-body {
  max-height: 320px;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.upload-item {
  background: #0B0F19;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  transition: border-color 0.2s;
}

.upload-item.is-done {
  border-color: rgba(16, 185, 129, 0.3);
}

.upload-item.is-paused {
  border-color: rgba(245, 158, 11, 0.3);
}

.upload-item.is-error {
  border-color: rgba(239, 68, 68, 0.3);
}

.upload-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.upload-item-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.upload-item-name {
  font-weight: 600;
  font-size: 0.84rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

.upload-badge {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.badge-uploading {
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan);
}

.badge-paused {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
}

.badge-done {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
}

.badge-error {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-rose);
}

.badge-queued {
  background: rgba(156, 163, 175, 0.15);
  color: var(--text-muted);
}

.upload-item-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.upload-action-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 26px;
  height: 26px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}

.upload-action-btn:hover {
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
}

.upload-action-btn.btn-cancel:hover {
  color: var(--accent-rose);
  background: rgba(239, 68, 68, 0.15);
}

.upload-action-btn svg {
  width: 14px;
  height: 14px;
}

.upload-item-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.74rem;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  margin-bottom: 6px;
}

.progress-bar-wrap {
  width: 100%;
  height: 6px;
  background: #1F2937;
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--primary-gradient);
  width: 0%;
  transition: width 0.15s ease;
}

.upload-item.is-done .progress-bar {
  background: var(--accent-emerald);
}

.upload-item.is-paused .progress-bar {
  background: var(--accent-amber);
}

.upload-item.is-error .progress-bar {
  background: var(--accent-rose);
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 60;
  opacity: 1;
  transition: opacity 0.2s ease;
}

.modal-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-card.modal-lg {
  max-width: 800px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

@keyframes modalIn {
  from {
    transform: scale(0.95);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
}

.modal-header h3.danger-title {
  color: var(--accent-rose);
}

.modal-subtitle {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  display: block;
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
}

.modal-close-btn:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 20px;
}

.modal-preview-body {
  flex: 1;
  overflow-y: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  background: #0B0F19;
}

.preview-image {
  max-width: 100%;
  max-height: 60vh;
  border-radius: var(--radius-sm);
  object-fit: contain;
}

.preview-text {
  width: 100%;
  max-height: 55vh;
  overflow: auto;
  background: #111827;
  padding: 16px;
  border-radius: var(--radius-sm);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  white-space: pre-wrap;
  color: #E5E7EB;
  border: 1px solid var(--border-subtle);
}

.preview-media {
  max-width: 100%;
  max-height: 55vh;
  outline: none;
}

.modal-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.current-path-badge {
  background: #0B0F19;
  border: 1px solid var(--border-subtle);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.84rem;
  color: var(--accent-cyan);
  margin-bottom: 16px;
  word-break: break-all;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-group input,
.form-group select {
  width: 100%;
  background: #0B0F19;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 0.88rem;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
}

.copy-url-group {
  display: flex;
  gap: 8px;
}

.copy-url-group input {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
}

.warning-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: #FCA5A5;
  font-size: 0.85rem;
  margin-bottom: 16px;
}

.warning-banner svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  stroke: var(--accent-rose);
}

.delete-target-badge {
  margin-top: 10px;
  background: #0B0F19;
  border: 1px solid var(--border-subtle);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  color: var(--text-secondary);
  word-break: break-all;
}

.modal-footer {
  padding: 14px 20px;
  background: var(--bg-surface-elevated);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideToast 0.25s ease;
  min-width: 280px;
}

.toast.toast-success {
  border-left: 4px solid var(--accent-emerald);
}

.toast.toast-error {
  border-left: 4px solid var(--accent-rose);
}

.toast.toast-info {
  border-left: 4px solid var(--accent-cyan);
}

@keyframes slideToast {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ============================================================== */
/* 🔐 LOGIN OVERLAY & CARD                                        */
/* ============================================================== */
.login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(11, 15, 25, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-surface);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  padding: 36px 32px;
  animation: modalScaleUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-brand {
  text-align: center;
  margin-bottom: 28px;
}

.login-brand-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: var(--primary-gradient);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 24px rgba(79, 70, 229, 0.45);
  margin-bottom: 16px;
}

.login-brand-icon svg {
  width: 28px;
  height: 28px;
  stroke: #FFFFFF;
}

.login-brand h2 {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.login-brand p {
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.login-error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #FCA5A5;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
}

.login-submit-btn {
  width: 100%;
  padding: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  margin-top: 10px;
  justify-content: center;
}

/* ============================================================== */
/* 👤 HEADER USER PROFILE PILL                                    */
/* ============================================================== */
.user-profile-pill {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: 30px;
  padding: 4px 6px 4px 10px;
  gap: 10px;
  transition: all 0.2s ease;
}

.user-profile-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-hover);
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4F46E5, #06B6D4);
  color: #FFFFFF;
  font-weight: 700;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-transform: uppercase;
}

.user-details {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.1;
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-role-badge {
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--accent-cyan);
}

.btn-logout {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.btn-logout:hover {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-rose);
}

.btn-logout svg {
  width: 16px;
  height: 16px;
}

/* ============================================================== */
/* 🏢 WORKSPACE VIEWS & ADMIN SECTIONS                            */
/* ============================================================== */
.workspace-view {
  display: flex;
  flex-direction: column;
  flex: 1;
  height: 100%;
  overflow-y: auto;
}

.admin-view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px 20px 28px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}

.admin-view-header h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}

.admin-view-header p {
  font-size: 0.86rem;
  color: var(--text-secondary);
}

.admin-table-card {
  margin: 20px 28px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px 24px;
}

.card-section-title {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.admin-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  text-align: left;
}

.admin-data-table th {
  padding: 12px 14px;
  color: var(--text-secondary);
  font-weight: 600;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.admin-data-table td {
  padding: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

.admin-data-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.text-center {
  text-align: center;
  color: var(--text-muted);
  padding: 30px !important;
}

/* BADGES */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-right: 4px;
}

.badge-dev {
  background: rgba(16, 185, 129, 0.15);
  color: #34D399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-prd {
  background: rgba(239, 68, 68, 0.15);
  color: #F87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-admin {
  background: rgba(139, 92, 246, 0.15);
  color: #C084FC;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.badge-active {
  background: rgba(16, 185, 129, 0.15);
  color: #10B981;
}

.badge-inactive {
  background: rgba(107, 114, 128, 0.2);
  color: #9CA3AF;
}

.action-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.74rem;
  padding: 3px 6px;
  border-radius: 4px;
}

.action-badge.action-login { background: rgba(59, 130, 246, 0.15); color: #60A5FA; }
.action-badge.action-upload { background: rgba(16, 185, 129, 0.15); color: #34D399; }
.action-badge.action-download { background: rgba(6, 182, 212, 0.15); color: #22D3EE; }
.action-badge.action-delete { background: rgba(239, 68, 68, 0.15); color: #F87171; }
.action-badge.action-admin { background: rgba(245, 158, 11, 0.15); color: #FBBF24; }

/* ============================================================== */
/* 🔍 AUDIT FILTER BAR & PAGINATION                               */
/* ============================================================== */
.audit-filter-card {
  margin: 20px 28px 0 28px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 20px;
}

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

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-field label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.filter-field input,
.filter-field select {
  background: #0B0F19;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 7px 10px;
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.15s;
}

.filter-field input:focus,
.filter-field select:focus {
  border-color: var(--primary);
}

.filter-actions-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  justify-content: flex-end;
}

.audit-pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  margin-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

.audit-pagination-bar span {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.pagination-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-badge {
  font-size: 0.82rem;
  color: var(--text-primary);
  font-weight: 600;
}

/* ============================================================== */
/* 🛡️ PERMISSIONS GRID & MODAL LG                                 */
/* ============================================================== */
.modal-lg {
  max-width: 680px;
  width: 95%;
}

.form-row {
  display: flex;
  gap: 16px;
}

.flex-1 {
  flex: 1;
}

.permissions-section-header {
  margin: 18px 0 12px 0;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

.permissions-section-header h4 {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.04em;
}

.permissions-section-header p {
  font-size: 0.78rem;
  color: var(--text-muted);
}

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

.perm-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
}

.perm-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-hover);
}

.perm-card input[type="checkbox"] {
  margin-top: 3px;
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.perm-info {
  display: flex;
  flex-direction: column;
}

.perm-title {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-primary);
}

.perm-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.25;
}

.perm-admin-card {
  grid-column: span 2;
  background: rgba(139, 92, 246, 0.08);
  border-color: rgba(139, 92, 246, 0.25);
}

.perm-admin-card:hover {
  background: rgba(139, 92, 246, 0.14);
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  cursor: pointer;
}

.checkbox-label input {
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
}

.field-hint {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 4px;
  display: block;
}

.table-action-btns {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.btn-xs {
  padding: 4px 8px;
  font-size: 0.76rem;
  border-radius: 4px;
}

