:root {
  color-scheme: light;
  font-family: Arial, sans-serif;
  background: #f4f7fb;
  color: #1f2937;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  /* Prefer top-level hahahaha/image1.jpg, then hahsha/image1.svg, then gradient fallback */
  background: url('hahaha/image1.jpg') center/cover no-repeat, url('hahsha/image1.svg') center/cover no-repeat, linear-gradient(180deg, #e6eefb 0%, #f4f7fb 100%);
  color: rgba(31,41,55,0.95);
}

.app-shell {
  width: 100%;
  max-width: 1100px;
  padding: 16px;
  margin: 0 auto;
}

header,
footer {
  text-align: center;
  margin-bottom: 16px;
}

h1,
h2 {
  margin: 0;
}

header p,
footer p {
  margin: 8px 0 0;
  color: #4b5563;
}

footer .org-attribution {
  font-size: 0.85em;
  color: #6b7280;
}

footer .org-attribution a {
  color: #1a4f63;
  font-weight: 600;
}

.card,
.panel {
  /* slightly more translucent panels so background image shows through more */
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(209,213,219,0.45);
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.hidden {
  display: none;
}

.active {
  display: block;
}

form {
  display: grid;
  gap: 14px;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}

input[type="text"],
input[type="password"],
input[type="tel"],
select,
input[type="file"] {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(203,213,225,0.7);
  border-radius: 10px;
  background: rgba(248,250,252,0.78);
}

button, .menu-button {
  cursor: pointer;
  padding: 12px 16px;
  border: none;
  border-radius: 10px;
  background: #2563eb;
  color: white;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
}

button.secondary {
  background: #64748b;
}

button.logout {
  margin-left: auto;
  background: #dc2626;
}

textarea {
  width: 100%;
  min-height: 90px;
  padding: 12px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
  resize: vertical;
}

.small-button {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.92rem;
  border: none;
  color: white;
}

.small-button.edit-button {
  background: #2563eb;
}

.small-button.delete-button {
  background: #dc2626;
}

.menu {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.menu-button {
  text-decoration: none;
}

/* Table and row polish */
tbody tr:hover {
  background: #f1f5f9;
}

.thumb {
  height: 40px;
  width: auto;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15,23,42,0.5);
  z-index: 1200;
}
.modal.hidden { display: none; }
.modal-content {
  background: #fff;
  border-radius: 12px;
  padding: 18px;
  width: min(680px, 96%);
  max-height: 86vh;
  overflow: auto;
  box-shadow: 0 20px 50px rgba(2,6,23,0.25);
}
.modal-close {
  float: right;
  background: transparent;
  border: none;
  font-size: 18px;
  cursor: pointer;
}
.modal img { max-width: 100%; height: auto; border-radius: 8px; }

/* Toast */
.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  background: #111827;
  color: #ffffff;
  padding: 12px 16px;
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(2,6,23,0.25);
  z-index: 1400;
}
.toast.hidden { display: none; }

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(2,6,23,0.85);
  z-index: 1600;
}
.lightbox.hidden { display: none; }
.lightbox img {
  max-width: 96%;
  max-height: 92vh;
  border-radius: 8px;
  box-shadow: 0 20px 50px rgba(2,6,23,0.6);
}
.lightbox .modal-close {
  position: absolute;
  right: 24px;
  top: 18px;
  color: #fff;
  font-size: 20px;
}

.menu-button.active {
  background: #1d4ed8;
}

.form-grid {
  grid-template-columns: 1fr;
}

.photo-preview {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
}

.photo-preview img {
  width: 100%;
  max-height: 240px;
  object-fit: contain;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
}

.form-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.message {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #ecfdf5;
  color: #166534;
  display: none;
}

.message.visible {
  display: block;
}

.search-row,
.report-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.table-container {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  background: #eef2ff;
}

th,
td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid #e2e8f0;
}

th {
  font-weight: 700;
}

.summary {
  padding: 16px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  margin-bottom: 18px;
  background: #f8fafc;
}

.summary p {
  margin: 0;
}

.hint {
  color: #6b7280;
  font-size: 0.95rem;
}

/* Larger screens: two-column form */
@media (min-width: 851px) {
  .form-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Mobile adjustments */
@media (max-width: 600px) {
  body { padding: 8px 0; }
  h1 { font-size: 1.25rem; }
  h2 { font-size: 1.05rem; }
  .app-shell { padding: 12px; }
  .menu { flex-direction: column; }
  .menu-button { width: 100%; text-align: center; }
  .photo-preview img { max-height: 200px; }
  .modal-content { width: calc(100% - 32px); padding: 12px; }
  .toast { left: 12px; right: 12px; }
}

@media (min-width: 601px) and (max-width: 850px) {
  .menu { gap: 8px; }
  .menu-button { padding: 10px 14px; }
}
