:root {
  color-scheme: light;
  --blue-700: #0a4a8a;
  --blue-600: #0f66b3;
  --blue-500: #0a75d6;
  --blue-400: #3f8edc;
  --blue-100: #e3f0fb;
  --ink-900: #0f172a;
  --ink-700: #334155;
  --ink-500: #64748b;
  --border: #d6e2f0;
  --surface: #ffffff;
  --surface-muted: #f5f8fc;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI Variable", "Segoe UI", "Noto Sans", "Trebuchet MS", sans-serif;
  color: var(--ink-900);
  background: linear-gradient(140deg, #eef4fb 0%, #f7f9fc 45%, #eef2fb 100%);
}

.app {
  position: relative;
  min-height: 100vh;
  padding: 20px 22px 30px;
  overflow: hidden;
}

.backdrop {
  position: absolute;
  inset: -40% -20% auto auto;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle at 30% 30%, rgba(15, 102, 179, 0.25), transparent 65%);
  opacity: 0.8;
  filter: blur(0.5px);
  pointer-events: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 22px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  animation: slideDown 600ms ease-out;
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(145deg, #0f66b3, #0a75d6);
}

.brand-mark svg {
  width: 24px;
  height: 24px;
  fill: #ffffff;
}

.brand-title {
  font-weight: 700;
  letter-spacing: 0.2px;
}

.brand-subtitle {
  color: var(--ink-500);
  font-size: 0.85rem;
}

.search {
  flex: 1;
  max-width: 520px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface-muted);
  border-radius: 999px;
  border: 1px solid transparent;
}

.search svg {
  width: 18px;
  height: 18px;
  stroke: var(--ink-500);
  stroke-width: 2;
  fill: none;
}

.search input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.95rem;
  flex: 1;
  color: var(--ink-700);
}

.top-actions {
  display: flex;
  gap: 10px;
}

button {
  border: none;
  font-family: inherit;
  padding: 10px 18px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
}

button.primary {
  background: var(--blue-600);
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(15, 102, 179, 0.25);
}

button.ghost {
  background: transparent;
  color: var(--ink-700);
}

.layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 22px;
  margin-top: 22px;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 18px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  animation: fadeIn 700ms ease-out;
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-title {
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 1px;
  color: var(--ink-500);
  margin-bottom: 6px;
}

.nav-item {
  text-align: left;
  background: transparent;
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--ink-700);
}

.nav-item.active {
  background: var(--blue-100);
  color: var(--blue-700);
}

.storage {
  background: var(--surface-muted);
  padding: 14px;
  border-radius: var(--radius-md);
}

.storage-title {
  font-weight: 600;
  margin-bottom: 8px;
}

.storage-bar {
  height: 6px;
  border-radius: 999px;
  background: #d7e6f7;
  overflow: hidden;
  margin-bottom: 6px;
}

.storage-bar span {
  display: block;
  width: 18%;
  height: 100%;
  background: linear-gradient(90deg, #0f66b3, #3f8edc);
}

.storage-meta {
  font-size: 0.8rem;
  color: var(--ink-500);
}

.content {
  background: rgba(255, 255, 255, 0.9);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow);
  animation: fadeIn 800ms ease-out;
}

.breadcrumb {
  display: flex;
  gap: 8px;
  color: var(--ink-500);
  font-size: 0.85rem;
}

.breadcrumb .divider {
  color: #9fb4cf;
}

.title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-top: 16px;
}

.title-row h1 {
  margin: 0;
  font-size: 2rem;
}

.title-row p {
  margin: 6px 0 0;
  color: var(--ink-500);
}

.presence {
  text-align: right;
  color: var(--ink-500);
}

.avatar-stack {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 6px;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--blue-100);
  color: var(--blue-700);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.75rem;
  border: 2px solid #ffffff;
  margin-left: -8px;
}

.toolbar {
  margin-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.tool-group {
  display: flex;
  gap: 10px;
}

.tool {
  background: var(--surface-muted);
  color: var(--ink-700);
  border-radius: 10px;
  padding: 8px 14px;
}

.tool.ghost {
  background: transparent;
  border: 1px solid var(--border);
}

.table {
  margin-top: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.table-head,
.table-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.6fr) 1fr 0.6fr 0.7fr;
  gap: 12px;
  align-items: center;
  padding: 12px 16px;
}

.table-head {
  background: var(--surface-muted);
  color: var(--ink-500);
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 1px;
}

.table-row {
  background: #ffffff;
  border-top: 1px solid var(--border);
  transition: background 200ms ease;
  cursor: pointer;
}

.table-row:hover {
  background: #f0f6ff;
}

.name-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
}

.item-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
}

.item-icon.folder {
  background: #eef4ff;
  color: #0f66b3;
}

.item-icon.file {
  background: #f2f7fb;
  color: #2f6fb7;
}

.item-icon svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #eef6ff;
  color: #0f66b3;
  font-size: 0.75rem;
  font-weight: 600;
}

.table-body {
  display: flex;
  flex-direction: column;
}

.cards {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.card {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.card-title {
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 1px;
  color: var(--ink-500);
}

.card-body {
  margin: 10px 0 6px;
  font-weight: 600;
}

.card-meta {
  color: var(--ink-500);
  font-size: 0.85rem;
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
  z-index: 20;
}

.modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(6px);
}

.modal-card {
  position: relative;
  width: min(420px, 92vw);
  background: #ffffff;
  border-radius: 18px;
  padding: 22px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  animation: fadeIn 220ms ease;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.modal-tag {
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.7rem;
  color: var(--blue-600);
  font-weight: 700;
  margin-bottom: 4px;
}

.modal-card h2 {
  margin: 0;
  font-size: 1.4rem;
}

.modal-copy {
  margin: 10px 0 16px;
  color: var(--ink-500);
}

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

.field {
  display: grid;
  gap: 8px;
  font-weight: 600;
  color: var(--ink-700);
  font-size: 0.9rem;
}

.field input {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-family: inherit;
  font-size: 0.95rem;
}

.modal-footnote {
  margin-top: 12px;
  font-size: 0.8rem;
  color: var(--ink-500);
}

.icon-button {
  border: none;
  background: var(--surface-muted);
  width: 36px;
  height: 36px;
  border-radius: 12px;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--ink-700);
  cursor: pointer;
}

.table-row {
  animation: rise 450ms ease-out forwards;
  opacity: 0;
  transform: translateY(8px);
}

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

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

@keyframes rise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

  .sidebar {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .nav-group {
    min-width: 180px;
  }
}

@media (max-width: 780px) {
  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .search {
    max-width: none;
  }

  .title-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .presence {
    text-align: left;
  }

  .table-head,
  .table-row {
    grid-template-columns: minmax(180px, 1fr) 0.8fr;
  }

  .table-head div:nth-child(3),
  .table-head div:nth-child(4),
  .table-row div:nth-child(3),
  .table-row div:nth-child(4) {
    display: none;
  }
}
