/* ----- Design tokens (polomski.de-inspired) ----- */
:root {
  --bg:         #7ea6c5;   /* sky-blue page bg */
  --surface:    #ffffff;   /* content card */
  --ink:        #2e455a;   /* deep slate headings */
  --ink-2:      #4a5d6d;   /* secondary slate */
  --muted:      #8a8175;   /* warm gray-brown body */
  --line:       #d8d5cf;
  --accent:     #5a95b8;   /* cyan-blue links */
  --accent-2:   #3d7899;
  --brand-navy: #22557a;   /* JP monogram, dark accent */
  --nav-bg:     #eeece8;   /* nav bar strip */
  --header-1:   #a8c4dc;   /* banner gradient top */
  --header-2:   #5f89ab;   /* banner gradient bottom */
  --radius:     4px;
  --maxw:       1080px;
  --font-sans:  "Inter", "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Cormorant Garamond", "Georgia", "Times New Roman", serif;
}

/* ----- Reset ----- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); }
img { max-width: 100%; display: block; }

/* ----- Landing / centered card layout ----- */
.page-wrap {
  min-height: 100vh;
  padding: 32px 16px;
  display: flex;
  justify-content: center;
}
.card {
  width: 100%;
  max-width: 960px;
  background: var(--surface);
  box-shadow: 0 4px 24px rgba(0,0,0,0.12);
  overflow: hidden;
}

/* ----- Header banner (JP image) ----- */
.banner {
  display: block;
  background: linear-gradient(135deg, var(--header-1) 0%, var(--header-2) 100%);
  line-height: 0;
}
.banner img {
  display: block;
  width: 100%;
  height: auto;
}

/* ----- Public nav bar ----- */
.site-nav {
  background: var(--nav-bg);
  border-top: 1px solid rgba(0,0,0,0.05);
  border-bottom: 1px solid rgba(0,0,0,0.05);
  padding: 12px 32px;
  display: flex;
  align-items: center;
  gap: 32px;
  font-size: 14px;
}
.site-nav a {
  color: var(--accent);
  text-transform: none;
  letter-spacing: 0.01em;
}
.site-nav a:hover { color: var(--accent-2); }
.site-nav a.active { color: var(--ink); font-weight: 500; }
.site-nav .spacer { flex: 1; }
.site-nav .search-icon {
  width: 18px;
  height: 18px;
  opacity: 0.55;
  color: var(--accent);
}

/* ----- Content ----- */
.content {
  padding: 40px 48px 24px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
  position: relative;
}
.content-signin {
  text-align: right;
  padding: 12px 48px 32px;
  font-size: 14px;
}
.content-signin a { color: var(--muted); }
.content-signin a:hover { color: var(--ink); }
.content h1, .content h2, .content h3 {
  font-family: var(--font-serif);
  font-weight: 500;
  color: var(--ink);
  letter-spacing: 0.005em;
}
.content h1 { font-size: 34px; margin: 0 0 20px; }
.content h2 { font-size: 22px; margin: 32px 0 12px; }
.content h3 { font-size: 17px; margin: 20px 0 8px; }
.content p  { margin: 0 0 14px; }
.content ul { margin: 0 0 16px; padding-left: 22px; }
.content ul li { margin-bottom: 4px; }
.content a { color: var(--accent); }
.content a:hover { color: var(--accent-2); }

/* ----- Footer inside card ----- */
.card-footer {
  padding: 16px 32px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.card-footer nav a { margin-left: 16px; color: var(--muted); }
.card-footer nav a:hover { color: var(--ink); }

/* ----- Buttons ----- */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
  font-family: inherit;
}
.btn-primary   { background: var(--brand-navy); color: #fff; }
.btn-primary:hover { background: var(--ink); color: #fff; }
.btn-outline   { border-color: var(--brand-navy); color: var(--brand-navy); background: #fff; }
.btn-outline:hover { background: var(--brand-navy); color: #fff; }
.btn-ghost     { color: var(--ink-2); background: transparent; }
.btn-ghost:hover { color: var(--accent-2); }

/* ----- Login page ----- */
.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.auth-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 0;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.12);
  overflow: hidden;
}
.auth-body { padding: 32px 32px 28px; }
.auth-body h1 {
  font-family: var(--font-serif);
  font-size: 24px;
  margin: 0 0 20px;
  font-weight: 500;
  color: var(--ink);
}
.form-field { margin-bottom: 16px; }
.form-field label {
  display: block;
  font-size: 13px;
  margin-bottom: 6px;
  color: var(--ink-2);
}
.form-field input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font: inherit;
  background: #fafafa;
}
.form-field input:focus {
  outline: none;
  border-color: var(--brand-navy);
  background: #fff;
}

/* ----- App shell (intern/extern/admin) ----- */
.app-shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.app-side {
  background: var(--brand-navy);
  color: #fff;
  padding: 24px 20px;
}
.app-side .brand { color: #fff; margin-bottom: 32px; display: inline-flex; gap: 10px; align-items: center; font-weight: 600; }
.app-side .brand-logo { width: 32px; height: 32px; }
.app-side .brand-name { font-family: var(--font-serif); font-size: 18px; }
.app-side nav a {
  display: block;
  color: rgba(255,255,255,0.75);
  padding: 8px 0;
  font-size: 14px;
}
.app-side nav a:hover, .app-side nav a.active {
  color: #fff;
}
.app-main { padding: 32px 40px; background: var(--bg); }
.app-main h1 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 32px;
  margin: 0 0 24px;
  color: var(--ink);
  background: none;
}
/* keep stat cards / tables on white surface within blue app-main */
.stat-row {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  margin-bottom: 32px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}
.stat .label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 8px;
}
.stat .value {
  font-family: var(--font-serif);
  font-size: 28px;
  color: var(--ink);
}

/* ----- Table ----- */
table.data {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
table.data th, table.data td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
table.data th {
  background: var(--nav-bg);
  font-weight: 500;
  color: var(--ink-2);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
table.data tr:last-child td { border-bottom: none; }
table.data td { color: var(--ink); }

/* ----- Admin: page head, forms, flash ----- */
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 24px;
}
.page-head h1 { margin: 0; }

.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-danger { background: #a12a2a; color: #fff; border-color: #a12a2a; }
.btn-danger:hover { background: #7f1f1f; color: #fff; }

.row-actions { white-space: nowrap; }
.row-actions a,
.row-actions button {
  font-size: 13px;
  margin-right: 12px;
  color: var(--accent);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  font: inherit;
}
.row-actions a:hover, .row-actions button:hover { color: var(--accent-2); }
.row-actions form { display: inline; }
.row-actions .danger { color: #a12a2a; }

.form-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 760px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}
.form-grid .full { grid-column: 1 / -1; }
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font: inherit;
  background: #fafafa;
}
.form-field textarea { min-height: 100px; resize: vertical; font-family: var(--font-sans); }
.form-field select:focus,
.form-field textarea:focus { outline: none; border-color: var(--brand-navy); background: #fff; }
.form-field .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.form-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 12px;
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.checkbox-row { display: flex; align-items: center; gap: 8px; }
.checkbox-row input { width: auto; }

.flash {
  padding: 10px 16px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: 14px;
  border: 1px solid transparent;
}
.flash-ok  { background: #e8f2eb; color: #1a5c3a; border-color: #b8d8c2; }
.flash-err { background: #f7e1e1; color: #7a1a1a; border-color: #e2b0b0; }

/* ----- Small screens ----- */
@media (max-width: 720px) {
  .content { padding: 28px 24px 20px; }
  .content-signin { padding: 12px 24px 24px; }
  .site-nav { padding: 12px 20px; gap: 20px; }
  .app-shell { grid-template-columns: 1fr; }
  .app-side { padding: 16px 20px; }
  .app-main { padding: 24px 20px; }
  .form-grid { grid-template-columns: 1fr; }
}
