:root {
  --bg-main: #0a0d14;
  --bg-card: #111726;
  --bg-card-hover: #161e31;
  --bg-surface: #1a2236;
  --border-color: #232d45;
  --border-focus: #3b82f6;
  
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-glow: rgba(59, 130, 246, 0.25);
  
  --color-image: #06b6d4;
  --color-image-bg: rgba(6, 182, 212, 0.12);
  --color-pdf: #ef4444;
  --color-pdf-bg: rgba(239, 68, 68, 0.12);
  --color-word: #3b82f6;
  --color-word-bg: rgba(59, 130, 246, 0.12);
  --color-excel: #10b981;
  --color-excel-bg: rgba(16, 185, 129, 0.12);
  --color-video: #f59e0b;
  --color-video-bg: rgba(245, 158, 11, 0.12);
  --color-text-col: #a855f7;
  --color-text-col-bg: rgba(168, 85, 247, 0.14);
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  
  --shadow-card: 0 4px 20px -2px rgba(0, 0, 0, 0.5);
  --shadow-pop: 0 10px 30px -5px rgba(0, 0, 0, 0.7);
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Common Helpers */
.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.w-full {
  width: 100%;
}

/* ================= AUTHENTICATION OVERLAY ================= */
.auth-wrapper {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top center, #172554 0%, #0a0d14 65%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: rgba(17, 23, 38, 0.85);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 36px 32px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  animation: modalFadeIn 0.3s ease-out;
}

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

.brand-badge {
  width: 52px;
  height: 52px;
  margin: 0 auto 16px;
  background: linear-gradient(135deg, #3b82f6, #06b6d4);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.35);
}

.auth-brand h1 {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
  margin-bottom: 6px;
}

.auth-subtitle {
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.auth-form .input-group {
  margin-bottom: 22px;
}

.auth-form label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.input-field-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.field-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  pointer-events: none;
}

.input-field-wrapper input {
  width: 100%;
  padding: 13px 44px 13px 42px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 0.95rem;
  font-family: inherit;
  transition: var(--transition);
}

.input-field-wrapper input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.toggle-pwd-btn {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  transition: var(--transition);
}

.toggle-pwd-btn:hover {
  color: var(--text-primary);
}

.error-text {
  color: #f87171;
  font-size: 0.82rem;
  margin-top: 8px;
  background: rgba(239, 68, 68, 0.1);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-primary {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: 13px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #4f46e5, #1d4ed8);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
}

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

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: #3b82f6;
}

.btn-danger {
  background: #dc2626;
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: 11px 20px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

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

.auth-footer {
  margin-top: 24px;
  text-align: center;
  font-size: 0.76rem;
  color: var(--text-muted);
}

/* Button Spinner */
.btn-loader {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* ================= MAIN APP CONTAINER ================= */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.app-header {
  height: 70px;
  background: rgba(17, 23, 38, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.logo-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-weight: 700;
  font-size: 1.05rem;
  color: #fff;
  letter-spacing: -0.01em;
}

.brand-sub {
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #34d399;
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 600;
  margin-left: 8px;
}

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

.header-center {
  flex: 1;
  max-width: 480px;
  margin: 0 24px;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-box svg {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
}

.search-box input {
  width: 100%;
  padding: 9px 36px 9px 38px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 9999px;
  color: #fff;
  font-size: 0.86rem;
  font-family: inherit;
  transition: var(--transition);
}

.search-box input:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--bg-card);
}

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

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

.stat-badge {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 6px 12px;
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

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

.stat-val {
  font-weight: 700;
  color: #fff;
  font-family: 'JetBrains Mono', monospace;
}

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

.btn-icon:hover {
  background: var(--bg-card-hover);
  color: #fff;
  border-color: var(--primary);
}

/* ================= MAIN CONTENT ================= */
.main-content {
  flex: 1;
  padding: 24px 28px 48px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* ================= UPLOAD SECTION ================= */
.upload-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.drop-zone {
  position: relative;
  background: rgba(17, 23, 38, 0.6);
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  overflow: hidden;
}

.drop-zone:hover {
  border-color: var(--primary);
  background: rgba(22, 30, 49, 0.75);
}

.drop-zone.drag-active {
  border-color: #06b6d4;
  background: rgba(6, 182, 212, 0.08);
  transform: scale(1.005);
}

.file-picker-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
  z-index: 10;
}

.drop-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}

.upload-icon-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(6, 182, 212, 0.15));
  border: 1px solid rgba(59, 130, 246, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #38bdf8;
  margin-bottom: 2px;
  transition: var(--transition);
}

.drop-zone:hover .upload-icon-circle {
  transform: translateY(-2px);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(6, 182, 212, 0.25));
  color: #fff;
}

.drop-text h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
}

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

.upload-actions {
  margin-top: 6px;
  pointer-events: auto;
}

.btn-upload-browse {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 8px 18px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.86rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

.btn-upload-browse:hover {
  border-color: var(--primary);
  background: var(--primary);
}

/* Upload Progress Panel */
.upload-progress-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  box-shadow: var(--shadow-card);
  animation: slideDown 0.25s ease-out;
}

.progress-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.progress-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.progress-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #fff;
}

.progress-percent {
  font-size: 0.86rem;
  font-weight: 700;
  color: #38bdf8;
  font-family: 'JetBrains Mono', monospace;
}

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

.close-btn:hover {
  color: #fff;
}

.overall-progress-track {
  width: 100%;
  height: 8px;
  background: var(--bg-surface);
  border-radius: 9999px;
  overflow: hidden;
  margin-bottom: 14px;
}

.overall-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #06b6d4, #10b981);
  transition: width 0.2s ease;
}

.upload-items-list {
  max-height: 160px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.upload-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
}

.upload-item-name {
  max-width: 60%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
  color: var(--text-primary);
}

.upload-item-status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
}

/* ================= CLOUD TEXT CLIPBOARD SECTION ================= */
.clipboard-section {
  margin-top: 20px;
  margin-bottom: 24px;
}

.clipboard-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  transition: var(--transition);
}

.clipboard-card:focus-within {
  border-color: rgba(168, 85, 247, 0.4);
  box-shadow: 0 4px 24px -2px rgba(168, 85, 247, 0.15);
}

.clipboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.clipboard-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.clipboard-icon-badge {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--color-text-col-bg);
  color: var(--color-text-col);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.clipboard-title-text h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.badge-live-sync {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(168, 85, 247, 0.2);
  color: #d8b4fe;
  padding: 2px 8px;
  border-radius: 9999px;
  border: 1px solid rgba(168, 85, 247, 0.35);
}

.clipboard-title-text p {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.clipboard-quick-tips {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tip-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(168, 85, 247, 0.08);
  border: 1px solid rgba(168, 85, 247, 0.2);
  color: #d8b4fe;
  font-size: 0.74rem;
  padding: 4px 10px;
  border-radius: 9999px;
  font-weight: 600;
}

/* Textarea input & actions */
.clipboard-input-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.textarea-wrapper {
  position: relative;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.textarea-wrapper:focus-within {
  border-color: #a855f7;
  background: #141b2e;
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.15);
}

#cloudTextInput {
  width: 100%;
  background: transparent;
  border: none;
  color: #f1f5f9;
  font-size: 0.92rem;
  font-family: inherit;
  resize: vertical;
  min-height: 48px;
  outline: none;
  line-height: 1.5;
}

#cloudTextInput::placeholder {
  color: var(--text-muted);
}

.textarea-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  flex-wrap: wrap;
}

.btn-paste-device {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

.btn-paste-device:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-sync-text {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  border: 1px solid rgba(168, 85, 247, 0.4);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 7px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 10px rgba(124, 58, 237, 0.35);
  transition: var(--transition);
}

.btn-sync-text:hover {
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.5);
}

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

/* ================= LATEST SYNCED TEXT CONTAINER ================= */
.latest-text-container {
  background: #151a2d;
  border: 1.5px solid #3730a3;
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35), 0 0 16px rgba(139, 92, 246, 0.12);
  animation: slideDown 0.25s ease-out;
}

.latest-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.latest-badge-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.74rem;
  color: #c4b5fd;
  letter-spacing: 0.03em;
}

.pulsing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #a855f7;
  box-shadow: 0 0 8px #a855f7;
  animation: pulseSync 2s infinite ease-in-out;
}

@keyframes pulseSync {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.latest-time-chip {
  background: rgba(168, 85, 247, 0.15);
  color: #e9d5ff;
  font-size: 0.7rem;
  padding: 1px 7px;
  border-radius: 9999px;
}

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

.btn-action-copy-highlight {
  background: #10b981;
  color: #fff;
  border: none;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
  transition: var(--transition);
}

.btn-action-copy-highlight:hover {
  background: #059669;
  transform: translateY(-1px);
}

.btn-action-copy-highlight.copied {
  background: #059669;
}

.btn-icon-danger {
  background: transparent;
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.btn-icon-danger:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: #ef4444;
  color: #fff;
}

.latest-content-preview {
  background: #0d121f;
  border: 1px solid #1e273e;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  max-height: 140px;
  overflow-y: auto;
}

.latest-text-pre {
  font-family: 'JetBrains Mono', Consolas, Monaco, monospace;
  font-size: 0.86rem;
  color: #f1f5f9;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.5;
  margin: 0;
}

.latest-meta-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ================= SIX COLUMN BOARD ================= */
.board-section {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.board-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 12px;
}

.board-title-group h2 {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #fff;
}

.board-title-group p {
  font-size: 0.84rem;
  color: var(--text-secondary);
}

.hint-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.2);
  color: #93c5fd;
  font-size: 0.78rem;
  padding: 5px 12px;
  border-radius: 9999px;
}

/* Grid for the 6 Columns */
.columns-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(210px, 1fr));
  gap: 16px;
  align-items: start;
}

@media (max-width: 1550px) {
  .columns-grid {
    grid-template-columns: repeat(3, minmax(240px, 1fr));
  }
}

@media (max-width: 992px) {
  .columns-grid {
    grid-template-columns: repeat(2, minmax(240px, 1fr));
  }
}

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

/* Column Card Container */
.column-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  min-height: 520px;
  max-height: 780px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.column-header {
  padding: 16px 14px 12px;
  background: rgba(26, 34, 54, 0.6);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.col-icon-badge {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.col-badge-image { background: var(--color-image-bg); color: var(--color-image); }
.col-badge-pdf   { background: var(--color-pdf-bg); color: var(--color-pdf); }
.col-badge-word  { background: var(--color-word-bg); color: var(--color-word); }
.col-badge-excel { background: var(--color-excel-bg); color: var(--color-excel); }
.col-badge-video { background: var(--color-video-bg); color: var(--color-video); }
.col-badge-text  { background: var(--color-text-col-bg); color: var(--color-text-col); }

.col-title-text h3 {
  font-size: 0.96rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.file-counter {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.sort-control {
  width: 100%;
}

.sort-select {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  padding: 6px 8px;
  font-size: 0.76rem;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
}

.sort-select:hover, .sort-select:focus {
  outline: none;
  border-color: var(--primary);
  color: #fff;
}

/* File List in Column */
.column-file-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 140px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  margin: 12px 0;
}

/* ================= FILE CARD DESIGN ================= */
.file-card {
  background: #141b2d;
  border: 1.5px solid #2a3a5a;
  border-radius: var(--radius-lg);
  padding: 10px;
  transition: var(--transition);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
}

.file-card:hover {
  transform: translateY(-2px);
  border-color: #3b82f6;
  background: #18223a;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(59, 130, 246, 0.25);
}

/* Card Visual Thumbnail Box */
.card-thumbnail-box {
  width: 100%;
  height: 118px;
  background: #0b0f19;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.card-thumbnail-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.file-card:hover .card-thumbnail-img {
  transform: scale(1.04);
}

/* Video Thumbnail Element */
.card-video-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-play-overlay {
  position: absolute;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  backdrop-filter: blur(4px);
  pointer-events: none;
}

/* Document Previews (PDF, Word, Excel) */
.doc-mockup {
  width: 72px;
  height: 84px;
  background: #1e293b;
  border-radius: 6px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.doc-mockup::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 16px;
  height: 16px;
  background: rgba(255, 255, 255, 0.15);
  border-bottom-left-radius: 4px;
}

.doc-badge-tag {
  position: absolute;
  bottom: 8px;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 3px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.doc-mockup-pdf { border-top: 3px solid var(--color-pdf); }
.doc-mockup-pdf .doc-badge-tag { background: var(--color-pdf); color: #fff; }

.doc-mockup-word { border-top: 3px solid var(--color-word); }
.doc-mockup-word .doc-badge-tag { background: var(--color-word); color: #fff; }

.doc-mockup-excel { border-top: 3px solid var(--color-excel); }
.doc-mockup-excel .doc-badge-tag { background: var(--color-excel); color: #fff; }

.doc-mockup svg {
  margin-top: -6px;
  opacity: 0.85;
}

/* Card Details (Under Thumbnail) */
.card-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 2px 2px 0;
}

.card-filename {
  font-size: 0.84rem;
  font-weight: 700;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.card-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.card-size {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  color: #94a3b8;
}

.card-date {
  color: #64748b;
}

/* Permanent Always-Visible Actions Bar under Thumbnail */
.card-actions-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.btn-card-download {
  flex: 1;
  height: 36px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
  -webkit-tap-highlight-color: transparent;
}

.btn-card-download:hover {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
  transform: translateY(-1px);
}

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

.btn-card-delete {
  width: 36px;
  height: 36px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.btn-card-delete:hover {
  background: #dc2626;
  color: #ffffff;
  border-color: #dc2626;
  box-shadow: 0 3px 10px rgba(220, 38, 38, 0.4);
}

/* ================= CLOUD TEXT CARD (IN 6TH COLUMN) ================= */
.text-card {
  background: #141b2d;
  border: 1.5px solid #2a3a5a;
  border-radius: var(--radius-lg);
  padding: 10px;
  transition: var(--transition);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
}

.text-card:hover {
  transform: translateY(-2px);
  border-color: #a855f7;
  background: #18223a;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(168, 85, 247, 0.25);
}

.text-snippet-box {
  background: #0c101c;
  border: 1px solid #202b42;
  border-radius: var(--radius-md);
  padding: 10px;
  min-height: 70px;
  max-height: 110px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transition: var(--transition);
}

.text-snippet-box:hover {
  border-color: rgba(168, 85, 247, 0.4);
  background: #0e1424;
}

.text-snippet-pre {
  font-family: 'JetBrains Mono', Consolas, Monaco, monospace;
  font-size: 0.8rem;
  color: #e2e8f0;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.4;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.text-click-hint {
  position: absolute;
  bottom: 4px;
  right: 6px;
  font-size: 0.64rem;
  color: #a855f7;
  background: rgba(12, 16, 28, 0.9);
  padding: 1px 5px;
  border-radius: 4px;
  pointer-events: none;
}

.text-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.text-meta-time {
  display: flex;
  align-items: center;
  gap: 4px;
}

.text-card-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.btn-card-copy {
  background: rgba(16, 185, 129, 0.14);
  border: 1.5px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: var(--transition);
}

.btn-card-copy:hover {
  background: #10b981;
  color: #fff;
  border-color: #10b981;
  box-shadow: 0 3px 10px rgba(16, 185, 129, 0.35);
}

.btn-card-copy.copied {
  background: #059669;
  color: #fff;
  border-color: #059669;
}

/* ================= MODALS ================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-box {
  width: 100%;
  max-width: 480px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 28px;
  position: relative;
  box-shadow: var(--shadow-pop);
  animation: modalFadeIn 0.25s ease-out;
}

.modal-box-large {
  max-width: 620px;
}

.modal-header-text {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 14px;
}

.modal-text-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.95rem;
  color: #d8b4fe;
}

.modal-text-meta {
  display: flex;
  gap: 6px;
}

.modal-body-text {
  margin-bottom: 16px;
}

.view-text-pre-wrapper {
  background: #0a0e19;
  border: 1px solid #232d45;
  border-radius: var(--radius-md);
  padding: 14px;
  max-height: 380px;
  overflow-y: auto;
}

.view-text-pre {
  font-family: 'JetBrains Mono', Consolas, Monaco, monospace;
  font-size: 0.88rem;
  color: #f8fafc;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.5;
  margin: 0;
}

.btn-copy-large {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #10b981;
  font-weight: 700;
}

.btn-copy-large:hover {
  background: #059669;
}

.btn-copy-large.copied {
  background: #059669;
}

.delete-text-preview {
  background: #0c101c;
  border: 1px solid #202b42;
  border-radius: var(--radius-sm);
  padding: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: #e2e8f0;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 90px;
  overflow: hidden;
  margin-top: 10px;
  line-height: 1.4;
}

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

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

.modal-close-icon {
  position: absolute;
  top: 16px;
  right: 18px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
}

.modal-close-icon:hover {
  color: #fff;
}

.modal-thumbnail-preview {
  width: 100%;
  max-height: 160px;
  background: #0d121f;
  border-radius: var(--radius-md);
  margin-bottom: 18px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-thumbnail-preview img {
  max-width: 100%;
  max-height: 160px;
  object-fit: contain;
}

.modal-thumbnail-preview video {
  max-width: 100%;
  max-height: 160px;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}

.modal-description {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 14px;
  word-break: break-all;
}

.modal-meta-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.chip-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
}

.modal-security-note {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.2);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 22px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.btn-download {
  padding: 11px 22px;
  font-size: 0.92rem;
}

.modal-danger-icon {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(220, 38, 38, 0.15);
  color: #ef4444;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

/* ================= PWA INSTALLATION UI ================= */
.btn-install-app {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.15), rgba(59, 130, 246, 0.15));
  border: 1px solid rgba(6, 182, 212, 0.4);
  color: #38bdf8;
  border-radius: var(--radius-md);
  padding: 7px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.15);
}

.btn-install-app:hover {
  background: linear-gradient(135deg, #06b6d4, #2563eb);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.4);
  transform: translateY(-1px);
}

.pwa-banner {
  background: linear-gradient(135deg, #111b33 0%, #0d162b 100%);
  border: 1px solid #2a3a5f;
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  box-shadow: var(--shadow-card);
  animation: slideDown 0.3s ease-out;
  flex-wrap: wrap;
}

.pwa-banner-content {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 240px;
}

.pwa-banner-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
}

.pwa-banner-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pwa-banner-text strong {
  font-size: 0.92rem;
  color: #fff;
}

.pwa-banner-text span {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.pwa-banner-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-dismiss-banner {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}

.btn-dismiss-banner:hover {
  color: #fff;
}

.btn-sm {
  padding: 7px 14px;
  font-size: 0.82rem;
}

/* ================= MOBILE RESPONSIVENESS ================= */
@media (max-width: 640px) {
  /* Bottom Sheet Modals on Mobile */
  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .modal-box {
    max-width: 100%;
    width: 100%;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    padding: 22px 18px calc(24px + env(safe-area-inset-bottom, 20px));
    max-height: 85vh;
    border-left: none;
    border-right: none;
    border-bottom: none;
    animation: slideUpMobile 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  }

  @keyframes slideUpMobile {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }

  .modal-thumbnail-preview {
    max-height: 110px;
    margin-bottom: 12px;
  }

  .modal-thumbnail-preview img,
  .modal-thumbnail-preview video {
    max-height: 110px;
  }

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

  .modal-description {
    font-size: 0.85rem;
    margin-bottom: 10px;
  }

  .modal-meta-chips {
    margin-bottom: 12px;
  }

  .modal-security-note {
    margin-bottom: 16px;
    font-size: 0.74rem;
    padding: 6px 10px;
  }

  .modal-actions {
    flex-direction: column-reverse;
    gap: 10px;
  }

  .modal-actions button {
    width: 100%;
    height: 48px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Responsive Header for Mobile */
  .app-header {
    padding: 0 16px;
    height: auto;
    min-height: 64px;
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .header-center {
    order: 3;
    max-width: 100%;
    width: 100%;
    margin: 0;
  }

  .header-right {
    gap: 8px;
  }

  .stat-badge {
    display: none;
  }

  .main-content {
    padding: 16px 14px 40px;
    gap: 20px;
  }
}

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

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-pop);
  animation: slideInRight 0.25s ease-out;
}

.toast-success { border-left: 4px solid #10b981; }
.toast-error { border-left: 4px solid #ef4444; }
.toast-info { border-left: 4px solid #3b82f6; }

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

/* Scrollbar Customization */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-main);
}

::-webkit-scrollbar-thumb {
  background: #27334d;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #394b70;
}
