/* ==========================================================================
   Spac2 Workspace — Modern Office Desktop UI
   Path: /workspace/css/workspace.css
   Aesthetic inspired by Modern Cloud Office Platforms
   ========================================================================== */

:root {
  /* Core Color Palette - Dark Theme (Default) */
  --bg-app: #121212;
  --bg-surface: #121212;
  --bg-surface-subtle: #1a1a1a;
  --bg-surface-hover: #222222;

  --primary-blue: #3b82f6;
  --primary-blue-hover: #60a5fa;
  --primary-blue-soft: rgba(59, 130, 246, 0.15);
  --primary-blue-border: rgba(59, 130, 246, 0.3);

  --color-green: #10b981;
  --color-green-soft: rgba(16, 185, 129, 0.15);
  --color-green-border: rgba(16, 185, 129, 0.3);

  --color-orange: #f97316;
  --color-orange-soft: rgba(249, 115, 22, 0.15);
  --color-orange-border: rgba(249, 115, 22, 0.3);

  --color-purple: #8b5cf6;
  --color-purple-soft: rgba(139, 92, 246, 0.15);
  --color-purple-border: rgba(139, 92, 246, 0.3);

  --color-red: #ef4444;
  --color-red-soft: rgba(239, 68, 68, 0.15);
  --color-red-border: rgba(239, 68, 68, 0.3);

  /* Typography Colors */
  --text-main: #f4f4f5;
  --text-muted: #a1a1aa;
  --text-light: #71717a;
  --border-color: #262626;
  --border-light: #1e1e1e;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.8);
  --shadow-hover: 0 12px 28px rgba(0, 0, 0, 0.85), 0 0 15px rgba(59, 130, 246, 0.2);

  /* Border Radii */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Transitions */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: all 0.18s var(--ease);
  --transition-normal: all 0.26s var(--ease);
}

/* Light Theme Overrides */
body.office-theme-light,
.office-theme-light {
  --bg-app: #f4f6fa;
  --bg-surface: #ffffff;
  --bg-surface-subtle: #f8fafc;
  --bg-surface-hover: #f1f5f9;
  
  --primary-blue: #3b82f6;
  --primary-blue-hover: #2563eb;
  --primary-blue-soft: #eff6ff;
  --primary-blue-border: #bfdbfe;

  --color-green: #10b981;
  --color-green-soft: #ecfdf5;
  --color-green-border: #a7f3d0;

  --color-orange: #f97316;
  --color-orange-soft: #fff7ed;
  --color-orange-border: #fed7aa;

  --color-purple: #8b5cf6;
  --color-purple-soft: #f5f3ff;
  --color-purple-border: #ddd6fe;

  --color-red: #ef4444;
  --color-red-soft: #fef2f2;
  --color-red-border: #fecaca;

  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --border-color: #e2e8f0;
  --border-light: #f1f5f9;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
  --shadow-hover: 0 12px 28px rgba(59, 130, 246, 0.12), 0 4px 8px rgba(0, 0, 0, 0.04);
}

/* Dark Theme Overrides */
body.office-theme-dark {
  --bg-app: #121212;
  --bg-surface: #121212;
  --bg-surface-subtle: #1a1a1a;
  --bg-surface-hover: #222222;

  --primary-blue: #3b82f6;
  --primary-blue-hover: #60a5fa;
  --primary-blue-soft: rgba(59, 130, 246, 0.15);
  --primary-blue-border: rgba(59, 130, 246, 0.3);

  --color-green-soft: rgba(16, 185, 129, 0.15);
  --color-green-border: rgba(16, 185, 129, 0.3);

  --color-orange-soft: rgba(249, 115, 22, 0.15);
  --color-orange-border: rgba(249, 115, 22, 0.3);

  --color-purple-soft: rgba(139, 92, 246, 0.15);
  --color-purple-border: rgba(139, 92, 246, 0.3);

  --color-red-soft: rgba(239, 68, 68, 0.15);
  --color-red-border: rgba(239, 68, 68, 0.3);

  --text-main: #f4f4f5;
  --text-muted: #a1a1aa;
  --text-light: #71717a;
  --border-color: #262626;
  --border-light: #1e1e1e;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.8);
  --shadow-hover: 0 12px 28px rgba(0, 0, 0, 0.85), 0 0 15px rgba(59, 130, 246, 0.2);
}

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  background-color: #121212;
}

body {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  background-color: var(--bg-app);
  color: var(--text-main);
  font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.35);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.6);
}

/* ==========================================================================
   Main Application Wrapper
   ========================================================================== */
.office-app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
  max-width: 1680px;
  margin: 0 auto;
  background: var(--bg-surface);
}

/* ==========================================================================
   Standardized Floating Glassmorphism Header (Countday Reference)
   ========================================================================== */
.pointer-events-none {
  pointer-events: none !important;
}

.pointer-events-auto {
  pointer-events: auto !important;
}

.glass-panel {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 8px 30px -4px rgba(0, 0, 0, 0.05), 0 2px 8px -1px rgba(0, 0, 0, 0.03);
}

body.office-theme-dark .glass-panel,
.dark .glass-panel {
  background: rgba(18, 18, 18, 0.65);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 36px -4px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.app-header-fixed {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding: calc(0.75rem + env(safe-area-inset-top)) 1rem 0;
}

.app-header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 20px;
  transition: var(--transition-normal);
  gap: 0.75rem;
}

@media (min-width: 768px) {
  .app-header-inner {
    border-radius: 22px;
    padding: 0.55rem 1.25rem;
  }
}

.header-brand-group {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

/* Back Button (.btn-back) */
.btn-back {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.04);
  border: 1.5px solid rgba(0, 0, 0, 0.22);
  color: #1f2937;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  flex-shrink: 0;
  font-size: 18px;
}

body.office-theme-dark .btn-back,
.dark .btn-back {
  background: rgba(255, 255, 255, 0.07);
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  color: #f4f4f5;
}

.btn-back:hover {
  background: rgba(0, 0, 0, 0.08);
  color: #000000;
  transform: translateX(-2px);
  border-color: rgba(0, 0, 0, 0.45);
}

body.office-theme-dark .btn-back:hover,
.dark .btn-back:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.42);
}

.btn-back:active {
  transform: scale(0.92);
  background: rgba(0, 0, 0, 0.12);
  border-color: rgba(0, 0, 0, 0.55);
}

body.office-theme-dark .btn-back:active,
.dark .btn-back:active {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.6);
}

.btn-sidebar-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border-color);
  font-size: 1.25rem;
  color: var(--text-main);
  cursor: pointer;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--bg-surface-subtle);
  transition: var(--transition-fast);
}

.btn-sidebar-toggle:hover {
  background: var(--bg-surface-hover);
  border-color: var(--primary-blue);
  color: var(--primary-blue);
}

/* Brand Link & Square Logo Card */
.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  transition: opacity 0.15s ease;
}

.brand-link:hover {
  opacity: 0.92;
}

.brand-logo-card {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.06);
  flex-shrink: 0;
  padding: 3.5px;
  box-sizing: border-box;
  transition: transform 0.2s ease;
}

body.office-theme-dark .brand-logo-card,
.dark .brand-logo-card {
  background: #ffffff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.brand-link:hover .brand-logo-card {
  transform: scale(1.04);
}

.brand-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 6px;
  display: block;
}

/* Brand Text: Spac2 | Workspace */
.brand-text {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  line-height: 1;
  white-space: nowrap;
}

.brand-name {
  font-weight: 800;
  font-size: 19px;
  color: #111827;
  letter-spacing: -0.025em;
  line-height: 1;
}

body.office-theme-dark .brand-name,
.dark .brand-name {
  color: #ffffff;
}

.brand-divider {
  font-size: 14px;
  font-weight: 300;
  color: #9ca3af;
  opacity: 0.7;
}

body.office-theme-dark .brand-divider,
.dark .brand-divider {
  color: #52525b;
  opacity: 0.85;
}

.brand-app {
  font-size: 14px;
  font-weight: 600;
  color: #4b5563;
  letter-spacing: -0.01em;
}

body.office-theme-dark .brand-app,
.dark .brand-app {
  color: #a1a1aa;
}

/* Right Actions Group */
.header-actions-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ==========================================================================
   Modern Search Bar Section (Below Header)
   ========================================================================== */
.workspace-search-section {
  width: 100%;
  margin-bottom: 0.25rem;
}

.workspace-search-box {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 0.6rem 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-fast);
}

.workspace-search-box:focus-within {
  border-color: var(--primary-blue);
  background: var(--bg-surface);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.14), var(--shadow-md);
  transform: translateY(-1px);
}

.workspace-search-box .search-icon {
  font-size: 1.2rem;
  color: var(--text-light);
  margin-right: 0.75rem;
  flex-shrink: 0;
}

.workspace-search-box .search-input {
  width: 100%;
  border: none;
  background: transparent;
  outline: none;
  font-family: inherit;
  font-size: 0.94rem;
  font-weight: 500;
  color: var(--text-main);
}

.workspace-search-box .search-input::placeholder {
  color: var(--text-light);
}

.workspace-search-box .search-hint {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-light);
  background: var(--border-color);
  padding: 0.12rem 0.5rem;
  border-radius: 4px;
  user-select: none;
  margin-right: 0.4rem;
}

.workspace-search-box .search-clear-btn {
  background: none;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  font-size: 1rem;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0.2rem;
  border-radius: 50%;
}

.workspace-search-box .search-clear-btn:hover {
  color: var(--text-main);
  background: var(--bg-surface-hover);
}

/* Header Right Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

.btn-header-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.4rem 0.65rem;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
}

.btn-header-link:hover {
  color: var(--primary-blue);
  background: var(--primary-blue-soft);
}

.header-utility-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-header-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-muted);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-header-icon:hover {
  background: var(--bg-surface-hover);
  color: var(--text-main);
  border-color: var(--text-light);
}

.btn-header-icon.sound-active {
  color: var(--primary-blue);
  border-color: var(--primary-blue-border);
  background: var(--primary-blue-soft);
}

.btn-header-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 0.35rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-header-pill:hover {
  background: var(--bg-surface-hover);
  color: var(--text-main);
}

/* User Profile Badge */
.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.25rem 0.65rem 0.25rem 0.25rem;
  border-radius: var(--radius-full);
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-color);
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: var(--transition-fast);
}

.user-profile-badge:hover {
  background: var(--bg-surface-hover);
  border-color: var(--primary-blue-border);
  transform: translateY(-1px);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #cbd5e1;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  overflow: hidden;
  flex-shrink: 0;
}

.user-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.user-avatar-initial {
  font-size: 0.85rem;
  font-weight: 800;
  color: #1e293b;
  text-transform: uppercase;
  line-height: 1;
}

body.office-theme-dark .user-avatar-initial {
  color: #f1f5f9;
}

body.office-theme-dark .user-avatar {
  background: #334155;
  color: #cbd5e1;
}

.user-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  text-align: left;
}

.user-name {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-main);
}

.user-status-text {
  font-size: 0.68rem;
  color: var(--text-light);
}

/* ==========================================================================
   2-Column Layout (Sidebar + Main Workspace)
   ========================================================================== */
.office-body-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
  width: 100%;
  background: var(--bg-surface);
  padding-top: calc(90px + env(safe-area-inset-top));
}

/* ==========================================================================
   Left Sidebar Navigation
   ========================================================================== */
.office-sidebar {
  padding: 1.25rem 1rem;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  background: var(--bg-surface);
}

.sidebar-top-actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

/* Primary Create Button & Dropdown */
.create-dropdown-wrapper {
  position: relative;
  width: 100%;
}

.btn-create-primary {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--primary-blue);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  padding: 0.75rem 1.15rem;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
  transition: var(--transition-fast);
}

.btn-create-primary:hover {
  background: var(--primary-blue-hover);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.35);
  transform: translateY(-1px);
}

.btn-create-icon {
  font-size: 1.15rem;
}

.create-menu-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 250px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 0.5rem;
  display: none;
  flex-direction: column;
  gap: 0.25rem;
  z-index: 200;
  animation: dropdownFade 0.18s ease-out;
}

.create-menu-dropdown.show {
  display: flex;
}

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

.create-menu-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.65rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-main);
  transition: var(--transition-fast);
}

.create-menu-item:hover {
  background: var(--bg-surface-hover);
}

.create-item-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.create-item-text strong {
  font-size: 0.84rem;
  font-weight: 700;
}

.create-item-text small {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Dashed Open File Button */
.btn-open-file {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: transparent;
  color: var(--text-main);
  border: 1.5px dashed var(--text-light);
  border-radius: var(--radius-md);
  padding: 0.7rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-open-file:hover {
  border-color: var(--primary-blue);
  color: var(--primary-blue);
  background: var(--primary-blue-soft);
}

/* Sidebar Nav Items */
.sidebar-nav-section {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.nav-item-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-md);
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: var(--transition-fast);
  width: 100%;
}

.nav-item-btn i {
  font-size: 1.15rem;
  flex-shrink: 0;
}

.nav-item-btn:hover {
  background: var(--bg-surface-hover);
  color: var(--text-main);
}

.nav-item-btn.active {
  background: var(--primary-blue-soft);
  color: var(--primary-blue);
  font-weight: 700;
}

.nav-counter {
  margin-left: auto;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.1rem 0.45rem;
  border-radius: 99px;
  background: var(--border-color);
  color: var(--text-muted);
}

.nav-item-btn.active .nav-counter {
  background: var(--primary-blue-border);
  color: var(--primary-blue);
}

/* Sidebar Categories */
.sidebar-category-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.category-heading {
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding-left: 0.65rem;
}

.category-list {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.category-filter-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 0.84rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition-fast);
  text-align: left;
  width: 100%;
}

.category-filter-item:hover {
  background: var(--bg-surface-hover);
}

.category-filter-item.active {
  background: var(--bg-surface-subtle);
  border-left: 3px solid var(--primary-blue);
  font-weight: 700;
}

/* Badges for File Types */
.badge-type-mini {
  font-size: 0.66rem;
  font-weight: 800;
  padding: 0.18rem 0.42rem;
  border-radius: 4px;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  text-transform: uppercase;
}

.badge-doc { background: #dbeafe; color: #1d4ed8; }
.badge-xls { background: #dcfce7; color: #15803d; }
.badge-ppt { background: #ffedd5; color: #c2410c; }
.badge-chat { background: #ede9fe; color: #6d28d9; }
.badge-pdf { background: #fee2e2; color: #b91c1c; }
.badge-prod { background: #e0f2fe; color: #0369a1; }
.badge-util { background: #f1f5f9; color: #475569; }
.badge-note { background: #fef3c7; color: #b45309; }
.badge-task { background: #ccfbf1; color: #0f766e; }
.badge-map { background: #e0e7ff; color: #4338ca; }
.badge-cal { background: #e0f2fe; color: #0284c7; }
.badge-code { background: #f3e8ff; color: #7e22ce; }

body.office-theme-dark .badge-doc { background: rgba(59, 130, 246, 0.25); color: #93c5fd; }
body.office-theme-dark .badge-xls { background: rgba(16, 185, 129, 0.25); color: #86efac; }
body.office-theme-dark .badge-ppt { background: rgba(249, 115, 22, 0.25); color: #fdba74; }
body.office-theme-dark .badge-chat { background: rgba(139, 92, 246, 0.25); color: #c4b5fd; }
body.office-theme-dark .badge-pdf { background: rgba(239, 68, 68, 0.25); color: #fca5a5; }
body.office-theme-dark .badge-prod { background: rgba(14, 165, 233, 0.25); color: #7dd3fc; }
body.office-theme-dark .badge-util { background: rgba(148, 163, 184, 0.2); color: #cbd5e1; }
body.office-theme-dark .badge-note { background: rgba(245, 158, 11, 0.25); color: #fde68a; }
body.office-theme-dark .badge-task { background: rgba(20, 184, 166, 0.25); color: #99f6e4; }
body.office-theme-dark .badge-map { background: rgba(99, 102, 241, 0.25); color: #c7d2fe; }
body.office-theme-dark .badge-cal { background: rgba(14, 165, 233, 0.25); color: #7dd3fc; }
body.office-theme-dark .badge-code { background: rgba(168, 85, 247, 0.25); color: #e9d5ff; }

.sidebar-footer {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.version-label {
  font-size: 0.72rem;
  color: var(--text-light);
}

/* ==========================================================================
   Center Main Content
   ========================================================================== */
.office-main-content {
  padding: 1.5rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  overflow-y: auto;
  background: var(--bg-surface);
}

.section-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.01em;
  margin-bottom: 0.85rem;
}

/* Quick Create Section */
.quick-create-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.create-card-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  cursor: pointer;
  user-select: none;
  transition: var(--transition-fast);
}

.create-card-item:hover {
  transform: translateY(-3px);
}

.card-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  padding: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.create-card-item:hover .card-preview {
  box-shadow: var(--shadow-md);
  border-color: var(--text-light);
}

/* Doc Card Background & Illustration */
.doc-preview-bg {
  background: #f0f7ff;
}
body.office-theme-dark .doc-preview-bg {
  background: rgba(59, 130, 246, 0.1);
}

.preview-doc-paper {
  width: 75%;
  height: 80%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-content: center;
}

.doc-line {
  height: 5px;
  border-radius: 3px;
  background: #bfdbfe;
}
.line-1 { width: 90%; }
.line-2 { width: 75%; }
.line-3 { width: 85%; }
.line-4 { width: 60%; }
.line-5 { width: 80%; }

/* XLS Card Background & Illustration */
.xls-preview-bg {
  background: #f2fbf6;
}
body.office-theme-dark .xls-preview-bg {
  background: rgba(16, 185, 129, 0.1);
}

.preview-grid-table {
  width: 85%;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.grid-table-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.65rem;
  font-weight: 700;
  color: #10b981;
  border-bottom: 1px solid #a7f3d0;
  padding-bottom: 2px;
}

.grid-table-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.62rem;
  color: #6ee7b7;
}

.cell-fill {
  flex: 1;
  height: 6px;
  border-radius: 2px;
  background: #d1fae5;
}

.cell-green-light {
  background: #a7f3d0;
}

/* PPT Card Background & Illustration */
.ppt-preview-bg {
  background: #fff8f2;
}
body.office-theme-dark .ppt-preview-bg {
  background: rgba(249, 115, 22, 0.1);
}

.preview-slides-slide {
  width: 80%;
  height: 75%;
  background: #ffedd5;
  border-radius: 6px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.slide-header-bar {
  width: 60%;
  height: 6px;
  background: #fb923c;
  border-radius: 2px;
}

.slide-body-split {
  flex: 1;
  display: flex;
  gap: 4px;
}

.slide-block-left {
  width: 45%;
  height: 100%;
  background: #fdba74;
  border-radius: 2px;
}

.slide-block-right {
  width: 55%;
  height: 100%;
  background: #fed7aa;
  border-radius: 2px;
}

/* Chat Card Background & Illustration */
.chat-preview-bg {
  background: #f7f4fe;
}
body.office-theme-dark .chat-preview-bg {
  background: rgba(139, 92, 246, 0.1);
}

.preview-chat-bubbles {
  width: 85%;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.chat-bubble {
  padding: 4px 6px;
  border-radius: 6px;
  max-width: 70%;
}

.bubble-left {
  align-self: flex-start;
  background: #ede9fe;
}

.bubble-right {
  align-self: flex-end;
  background: #ddd6fe;
}

.bubble-line {
  height: 4px;
  border-radius: 2px;
}

.line-purple { width: 32px; background: #8b5cf6; }
.line-purple-light { width: 28px; background: #a78bfa; }

/* Plus Button on Cards */
.card-plus-btn {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.88rem;
  font-weight: 800;
  transition: var(--transition-fast);
}

.plus-blue { background: #dbeafe; color: #2563eb; }
.plus-green { background: #dcfce7; color: #16a34a; }
.plus-orange { background: #ffedd5; color: #ea580c; }
.plus-purple { background: #ede9fe; color: #7c3aed; }

.create-card-item:hover .card-plus-btn {
  transform: scale(1.15);
}

.create-card-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
}

/* Frequent Folders Section */
.folders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

.folder-card-item {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-fast);
}

.folder-card-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-blue);
}

.folder-tab-badge {
  position: absolute;
  top: 0;
  left: 1rem;
  width: 38px;
  height: 4px;
  border-radius: 0 0 4px 4px;
  background: #f97316;
}

.badge-blue-tab { background: #3b82f6; }
.badge-purple-tab { background: #8b5cf6; }

.folder-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 0.25rem;
}

.folder-time {
  font-size: 0.74rem;
  color: var(--text-muted);
}

/* Files Listing Section */
.listing-header-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.listing-title-group {
  display: flex;
  align-items: center;
  gap: 1.15rem;
  flex-wrap: wrap;
}

.listing-title-group .section-title {
  margin-bottom: 0;
}

/* View Switcher: All Files vs All Apps */
.listing-view-switcher {
  display: inline-flex;
  align-items: center;
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-color);
  padding: 3px;
  border-radius: var(--radius-full);
  gap: 3px;
}

.btn-view-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.9rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition-fast);
  user-select: none;
}

.btn-view-toggle:hover {
  color: var(--text-main);
  background: rgba(0, 0, 0, 0.04);
}

body.office-theme-dark .btn-view-toggle:hover {
  background: rgba(255, 255, 255, 0.06);
}

.btn-view-toggle.active {
  background: var(--bg-surface);
  color: var(--primary-blue);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.04);
}

body.office-theme-dark .btn-view-toggle.active {
  background: #27272a;
  color: #60a5fa;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.btn-view-toggle i {
  font-size: 0.95rem;
}

.listing-count-badge {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-color);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
}

/* Guest Empty State in All Files */
.auth-guest-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3.5rem 1.5rem;
  background: var(--bg-surface-subtle);
  border: 1.5px dashed var(--border-color);
  border-radius: var(--radius-lg);
  margin-top: 0.5rem;
  transition: var(--transition-fast);
}

.auth-guest-empty-state:hover {
  border-color: var(--primary-blue-border);
}

.guest-illustration-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.1);
  color: var(--primary-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.15);
}

.guest-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.01em;
  margin-bottom: 0.5rem;
}

.guest-desc {
  max-width: 500px;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.guest-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}

.btn-guest-login {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--primary-blue);
  color: #ffffff;
  padding: 0.65rem 1.35rem;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
  transition: var(--transition-fast);
}

.btn-guest-login:hover {
  background: var(--primary-blue-hover);
  box-shadow: 0 6px 18px rgba(59, 130, 246, 0.35);
  transform: translateY(-1px);
}

.btn-guest-register {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 0.65rem 1.35rem;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  transition: var(--transition-fast);
}

.btn-guest-register:hover {
  background: var(--bg-surface-hover);
  border-color: var(--text-light);
  transform: translateY(-1px);
}

.cloud-sync-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: #10b981;
  background: rgba(16, 185, 129, 0.1);
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
}

body.office-theme-dark .cloud-sync-tag {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
}

.files-list-table {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

/* ==========================================================================
   Modern App Grid View (Optimized for High Density & Icon Display)
   ========================================================================== */
.apps-grid-view {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: 1.15rem 0.85rem;
  padding: 0.25rem 0 1rem;
  width: 100%;
}

.app-grid-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0.85rem 0.5rem 0.65rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  cursor: pointer;
  user-select: none;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.app-grid-card:hover {
  transform: translateY(-4px);
  background: var(--bg-surface-hover);
  border-color: var(--primary-blue-border);
  box-shadow: 0 8px 20px -4px rgba(59, 130, 246, 0.16), 0 2px 6px rgba(0, 0, 0, 0.04);
}

body.office-theme-dark .app-grid-card {
  background: var(--bg-surface-subtle);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.office-theme-dark .app-grid-card:hover {
  background: var(--bg-surface-hover);
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6), 0 0 12px rgba(59, 130, 246, 0.2);
}

/* App Icon Box */
.app-grid-icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 0.65rem;
  flex-shrink: 0;
  transition: transform 0.2s ease;
  padding: 2.5px;
}

body.office-theme-dark .app-grid-icon-wrap {
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.app-grid-card:hover .app-grid-icon-wrap {
  transform: scale(1.08);
}

.app-grid-icon-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 11px;
  display: block;
}

/* App Title */
.app-grid-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
  max-width: 100%;
  transition: color 0.15s ease;
}

.app-grid-card:hover .app-grid-title {
  color: var(--primary-blue);
}

/* Star Favorite Button on Grid Card */
.app-grid-star-btn {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.06);
  color: var(--text-light);
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: var(--transition-fast);
  z-index: 2;
}

body.office-theme-dark .app-grid-star-btn {
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(255, 255, 255, 0.1);
}

.app-grid-card:hover .app-grid-star-btn,
.app-grid-star-btn.active {
  opacity: 1;
}

.app-grid-star-btn.active {
  color: #f59e0b;
}

.app-grid-star-btn:hover {
  transform: scale(1.2);
  color: #f59e0b;
}

/* File / App Row Item */
.file-row-item {
  display: grid;
  grid-template-columns: auto 1fr auto auto auto auto;
  align-items: center;
  gap: 1rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  text-decoration: none;
  color: inherit;
  transition: var(--transition-fast);
  cursor: pointer;
}

.file-row-item:hover {
  background: var(--bg-surface-hover);
  border-color: var(--primary-blue-border);
  transform: translateX(2px);
}

.file-status-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ef4444;
  flex-shrink: 0;
}

.file-row-meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.file-row-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.file-row-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-row-path {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-star-fav {
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.3rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.btn-star-fav:hover {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
  transform: scale(1.15);
}

.btn-star-fav.active {
  color: #f59e0b;
}

.file-row-time {
  font-size: 0.76rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.file-row-size {
  font-size: 0.76rem;
  color: var(--text-light);
  white-space: nowrap;
  min-width: 60px;
  text-align: right;
}

.file-row-action {
  font-size: 1rem;
  color: var(--text-light);
  transition: var(--transition-fast);
}

.file-row-item:hover .file-row-action {
  color: var(--primary-blue);
  transform: translate(2px, -2px);
}

/* Loading & Empty State */
.loading-placeholder, .empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 3rem 1rem;
  color: var(--text-muted);
  text-align: center;
}

.loading-placeholder i, .empty-state i {
  font-size: 2.2rem;
  color: var(--primary-blue);
}

/* ==========================================================================
   Right Panel: Greeting, Widgets, Promo Banner
   ========================================================================== */
.office-right-panel {
  padding: 1.25rem 1.15rem;
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  background: var(--bg-surface);
}

.right-widget-card {
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Greeting Widget */
.greeting-phrase {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-muted);
}

.clock-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.clock-time {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.lunar-phase-badge {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #fffbeb;
  color: #f59e0b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  border: 1px solid #fef3c7;
}

body.office-theme-dark .lunar-phase-badge {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.3);
}

.lunar-calendar-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.lunar-tag {
  font-weight: 600;
}

.lunar-date-val {
  font-weight: 800;
  color: var(--text-main);
}

/* Frequent Files Widget */
.widget-subtitle {
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--text-main);
}

.frequent-files-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.frequent-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.6rem 0.75rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: inherit;
  transition: var(--transition-fast);
}

.frequent-item:hover {
  border-color: var(--primary-blue-border);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.frequent-item-header {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.frequent-item-name {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.frequent-item-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-light);
}

/* Promo Banner Widget */
.promo-banner-widget {
  background: linear-gradient(135deg, #eff6ff 0%, #f5f3ff 100%);
  border-color: #dbeafe;
}

body.office-theme-dark .promo-banner-widget {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%);
  border-color: rgba(59, 130, 246, 0.25);
}

.promo-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--primary-blue);
  margin-bottom: 0.25rem;
}

.promo-description {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.btn-promo-action {
  width: 100%;
  background: var(--primary-blue);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  padding: 0.65rem 1rem;
  font-size: 0.88rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-promo-action:hover {
  background: var(--primary-blue-hover);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Panel Bottom Status */
.panel-bottom-status {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.25rem;
  font-size: 0.74rem;
  color: var(--text-light);
  cursor: pointer;
  transition: var(--transition-fast);
}

.panel-bottom-status:hover {
  color: var(--primary-blue);
}

.status-indicator-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
}

/* ==========================================================================
   Modals
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-normal);
}

.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.modal-box {
  position: relative;
  width: 100%;
  max-width: 640px;
  max-height: 85vh;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  box-shadow: var(--shadow-lg);
  overflow-y: auto;
  transform: scale(0.95);
  transition: var(--transition-normal);
}

.modal-overlay.show .modal-box {
  transform: scale(1);
}

.modal-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

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

.modal-top {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.ecosystem-badge-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--primary-blue-soft);
  color: var(--primary-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.modal-meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.modal-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.ecosystem-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.75rem;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.ecosystem-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.5rem;
  padding: 0.85rem 0.5rem;
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-main);
  transition: var(--transition-fast);
}

.ecosystem-item:hover {
  background: var(--bg-surface-hover);
  border-color: var(--primary-blue);
  transform: translateY(-2px);
}

.ecosystem-item-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #0f172a;
}

.ecosystem-item-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ecosystem-item-name {
  font-size: 0.78rem;
  font-weight: 700;
}

/* File Drop Zone in Open File Modal */
.file-drop-zone {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  text-align: center;
  background: var(--bg-surface-subtle);
  transition: var(--transition-fast);
}

.file-drop-zone.dragover {
  border-color: var(--primary-blue);
  background: var(--primary-blue-soft);
}

.drop-icon {
  font-size: 3rem;
  color: var(--primary-blue);
}

.drop-title {
  font-size: 1.05rem;
  font-weight: 700;
}

.drop-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  max-width: 360px;
}

.btn-select-file {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--primary-blue);
  color: #ffffff;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 0.5rem;
  transition: var(--transition-fast);
}

.btn-select-file:hover {
  background: var(--primary-blue-hover);
  transform: translateY(-1px);
}

.file-preview-area {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
}

.preview-file-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.preview-meta {
  display: flex;
  flex-direction: column;
}

.preview-actions {
  display: flex;
  gap: 0.75rem;
}

/* Sidebar Backdrop Overlay */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 490;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.26s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

body.sidebar-active {
  overflow: hidden !important;
}

/* Sidebar Mobile Header */
.sidebar-mobile-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.85rem;
  margin-bottom: 0.25rem;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-mobile-brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.sidebar-mobile-logo {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  object-fit: cover;
}

.btn-sidebar-close {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.15rem;
  transition: var(--transition-fast);
}

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

/* ==========================================================================
   Responsive Breakpoints & Mobile Optimization
   ========================================================================== */
@media (max-width: 1024px) {
  .office-body-layout {
    grid-template-columns: 240px 1fr;
  }
  .quick-create-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  /* Standardized Header: Compact & Non-Overflowing */
  .app-header-fixed {
    padding: calc(0.4rem + env(safe-area-inset-top)) 0.65rem 0;
  }

  .app-header-inner {
    padding: 0.35rem 0.6rem;
    border-radius: 16px;
    gap: 0.35rem;
    min-height: 46px;
  }

  /* Left Brand Group */
  .header-brand-group {
    gap: 0.35rem;
    min-width: 0;
  }

  .btn-back {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    font-size: 16px;
  }

  .btn-sidebar-toggle {
    display: flex;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    font-size: 16px;
  }

  .brand-link {
    gap: 6px;
    min-width: 0;
  }

  .brand-logo-card {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    padding: 2.5px;
  }

  .brand-name {
    font-size: 16px;
    font-weight: 800;
  }

  /* Hide redundant branding elements on Mobile to save horizontal space */
  .brand-divider,
  .brand-app {
    display: none !important;
  }

  /* Right Actions Group */
  .header-actions-group {
    gap: 0.35rem;
    flex-shrink: 0;
  }

  /* Connect Button: Transform into sleek icon-only button on Mobile */
  .btn-header-link {
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    color: var(--text-muted);
    font-size: 1rem;
  }

  .btn-header-link .btn-header-text {
    display: none !important;
  }

  .btn-header-link .search-subicon {
    margin: 0;
    font-size: 1.1rem;
  }

  .btn-header-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 1rem;
  }

  /* User Profile Badge: Avatar only on Mobile, hide user name & status */
  .user-profile-badge {
    padding: 0;
    border: none;
    background: transparent;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
  }

  .user-profile-badge:hover {
    transform: scale(1.05);
    background: transparent;
    border-color: transparent;
  }

  .user-text {
    display: none !important;
  }

  .user-avatar {
    width: 32px;
    height: 32px;
    border: 1.5px solid var(--border-color);
    box-shadow: var(--shadow-sm);
  }

  /* Sidebar Mobile Drawer */
  .sidebar-mobile-header {
    display: flex;
  }

  .office-body-layout {
    grid-template-columns: 1fr;
    position: relative;
    padding-top: calc(68px + env(safe-area-inset-top));
  }

  .office-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 285px;
    max-width: 85vw;
    height: 100vh;
    height: 100dvh;
    z-index: 500;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 12px 0 35px rgba(0, 0, 0, 0.25);
    padding: calc(0.85rem + env(safe-area-inset-top)) 1rem calc(1rem + env(safe-area-inset-bottom));
    overflow-y: auto;
  }

  .office-sidebar.open {
    transform: translateX(0);
  }

  /* Main Content Adjustments */
  .office-main-content {
    padding: 0.85rem 0.85rem 2.5rem;
    gap: 1.35rem;
  }

  .workspace-search-box {
    padding: 0.5rem 0.85rem;
  }

  .workspace-search-box .search-hint {
    display: none !important;
  }

  .workspace-search-box .search-icon {
    font-size: 1.1rem;
    margin-right: 0.5rem;
  }

  .workspace-search-box .search-input {
    font-size: 0.88rem;
  }

  .section-title {
    font-size: 0.96rem;
    margin-bottom: 0.65rem;
  }

  .quick-create-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
  }

  .create-card-item {
    gap: 0.45rem;
  }

  .create-card-name {
    font-size: 0.82rem;
  }

  .folders-grid {
    grid-template-columns: 1fr;
    gap: 0.55rem;
  }

  .folder-card-item {
    padding: 0.65rem 0.85rem;
  }

  .listing-header-wrap {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }

  .listing-title-group {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    width: 100%;
  }

  .listing-view-switcher {
    width: 100%;
    display: flex;
  }

  .btn-view-toggle {
    flex: 1;
    justify-content: center;
    padding: 0.45rem 0.65rem;
    font-size: 0.82rem;
  }

  .listing-view-controls {
    display: none;
  }

  /* Files List Table Mobile */
  .file-row-item {
    display: flex;
    align-items: center;
    padding: 0.65rem 0.75rem;
    gap: 0.65rem;
  }

  .file-row-time,
  .file-row-size {
    display: none !important;
  }

  .file-row-meta {
    flex: 1;
    min-width: 0;
  }

  .file-row-title-wrap {
    gap: 0.4rem;
  }

  .file-row-title {
    font-size: 0.84rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .file-row-path {
    font-size: 0.72rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .cloud-sync-tag {
    display: none;
  }

  .btn-star-fav {
    width: 28px;
    height: 28px;
    font-size: 1.05rem;
    flex-shrink: 0;
  }

  .file-row-action {
    font-size: 1.1rem;
    flex-shrink: 0;
    margin-left: 0.25rem;
  }

  /* App Grid View Mobile */
  .apps-grid-view {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.65rem 0.45rem;
    padding: 0.25rem 0 1rem;
  }

  .app-grid-card {
    padding: 0.65rem 0.35rem 0.5rem;
    border-radius: var(--radius-md);
  }

  .app-grid-icon-wrap {
    width: 44px;
    height: 44px;
    border-radius: 11px;
    margin-bottom: 0.45rem;
  }

  .app-grid-icon-img {
    border-radius: 9px;
  }

  .app-grid-title {
    font-size: 0.74rem;
    font-weight: 600;
  }

  .app-grid-star-btn {
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    font-size: 0.75rem;
    opacity: 1;
  }

  /* Modals on Mobile */
  .modal-box {
    width: 92%;
    max-width: 440px;
    padding: 1.25rem 1rem;
    border-radius: 18px;
  }

  .modal-top {
    gap: 0.75rem;
  }

  .modal-title {
    font-size: 1.1rem;
  }

  .ecosystem-grid {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.5rem;
    max-height: 340px;
  }

  .ecosystem-item {
    padding: 0.6rem 0.35rem;
    gap: 0.35rem;
  }

  .ecosystem-item-icon {
    width: 36px;
    height: 36px;
  }

  .ecosystem-item-name {
    font-size: 0.72rem;
  }

  .file-drop-zone {
    padding: 1.75rem 1rem;
  }

  .drop-icon {
    font-size: 2.25rem;
  }

  .drop-title {
    font-size: 0.95rem;
  }
}

@media (max-width: 380px) {
  .app-header-fixed {
    padding: calc(0.35rem + env(safe-area-inset-top)) 0.4rem 0;
  }

  .app-header-inner {
    padding: 0.3rem 0.45rem;
    gap: 0.25rem;
    border-radius: 14px;
  }

  .btn-back,
  .btn-sidebar-toggle {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 15px;
  }

  .brand-logo-card {
    width: 30px;
    height: 30px;
    border-radius: 7px;
  }

  .brand-name {
    font-size: 15px;
  }

  .btn-header-link,
  .btn-header-icon,
  .user-profile-badge {
    width: 32px;
    height: 32px;
  }

  .user-avatar {
    width: 30px;
    height: 30px;
  }

  .office-body-layout {
    padding-top: calc(62px + env(safe-area-inset-top));
  }

  .office-main-content {
    padding: 0.65rem 0.55rem 2rem;
    gap: 1rem;
  }

  .apps-grid-view {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.55rem 0.35rem;
  }

  .app-grid-icon-wrap {
    width: 40px;
    height: 40px;
    border-radius: 10px;
  }

  .app-grid-title {
    font-size: 0.7rem;
  }
}
