@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

/* ============================================
   ITSG Drive - Design System & Variables
   Theme: Light & Dark Modes + Inter Sans-serif
   ============================================ */

:root {
  /* Font Family - Enforcing Inter across all UI */
  --font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'DM Mono', monospace;

  /* Common Metrics */
  --header-height: 64px;
  --toolbar-height: 76px;
  --statusbar-height: 36px;
  --sidebar-width: 256px;
  --ease-fast: 150ms cubic-bezier(.16, 1, .3, 1);
  --ease-smooth: 240ms cubic-bezier(.16, 1, .3, 1);
  --ease-bounce: 350ms cubic-bezier(.34, 1.56, .64, 1);

  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 26px;
}

/* Light Theme Variables (Default) */
[data-theme="light"], :root:not([data-theme="dark"]) {
  --canvas: #f4f6fa;
  --surface: #ffffff;
  --surface-hover: #f8fafc;
  --surface-active: #edf3fc;
  --surface-soft: #f1f4f9;

  --ink: #0f172a;
  --ink-soft: #475569;
  --ink-faint: #64748b;
  --ink-muted: #94a3b8;

  --line: #e2e8f0;
  --line-strong: #cbd5e1;

  --brand: #2563eb;
  --brand-hover: #1d4ed8;
  --brand-soft: rgba(37, 99, 235, .08);
  --brand-softer: rgba(37, 99, 235, .04);
  --brand-border: #bfdbfe;

  --accent-teal: #0d9488;
  --accent-amber: #d97706;
  --danger: #ef4444;
  --danger-soft: #fef2f2;
  --success: #10b981;
  --success-soft: #ecfdf5;

  --shadow-xs: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow-sm: 0 4px 12px rgba(15, 23, 42, .06);
  --shadow-md: 0 12px 28px rgba(15, 23, 42, .09);
  --shadow-lg: 0 24px 52px rgba(15, 23, 42, .15);
  --shadow-glow: 0 0 20px rgba(37, 99, 235, .22);

  --glass-bg: rgba(255, 255, 255, .82);
  --glass-border: rgba(226, 232, 240, .8);
}

/* Dark Theme Variables */
[data-theme="dark"] {
  --canvas: #090f1a;
  --surface: #111a2e;
  --surface-hover: #17233c;
  --surface-active: #1d2d4c;
  --surface-soft: #141f35;

  --ink: #f1f5f9;
  --ink-soft: #cbd5e1;
  --ink-faint: #8195b0;
  --ink-muted: #4e617b;

  --line: #1e2c44;
  --line-strong: #2c3e5d;

  --brand: #3b82f6;
  --brand-hover: #60a5fa;
  --brand-soft: rgba(59, 130, 246, .14);
  --brand-softer: rgba(59, 130, 246, .07);
  --brand-border: #2563eb;

  --accent-teal: #14b8a6;
  --accent-amber: #f59e0b;
  --danger: #f87171;
  --danger-soft: rgba(239, 68, 68, .12);
  --success: #34d399;
  --success-soft: rgba(16, 185, 129, .12);

  --shadow-xs: 0 1px 3px rgba(0, 0, 0, .3);
  --shadow-sm: 0 6px 16px rgba(0, 0, 0, .4);
  --shadow-md: 0 16px 36px rgba(0, 0, 0, .5);
  --shadow-lg: 0 28px 64px rgba(0, 0, 0, .7);
  --shadow-glow: 0 0 24px rgba(59, 130, 246, .3);

  --glass-bg: rgba(17, 26, 46, .85);
  --glass-border: rgba(30, 44, 68, .8);
}

/* ============================================
   Base Reset & Global Styles
   ============================================ */

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  font-family: var(--font-sans);
  color: var(--ink);
  background-color: var(--canvas);
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--ease-smooth), color var(--ease-smooth);
}

button, input, textarea, select {
  font-family: var(--font-sans);
  font-size: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: 0;
  background: transparent;
}

button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* SVG & Icon system */
.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 1.15em;
  height: 1.15em;
  display: inline-block;
  vertical-align: middle;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  flex-shrink: 0;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--ink-muted);
}

/* ============================================
   Login Screen
   ============================================ */

#login-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #07101f;
  transition: opacity .35s ease, visibility .35s ease;
}

#login-screen.hidden {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.login-backdrop {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(59, 130, 246, .22), transparent 40%),
              radial-gradient(circle at 80% 80%, rgba(20, 184, 166, .15), transparent 40%),
              linear-gradient(135deg, #060c18 0%, #0d192e 100%);
}

.login-shell {
  position: relative;
  z-index: 1;
  width: min(420px, calc(100% - 32px));
}

.login-card {
  padding: 38px 32px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: var(--radius-xl);
  background: rgba(15, 25, 43, .92);
  box-shadow: 0 32px 80px rgba(0, 0, 0, .55);
  backdrop-filter: blur(20px);
  animation: login-enter .45s var(--ease-bounce);
}

@keyframes login-enter {
  from { opacity: 0; transform: translateY(20px) scale(.96); }
}

.personal-login-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.03em;
}

.personal-login-brand em {
  font-style: normal;
  font-weight: 500;
  opacity: .7;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  box-shadow: 0 6px 18px rgba(37, 99, 235, .4);
}

.login-card-heading {
  text-align: center;
  margin-top: 28px;
}

.login-card h2 {
  margin: 0;
  color: #f8fafc;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.02em;
}

.login-subtitle {
  margin: 8px 0 28px;
  color: #94a3b8;
  text-align: center;
  font-size: 12px;
}

.login-field label {
  display: block;
  margin-bottom: 8px;
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 600;
}

.login-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.field-icon {
  position: absolute;
  left: 14px;
  color: #64748b;
}

.login-field input {
  width: 100%;
  height: 48px;
  padding: 0 44px 0 44px;
  border: 1px solid #283954;
  border-radius: var(--radius-md);
  color: #f8fafc;
  background: #0b1424;
  transition: border-color var(--ease-fast), box-shadow var(--ease-fast);
}

.login-field input::placeholder {
  color: #475569;
}

.login-field input:focus {
  border-color: var(--brand);
  background: #0e1a2f;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .2);
  outline: 0;
}

.toggle-password {
  position: absolute;
  right: 8px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-xs);
  color: #64748b;
  transition: color var(--ease-fast), background var(--ease-fast);
}

.toggle-password:hover {
  color: #3b82f6;
  background: rgba(59, 130, 246, .1);
}

.login-btn {
  width: 100%;
  height: 48px;
  margin-top: 24px;
  border-radius: var(--radius-md);
  color: #fff;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  box-shadow: 0 8px 20px rgba(37, 99, 235, .32);
  font-size: 14px;
  font-weight: 700;
  transition: transform var(--ease-fast), box-shadow var(--ease-fast);
}

.login-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(37, 99, 235, .42);
}

.login-btn:active {
  transform: translateY(0);
}

.login-btn .btn-text {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.spinner {
  display: none;
  width: 20px;
  height: 20px;
  margin: auto;
  border: 2px solid rgba(255, 255, 255, .3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
}

.login-btn.loading .btn-text { display: none; }
.login-btn.loading .spinner { display: block; }

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

.login-error {
  display: none;
  margin-top: 16px;
  padding: 11px 14px;
  border: 1px solid rgba(239, 68, 68, .3);
  border-radius: var(--radius-sm);
  color: #f87171;
  background: rgba(239, 68, 68, .1);
  font-size: 12px;
}
.login-error.show { display: block; }

.login-footnote {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 24px;
  color: #475569;
  font-size: 11px;
}

/* ============================================
   App Main Shell Layout
   ============================================ */

#file-manager {
  display: none;
  height: 100vh;
  flex-direction: column;
  background: var(--canvas);
}

#file-manager.active {
  display: flex;
  animation: app-in .3s var(--ease-smooth);
}

@keyframes app-in {
  from { opacity: 0; transform: scale(.99); }
}

/* Header */
.fm-header {
  z-index: 20;
  display: flex;
  align-items: center;
  flex: 0 0 var(--header-height);
  gap: 20px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-xs);
  transition: background var(--ease-smooth), border-color var(--ease-smooth);
}

.fm-brand-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 calc(var(--sidebar-width) - 20px);
}

.fm-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -.03em;
  text-decoration: none;
}

.fm-brand em {
  font-style: normal;
  font-weight: 500;
  color: var(--ink-faint);
}

.fm-brand .brand-mark {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
}

.history-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-right: 12px;
  border-right: 1px solid var(--line);
}

.history-controls .icon-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-xs);
}

.fm-breadcrumb {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
}

.fm-breadcrumb::-webkit-scrollbar { display: none; }

.breadcrumb-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: var(--radius-xs);
  color: var(--ink-faint);
  font-size: 12px;
  font-weight: 600;
  transition: color var(--ease-fast), background var(--ease-fast);
}

.breadcrumb-item:hover {
  color: var(--brand);
  background: var(--brand-soft);
}

.breadcrumb-item.active {
  color: var(--ink);
  background: var(--surface-soft);
  font-weight: 700;
}

.breadcrumb-sep {
  color: var(--ink-muted);
}

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

/* Theme Toggle Button Specifics */
#btn-theme-toggle {
  position: relative;
}

[data-theme="dark"] .theme-icon-sun { display: inline-block; color: var(--accent-amber); }
[data-theme="dark"] .theme-icon-moon { display: none; }
:root:not([data-theme="dark"]) .theme-icon-sun { display: none; }
:root:not([data-theme="dark"]) .theme-icon-moon { display: inline-block; color: var(--ink-faint); }

.header-btn, .toolbar-btn, .btn, .icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  background: var(--surface);
  font-size: 12px;
  font-weight: 600;
  transition: all var(--ease-fast);
}

.header-btn:hover, .toolbar-btn:hover {
  color: var(--ink);
  border-color: var(--brand-border);
  background: var(--surface-hover);
  box-shadow: var(--shadow-xs);
}

.header-btn.danger:hover {
  color: var(--danger);
  border-color: var(--danger);
  background: var(--danger-soft);
}

/* Toolbar */
.fm-toolbar {
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 var(--toolbar-height);
  gap: 16px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.toolbar-context h2 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -.03em;
}

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

.toolbar-btn-primary {
  color: #fff !important;
  border-color: var(--brand) !important;
  background: var(--brand) !important;
  box-shadow: 0 4px 12px rgba(37, 99, 235, .25);
}

.toolbar-btn-primary:hover {
  background: var(--brand-hover) !important;
  box-shadow: 0 6px 16px rgba(37, 99, 235, .35);
}

.action-menu {
  position: relative;
}

.menu-caret {
  width: 12px !important;
  margin-left: -2px;
  opacity: .7;
}

.action-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 100;
  display: grid;
  min-width: 168px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(16px);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity var(--ease-fast), transform var(--ease-fast);
}

.action-menu:hover .action-dropdown,
.action-menu:focus-within .action-dropdown {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.action-dropdown button {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 36px;
  padding: 0 10px;
  border-radius: var(--radius-xs);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
  transition: background var(--ease-fast), color var(--ease-fast);
}

.action-dropdown button:hover {
  color: var(--brand);
  background: var(--brand-soft);
}

.toolbar-divider {
  width: 1px;
  height: 24px;
  margin: 0 4px;
  background: var(--line);
}

.view-switcher {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.view-switcher .icon-btn {
  width: 30px;
  height: 28px;
  border: 0;
  border-radius: var(--radius-xs);
  color: var(--ink-faint);
  background: transparent;
}

.view-switcher .icon-btn.active {
  color: var(--brand);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.toolbar-search {
  position: relative;
  display: flex;
  align-items: center;
  width: 220px;
  height: 36px;
}

.toolbar-search-icon {
  position: absolute;
  left: 11px;
  color: var(--ink-muted);
}

.toolbar-search input {
  width: 100%;
  height: 100%;
  padding: 0 48px 0 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: var(--surface-soft);
  font-size: 12px;
  font-weight: 500;
  transition: width var(--ease-smooth), border-color var(--ease-fast), box-shadow var(--ease-fast);
}

.toolbar-search input::placeholder {
  color: var(--ink-muted);
}

.toolbar-search input:focus {
  width: 260px;
  border-color: var(--brand);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--brand-soft);
  outline: 0;
}

.toolbar-search kbd {
  position: absolute;
  right: 8px;
  padding: 2px 5px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  color: var(--ink-muted);
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 10px;
  pointer-events: none;
}

/* Sidebar & Body */
.fm-body {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.fm-sidebar {
  position: relative;
  z-index: 15;
  display: flex;
  flex: 0 0 var(--sidebar-width);
  flex-direction: column;
  padding: 20px 12px 14px;
  border-right: 1px solid var(--line);
  background: var(--surface);
  transition: background var(--ease-smooth), border-color var(--ease-smooth);
}

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

.sidebar-title {
  padding: 0 10px 6px;
  color: var(--ink-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 38px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  transition: all var(--ease-fast);
}

.sidebar-item:hover {
  color: var(--brand);
  background: var(--brand-softer);
}

.sidebar-item.active {
  color: var(--brand);
  background: var(--brand-soft);
  font-weight: 700;
}

.sidebar-item-icon {
  display: grid;
  place-items: center;
  width: 22px;
}

.star-icon-color { color: var(--accent-amber); }
.type-image-color { color: #ec4899; }
.type-video-color { color: #8b5cf6; }
.type-audio-color { color: #10b981; }
.type-doc-color { color: #3b82f6; }
.type-code-color { color: #f59e0b; }

.sidebar-divider {
  height: 1px;
  margin: 14px 10px;
  background: var(--line);
}

.sidebar-storage {
  margin-top: auto;
  padding: 16px 10px 4px;
}

.storage-heading {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  color: var(--ink-faint);
  font-size: 11px;
  font-weight: 600;
}

.storage-bar {
  height: 6px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--line);
}

.storage-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--accent-teal));
  transition: width .4s ease;
}

.storage-text {
  margin-top: 8px;
  color: var(--ink-muted);
  font-size: 10px;
  font-weight: 500;
}

/* Main Content Area */
.fm-content {
  position: relative;
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  background: var(--canvas);
}

.fm-content-inner {
  flex: 1;
  overflow: auto;
  padding: 24px 28px 40px;
}

.loading-state, .empty-state {
  display: flex;
  min-height: 100%;
  align-items: center;
  justify-content: center;
}

.loading-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid var(--line-strong);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .65s linear infinite;
}

.empty-state {
  flex-direction: column;
  gap: 8px;
  min-height: 320px;
  text-align: center;
}

.empty-state-icon {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  margin-bottom: 8px;
  border-radius: 22px;
  color: var(--brand);
  background: var(--brand-soft);
}

.empty-state-icon .icon { width: 32px; height: 32px; }

.empty-state-text {
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
}

.empty-state-hint {
  max-width: 280px;
  color: var(--ink-faint);
  font-size: 12px;
}

/* ============================================
   File View Modes: Grid & List
   ============================================ */

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

.file-item-grid {
  position: relative;
  display: flex;
  min-height: 165px;
  flex-direction: column;
  align-items: flex-start;
  padding: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  user-select: none;
  transition: transform var(--ease-fast), border-color var(--ease-fast), box-shadow var(--ease-fast), background var(--ease-fast);
}

.file-item-grid:hover {
  transform: translateY(-3px);
  border-color: var(--brand-border);
  box-shadow: var(--shadow-md);
  background: var(--surface-hover);
}

.file-item-grid.selected {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: 0 0 0 2px var(--brand-border);
}

.file-item-grid.drag-over {
  border-color: var(--brand);
  background: var(--brand-soft);
  transform: scale(1.03);
}

.file-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.file-icon .icon { width: 26px; height: 26px; }

.file-icon.type-folder { color: #f59e0b; background: rgba(245, 158, 11, .12); }
.file-icon.type-image { color: #ec4899; background: rgba(236, 72, 153, .12); }
.file-icon.type-video { color: #8b5cf6; background: rgba(139, 92, 246, .12); }
.file-icon.type-audio { color: #10b981; background: rgba(16, 185, 129, .12); }
.file-icon.type-pdf { color: #ef4444; background: rgba(239, 68, 68, .12); }
.file-icon.type-sheet { color: #10b981; background: rgba(16, 185, 129, .12); }
.file-icon.type-slides { color: #f97316; background: rgba(249, 115, 22, .12); }
.file-icon.type-code { color: #3b82f6; background: rgba(59, 130, 246, .12); }
.file-icon.type-archive { color: #d97706; background: rgba(217, 119, 6, .12); }
.file-icon.type-file { color: #64748b; background: rgba(100, 116, 139, .12); }

.file-item-grid .file-name {
  display: -webkit-box;
  width: 100%;
  margin-top: auto;
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  word-break: break-word;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.file-meta {
  display: block;
  width: 100%;
  margin-top: 4px;
  overflow: hidden;
  color: var(--ink-faint);
  font-size: 10px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-star-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  color: var(--accent-amber);
  display: flex;
  align-items: center;
}

.file-select-indicator {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 10;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xs);
  color: transparent;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  opacity: .5;
  transform: scale(.92);
  transition: all var(--ease-fast);
}

.file-item-grid:hover .file-select-indicator,
.file-item-list:hover .file-select-indicator {
  opacity: 1;
  transform: scale(1);
  border-color: var(--brand-border);
  color: var(--ink-muted);
}

.file-select-indicator.selected,
.file-item-grid.selected .file-select-indicator,
.file-item-list.selected .file-select-indicator {
  opacity: 1;
  transform: scale(1);
  border-color: var(--brand);
  background: var(--brand);
  color: #ffffff;
}

/* List View */
.file-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.file-list-header, .file-item-list {
  display: grid;
  grid-template-columns: 36px minmax(200px, 1fr) 130px 170px 40px;
  align-items: center;
}

.file-item-list .file-select-indicator {
  position: relative;
  top: auto;
  right: auto;
  opacity: .5;
}

.file-list-header {
  height: 40px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-faint);
  background: var(--surface-soft);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.file-list-header span {
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: color var(--ease-fast);
}

.file-list-header span:hover {
  color: var(--brand);
}

.file-item-list {
  height: 54px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  user-select: none;
  transition: background var(--ease-fast);
}

.file-item-list:last-child {
  border-bottom: 0;
}

.file-item-list:hover {
  background: var(--surface-hover);
}

.file-item-list.selected {
  background: var(--brand-soft);
  box-shadow: inset 3px 0 0 var(--brand);
}

.file-item-list.drag-over {
  background: var(--brand-soft);
}

.file-name-col {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
}

.file-item-list .file-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-xs);
}

.file-item-list .file-icon .icon { width: 18px; height: 18px; }

.file-item-list .file-name {
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-size, .file-date {
  color: var(--ink-faint);
  font-size: 11px;
  font-weight: 500;
}

.file-star-btn {
  color: var(--ink-muted);
  transition: color var(--ease-fast);
}

.file-star-btn.active, .file-star-btn:hover {
  color: var(--accent-amber);
}

/* Search results header */
.search-results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding: 12px 16px;
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-md);
  color: var(--brand);
  background: var(--brand-soft);
}

.search-results-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
}

.search-results-close {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: var(--radius-xs);
  color: var(--brand);
  font-size: 11px;
  font-weight: 700;
}

.search-results-close:hover {
  background: rgba(37, 99, 235, .15);
}

/* Inline Rename Input */
.rename-input {
  width: 100%;
  padding: 4px 8px;
  border: 1px solid var(--brand);
  border-radius: var(--radius-xs);
  color: var(--ink);
  background: var(--surface);
  font-size: 12px;
  outline: none;
  box-shadow: 0 0 0 3px var(--brand-soft);
}

/* ============================================
   Floating Batch Toolbar & Mobile FAB
   ============================================ */

.batch-toolbar {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  z-index: 500;
  opacity: 0;
  pointer-events: none;
  transition: transform .3s var(--ease-bounce), opacity .25s ease;
}

.batch-toolbar.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.batch-toolbar-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 18px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xl);
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.batch-count {
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.batch-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.batch-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--ink-soft);
  background: var(--surface);
  font-size: 12px;
  font-weight: 600;
  transition: all var(--ease-fast);
}

.batch-btn:hover {
  color: var(--brand);
  border-color: var(--brand-border);
  background: var(--brand-soft);
}

.batch-btn.danger:hover {
  color: var(--danger);
  border-color: var(--danger);
  background: var(--danger-soft);
}

.batch-btn.cancel {
  width: 34px;
  padding: 0;
  justify-content: center;
}

/* Mobile FAB */
.mobile-fab-container {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 450;
  display: none;
}

.mobile-fab-main {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  color: #fff;
  background: var(--brand);
  box-shadow: 0 8px 24px rgba(37, 99, 235, .4);
  transition: transform .25s var(--ease-bounce);
}

.mobile-fab-container.active .mobile-fab-main {
  transform: rotate(45deg);
  background: var(--ink-soft);
}

.mobile-fab-menu {
  position: absolute;
  bottom: 64px;
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: all .2s var(--ease-smooth);
}

.mobile-fab-container.active .mobile-fab-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.mobile-fab-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xl);
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

/* Status Bar */
.fm-statusbar {
  display: flex;
  align-items: center;
  flex: 0 0 var(--statusbar-height);
  gap: 18px;
  padding: 0 24px;
  border-top: 1px solid var(--line);
  color: var(--ink-faint);
  background: var(--surface);
  font-size: 11px;
  font-weight: 600;
}

.statusbar-item, .statusbar-sync {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.statusbar-sync {
  margin-left: auto;
  color: var(--success);
}

.statusbar-sync i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
}

/* Context Menu */
.context-menu {
  position: fixed;
  z-index: 2000;
  display: none;
  min-width: 220px;
  padding: 6px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(16px);
}

.context-menu.show {
  display: block;
  animation: pop-in .15s var(--ease-smooth);
}

@keyframes pop-in {
  from { opacity: 0; transform: scale(.96) translateY(-4px); }
}

.context-menu-item {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 36px;
  gap: 10px;
  padding: 0 10px;
  border-radius: var(--radius-xs);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  transition: background var(--ease-fast), color var(--ease-fast);
}

.context-menu-item:hover {
  color: var(--ink);
  background: var(--surface-hover);
}

.context-menu-item.danger:hover {
  color: var(--danger);
  background: var(--danger-soft);
}

.context-menu-item-icon {
  display: grid;
  place-items: center;
  width: 18px;
  color: var(--ink-faint);
}

.context-menu-item-shortcut {
  margin-left: auto;
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 10px;
}

.context-menu-divider {
  height: 1px;
  margin: 5px 6px;
  background: var(--line);
}

/* Modals */
.modal-overlay {
  position: fixed;
  z-index: 3000;
  display: none;
  place-items: center;
  inset: 0;
  padding: 20px;
  background: rgba(0, 0, 0, .45);
  backdrop-filter: blur(4px);
}

.modal-overlay.show {
  display: grid;
  animation: fade-in .15s ease;
}

@keyframes fade-in { from { opacity: 0; } }

.modal {
  display: flex;
  width: min(100%, 480px);
  max-height: min(720px, 90vh);
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  animation: modal-in .22s var(--ease-bounce);
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
}

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

.modal-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

.modal-title-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-xs);
  color: var(--brand);
  background: var(--brand-soft);
}

.modal-close {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: var(--radius-xs);
  color: var(--ink-faint);
}

.modal-close:hover {
  color: var(--ink);
  background: var(--surface-hover);
}

.modal-body {
  padding: 20px;
  overflow: auto;
  color: var(--ink-soft);
  font-size: 13px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
}

.modal-input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: var(--surface-soft);
  font-size: 13px;
  font-weight: 500;
  transition: all var(--ease-fast);
}

.modal-input:focus {
  border-color: var(--brand);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--brand-soft);
  outline: 0;
}

/* Editor Modal */
.modal.editor-modal {
  width: min(100%, 880px);
  height: min(84vh, 760px);
}

.modal.editor-modal .modal-body {
  display: flex;
  flex: 1;
  padding: 14px;
  overflow: hidden;
}

.editor-textarea {
  width: 100%;
  height: 100%;
  min-height: 320px;
  padding: 16px;
  resize: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: var(--surface-soft);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  outline: 0;
  tab-size: 2;
}

.editor-footer {
  justify-content: space-between;
  align-items: center;
}

.editor-stats {
  color: var(--ink-faint);
  font-size: 11px;
  font-weight: 500;
}

.modal-footer-btns {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Preview Modal */
.preview-modal {
  width: min(100%, 1020px);
  height: min(85vh, 780px);
}

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

.image-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
}

.preview-body {
  position: relative;
  display: flex;
  min-height: 0;
  flex: 1;
  padding: 14px;
  overflow: hidden;
  align-items: center;
  justify-content: center;
}

.preview-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--ink);
  background: var(--glass-bg);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(8px);
  transition: all var(--ease-fast);
}

.preview-nav-btn:hover {
  color: var(--brand);
  transform: translateY(-50%) scale(1.08);
}

.preview-nav-btn.prev { left: 24px; }
.preview-nav-btn.next { right: 24px; }

.preview-content {
  display: flex;
  width: 100%;
  height: 100%;
  min-height: 0;
  align-items: center;
  justify-content: center;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.preview-content img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform .2s ease;
}

.preview-content video {
  max-width: 100%;
  max-height: 100%;
  outline: none;
}

.preview-content audio {
  width: min(540px, 90%);
}

.preview-content iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.preview-text {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 20px;
  overflow: auto;
  color: var(--ink);
  background: var(--surface-soft);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
}

/* Upload Progress & Drag Overlay */
.drop-overlay {
  position: absolute;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  inset: 16px;
  border: 2px dashed var(--brand);
  border-radius: var(--radius-lg);
  background: var(--brand-soft);
  backdrop-filter: blur(6px);
}

.drop-overlay.show { display: flex; animation: fade-in .15s ease; }

.drop-overlay-icon {
  display: grid;
  width: 60px;
  height: 60px;
  margin: 0 auto 12px;
  place-items: center;
  border-radius: 20px;
  color: var(--brand);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.drop-overlay-icon .icon { width: 30px; height: 30px; }

.upload-progress {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 2500;
  display: none;
  width: 300px;
  padding: 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.upload-progress.show { display: block; animation: pop-in .2s ease; }

.upload-progress-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.upload-progress-bar {
  height: 6px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--line);
}

.upload-progress-bar-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--accent-teal));
  transition: width .25s ease;
}

.upload-progress-info {
  margin-top: 8px;
  color: var(--ink-faint);
  font-size: 11px;
}

/* Toasts */
.toast-container {
  position: fixed;
  bottom: calc(var(--statusbar-height) + 12px);
  right: 20px;
  z-index: 5000;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  width: min(340px, calc(100vw - 40px));
  gap: 10px;
  padding: 12px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  font-size: 12px;
  font-weight: 600;
  pointer-events: auto;
  backdrop-filter: blur(12px);
  animation: toast-in .25s var(--ease-bounce);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(16px) scale(.95); }
}

.toast.removing { animation: toast-out .2s ease forwards; }
@keyframes toast-out { to { opacity: 0; transform: translateY(12px) scale(.95); } }

.toast-icon {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
}

.toast.success .toast-icon { color: var(--success); background: var(--success-soft); }
.toast.error .toast-icon { color: var(--danger); background: var(--danger-soft); }
.toast.info .toast-icon { color: var(--brand); background: var(--brand-soft); }

/* Sidebar Toggle Overlay */
.sidebar-toggle { display: none; }
.sidebar-overlay { display: none; }

/* ============================================
   Responsive Media Queries for All Devices
   ============================================ */

/* Tablet (Max 900px) */
@media (max-width: 900px) {
  .fm-header { gap: 12px; padding: 0 16px; }
  .fm-brand-wrap { flex-basis: 180px; }
  .fm-toolbar { padding: 0 16px; }
  .fm-content-inner { padding: 20px; }
  .toolbar-search { width: 170px; }
  .toolbar-search input:focus { width: 200px; }
  .fm-sidebar { flex-basis: 220px; }
}

/* Mobile & Small Tablets (Max 768px) */
@media (max-width: 768px) {
  :root {
    --header-height: 58px;
    --toolbar-height: auto;
    --statusbar-height: 32px;
  }

  .sidebar-toggle { display: grid; }
  .mobile-fab-container { display: block; }

  .fm-header { gap: 10px; padding: 0 12px; }
  .fm-brand-wrap { flex: 0 0 auto; }
  .fm-brand { font-size: 16px; }
  .theme-label-text, .header-btn .btn-label { display: none; }
  .header-btn { width: 36px; padding: 0; }

  .fm-toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
    padding: 12px 14px;
  }

  .toolbar-actions {
    width: 100%;
    justify-content: space-between;
    gap: 6px;
  }

  .toolbar-btn .btn-label { display: none; }
  .toolbar-btn { height: 36px; padding: 0 10px; }

  .toolbar-search {
    flex: 1;
    min-width: 0;
    width: auto;
  }

  .toolbar-search input:focus { width: 100%; }
  .toolbar-search kbd { display: none; }

  /* Mobile Slide Drawer Sidebar */
  .fm-sidebar {
    position: fixed;
    top: var(--header-height);
    bottom: 0;
    left: calc(-1 * var(--sidebar-width));
    z-index: 100;
    width: var(--sidebar-width);
    box-shadow: var(--shadow-lg);
    transition: left .28s var(--ease-smooth);
  }

  .fm-sidebar.open { left: 0; }

  .sidebar-overlay {
    position: fixed;
    z-index: 90;
    inset: var(--header-height) 0 0 0;
    background: rgba(0, 0, 0, .4);
    backdrop-filter: blur(3px);
  }

  .sidebar-overlay.show { display: block; }

  .fm-content-inner { padding: 16px 14px 80px; }

  .file-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
  }

  .file-item-grid { min-height: 145px; padding: 12px; }

  .file-list-header, .file-item-list {
    grid-template-columns: minmax(0, 1fr) 90px 36px;
    padding-right: 12px;
    padding-left: 12px;
  }

  .file-list-header span:nth-child(2), .file-size { display: none; }

  .batch-toolbar { width: calc(100% - 24px); }
  .batch-toolbar-inner { justify-content: space-between; width: 100%; padding: 8px 12px; }
  .batch-btn span { display: none; }

  .preview-modal { height: min(90vh, 760px); }
  .preview-nav-btn { width: 34px; height: 34px; }
  .preview-nav-btn.prev { left: 10px; }
  .preview-nav-btn.next { right: 10px; }
}

/* Small Screens (Max 480px) */
@media (max-width: 480px) {
  .file-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toolbar-divider { display: none; }
  .fm-brand em { display: none; }
  .login-card { padding: 28px 20px; }
}

/* =========================================
   Real Server Metrics & Storage Styles
   ========================================= */
.storage-heading-title {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
}
.storage-heading-title .icon {
  width: 14px;
  height: 14px;
  color: var(--brand);
}

.icon-btn-xs {
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: var(--radius-xs);
}
.icon-btn-xs .icon {
  width: 12px;
  height: 12px;
}

.storage-subtext {
  margin-top: 2px;
  color: var(--ink-faint);
  font-size: 10px;
}

.server-mini-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 10px;
}

.mini-metric-item {
  display: flex;
  flex-direction: column;
  padding: 6px 8px;
  background: var(--surface-hover);
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
}

.mini-metric-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  font-weight: 600;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.mini-metric-label .icon {
  width: 11px;
  height: 11px;
  color: var(--brand);
}

.mini-metric-val {
  margin-top: 2px;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
  font-family: var(--font-mono, monospace);
}

.btn-server-detail {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  margin-top: 10px;
  padding: 6px 10px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--ink-muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--ease-fast);
}
.btn-server-detail:hover {
  background: var(--brand-soft);
  border-color: var(--brand-border);
  color: var(--brand);
}
.btn-server-detail .icon {
  width: 13px;
  height: 13px;
}

/* Status dots */
.server-status-dot, .status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  background: #94a3b8;
}
.server-status-dot.online, .status-dot.online {
  background: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
}
.server-status-dot.offline, .status-dot.offline {
  background: #ef4444;
}
.server-status-dot.warning, .status-dot.warning {
  background: #f59e0b;
}

.statusbar-server-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  color: inherit;
  font: inherit;
  transition: background var(--ease-fast);
}
.statusbar-server-btn:hover {
  background: var(--surface-hover);
}

/* Server Modal */
.server-modal {
  max-width: 680px;
  width: 95%;
}

.server-modal-body {
  max-height: 75vh;
  overflow-y: auto;
  padding: 20px;
}

.server-status-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (max-width: 580px) {
  .server-status-grid {
    grid-template-columns: 1fr;
  }
}

.server-card {
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.server-card.full-width {
  grid-column: 1 / -1;
}

.server-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.server-card-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--ink-muted);
  letter-spacing: 0.5px;
}
.server-card-title .icon {
  width: 14px;
  height: 14px;
  color: var(--brand);
}

.server-card-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 99px;
  background: var(--line);
  color: var(--ink-muted);
}
.server-card-badge.good { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.server-card-badge.warn { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.server-card-badge.danger { background: rgba(239, 68, 68, 0.15); color: #ef4444; }

.server-card-val {
  font-size: 20px;
  font-weight: 800;
  color: var(--ink);
  font-family: var(--font-mono, monospace);
  line-height: 1.2;
}

.server-card-sub {
  font-size: 11px;
  color: var(--ink-faint);
}

.server-bar-track {
  width: 100%;
  height: 6px;
  background: var(--line);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 4px;
}
.server-bar-fill {
  height: 100%;
  border-radius: 99px;
  background: var(--brand);
  transition: width 0.3s ease;
}
.server-bar-fill.warn { background: #f59e0b; }
.server-bar-fill.danger { background: #ef4444; }

.server-info-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 12px;
  font-size: 11px;
  margin-top: 4px;
}
.server-info-label {
  color: var(--ink-faint);
  font-weight: 500;
}
.server-info-val {
  color: var(--ink);
  font-weight: 600;
  font-family: var(--font-mono, monospace);
  word-break: break-all;
}

.server-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.server-last-updated {
  font-size: 11px;
  color: var(--ink-faint);
}

/* =========================================
   Enhanced Real Upload Progress Styles
   ========================================= */
.upload-progress {
  position: fixed;
  right: 24px;
  bottom: calc(var(--statusbar-height, 32px) + 16px);
  z-index: 2500;
  display: none;
  width: 320px;
  padding: 14px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(10px);
}

.upload-progress.show {
  display: block;
  animation: pop-in 0.2s ease;
}

.upload-progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.upload-progress-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  min-width: 0;
}
.upload-progress-title span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.upload-progress-title .icon {
  width: 16px;
  height: 16px;
  color: var(--brand);
  flex-shrink: 0;
}

.upload-cancel-btn {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--ink-faint);
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all var(--ease-fast);
  flex-shrink: 0;
}
.upload-cancel-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}
.upload-cancel-btn .icon {
  width: 13px;
  height: 13px;
}

.upload-progress-bar {
  height: 6px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--line);
}

.upload-progress-bar-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--accent-teal));
  transition: width 0.15s ease-out;
}

.upload-progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  font-size: 11px;
}

.upload-progress-percent {
  font-weight: 700;
  color: var(--brand);
  font-family: var(--font-mono, monospace);
}

.upload-progress-speed {
  font-weight: 500;
  color: var(--ink-muted);
  font-size: 10px;
  font-family: var(--font-mono, monospace);
}

.upload-progress-details {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
  color: var(--ink-faint);
  font-size: 10px;
}

.upload-progress-eta {
  font-style: italic;
}

/* =========================================
   Real Thumbnail Preview Styles
   ========================================= */
.file-thumb-container {
  position: relative;
  width: 100%;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-xs);
  overflow: hidden;
  background: var(--surface-hover);
  margin-bottom: 4px;
}

.file-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  transition: transform 0.25s ease, opacity 0.2s ease;
  opacity: 0;
}
.file-thumb-img.loaded {
  opacity: 1;
}

.file-item-grid:hover .file-thumb-img {
  transform: scale(1.05);
}

.file-thumb-badge {
  position: absolute;
  bottom: 4px;
  right: 4px;
  padding: 2px 4px;
  border-radius: var(--radius-xs);
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 3px;
  pointer-events: none;
}
.file-thumb-badge .icon {
  width: 10px;
  height: 10px;
}

/* List view thumbnail */
.file-list-thumb {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-xs);
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--line);
}

