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

body {
  font-family: system-ui, -apple-system, sans-serif;
  background: #f0f2f5;
  color: #1a1a2e;
  min-height: 100vh;
  display: flex;
  justify-content: center;
}

.screen {
  width: 100%;
  max-width: 700px;
  padding: 2rem 1rem;
}

/* ===== CARD ===== */
.card {
  background: #fff;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.card h1 { font-size: 1.4rem; margin-bottom: 0.5rem; }
.card h2 { font-size: 1.1rem; margin-bottom: 1rem; }
.card p { color: #555; margin-bottom: 1.5rem; }

/* ===== AUTH SCREEN ===== */
#auth-screen .card { max-width: 420px; margin: 4rem auto; }

#auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 1.2rem;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #ddd;
}

#auth-tabs .tab {
  flex: 1;
  padding: 0.6rem;
  border: none;
  background: #f9f9f9;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  color: #666;
  transition: background 0.15s, color 0.15s;
}

#auth-tabs .tab.active {
  background: #2563eb;
  color: #fff;
}

#auth-form {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

#auth-form input {
  padding: 0.7rem 0.9rem;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.15s;
}

#auth-form input:focus { border-color: #2563eb; }

#auth-submit {
  padding: 0.7rem;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

#auth-submit:hover { background: #1d4ed8; }

.error-msg {
  margin-top: 0.8rem;
  padding: 0.6rem 0.8rem;
  background: #fef2f2;
  color: #b91c1c;
  border-radius: 8px;
  font-size: 0.85rem;
}

/* ===== DIAGNOSTICS ===== */
.diagnostics {
  background: #1a1a2e;
  color: #e0e0e0;
  border-radius: 12px;
  padding: 1.2rem 1.5rem;
  margin-bottom: 1.5rem;
}

.diagnostics h2 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #888;
  margin-bottom: 0.8rem;
}

.diag-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem 2rem;
}

.diag-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

.diag-label { color: #888; }

.diag-value {
  font-weight: 600;
  color: #4ade80;
  font-family: 'SF Mono', 'Consolas', monospace;
  font-size: 0.8rem;
  text-align: right;
  word-break: break-all;
}

#diag-aud.diag-value {
  font-size: 1.1rem;
  color: #facc15;
}

/* ===== CONTENT ===== */
.content { display: flex; flex-direction: column; gap: 1.5rem; }

/* ===== AVATAR PREVIEW ===== */
.avatar-preview {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  overflow: hidden;
}

.avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.placeholder-icon { font-size: 3rem; }

.upload-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.upload-row input[type="file"] {
  flex: 1;
  font-size: 0.85rem;
}

.upload-row button, .btn-small {
  padding: 0.5rem 1rem;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.upload-row button:hover, .btn-small:hover { background: #1d4ed8; }

.upload-row button:disabled, .btn-small:disabled { background: #94a3b8; cursor: not-allowed; }

.upload-status {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  min-height: 1.2em;
}

.upload-status.error { color: #b91c1c; }
.upload-status.success { color: #16a34a; }

/* ===== FILE TABLE ===== */
.file-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.file-table th {
  text-align: left;
  padding: 0.5rem 0.6rem;
  border-bottom: 2px solid #e2e8f0;
  color: #888;
  font-weight: 600;
}

.file-table td {
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid #f0f0f0;
}

.file-table td.empty { text-align: center; color: #999; padding: 2rem; }

.file-table .btn-delete {
  padding: 0.3rem 0.6rem;
  background: #fee2e2;
  color: #b91c1c;
  border: none;
  border-radius: 6px;
  font-size: 0.75rem;
  cursor: pointer;
}

.file-table .btn-delete:hover { background: #fecaca; }

/* ===== LOGOUT ===== */
.btn-logout {
  display: block;
  margin: 2rem auto;
  padding: 0.5rem 2rem;
  background: #e2e8f0;
  color: #555;
  border: none;
  border-radius: 8px;
  font-size: 0.85rem;
  cursor: pointer;
}

.btn-logout:hover { background: #cbd5e1; }
