:root {
  --md-sys-color-primary: #00639b;
  --md-sys-color-on-primary: #ffffff;
  --md-sys-color-primary-container: #cce5ff;
  --md-sys-color-on-primary-container: #001d32;
  --md-sys-color-surface: #fdfcff;
  --md-sys-color-surface-container: #f0f4f9;
  --md-sys-color-surface-container-high: #e9eef6;
  --md-sys-color-surface-container-highest: #e1e7f0;
  --md-sys-color-on-surface: #1a1c1e;
  --md-sys-color-on-surface-variant: #43474e;
  --md-sys-color-outline: #73777f;
  --md-sys-color-outline-variant: #c3c7d0;
  --md-sys-color-error: #ba1a1a;
  --md-sys-color-error-container: #ffdad6;
  --md-sys-color-success: #1b6d3b;
  --md-sys-color-success-container: #c4f3d0;
  --md-shape-corner-xs: 4px;
  --md-shape-corner-sm: 8px;
  --md-shape-corner-md: 12px;
  --md-shape-corner-lg: 16px;
  --md-shape-corner-xl: 28px;
  --md-elevation-1: 0px 1px 3px 1px rgba(0, 0, 0, 0.15), 0px 1px 2px 0px rgba(0, 0, 0, 0.3);
  --md-elevation-2: 0px 2px 6px 2px rgba(0, 0, 0, 0.15), 0px 1px 2px 0px rgba(0, 0, 0, 0.3);
  --md-elevation-3: 0px 4px 8px 3px rgba(0, 0, 0, 0.15), 0px 1px 3px 0px rgba(0, 0, 0, 0.3);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: #f7f9fc;
  color: var(--md-sys-color-on-surface);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Material Top App Bar */
.top-app-bar {
  background: #ffffff;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
  height: 64px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

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

.brand-icon {
  width: 36px;
  height: 36px;
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-primary);
  border-radius: var(--md-shape-corner-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--md-sys-color-primary);
  letter-spacing: -0.5px;
}

.brand-badge {
  font-size: 0.75rem;
  background: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface-variant);
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 500;
}

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

.token-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--md-sys-color-surface-container);
  border: 1px solid var(--md-sys-color-outline-variant);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.token-badge:hover {
  background: var(--md-sys-color-surface-container-high);
}

.token-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
}

/* Main Container */
.main-content {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Disk Usage Bar */
.disk-card {
  background: #ffffff;
  border-radius: var(--md-shape-corner-lg);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--md-sys-color-outline-variant);
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.disk-info {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
  color: var(--md-sys-color-on-surface-variant);
}

.disk-meter-container {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 280px;
}

.disk-meter {
  flex: 1;
  height: 8px;
  background: var(--md-sys-color-surface-container-highest);
  border-radius: 4px;
  overflow: hidden;
}

.disk-meter-fill {
  height: 100%;
  background: var(--md-sys-color-primary);
  width: 0%;
  transition: width 0.4s ease;
  border-radius: 4px;
}

/* Upload Dropzone */
.dropzone-card {
  background: #ffffff;
  border: 2px dashed var(--md-sys-color-outline-variant);
  border-radius: var(--md-shape-corner-xl);
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.dropzone-card:hover, .dropzone-card.dragover {
  border-color: var(--md-sys-color-primary);
  background: #f0f7ff;
}

.dropzone-icon {
  font-size: 48px;
  color: var(--md-sys-color-primary);
  margin-bottom: 8px;
}

.dropzone-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.dropzone-desc {
  font-size: 0.875rem;
  color: var(--md-sys-color-on-surface-variant);
}

/* Upload Progress Area */
.upload-queue {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.upload-item {
  background: #ffffff;
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-shape-corner-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.upload-file-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 180px;
}

.upload-file-name {
  font-weight: 500;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.upload-file-size {
  font-size: 0.75rem;
  color: var(--md-sys-color-on-surface-variant);
}

.upload-progress-bar {
  flex: 1;
  height: 6px;
  background: var(--md-sys-color-surface-container-highest);
  border-radius: 3px;
  overflow: hidden;
}

.upload-progress-fill {
  height: 100%;
  background: var(--md-sys-color-primary);
  width: 0%;
  transition: width 0.15s ease;
}

/* Action Toolbar */
.toolbar-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background: #ffffff;
  padding: 12px 16px;
  border-radius: var(--md-shape-corner-lg);
  border: 1px solid var(--md-sys-color-outline-variant);
}

.breadcrumb-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 0.95rem;
  font-weight: 500;
}

.breadcrumb-item {
  cursor: pointer;
  color: var(--md-sys-color-primary);
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.15s;
}

.breadcrumb-item:hover {
  background: var(--md-sys-color-surface-container);
}

.breadcrumb-sep {
  color: var(--md-sys-color-outline);
}

.toolbar-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Material Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary {
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
}

.btn-primary:hover {
  background: #005080;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.btn-outlined {
  background: transparent;
  color: var(--md-sys-color-on-surface);
  border: 1px solid var(--md-sys-color-outline-variant);
}

.btn-outlined:hover {
  background: var(--md-sys-color-surface-container);
}

.btn-danger {
  color: var(--md-sys-color-error);
}

.btn-danger:hover {
  background: var(--md-sys-color-error-container);
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--md-sys-color-on-surface-variant);
  cursor: pointer;
  transition: background 0.15s;
}

.btn-icon:hover {
  background: var(--md-sys-color-surface-container);
  color: var(--md-sys-color-on-surface);
}

/* Search input */
.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--md-sys-color-surface-container);
  border-radius: 20px;
  padding: 6px 14px;
  border: 1px solid transparent;
}

.search-box:focus-within {
  border-color: var(--md-sys-color-primary);
  background: #ffffff;
}

.search-input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.875rem;
  width: 140px;
}

/* File Table */
.file-list-card {
  background: #ffffff;
  border-radius: var(--md-shape-corner-lg);
  border: 1px solid var(--md-sys-color-outline-variant);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.file-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.file-table th {
  background: var(--md-sys-color-surface-container);
  padding: 12px 16px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--md-sys-color-on-surface-variant);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.file-table td {
  padding: 12px 16px;
  font-size: 0.875rem;
  border-bottom: 1px solid #edf0f5;
  vertical-align: middle;
}

.file-table tr:hover td {
  background: #f8fafc;
}

.file-table tr:last-child td {
  border-bottom: none;
}

.file-cell-name {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
}

.file-type-icon {
  font-size: 22px;
  width: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.file-link {
  color: var(--md-sys-color-on-surface);
  text-decoration: none;
  cursor: pointer;
}

.file-link:hover {
  color: var(--md-sys-color-primary);
  text-decoration: underline;
}

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

/* CLI Helper Banner */
.cli-helper-card {
  background: #1e293b;
  color: #f1f5f9;
  border-radius: var(--md-shape-corner-lg);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cli-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 600;
  color: #94a3b8;
}

.cli-code {
  background: #0f172a;
  border-radius: 8px;
  padding: 10px 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.85rem;
  color: #38bdf8;
  overflow-x: auto;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* Modal Dialog */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

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

.modal-dialog {
  background: #ffffff;
  border-radius: var(--md-shape-corner-xl);
  padding: 24px;
  width: 90%;
  max-width: 480px;
  box-shadow: var(--md-elevation-3);
  transform: scale(0.95);
  transition: transform 0.2s ease;
}

.modal-overlay.active .modal-dialog {
  transform: scale(1);
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.modal-desc {
  font-size: 0.875rem;
  color: var(--md-sys-color-on-surface-variant);
  margin-bottom: 20px;
}

.input-field {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-shape-corner-md);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
  margin-bottom: 16px;
}

.input-field:focus {
  border-color: var(--md-sys-color-primary);
  box-shadow: 0 0 0 3px rgba(0, 99, 155, 0.15);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* Preview Modal for images / text */
.preview-modal .modal-dialog {
  max-width: 800px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.preview-content {
  overflow: auto;
  max-height: 60vh;
  margin-bottom: 16px;
  display: flex;
  justify-content: center;
  background: #f8fafc;
  border-radius: 8px;
  padding: 12px;
}

.preview-content img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

.preview-content pre {
  width: 100%;
  font-family: monospace;
  font-size: 0.85rem;
  white-space: pre-wrap;
  word-break: break-all;
}

/* Toast Notification */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 2000;
}

.toast {
  background: #1e293b;
  color: #ffffff;
  padding: 10px 18px;
  border-radius: 24px;
  font-size: 0.875rem;
  box-shadow: var(--md-elevation-2);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: fadeIn 0.2s ease;
}

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