/* Scout Camp Booking — admin panel (standalone). */

:root {
  --scb-forest: #3a6b3a;
  --scb-forest-soft: #dde8d8;
  --scb-forest-ink: #25491f;
  --scb-leaf: #5fa67c;
  --scb-wood: #b8854a;
  --scb-wood-soft: #efe2cd;
  --scb-ember: #d76944;
  --scb-ember-soft: #f6dccd;
  --scb-water: #5b8da4;
  --scb-water-soft: #d6e3eb;
  --scb-line: #e8e6dc;
  --scb-line-strong: #d2cfc1;
  --scb-bg: #fafaf6;
  --scb-bg-warm: #f8f7f0;
  --scb-ink: #232b1f;
  --scb-ink-muted: #88907a;
  --scb-paid: #4f8c52;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--scb-bg);
  color: var(--scb-ink);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
}

a { color: var(--scb-forest); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Layout */
.app { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.sidebar {
  background: linear-gradient(180deg, #1a2818 0%, #2a3e26 100%);
  color: white;
  padding: 20px 0;
  display: flex;
  flex-direction: column;
}
.sidebar-brand {
  padding: 0 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.sidebar-brand small { display: block; font-size: 11px; font-weight: 400; color: #a4c598; margin-top: 2px; }
.sidebar nav { flex: 1; padding: 12px 0; }
.sidebar nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px; color: #c4e0bc; font-size: 13px; font-weight: 500;
  border-left: 3px solid transparent;
}
.sidebar nav a:hover { background: rgba(255,255,255,0.04); text-decoration: none; }
.sidebar nav a.is-active {
  background: rgba(255,255,255,0.08); color: white;
  border-left-color: #5fa67c;
}
.sidebar nav .nav-icon { width: 16px; text-align: center; }
.sidebar-footer { padding: 12px 20px; border-top: 1px solid rgba(255,255,255,0.08); font-size: 12px; color: #a4c598; }
.sidebar-footer a { color: #c4e0bc; display: block; }

.main { padding: 24px 32px; max-width: 1200px; }

/* Headings */
h1.page-title {
  font-size: 24px; font-weight: 700; letter-spacing: -0.01em;
  margin: 0 0 4px;
}
.page-subtitle { color: var(--scb-ink-muted); font-size: 13px; margin: 0 0 24px; }

/* Stats grid */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat {
  background: white;
  border: 1px solid var(--scb-line);
  border-radius: 12px;
  padding: 18px;
}
.stat-label { font-size: 11px; color: var(--scb-ink-muted); text-transform: uppercase; letter-spacing: 0.08em; margin: 0 0 6px; }
.stat-value { font-size: 28px; font-weight: 700; letter-spacing: -0.01em; margin: 0; font-variant-numeric: tabular-nums; }

/* Cards */
.card {
  background: white;
  border: 1px solid var(--scb-line);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
}
.card h2 { margin: 0 0 12px; font-size: 15px; font-weight: 600; }

/* Tables */
.table { width: 100%; border-collapse: collapse; background: white; border: 1px solid var(--scb-line); border-radius: 12px; overflow: hidden; }
.table thead { background: var(--scb-bg-warm); }
.table th, .table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--scb-line); font-size: 13px; }
.table th { font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--scb-ink-muted); }
.table tbody tr:hover { background: #fafbf8; }
.table tbody tr:last-child td { border-bottom: none; }
.tnum { font-variant-numeric: tabular-nums; }

/* Tags */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 500;
  padding: 2px 8px; border-radius: 999px;
  background: var(--scb-bg-warm); color: var(--scb-ink-muted);
  border: 1px solid var(--scb-line);
}
.tag-paid { background: #e3f1e3; color: #2c5e2c; border-color: #c4dec4; }
.tag-unpaid { background: #fae0d3; color: #8c3a1a; border-color: #f0c0a3; }
.tag-pending { background: #f5e6c4; color: #6e4f10; border-color: #e6cf86; }
.tag-confirmed { background: var(--scb-forest-soft); color: var(--scb-forest-ink); border-color: #c4dec4; }
.tag-cancelled { background: #eee; color: #888; border-color: #ddd; }

/* Filters */
.filters { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.filters input, .filters select { padding: 8px 10px; border-radius: 8px; border: 1px solid var(--scb-line-strong); background: white; font-size: 13px; font-family: inherit; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 8px 14px; border-radius: 8px;
  border: 1px solid var(--scb-line-strong); background: white; color: var(--scb-ink);
  font-size: 13px; font-weight: 500; cursor: pointer;
  text-decoration: none; transition: background .15s; font-family: inherit;
}
.btn:hover { background: var(--scb-bg-warm); text-decoration: none; }
.btn-primary { background: var(--scb-forest); border-color: var(--scb-forest); color: white !important; }
.btn-primary:hover { background: var(--scb-forest-ink); color: white; }
.btn-danger { color: var(--scb-ember); border-color: var(--scb-ember); background: white; }
.btn-danger:hover { background: var(--scb-ember-soft); color: var(--scb-ember); }
.btn-sm { padding: 4px 10px; font-size: 12px; }

/* Form */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form label.field-label { display: block; font-size: 12px; font-weight: 500; color: #4d564a; margin-bottom: 4px; }
.form input[type="text"],
.form input[type="email"],
.form input[type="tel"],
.form input[type="url"],
.form input[type="number"],
.form input[type="date"],
.form input[type="time"],
.form input[type="password"],
.form select,
.form textarea {
  width: 100%; padding: 8px 10px;
  border-radius: 8px; border: 1px solid var(--scb-line-strong);
  background: white; font-size: 13px; font-family: inherit;
}
.form textarea { min-height: 80px; }
.form input:focus, .form select:focus, .form textarea:focus {
  outline: none; border-color: var(--scb-forest);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--scb-forest) 18%, transparent);
}

/* Calendar — wspólne */
.calendar-wrap { background: white; border: 1px solid var(--scb-line); border-radius: 12px; padding: 20px; overflow-x: auto; }
.cal-nav { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.cal-nav h2 { margin: 0 8px; font-size: 18px; min-width: 180px; }
.cal-view-switch { display: inline-flex; gap: 1px; background: var(--scb-line); border: 1px solid var(--scb-line); border-radius: 8px; overflow: hidden; }
.cal-view-switch a { padding: 6px 14px; background: white; color: var(--scb-ink-muted); font-size: 13px; font-weight: 500; text-decoration: none; }
.cal-view-switch a:hover { background: var(--scb-bg-warm); text-decoration: none; }
.cal-view-switch a.is-active { background: var(--scb-forest); color: white; }

/* Miesiąc — siatka */
.cal-month { display: flex; flex-direction: column; gap: 1px; background: var(--scb-line); border: 1px solid var(--scb-line); border-radius: 8px; overflow: hidden; min-width: 700px; }
.cal-month-head { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--scb-line); }
.cal-month-head > div { background: var(--scb-bg-warm); text-align: center; font-size: 11px; font-weight: 600; color: var(--scb-ink-muted); padding: 8px; text-transform: uppercase; letter-spacing: 0.05em; }
.cal-week-row { position: relative; display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--scb-line); }
.cal-day {
  background: white;
  position: relative;
  min-height: 110px;
  padding: 6px;
}
.cal-day.is-other { background: #fafaf8; }
.cal-day.is-other .cal-num { opacity: 0.4; }
.cal-day.is-today { background: var(--scb-forest-soft); }
.cal-day.is-blocked {
  background: repeating-linear-gradient(
    45deg,
    #f3e8e0,
    #f3e8e0 6px,
    #ead4c4 6px,
    #ead4c4 12px
  );
}
.cal-day.is-blocked .cal-num { color: #88381f; }
.cal-num { font-size: 12px; font-weight: 600; color: var(--scb-ink-muted); }
.cal-day.is-today .cal-num { color: var(--scb-forest-ink); font-weight: 700; }

/* Paski rezerwacji nakładane na siatkę tygodniową */
.cal-bars-overlay {
  position: absolute;
  top: 26px;          /* poniżej numeru dnia */
  left: 0; right: 0;  /* obejmuje całą szerokość week-row */
  bottom: 4px;
  pointer-events: none;
}
.cal-bar {
  position: absolute;
  height: 22px;
  border-radius: 4px;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  pointer-events: auto;
  text-decoration: none !important;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
  transition: transform .1s, box-shadow .1s;
}
.cal-bar:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0,0,0,0.16);
  text-decoration: none !important;
}
.cal-bar.is-continued-left { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.cal-bar.is-continued-right { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.cal-bar.is-unpaid::before { content: '⚠️'; margin-right: 4px; font-size: 10px; }

/* Tydzień — większe komórki */
.cal-week { min-height: 600px; }
.cal-week .cal-day { min-height: 600px; padding: 8px; }
.cal-week .cal-num { font-size: 14px; }
.cal-week .cal-day-name { font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--scb-ink-muted); margin-bottom: 4px; }
.cal-week .cal-bars-overlay { top: 50px; }
.cal-week .cal-bar { height: 28px; font-size: 12px; padding: 0 10px; }

/* Dzień — sekcje listy */
.cal-day-view { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
@media (max-width: 980px) { .cal-day-view { grid-template-columns: 1fr; } }
.cal-day-section { background: white; border: 1px solid var(--scb-line); border-radius: 10px; padding: 16px; }
.cal-day-section h3 { margin: 0 0 12px; font-size: 14px; display: flex; align-items: center; gap: 6px; }
.cal-day-section h3 .count { background: var(--scb-bg-warm); color: var(--scb-ink-muted); font-size: 11px; padding: 2px 8px; border-radius: 999px; }
.cal-day-list { display: flex; flex-direction: column; gap: 8px; }
.cal-day-item { display: block; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--scb-line); text-decoration: none; color: var(--scb-ink); }
.cal-day-item:hover { background: var(--scb-bg-warm); text-decoration: none; }
.cal-day-item .ci-code { font-size: 11px; color: var(--scb-ink-muted); font-variant-numeric: tabular-nums; }
.cal-day-item .ci-name { font-weight: 600; font-size: 14px; margin: 2px 0; }
.cal-day-item .ci-meta { font-size: 12px; color: var(--scb-ink-muted); }

/* Notice */
.notice { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 13px; }
.notice-success { background: #e3f1e3; color: #2c5e2c; border-left: 3px solid var(--scb-paid); }
.notice-error { background: var(--scb-ember-soft); color: #8c3a1a; border-left: 3px solid var(--scb-ember); }
.notice-info { background: var(--scb-water-soft); color: #2a4f63; border-left: 3px solid var(--scb-water); }

/* Two-col layout */
.two-col { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: sticky; top: 0; z-index: 10; padding: 12px 0; }
  .sidebar nav { display: flex; overflow-x: auto; padding: 0; }
  .sidebar nav a { white-space: nowrap; border-left: none; border-bottom: 3px solid transparent; }
  .sidebar nav a.is-active { border-bottom-color: #5fa67c; border-left: none; }
  .sidebar-brand, .sidebar-footer { display: none; }
  .main { padding: 16px; }
  .two-col { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
}

/* Login */
.login-page {
  min-height: 100vh;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #1a2818, #3a6b3a);
  padding: 20px;
}
.login-card {
  background: white;
  width: 100%; max-width: 380px;
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 20px 60px -20px rgba(0,0,0,0.3);
}
.login-card h1 {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 700;
  text-align: center;
}
.login-card .subtitle {
  text-align: center;
  color: var(--scb-ink-muted);
  font-size: 13px;
  margin-bottom: 24px;
}

/* Shortcode box */
.shortcode-box {
  display: inline-block;
  padding: 6px 12px;
  background: #1a2818;
  color: #c4e0bc;
  border-radius: 6px;
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  font-size: 13px;
}

/* Activity */
.activity { display: flex; flex-direction: column; gap: 8px; }
.activity-item {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 0; border-bottom: 1px solid var(--scb-line);
  font-size: 13px;
}
.activity-item:last-child { border-bottom: none; }

/* Codeblock for snippets */
pre.code-block {
  background: #1a2818; color: #c4e0bc;
  padding: 14px 16px; border-radius: 8px;
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  font-size: 12px; line-height: 1.6;
  overflow-x: auto;
  white-space: pre;
}
