* {
  box-sizing: border-box;
  font-family: Arial, Helvetica, sans-serif;
}

body {
  margin: 0;
  background: #f5f7fb;
  color: #1f2937;
}

.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: #ffffff;
  padding: 32px;
  border-radius: 18px;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.08);
}

.login-card h1 {
  margin: 0 0 8px;
}

.subtitle {
  margin: 0 0 24px;
  color: #6b7280;
}

label {
  display: block;
  margin: 14px 0 8px;
  font-weight: 600;
}

input[type="text"],
input[type="password"],
input[type="file"] {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  background: #fff;
}

button {
  border: none;
  border-radius: 12px;
  padding: 12px 16px;
  background: #111827;
  color: white;
  cursor: pointer;
  font-weight: 600;
}

button:hover {
  opacity: 0.94;
}

.error {
  background: #fee2e2;
  color: #991b1b;
  padding: 12px;
  border-radius: 12px;
  margin-bottom: 16px;
}

.topbar {
  background: #ffffff;
  padding: 20px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 18px rgba(0, 0, 0, 0.05);
}

.topbar h1 {
  margin: 0 0 6px;
}

.topbar p {
  margin: 0;
  color: #6b7280;
}

.page-wrap {
  max-width: 1700px;
  margin: 0 auto;
  padding: 24px;
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(360px, 0.8fr);
  gap: 24px;
  align-items: start;
}

.card {
  background: #ffffff;
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
}

.files-card {
  min-height: 760px;
}

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

.section-head h2 {
  margin: 0 0 12px;
}

.path-bar {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px 14px;
  color: #374151;
  min-width: 420px;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  background: #111827;
  color: #fff;
  border-radius: 12px;
  padding: 12px 16px;
  font-weight: 700;
}

.wide-toolbar {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) auto;
  gap: 14px;
  margin-bottom: 18px;
}

.folder-form {
  display: flex;
  gap: 10px;
}

.folder-form input {
  flex: 1;
}

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

.drop-zone {
  border: 2px dashed #cbd5e1;
  background: #f8fafc;
  border-radius: 16px;
  padding: 28px;
  text-align: center;
  margin-bottom: 22px;
  transition: 0.2s ease;
}

.drop-zone.dragover {
  border-color: #111827;
  background: #eef2ff;
}

.drop-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}

.drop-subtitle {
  color: #6b7280;
}

.file-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.file-item {
  border: 1px solid #e5e7eb;
  padding: 16px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 74px;
}

.file-left {
  min-width: 0;
}

.folder-link,
.file-link {
  color: #111827;
  text-decoration: none;
  font-weight: 700;
  font-size: 16px;
}

.folder-link:hover,
.file-link:hover {
  text-decoration: underline;
}

.meta {
  margin-top: 6px;
  color: #6b7280;
  font-size: 13px;
}

.delete-btn,
.logout-btn {
  background: #dc2626;
}

.chat-card {
  display: flex;
  flex-direction: column;
  min-height: 760px;
}

.messages {
  flex: 1;
  overflow-y: auto;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 14px;
  background: #fafafa;
  min-height: 580px;
  max-height: 580px;
}

.message {
  background: #fff;
  border: 1px solid #ececec;
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 10px;
}

.message-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  font-size: 13px;
}

.message-head span {
  color: #6b7280;
}

.chat-form {
  display: flex;
  gap: 12px;
  margin-top: 14px;
}

.chat-form input {
  flex: 1;
  padding: 13px 14px;
  border: 1px solid #d1d5db;
  border-radius: 12px;
}

.empty {
  color: #6b7280;
}

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

  .messages {
    min-height: 320px;
    max-height: 420px;
  }
}

@media (max-width: 760px) {
  .section-head,
  .wide-toolbar,
  .folder-form,
  .chat-form {
    display: flex;
    flex-direction: column;
  }

  .path-bar {
    min-width: 0;
    width: 100%;
  }
}

.selection-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.explorer-section {
  margin-bottom: 26px;
}

.section-label {
  font-size: 15px;
  font-weight: 700;
  color: #374151;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e5e7eb;
}

.item-select {
  display: flex;
  align-items: center;
}

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

.mini-btn {
  text-decoration: none;
  background: #111827;
  color: white;
  padding: 10px 12px;
  border-radius: 10px;
  font-weight: 600;
}

.danger-btn {
  background: #dc2626;
}

.rename-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

.rename-form input {
  width: 140px;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
}

.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.rename-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

.rename-form input {
  width: 140px;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
}

.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.chat-head-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.chat-image-wrap {
  margin-top: 8px;
}

.chat-image {
  max-width: 260px;
  max-height: 260px;
  border-radius: 12px;
  display: block;
  border: 1px solid #e5e7eb;
}