:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --border: #dfe5ef;
  --text: #1f2937;
  --muted: #667085;
  --accent: #2563eb;
  --sidebar: #fbfcfe;
}

html, body {
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  letter-spacing: 0;
}

.app-navbar {
  background: var(--surface);
  height: 58px;
}

.app-shell {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  min-height: calc(100vh - 58px);
}

.sidebar {
  background: var(--sidebar);
  padding: 18px 12px;
}

.sidebar a {
  align-items: center;
  border-radius: 8px;
  color: #344054;
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  text-decoration: none;
}

.sidebar a:hover {
  background: #eef4ff;
  color: var(--accent);
}

.content {
  padding: 24px;
  min-width: 0;
}

.page-title {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.page-title h1 {
  font-size: 1.55rem;
  font-weight: 700;
  margin: 0;
}

.panel, .metric-card, .login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(31, 41, 55, 0.05);
}

.panel {
  padding: 18px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.metric-card {
  padding: 18px;
}

.metric-card span, .readonly-grid span {
  color: var(--muted);
  display: block;
  font-size: .86rem;
}

.metric-card strong {
  display: block;
  font-size: 1.65rem;
  margin-top: 8px;
}

.login-page {
  align-items: center;
  display: flex;
  min-height: 100vh;
  justify-content: center;
  padding: 24px;
}

.login-card {
  max-width: 420px;
  padding: 32px;
  width: 100%;
}

.login-card h1 {
  font-size: 1.35rem;
}

.brand-icon {
  color: var(--accent);
  font-size: 2.4rem;
}

.explorer-title {
  align-items: flex-start;
}

.breadcrumb-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.breadcrumb-line a {
  color: var(--accent);
  text-decoration: none;
}

.search-box {
  max-width: 420px;
  width: 100%;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 380px) 1fr;
  gap: 16px;
}

.upload-zone {
  align-items: center;
  border: 1px dashed #9db7e8;
  border-radius: 8px;
  display: flex;
  gap: 10px;
  padding: 10px;
  transition: background .18s ease, border-color .18s ease;
}

.upload-zone.is-dragging {
  background: #eef4ff;
  border-color: var(--accent);
}

.explorer-table th {
  color: var(--muted);
  font-size: .82rem;
  font-weight: 600;
}

.folder-icon {
  color: #d89216;
  font-size: 1.25rem;
}

.file-icon {
  color: #64748b;
  font-size: 1.2rem;
}

.file-link {
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

.actions {
  white-space: nowrap;
}

.password-reset {
  max-width: 150px;
}

.action-input {
  max-width: 180px;
}

.move-input {
  max-width: 105px;
}

.form-panel {
  max-width: 680px;
}

.readonly-grid {
  display: grid;
  gap: 12px;
}

.readonly-grid strong {
  overflow-wrap: anywhere;
}

.preview-panel iframe {
  border: 0;
  height: 72vh;
  width: 100%;
}

.image-preview, .video-preview {
  display: block;
  max-height: 72vh;
  max-width: 100%;
  margin: auto;
}

.text-preview {
  background: #111827;
  border-radius: 8px;
  color: #f8fafc;
  min-height: 420px;
  padding: 18px;
  white-space: pre-wrap;
}

.empty-state {
  color: var(--muted);
  padding: 48px 18px;
  text-align: center;
}

.empty-state i {
  display: block;
  font-size: 3rem;
  margin-bottom: 12px;
}

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

  .sidebar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-grid, .toolbar {
    grid-template-columns: 1fr;
  }

  .page-title {
    align-items: stretch;
    flex-direction: column;
  }
}
