:root {
  --bg: #f4f7fb;
  --card: #ffffff;
  --text: #1d2939;
  --muted: #6b7280;
  --border: #e2e8f0;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
}

* {
  box-sizing: border-box;
}

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

.page-shell {
  min-height: 100vh;
  padding: 24px;
}

header {
  max-width: 960px;
  margin: 0 auto 24px;
  padding: 18px 24px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
}

header h1 {
  margin: 0 0 10px;
  font-size: clamp(1.8rem, 2.5vw, 2.8rem);
}

header p {
  margin: 0;
  color: var(--muted);
}

.admin-header-row {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.admin-title {
  margin: 0;
}

.logout-button {
  background: #38bdf8;
  color: #fff;
  border: none;
  padding: 8px 12px;
  border-radius: 8px;
  min-height: 40px;
  white-space: nowrap;
}

main {
  max-width: 960px;
  margin: 0 auto;
  display: grid;
  gap: 20px;
}

.search-panel,
.results-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px;
}

.results-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.results-header-row h2 {
  margin: 0;
}

.results-meta {
  color: var(--muted);
  font-weight: 700;
  text-align: right;
}

.field-row {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.field-row label {
  font-weight: 600;
}

.field-row input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 1rem;
}

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease;
}

button:hover {
  background: var(--accent-dark);
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  background: var(--accent);
  color: white;
  text-decoration: none;
  border-radius: 14px;
  font-weight: 700;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.action-tile {
  display: grid;
  gap: 10px;
  min-height: 160px;
  padding: 18px;
  border-radius: 16px;
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  background: linear-gradient(140deg, #ffffff, #eef4ff);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.action-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.12);
}

.action-icon {
  width: 52px;
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #dbeafe;
  border-radius: 12px;
}

.action-title {
  font-weight: 800;
  font-size: 1.05rem;
}

.action-subtitle {
  color: var(--muted);
  font-size: 0.92rem;
}

.app-section-header {
  display: flex;
  align-items: baseline;
  margin-bottom: 10px;
}

.app-section-title {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  margin: 0;
}

.app-logo-inline {
  height: 1em;
  width: auto;
  border-radius: 4px;
  object-fit: contain;
  border: 1px solid var(--border);
}

.hidden {
  display: none;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
}

.login-panel {
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.15);
}

.error-message {
  color: #dc2626;
  margin-top: 12px;
  font-weight: 600;
}

.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

thead {
  background: #f8fafc;
}

th,
td {
  padding: 14px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  color: var(--muted);
  font-weight: 700;
}

tbody tr:hover {
  background: #f8fafc;
}

.result-image {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
}

.message {
  margin-bottom: 16px;
  min-height: 24px;
  color: var(--muted);
}

@media (max-width: 720px) {
  .page-shell {
    padding: 14px;
  }

  header {
    padding: 14px;
  }

  .search-panel,
  .results-panel {
    padding: 16px;
  }

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

  .logout-button {
    width: 100%;
  }

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

  .results-meta {
    text-align: left;
  }

  main {
    padding: 0;
  }

  .field-row {
    gap: 6px;
  }

  th,
  td {
    padding: 12px 10px;
  }
}
