@import url("https://fonts.googleapis.com/css2?family=Cinzel:wght@500;600;700&family=Cormorant+Garamond:wght@400;500;600;700&display=swap");

:root {
  --ink: #1f2a39;
  --navy: #10263f;
  --navy-deep: #0a1a2d;
  --burgundy: #5b1e21;
  --gold: #b08b4f;
  --parchment: #f7f2e8;
  --parchment-dark: #efe5d3;
  --stone: #d9cbb7;
  --border: #cdbfa9;
  --success: #0f6b3e;
  --error: #a3221c;
  --shadow: rgba(16, 38, 63, 0.12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Cormorant Garamond", "Palatino", "Times New Roman", serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -15%, #e6edf7 0%, transparent 60%),
    radial-gradient(900px 520px at 110% 0%, #f0e4d1 0%, transparent 58%),
    repeating-linear-gradient(
      135deg,
      rgba(16, 38, 63, 0.02) 0px,
      rgba(16, 38, 63, 0.02) 2px,
      transparent 2px,
      transparent 10px
    ),
    linear-gradient(135deg, #f7f2e8 0%, #efe4d3 100%);
}

.wrap {
  max-width: 980px;
  margin: 26px auto 64px;
  padding: 0 18px;
}

.hero {
  background: var(--parchment);
  border: 1px solid var(--border);
  border-top: 6px solid var(--burgundy);
  border-radius: 16px;
  padding: 22px 24px 18px;
  box-shadow: 0 18px 44px var(--shadow);
  margin-bottom: 18px;
}

.court-bar {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 18px;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(176, 139, 79, 0.35);
}

.court-seal img {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  border: 2px solid #e8dcc7;
  background: #fff;
  object-fit: contain;
}

.court-titles {
  display: grid;
  gap: 4px;
}

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
}

.court-name {
  font-family: "Cinzel", "Times New Roman", serif;
  font-size: 20px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--navy);
}

.court-sub {
  color: #4a5563;
  font-weight: 600;
}

.hero-content {
  padding-top: 16px;
}

.user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding: 10px 12px;
  background: #fbf5ea;
  border: 1px dashed #d6c5aa;
  border-radius: 10px;
  font-weight: 600;
  color: #5d4a2b;
}

.user-actions {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.hero h1 {
  font-family: "Cinzel", "Times New Roman", serif;
  font-size: 32px;
  margin: 0 0 8px;
  color: var(--navy);
}

.hero p {
  margin: 0 0 12px;
  color: #4c5a6a;
  font-weight: 500;
}

.panel {
  background: #fffdf7;
  border: 1px solid var(--border);
  padding: 18px;
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(16, 38, 63, 0.08);
  margin-bottom: 16px;
}

.action-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
}

.validation-msg {
  font-size: 13px;
  color: #7b6a55;
  transition: opacity 0.2s ease;
}

.section-title {
  font-family: "Cinzel", "Times New Roman", serif;
  font-size: 20px;
  margin: 0 0 14px;
  color: var(--navy-deep);
}

.alert {
  padding: 12px 14px;
  border-radius: 10px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  background: #fffaf2;
  font-weight: 600;
}

.alert.success {
  border-color: #b7dcc2;
  color: var(--success);
}

.alert.error {
  border-color: #f0b6b2;
  color: var(--error);
}

.login-card {
  max-width: 420px;
  margin: 60px auto;
  background: var(--parchment);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 18px 44px var(--shadow);
}

.login-hero {
  max-width: 420px;
  margin: 0 auto 18px;
}

.login-title {
  font-family: "Cinzel", "Times New Roman", serif;
  font-size: 24px;
  margin-bottom: 8px;
  color: var(--navy);
}

.login-sub {
  margin: 0 0 16px;
  color: #4c5a6a;
}

.login-form button {
  width: 100%;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
}

.admin-table th,
.admin-table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
}

.inline-form {
  display: inline-block;
  margin-right: 6px;
}

.admin-form {
  display: grid;
  gap: 10px;
}

.file-panel .file-scroll {
  max-height: 540px;
  overflow: auto;
  padding-right: 6px;
}

.admin-form .remember-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: #3f3a31;
}

.admin-form .remember-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

.progress-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 20, 34, 0.4);
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 20;
}

.progress-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.progress-card {
  background: #fffdf7;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 22px;
  width: min(360px, 90vw);
  box-shadow: 0 18px 36px rgba(16, 38, 63, 0.18);
  text-align: center;
}

.progress-title {
  font-family: "Cinzel", "Times New Roman", serif;
  font-size: 18px;
  color: var(--navy);
  margin-bottom: 10px;
}

.progress-bar {
  position: relative;
  height: 10px;
  background: #efe1cc;
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar span {
  position: absolute;
  inset: 0;
  width: 45%;
  background: linear-gradient(90deg, #b08b4f, #5b1e21, #b08b4f);
  animation: progress-move 1.2s ease-in-out infinite;
}

.progress-note {
  margin-top: 10px;
  font-size: 13px;
  color: #6f6352;
}

label {
  display: block;
  margin-bottom: 12px;
  font-weight: 700;
  color: #3f3a31;
}

textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 12px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  background: #fffdf7;
  resize: vertical;
}

.tabs {
  display: inline-flex;
  gap: 8px;
  margin-bottom: 12px;
}

.tab-btn {
  background: #efe1cc;
  color: #5d4a2b;
  border: 1px solid #d4c1a4;
  padding: 8px 14px;
  border-radius: 8px 8px 0 0;
  font-weight: 700;
  cursor: pointer;
  font-family: "Cinzel", "Times New Roman", serif;
  letter-spacing: 0.04em;
}

.tab-btn.active {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
  border-width: 2px;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="file"] {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 12px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  background: #fffdf7;
}

button {
  background: var(--burgundy);
  color: white;
  border: none;
  padding: 12px 18px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 10px 18px rgba(91, 30, 33, 0.25);
  letter-spacing: 0.02em;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

button:hover { opacity: 0.94; }

.ghost-btn {
  background: transparent;
  color: var(--navy);
  border: 1px solid #c9b69c;
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  font-size: 13px;
  letter-spacing: 0.02em;
  box-shadow: none;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-family: inherit;
}

.ghost-btn:hover {
  background: #f1e6d6;
}

.sample-block {
  margin: 10px 0 14px;
}

.sample-block summary {
  cursor: pointer;
  font-family: "Cinzel", "Times New Roman", serif;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 12px;
}

.sample-block pre {
  margin: 8px 0 0;
  font-family: "Courier New", monospace;
  font-size: 13px;
  white-space: pre-wrap;
  background: #fbf5ea;
  border: 1px dashed #d3c2a8;
  border-radius: 10px;
  padding: 10px 12px;
}

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

.hint {
  color: #5d564c;
  margin-top: -6px;
  font-weight: 600;
}

.bulk-hint {
  margin-bottom: 18px;
}

.bulk-excel {
  margin-top: 6px;
  margin-bottom: 20px;
}

ul { margin: 8px 0 0; padding-left: 18px; }

footer { margin-top: 24px; color: #5d564c; }
code { background: #f3eadc; padding: 2px 5px; border-radius: 4px; }

.success-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.recent-outputs {
  margin-top: 12px;
  background: #fbf5ea;
  border: 1px dashed #d6c5aa;
  border-radius: 10px;
  padding: 10px 12px;
}

.file-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.delete-btn {
  background: transparent;
  color: #7a5a35;
  border: none;
  padding: 0 2px;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  box-shadow: none;
}

.delete-btn:hover {
  color: #7a2f31;
}

.recent-outputs a {
  color: var(--navy);
  text-decoration: none;
}

.file-list {
  margin: 6px 0 0;
  padding-left: 18px;
  list-style: decimal;
  list-style-position: outside;
}

.file-list li::marker {
  color: #6a5431;
  font-weight: 700;
}

.recent-outputs a:hover {
  text-decoration: underline;
}

.recent-title {
  font-weight: 700;
  color: #6a5431;
  margin-bottom: 6px;
}

.disclaimer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(30, 26, 18, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
}

.disclaimer-card {
  max-width: 560px;
  width: 100%;
  background: #fbf6ee;
  border: 1px solid rgba(120, 98, 70, 0.35);
  border-radius: 20px;
  box-shadow: 0 18px 60px rgba(28, 24, 17, 0.2);
  padding: 28px 30px;
  color: #2b251c;
}

.disclaimer-title {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  margin-bottom: 10px;
}


.session-details summary {
  cursor: pointer;
  font-weight: 700;
  color: #5a4630;
}

.session-details[open] summary {
  margin-bottom: 6px;
}

.admin-search {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
  font-weight: 700;
  color: #5a4630;
}

.admin-table input[type="text"] {
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid #d3c1a5;
  font-size: 0.9rem;
}

@keyframes progress-move {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(220%); }
}

@media (max-width: 720px) {
  .court-bar {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .court-seal img {
    margin: 0 auto;
  }

  .hero h1 {
    font-size: 28px;
  }

}

@media (max-width: 640px) {
  .tabs {
    display: grid;
    grid-template-columns: 1fr;
  }

  .tab-btn {
    border-radius: 8px;
  }

  .action-row,
  .success-actions {
    flex-direction: column;
    align-items: stretch;
  }
}
