:root {
  color-scheme: light dark;
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  background: #f5f7fb;
  color: #1f2933;
}

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

body {
  margin: 0;
  min-height: 100vh;
}

.layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: #111827;
  color: #f9fafb;
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sidebar__header h2 {
  margin: 0;
  font-size: 1.25rem;
}

.sidebar__header p {
  margin: 0.25rem 0 0;
  color: rgba(249, 250, 251, 0.7);
  font-size: 0.9rem;
}

.file-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  overflow-y: auto;
  flex: 1;
}

.file-item {
  background: rgba(17, 24, 39, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 0.6rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.file-item:hover,
.file-item:focus {
  background: rgba(37, 99, 235, 0.4);
  border-color: rgba(59, 130, 246, 0.8);
  outline: none;
}

.file-item.active {
  background: rgba(59, 130, 246, 0.7);
  border-color: rgba(191, 219, 254, 0.8);
}

.file-item__name {
  margin: 0;
  font-weight: 600;
  word-break: break-all;
}

.file-item__meta {
  margin: 0.25rem 0 0;
  font-size: 0.8rem;
  color: rgba(249, 250, 251, 0.75);
}

.main {
  padding: 2.5rem 3rem;
  background: linear-gradient(160deg, #f9fafd 0%, #e6ecff 100%);
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.card {
  background: rgba(255, 255, 255, 0.85);
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.15);
  backdrop-filter: blur(12px);
}

.card h1,
.card h2 {
  margin-top: 0;
}

.muted {
  color: #52606d;
}

.small {
  font-size: 0.9rem;
}

.upload-form {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.5rem;
}

.progress {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.progress__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  color: #1d4ed8;
}

.progress__bar {
  width: 100%;
  height: 10px;
  background: rgba(59, 130, 246, 0.15);
  border-radius: 999px;
  overflow: hidden;
}

.progress__fill {
  height: 100%;
  background: linear-gradient(90deg, #2563eb, #60a5fa);
  width: 0;
  transition: width 0.2s ease;
}

.file-input {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border: 2px dashed #93c5fd;
  border-radius: 0.75rem;
  background: rgba(59, 130, 246, 0.1);
  color: #1d4ed8;
  font-weight: 600;
  cursor: pointer;
  min-width: 220px;
}

.file-input input[type="file"] {
  opacity: 0;
  position: absolute;
  inset: 0;
  cursor: pointer;
}

button,
.secondary,
.danger {
  border: none;
  border-radius: 0.6rem;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.primary {
  background: #2563eb;
  color: #fff;
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.3);
}

.primary:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
}

.secondary {
  background: #e2e8f0;
  color: #1e293b;
}

.secondary:hover {
  background: #cbd5f5;
}

.danger {
  background: #ef4444;
  color: #fff;
}

.danger:hover {
  background: #dc2626;
}

.details-card {
  flex: 1;
}

.details-empty {
  text-align: center;
  color: #52606d;
}

.details-content.hidden,
.toast.hidden,
.progress.hidden {
  display: none;
}

.details-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.details-header h2 {
  margin-bottom: 0.25rem;
}

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

.details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin: 0;
}

.details-grid dt {
  font-size: 0.85rem;
  color: #64748b;
  margin-bottom: 0.25rem;
}

.details-grid dd {
  margin: 0;
  font-weight: 600;
  color: #1e293b;
  word-break: break-all;
}

.toast {
  position: fixed;
  right: 2rem;
  bottom: 2rem;
  background: #111827;
  color: #fff;
  padding: 1rem 1.5rem;
  border-radius: 0.75rem;
  box-shadow: 0 20px 30px rgba(15, 23, 42, 0.3);
  min-width: 220px;
}

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

  .sidebar {
    flex-direction: row;
    align-items: flex-start;
    overflow-x: auto;
    gap: 1rem;
  }

  .file-list {
    flex-direction: row;
    flex: none;
    width: 100%;
  }

  .file-item {
    min-width: 240px;
  }
}

@media (max-width: 768px) {
  .main {
    padding: 1.5rem;
  }

  .upload-form {
    flex-direction: column;
    align-items: stretch;
  }

  .details-header {
    flex-direction: column;
    align-items: stretch;
  }

  .details-actions {
    justify-content: flex-start;
  }
}
