:root {
  --bg: #f4f7ff;
  --panel: #ffffff;
  --line: #d8e1f0;
  --text: #16233c;
  --muted: #69778f;
  --primary: #1d4ed8;
  --primary-dark: #1e40af;
  --soft: #eef4ff;
  --success: #109468;
  --danger: #df5145;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top right, rgba(29, 78, 216, 0.12), transparent 24%),
    linear-gradient(180deg, #f6f9ff 0%, #eef3fb 100%);
}

button,
input,
textarea {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  padding: 16px;
}

.hidden {
  display: none !important;
}

.auth-view {
  min-height: calc(100vh - 32px);
  display: grid;
  place-items: center;
}

.auth-card {
  width: min(100%, 420px);
  background: rgba(255, 255, 255, 0.94);
  border-radius: 24px;
  border: 1px solid var(--line);
  padding: 26px 20px;
  box-shadow: 0 24px 60px rgba(22, 35, 60, 0.08);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
}

h1,
h2 {
  margin: 0;
}

.auth-card h1,
.topbar h1 {
  font-size: 28px;
  line-height: 1.2;
}

.auth-desc,
.panel-head p,
.summary-note,
.summary-label {
  color: var(--muted);
}

.auth-desc {
  margin: 12px 0 22px;
  line-height: 1.6;
}

.form {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
}

input,
textarea {
  min-height: 48px;
  border-radius: 14px;
  border: 1px solid #c5d4ef;
  padding: 0 14px;
  background: #fff;
}

textarea {
  min-height: 108px;
  padding: 12px 14px;
  resize: vertical;
}

input:focus,
textarea:focus {
  outline: 2px solid rgba(29, 78, 216, 0.14);
  border-color: var(--primary);
}

button {
  min-height: 48px;
  border: none;
  border-radius: 14px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
}

button:hover {
  background: var(--primary-dark);
  cursor: pointer;
}

.ghost-button {
  min-height: 40px;
  padding: 0 16px;
  background: #fff;
  color: var(--text);
  border: 1px solid var(--line);
}

.ghost-button:hover {
  background: #f8fbff;
}

.message {
  min-height: 22px;
  margin: 10px 0 0;
  font-size: 14px;
}

.message.success {
  color: var(--success);
}

.message.error {
  color: var(--danger);
}

.dashboard-view {
  width: min(1040px, 100%);
  margin: 0 auto;
}

.topbar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 16px;
}

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

.profile-chip {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--soft);
  border: 1px solid #cad9ff;
  color: var(--primary);
  font-weight: 700;
}

.summary-card,
.panel-card {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px;
  box-shadow: 0 18px 40px rgba(22, 35, 60, 0.06);
}

.summary-card {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.summary-main strong {
  display: block;
  margin-top: 8px;
  font-size: 36px;
}

.hall-grid,
.module-view,
.route-view {
  display: grid;
  gap: 14px;
}

.hall-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.hall-card {
  aspect-ratio: 1 / 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  padding: 10px 8px;
  border-radius: 18px;
  color: var(--text);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #f7faff 100%);
  box-shadow: 0 12px 20px rgba(22, 35, 60, 0.06);
}

.hall-card strong {
  font-size: 17px;
  line-height: 1.25;
}

.hall-card:hover {
  background: linear-gradient(180deg, #ffffff 0%, #eef4ff 100%);
}

.hall-card span {
  color: var(--muted);
  font-size: 12px;
}

.placeholder-card {
  background: #f3f6fb;
  color: #8b97ab;
  border-style: dashed;
  box-shadow: none;
}

.section-head {
  margin-bottom: 14px;
}

.section-head p {
  margin: 8px 0 0;
  line-height: 1.6;
  color: var(--muted);
}

.panel-head {
  margin-bottom: 14px;
}

.panel-head p {
  margin: 8px 0 0;
  line-height: 1.6;
}

.profile-box,
.project-item,
.empty-state {
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #f8fbff;
  padding: 14px;
}

.project-list {
  display: grid;
  gap: 12px;
}

.request-list {
  display: grid;
  gap: 12px;
}

.query-meta {
  margin-top: 12px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #f8fbff;
  line-height: 1.7;
  color: var(--muted);
}

.preset-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.preset-button {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #f7faff;
  color: var(--text);
  font-weight: 600;
}

.preset-button:hover {
  background: #eef4ff;
}

.query-result {
  margin-top: 12px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.result-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

.result-table th,
.result-table td {
  padding: 12px 10px;
  border-bottom: 1px solid #e8eef8;
  text-align: left;
  font-size: 14px;
  white-space: nowrap;
}

.result-table thead {
  background: #f5f8ff;
}

.result-table tbody tr:nth-child(even) {
  background: #fbfdff;
}

.empty-state {
  color: var(--muted);
  text-align: center;
}

.project-item strong {
  display: block;
  min-width: 0;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
}

.project-item-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: nowrap;
}

.project-item-head .tag {
  flex: 0 0 auto;
}

.project-item-head strong {
  flex: 0 1 auto;
}

.inline-action-button {
  min-height: 34px;
  padding: 0 12px;
  margin-top: 8px;
}

.project-inline-note {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.query-box {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #e6edf9;
}

.request-item {
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #f8fbff;
  padding: 14px;
}

.request-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.status-badge.pending {
  background: #fff4db;
  color: #9a6700;
}

.status-badge.approved {
  background: #e8f8f0;
  color: var(--success);
}

.status-badge.rejected {
  background: #ffeceb;
  color: var(--danger);
}

.request-meta {
  line-height: 1.7;
  color: var(--muted);
}

.inline-file-button {
  min-height: 30px;
  margin: 4px 8px 0 0;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid #c5d4ef;
  background: #fff;
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
}

.inline-file-button:hover {
  background: #eef4ff;
}

@media (min-width: 900px) {
  .topbar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .hall-grid {
    gap: 14px;
  }

  .summary-card {
    grid-template-columns: 220px 1fr;
    align-items: center;
  }
}

@media (max-width: 420px) {
  .hall-card {
    padding: 8px 6px;
    border-radius: 16px;
  }

  .hall-card strong {
    font-size: 15px;
  }
}
