.files-shell {
  min-height: 100vh;
  color: #142033;
  background:
    linear-gradient(180deg, rgba(233, 238, 246, 0.96) 0%, rgba(246, 248, 251, 1) 38%, #eef3f8 100%);
}

.files-shell .muted {
  color: #52637a;
}

.files-shell .empty {
  border: 1px dashed #c8d3e1;
  background: #f8fafc;
  color: #52637a;
}

.files-app {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 64px;
}

.files-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
  gap: 24px;
  align-items: end;
  margin-bottom: 24px;
}

.files-hero .badge {
  background: #dbeafe;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.files-hero h1 {
  margin: 12px 0 10px;
  color: #0f172a;
  font-size: clamp(2.5rem, 7vw, 5.4rem);
  line-height: 0.92;
}

.files-hero p {
  max-width: 720px;
  color: #334155;
  font-size: 1.04rem;
}

.files-status,
.files-panel {
  border: 1px solid #d6dee9;
  background: #ffffff;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
}

.files-status {
  border-radius: 8px;
  padding: 18px;
}

.files-status strong {
  display: block;
  margin-bottom: 6px;
  color: #0f172a;
  font-size: 1.1rem;
}

.files-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 20px;
  margin-bottom: 20px;
}

.files-panel {
  border-radius: 8px;
  padding: 22px;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.panel-heading h2 {
  margin: 0 0 6px;
  color: #0f172a;
}

.files-shell .btn {
  min-height: 44px;
  border-radius: 8px;
  font-weight: 800;
}

.files-shell .btn.primary {
  background: #1d4ed8;
  color: #ffffff;
  border-color: #1d4ed8;
}

.files-shell .btn.primary:hover {
  background: #1e40af;
  border-color: #1e40af;
}

.files-shell .btn.secondary {
  background: #eef2f7;
  color: #1f2a44;
  border: 1px solid #cfd8e5;
}

.files-shell .btn.secondary:hover {
  background: #e2e8f0;
}

.files-shell .btn.danger {
  background: #fff1f2;
  color: #be123c;
  border: 1px solid #fecdd3;
}

.files-shell .btn:disabled {
  opacity: 0.62;
  cursor: not-allowed;
}

.file-upload-form {
  display: grid;
  gap: 14px;
}

.file-drop {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  min-height: 104px;
  padding: 18px;
  border: 1px dashed #7aa2f7;
  border-radius: 8px;
  background: #f3f7ff;
  color: #1e293b;
  cursor: pointer;
  transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
}

.file-drop:hover {
  transform: translateY(-1px);
  border-color: #1d4ed8;
  background: #eff6ff;
}

.file-drop:has(input:disabled) {
  cursor: not-allowed;
  border-color: #cbd5e1;
  background: #f8fafc;
}

.file-drop:has(input:disabled):hover {
  transform: none;
  border-color: #cbd5e1;
  background: #f8fafc;
}

.file-drop input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.file-drop-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 8px;
  background: #1d4ed8;
  color: #ffffff;
  font-size: 2rem;
  line-height: 1;
}

.file-drop strong {
  color: #0f172a;
  overflow-wrap: anywhere;
}

.file-drop small {
  display: block;
  margin-top: 4px;
  color: #64748b;
}

.quota-meter {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.quota-bar {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #dbe3ee;
}

.quota-bar span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb, #16a34a);
  transition: width 280ms ease;
}

.quota-text {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  color: #475569;
}

.quota-text strong {
  color: #0f172a;
}

.quota-text span {
  text-align: right;
}

.file-list {
  display: grid;
  gap: 10px;
}

.file-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid #dbe3ee;
  border-radius: 8px;
  background: #ffffff;
}

.file-row h3 {
  margin: 0 0 6px;
  color: #0f172a;
  font-size: 1rem;
  overflow-wrap: anywhere;
}

.file-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.files-shell .form-message {
  color: #1e293b;
}

.files-shell .form-message.success {
  background: #ecfdf5;
  border-color: #bbf7d0;
  color: #166534;
}

.files-shell .form-message.error {
  background: #fff1f2;
  border-color: #fecdd3;
  color: #be123c;
}

@media (max-width: 820px) {
  .files-hero,
  .files-grid,
  .file-row {
    grid-template-columns: 1fr;
  }

  .file-actions {
    justify-content: stretch;
  }

  .file-actions .btn {
    flex: 1 1 120px;
  }
}
