/* ==================== DRIVE CRIATIVA - MOBILE FIRST REDESIGN ==================== */

:root {
  --radius: 16px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --primary: #212529;
  --primary-light: rgba(33, 37, 41, 0.08);
  --danger: #ef4444;
  --success: #10b981;
  --warning: #f59e0b;
  --bg-gradient: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

* {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

/* ==================== LAYOUT PRINCIPAL ==================== */

#drive-system {
  display: none;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 0;
}

#drive-system.active {
  display: block;
}

/* ==================== HEADER ==================== */

.system-header {
  background: rgba(15, 15, 15, 0.95);
  backdrop-filter: blur(20px);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.system-header img {
  height: 32px;
  width: auto;
}

.system-header h1 {
  font-size: 18px;
  font-weight: 700;
  color: white;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  margin: 0;
}

.header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.btn-nav,
.btn-logout {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: 10px 14px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

.btn-nav:active,
.btn-logout:active {
  transform: scale(0.95);
  background: rgba(255, 255, 255, 0.15);
}

.btn-nav i,
.btn-logout i {
  font-size: 18px;
}

/* Esconde texto em telas pequenas */
.btn-nav .btn-text {
  display: none;
}

/* ==================== CONTAINER ==================== */

.drive-container {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 65px);
  min-height: calc(100dvh - 65px);
}

/* ==================== SIDEBAR HORIZONTAL (MOBILE) ==================== */

.drive-sidebar {
  background: white;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 65px;
  z-index: 999;
}

.sidebar-header {
  padding: 14px 16px;
  background: var(--primary);
  color: white;
}

.sidebar-header h3 {
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.client-list {
  padding: 12px;
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.client-list::-webkit-scrollbar {
  display: none;
}

/* ==================== CLIENT CARD ==================== */

.client-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  background: #f8f9fa;
  border: 2px solid transparent;
  min-width: 90px;
  flex-shrink: 0;
  scroll-snap-align: start;
}

.client-item:active {
  transform: scale(0.95);
}

.client-item.active {
  background: var(--primary);
  color: white;
  box-shadow: var(--shadow);
}

.client-item-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid white;
  box-shadow: var(--shadow-sm);
}

.client-item.active .client-item-avatar {
  border-color: rgba(255, 255, 255, 0.3);
}

.client-item-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
}

.client-item-name {
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.client-item-storage {
  font-size: 9px;
  opacity: 0.7;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  width: 100%;
}

.storage-bar {
  width: 100%;
  height: 3px;
  background: rgba(0,0,0,0.1);
  border-radius: 2px;
  overflow: hidden;
}

.client-item.active .storage-bar {
  background: rgba(255,255,255,0.2);
}

.storage-bar-fill {
  height: 100%;
  background: var(--success);
  border-radius: 2px;
  transition: width 0.3s;
}

.storage-bar-fill.warning {
  background: var(--warning);
}

.storage-bar-fill.danger {
  background: var(--danger);
}

/* ==================== MAIN AREA ==================== */

.drive-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #f8f9fa;
}

/* ==================== BREADCRUMB ==================== */

.drive-breadcrumb {
  padding: 12px 16px;
  background: white;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  position: sticky;
  top: 145px;
  z-index: 998;
}

.drive-breadcrumb::-webkit-scrollbar {
  display: none;
}

.breadcrumb-item {
  font-size: 14px;
  color: #6b7280;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-xs);
  white-space: nowrap;
  flex-shrink: 0;
  font-weight: 600;
}

.breadcrumb-item:active {
  background: var(--primary-light);
}

.breadcrumb-item.active {
  color: var(--primary);
  background: var(--primary-light);
}

.breadcrumb-separator {
  color: #d1d5db;
  font-size: 12px;
  flex-shrink: 0;
}

/* ==================== TOOLBAR ==================== */

.drive-toolbar {
  padding: 12px 16px;
  background: white;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  gap: 8px;
  align-items: center;
  overflow-x: auto;
  scrollbar-width: none;
  position: sticky;
  top: 197px;
  z-index: 997;
}

.drive-toolbar::-webkit-scrollbar {
  display: none;
}

.toolbar-btn {
  padding: 10px 16px;
  border: 1px solid #e5e7eb;
  border-radius: var(--radius-xs);
  background: white;
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.toolbar-btn:active {
  transform: scale(0.95);
  background: var(--primary-light);
}

.toolbar-btn i {
  font-size: 20px;
}

/* ==================== VIEW CONTROLS ==================== */

.view-controls {
  display: flex;
  gap: 4px;
  margin-left: auto;
  background: #f3f4f6;
  padding: 4px;
  border-radius: var(--radius-xs);
  flex-shrink: 0;
}

.view-btn {
  padding: 8px 10px;
  border: none;
  background: transparent;
  color: #6b7280;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
}

.view-btn.active {
  background: white;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.view-btn i {
  font-size: 20px;
}

/* ==================== SELECTION BAR ==================== */

.selection-bar {
  display: none;
  padding: 12px 16px;
  background: var(--primary);
  color: white;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 65px;
  z-index: 996;
}

.selection-bar.show {
  display: flex;
}

.selection-count {
  font-size: 14px;
  font-weight: 700;
  flex: 1;
}

.selection-actions {
  display: flex;
  gap: 8px;
}

.selection-btn {
  padding: 8px 12px;
  border: none;
  border-radius: var(--radius-xs);
  background: rgba(255,255,255,0.15);
  color: white;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.selection-btn:active {
  background: rgba(255,255,255,0.25);
  transform: scale(0.95);
}

.selection-btn.danger {
  background: var(--danger);
}

.selection-btn i {
  font-size: 18px;
}

/* Esconde texto em telas pequenas */
@media (max-width: 400px) {
  .selection-btn span {
    display: none;
  }
}

/* ==================== CONTENT AREA ==================== */

.drive-content {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 300px;
  color: #9ca3af;
  text-align: center;
  padding: 20px;
}

.empty-state i {
  font-size: 64px;
  margin-bottom: 16px;
  opacity: 0.4;
}

.empty-state p {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #6b7280;
}

.empty-hint {
  font-size: 13px;
  opacity: 0.8;
}

/* ==================== SECTIONS ==================== */

.folders-section,
.files-section {
  margin-bottom: 24px;
}

.section-title {
  font-size: 12px;
  font-weight: 800;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 12px;
  padding: 8px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title i {
  font-size: 16px;
}

/* ==================== FOLDERS GRID ==================== */

.folders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

/* ==================== FILES GRID ==================== */

.files-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: #e5e7eb;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.drive-content.view-grid .files-grid {
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  background: transparent;
}

/* ==================== FOLDER ITEMS ==================== */

.folder-item {
  background: white;
  border: 2px solid #f3f4f6;
  border-radius: var(--radius-sm);
  padding: 16px 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  user-select: none;
}

.folder-item:active {
  transform: scale(0.95);
}

.folder-item.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: var(--shadow);
}

.folder-item.selected .item-select-indicator {
  opacity: 1;
}

.folder-item > i {
  font-size: 48px;
  color: #fbbf24;
  margin-bottom: 8px;
  display: block;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.folder-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==================== FILE ITEMS ==================== */

.file-item {
  background: white;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  user-select: none;
  overflow: hidden;
  aspect-ratio: 1;
}

.drive-content.view-grid .file-item {
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
}

.file-item.selected {
  outline: 4px solid var(--primary);
  outline-offset: -4px;
  z-index: 10;
}

.drive-content.view-grid .file-item.selected {
  border-color: var(--primary);
  outline: none;
  box-shadow: var(--shadow-lg);
}

.file-item.selected .item-select-indicator {
  opacity: 1;
}

.file-thumbnail {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #f3f4f6;
}

.file-thumbnail img,
.file-thumbnail video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.file-type-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(10px);
  color: white;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  box-shadow: var(--shadow);
}

/* ==================== SELECTION INDICATOR ==================== */

.item-select-indicator {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 24px;
  height: 24px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 5;
  pointer-events: none;
  box-shadow: var(--shadow);
}

.item-select-indicator::after {
  content: '';
  width: 10px;
  height: 6px;
  border-left: 2px solid white;
  border-bottom: 2px solid white;
  transform: rotate(-45deg);
  margin-top: -2px;
}

/* ==================== LIST VIEW ==================== */

.files-list {
  display: flex;
  flex-direction: column;
  background: white;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.file-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: white;
  border-bottom: 1px solid #f3f4f6;
  cursor: pointer;
  transition: background 0.2s;
  position: relative;
}

.file-list-item:last-child {
  border-bottom: none;
}

.file-list-item:active {
  background: #f9fafb;
}

.file-list-item.selected {
  background: var(--primary-light);
}

.file-list-item.selected .item-select-indicator {
  opacity: 1;
}

.file-list-item .item-select-indicator {
  position: relative;
  top: auto;
  left: auto;
  flex-shrink: 0;
}

.list-item-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.list-item-icon.folder i {
  font-size: 48px;
  color: #fbbf24;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.file-list-thumbnail {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-xs);
  overflow: hidden;
  background: #f3f4f6;
  flex-shrink: 0;
}

.file-list-thumbnail img,
.file-list-thumbnail video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-indicator {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(10px);
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
}

.file-list-info {
  flex: 1;
  min-width: 0;
}

.file-list-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 6px;
  word-break: break-word;
}

.file-list-details {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.file-detail-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: #f3f4f6;
  border-radius: 6px;
  font-size: 10px;
  color: #6b7280;
  font-weight: 600;
}

.file-detail-tag i {
  font-size: 12px;
}

.file-detail-tag.type-video {
  background: #fef3c7;
  color: #92400e;
}

.file-detail-tag.type-image {
  background: #dbeafe;
  color: #1e40af;
}

/* ==================== MODALS ==================== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 16px;
}

.modal-overlay.show {
  display: flex;
}

.modal-content {
  background: white;
  border-radius: var(--radius);
  width: 100%;
  max-width: 400px;
  overflow: hidden;
  animation: modalSlideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: var(--shadow-lg);
}

.modal-preview-content {
  max-width: 95vw;
  max-height: 90vh;
  max-height: 90dvh;
  background: transparent;
  display: flex;
  flex-direction: column;
}

.modal-header {
  padding: 16px;
  background: var(--primary);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.modal-close {
  background: transparent;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-xs);
  width: 40px;
  height: 40px;
  transition: all 0.2s;
}

.modal-close:active {
  background: rgba(255,255,255,0.15);
  transform: scale(0.9);
}

.preview-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(10px);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  z-index: 10;
}

.modal-body {
  padding: 20px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
}

.form-control {
  width: 100%;
  padding: 12px;
  border: 2px solid #e5e7eb;
  border-radius: var(--radius-xs);
  font-size: 16px;
  transition: border 0.2s;
  font-weight: 500;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
}

.modal-footer {
  padding: 16px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  gap: 12px;
  background: #f8f9fa;
}

.btn {
  flex: 1;
  padding: 12px 16px;
  border: none;
  border-radius: var(--radius-xs);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:active {
  transform: scale(0.98);
  background: var(--pt75);
}

.btn-secondary {
  background: #e5e7eb;
  color: #6b7280;
}

.btn-secondary:active {
  background: #d1d5db;
}

.preview-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

.preview-container img,
.preview-container video {
  max-width: 100%;
  max-height: 70vh;
  max-height: 70dvh;
  border-radius: var(--radius);
  object-fit: contain;
}

.preview-info {
  background: white;
  padding: 16px;
  border-radius: var(--radius);
  margin-top: 12px;
  text-align: center;
}

.preview-info h4 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--primary);
  word-break: break-word;
}

.preview-info p {
  font-size: 12px;
  color: #6b7280;
  margin: 0;
}

@keyframes modalSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ==================== ACTIONS MODAL ==================== */

.actions-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 10001;
  opacity: 0;
  transition: opacity 0.2s;
}

.actions-modal-overlay.show {
  opacity: 1;
}

.actions-modal {
  background: white;
  width: 100%;
  max-width: 500px;
  border-radius: var(--radius) var(--radius) 0 0;
  padding-bottom: env(safe-area-inset-bottom);
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.actions-modal-overlay.show .actions-modal {
  transform: translateY(0);
}

.actions-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid #e5e7eb;
}

.actions-modal-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  margin-right: 12px;
}

.actions-modal-close {
  background: #f3f4f6;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 20px;
  color: #6b7280;
  transition: all 0.2s;
}

.actions-modal-close:active {
  transform: scale(0.9);
  background: #e5e7eb;
}

.actions-modal-body {
  padding: 8px;
}

.actions-modal-btn {
  width: 100%;
  padding: 16px;
  border: none;
  background: transparent;
  font-size: 16px;
  font-weight: 600;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  border-radius: var(--radius-xs);
  transition: background 0.2s;
}

.actions-modal-btn:active {
  background: #f3f4f6;
}

.actions-modal-btn i {
  font-size: 24px;
  width: 32px;
  text-align: center;
}

.actions-modal-btn.danger {
  color: var(--danger);
}

/* ==================== DRAG & DROP ==================== */

.drive-content.dragover {
  background: rgba(16, 185, 129, 0.08);
  outline: 3px dashed var(--success);
  outline-offset: -3px;
  border-radius: var(--radius-sm);
}

/* ==================== PROGRESSO MULTI-ARQUIVO ==================== */

.multi-progress-container {
  position: fixed;
  bottom: 16px;
  right: 16px;
  left: 16px;
  max-width: 420px;
  margin: 0 auto;
  max-height: 80vh;
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: none;
  flex-direction: column;
  z-index: 9999;
  animation: slideInUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.multi-progress-container.show {
  display: flex;
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(100px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.multi-progress-header {
  padding: 16px;
  background: linear-gradient(135deg, var(--primary), #495057);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.multi-progress-title {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.multi-progress-title h4 {
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.multi-progress-title .subtitle {
  font-size: 11px;
  opacity: 0.85;
  font-weight: 500;
}

.multi-progress-stats {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.multi-progress-percentage {
  font-size: 22px;
  font-weight: 800;
}

.multi-progress-speed {
  font-size: 11px;
  opacity: 0.9;
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
}

.multi-progress-global {
  padding: 14px 16px;
  background: #f8f9fa;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
}

.global-bar-container {
  height: 6px;
  background: #e5e7eb;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 10px;
}

.global-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #495057);
  border-radius: 3px;
  transition: width 0.3s ease;
  position: relative;
}

.global-bar-fill::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  to { left: 100%; }
}

.global-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: #6b7280;
  gap: 8px;
  font-weight: 600;
}

.global-info span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.global-info i {
  font-size: 13px;
}

.multi-progress-files {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 50vh;
  min-height: 100px;
}

.multi-progress-files::-webkit-scrollbar {
  width: 6px;
}

.multi-progress-files::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.multi-progress-files::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

.file-progress-card {
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: var(--radius-xs);
  padding: 12px;
  transition: all 0.3s ease;
}

.file-progress-card.uploading {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(33, 37, 41, 0.08);
}

.file-progress-card.completed {
  border-color: var(--success);
  background: #ecfdf5;
}

.file-progress-card.error {
  border-color: var(--danger);
  background: #fef2f2;
}

.file-progress-card.pending {
  opacity: 0.6;
}

.file-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.file-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  background: #f3f4f6;
  color: #6b7280;
}

.file-progress-card.uploading .file-icon {
  background: var(--primary-light);
  color: var(--primary);
  animation: pulse 2s ease-in-out infinite;
}

.file-progress-card.completed .file-icon {
  background: #d1fae5;
  color: var(--success);
}

.file-progress-card.error .file-icon {
  background: #fee2e2;
  color: var(--danger);
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.file-card-info {
  flex: 1;
  min-width: 0;
}

.file-card-name {
  font-size: 13px;
  font-weight: 700;
  color: #1f2937;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.file-card-meta {
  font-size: 11px;
  color: #6b7280;
  font-weight: 600;
}

.file-card-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  flex-shrink: 0;
  white-space: nowrap;
}

.file-card-status.pending {
  background: #f3f4f6;
  color: #6b7280;
}

.file-card-status.uploading {
  background: var(--primary-light);
  color: var(--primary);
}

.file-card-status.uploading i {
  animation: bounce 1s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

.file-card-status.completed {
  background: #d1fae5;
  color: #065f46;
}

.file-card-status.error {
  background: #fee2e2;
  color: #991b1b;
}

.file-card-progress {
  margin-top: 10px;
}

.file-progress-bar {
  height: 4px;
  background: #e5e7eb;
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 6px;
}

.file-progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.file-progress-card.completed .file-progress-fill {
  background: var(--success);
}

.file-progress-card.error .file-progress-fill {
  background: var(--danger);
}

.file-progress-details {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  color: #6b7280;
  font-weight: 600;
}

.multi-progress-footer {
  padding: 14px 16px;
  background: #f8f9fa;
  border-top: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.footer-info {
  font-size: 11px;
  color: #6b7280;
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  font-weight: 600;
}

.footer-actions {
  display: flex;
  gap: 8px;
}

.footer-btn {
  padding: 8px 14px;
  border: none;
  border-radius: var(--radius-xs);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.footer-btn.close {
  background: #e5e7eb;
  color: #4b5563;
}

.footer-btn.close:active {
  transform: scale(0.95);
  background: #d1d5db;
}

.multi-progress-container.completed .multi-progress-header {
  background: linear-gradient(135deg, var(--success), #059669);
}

.multi-progress-container.completed .footer-info {
  color: #065f46;
}

.multi-progress-container.error .multi-progress-header {
  background: linear-gradient(135deg, var(--danger), #dc2626);
}

/* ==================== LOADING ==================== */

.empty-state .ph-spinner {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.loading-clients {
  padding: 20px;
  text-align: center;
  color: #6b7280;
  font-size: 13px;
  font-weight: 600;
}

/* ==================== DESKTOP (TABLET+) ==================== */

@media (min-width: 768px) {
  .system-header {
    padding: 20px 24px;
  }

  .system-header h1 {
    font-size: 20px;
  }

  .btn-nav .btn-text {
    display: inline;
  }

  .drive-container {
    flex-direction: row;
    min-height: calc(100vh - 73px);
  }

  .drive-sidebar {
    width: 280px;
    flex-shrink: 0;
    border-right: 1px solid #e5e7eb;
    border-bottom: none;
    position: sticky;
    top: 73px;
    height: calc(100vh - 73px);
    overflow-y: auto;
  }

  .client-list {
    flex-direction: column;
    overflow-x: visible;
    overflow-y: auto;
    max-height: calc(100vh - 180px);
  }

  .client-item {
    flex-direction: row;
    min-width: unset;
    justify-content: flex-start;
  }

  .client-item-info {
    align-items: flex-start;
  }

  .client-item-name {
    text-align: left;
  }

  .client-item-storage {
    flex-direction: row;
    align-items: center;
  }

  .storage-bar {
    max-width: 60px;
  }

  .drive-breadcrumb {
    position: static;
  }

  .drive-toolbar {
    position: static;
  }

  .selection-bar {
    top: 73px;
  }

  .folders-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 16px;
  }

  .files-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 2px;
  }

  .drive-content.view-grid .files-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
  }

  .file-list-thumbnail {
    width: 80px;
    height: 80px;
  }

  .multi-progress-container {
    right: 20px;
    left: auto;
    width: 420px;
  }
}

/* ==================== LARGE DESKTOP ==================== */

@media (min-width: 1024px) {
  .drive-sidebar {
    width: 320px;
  }

  .files-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }

  .drive-content.view-grid .files-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
}

/* ==================== EXTRA LARGE DESKTOP ==================== */

@media (min-width: 1440px) {
  .files-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }

  .drive-content.view-grid .files-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }
}

/* ==================== SAFE AREA (iOS) ==================== */

@supports (padding: env(safe-area-inset-bottom)) {
  .system-header {
    padding-top: calc(16px + env(safe-area-inset-top));
  }

  .actions-modal {
    padding-bottom: calc(env(safe-area-inset-bottom) + 12px);
  }

  .multi-progress-container {
    bottom: calc(16px + env(safe-area-inset-bottom));
  }
}
