* {
  box-sizing: border-box;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

body {
  margin: 0;
  background: #f5f7fa;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #172033;
}

.container {
  text-align: center;
}

.logo {
  font-size: 2.2rem;
  margin-bottom: 0.2rem;
}

.tagline {
  color: #666;
  margin-bottom: 2rem;
}

.card {
  background: white;
  padding: 2rem;
  width: 320px;
  border-radius: 10px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.08);
}

.tabs {
  display: flex;
  margin-bottom: 1rem;
}

.tab {
  flex: 1;
  padding: 0.7rem;
  border: none;
  background: #eee;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
}

.tab:hover {
  background: #ddd;
}

.tab.active {
  background: #2563eb;
  color: white;
}

.form {
  display: flex;
  flex-direction: column;
}

.form input,
.form textarea {
  padding: 0.7rem;
  margin-bottom: 0.8rem;
  border-radius: 6px;
  border: 1px solid #ccc;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  font-size: 1rem;
}

.form input:focus,
.form textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form input:disabled,
.form select:disabled,
.form textarea:disabled {
  background-color: #f0f0f0;
  cursor: not-allowed;
  opacity: 0.7;
}

.form textarea {
  min-height: 5rem;
  resize: vertical;
}

.form label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.8rem;
  color: #334155;
  font-size: 0.92rem;
  font-weight: 650;
  text-align: left;
}

.form select {
  padding: 0.7rem;
  border-radius: 6px;
  border: 1px solid #ccc;
  background: white;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  font-size: 1rem;
}

.form select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form button,
.secondary-button {
  padding: 0.7rem;
  border-radius: 6px;
  border: none;
  background: #2563eb;
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.form button:hover:not(:disabled) {
  background: #1e4ed8;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.form button:active:not(:disabled) {
  transform: translateY(0);
}

.form button:disabled,
.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.hidden {
  display: none;
}

.dashboard-page {
  display: block;
  padding: 2rem;
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 1040px;
  margin: 0 auto 1.5rem;
}

.dashboard-header h1 {
  margin: 0;
  font-size: 2rem;
}

.eyebrow {
  margin: 0 0 0.25rem;
  color: #2563eb;
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0;
  text-transform: uppercase;
}

.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(320px, 1fr);
  gap: 1.25rem;
  max-width: 1040px;
  margin: 0 auto;
}

.panel {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1.25rem;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.06);
}

.panel h2 {
  margin: 0 0 0.45rem;
  font-size: 1.15rem;
}

.section-copy {
  margin: 0 0 1rem;
  color: #64748b;
  line-height: 1.45;
}

.home-form input {
  margin-bottom: 0;
}

.room-panel,
.documentation-panel,
.timeline-panel {
  grid-column: 1 / -1;
}

.room-form,
.document-form,
.timeline-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) minmax(180px, 0.8fr) auto;
  gap: 0.75rem;
  align-items: end;
  margin-bottom: 1rem;
}

.document-form {
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) minmax(150px, 0.8fr) minmax(220px, 1.2fr);
}

.timeline-form {
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) minmax(150px, 0.8fr) minmax(150px, 0.8fr);
}

.room-form label,
.document-form label,
.timeline-form label {
  margin-bottom: 0;
}

.room-form input,
.document-form input,
.timeline-form input,
.timeline-form textarea {
  margin-bottom: 0;
}

.room-form button,
.document-form button,
.timeline-form button {
  min-height: 2.75rem;
}

.document-form .file-field {
  grid-column: span 2;
}

.document-form .status-message {
  grid-column: 1 / -1;
  margin-top: 0;
}

.timeline-title-field,
.timeline-description-field,
.timeline-form .status-message {
  grid-column: 1 / -1;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.status-message {
  min-height: 1.2rem;
  margin: 0.8rem 0 0;
  color: #64748b;
  font-size: 0.9rem;
  animation: slideIn 0.3s ease;
}

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

.status-message.error {
  color: #b91c1c;
  font-weight: 500;
}

.status-message.success {
  color: #047857;
  font-weight: 500;
}

.homes-list,
.rooms-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.home-card,
.room-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  transition: all 0.2s ease;
}

.home-card:hover,
.room-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.home-card > div:first-child,
.room-card > div:first-child {
  flex: 1;
}

.home-card h3,
.home-card p,
.room-card h3,
.room-card p {
  margin: 0;
}

.home-card h3,
.room-card h3 {
  font-size: 1rem;
  color: #172033;
}

.home-card p,
.room-card p {
  margin-top: 0.25rem;
  color: #64748b;
  font-size: 0.9rem;
}

.home-card strong {
  white-space: nowrap;
  color: #2563eb;
  font-weight: 600;
}

.document-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.8rem;
}

.document-item {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.65rem;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: white;
}

.document-item span,
.document-empty {
  color: #64748b;
  font-size: 0.86rem;
}

.document-empty {
  margin: 0;
}

.document-link,
.text-danger-button {
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 650;
  text-align: left;
}

.document-link {
  color: #2563eb;
}

.document-link:hover,
.text-danger-button:hover {
  text-decoration: underline;
}

.text-danger-button {
  color: #b91c1c;
  white-space: nowrap;
}

.timeline-list {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.timeline-year {
  margin: 0.75rem 0 0;
  color: #2563eb;
  font-size: 1rem;
}

.timeline-item {
  display: grid;
  grid-template-columns: 1rem 1fr;
  gap: 0.8rem;
}

.timeline-marker {
  width: 0.75rem;
  height: 0.75rem;
  margin-top: 0.5rem;
  border-radius: 999px;
  background: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.timeline-content {
  padding: 0.85rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}

.timeline-item-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.timeline-content h4,
.timeline-content p {
  margin: 0;
}

.timeline-content h4 {
  color: #172033;
  font-size: 1rem;
}

.timeline-content p {
  margin-top: 0.25rem;
  color: #64748b;
  font-size: 0.9rem;
}

.timeline-description {
  line-height: 1.45;
}

.home-card-actions {
  display: flex;
  gap: 0.5rem;
}

.delete-button {
  padding: 0.5rem 0.75rem;
  background: #ef4444;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.delete-button:hover:not(:disabled) {
  background: #dc2626;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.delete-button:active:not(:disabled) {
  transform: translateY(0);
}

.delete-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.empty-state {
  margin: 0;
  padding: 1rem;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  color: #64748b;
  background: #f8fafc;
  font-size: 0.95rem;
}

.secondary-button {
  background: #e2e8f0;
  color: #172033;
}

.secondary-button:hover:not(:disabled) {
  background: #cbd5e1;
  transform: translateY(-1px);
}

@media (max-width: 760px) {
  .dashboard-page {
    padding: 1rem;
  }

  .dashboard-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .dashboard-layout,
  .form-grid,
  .room-form,
  .document-form,
  .timeline-form {
    grid-template-columns: 1fr;
  }

  .document-form .file-field {
    grid-column: auto;
  }

  .timeline-title-field,
  .timeline-description-field,
  .timeline-form .status-message {
    grid-column: auto;
  }

  .panel {
    padding: 1rem;
  }

  .home-card,
  .room-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .home-card-actions {
    width: 100%;
  }

  .delete-button {
    width: 100%;
  }

  .document-item {
    grid-template-columns: 1fr;
    align-items: flex-start;
  }
}
